-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·77 lines (67 loc) · 2.31 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·77 lines (67 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
# XPR Network Developer Skill Installer for Claude Code
# This script installs the skill by creating a symlink in ~/.claude/skills/
set -e
SKILL_NAME="xpr-network-dev"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SKILL_DIR="$SCRIPT_DIR/skill"
CLAUDE_SKILLS_DIR="$HOME/.claude/skills"
SKILL_LINK="$CLAUDE_SKILLS_DIR/$SKILL_NAME"
echo "XPR Network Developer Skill Installer"
echo "======================================"
echo ""
# Check if skill directory exists
if [ ! -d "$SKILL_DIR" ]; then
echo "Error: skill directory not found at $SKILL_DIR"
exit 1
fi
# Check if SKILL.md exists
if [ ! -f "$SKILL_DIR/SKILL.md" ]; then
echo "Error: SKILL.md not found at $SKILL_DIR/SKILL.md"
exit 1
fi
# Create ~/.claude/skills/ directory if it doesn't exist
if [ ! -d "$CLAUDE_SKILLS_DIR" ]; then
echo "Creating $CLAUDE_SKILLS_DIR ..."
mkdir -p "$CLAUDE_SKILLS_DIR"
fi
# Handle existing installation
if [ -e "$SKILL_LINK" ] || [ -L "$SKILL_LINK" ]; then
if [ -L "$SKILL_LINK" ]; then
EXISTING_TARGET="$(readlink "$SKILL_LINK")"
if [ "$EXISTING_TARGET" = "$SKILL_DIR" ]; then
echo "Skill '$SKILL_NAME' is already installed and up to date."
echo ""
echo "Skill location: $SKILL_DIR"
echo "Symlink: $SKILL_LINK -> $SKILL_DIR"
echo ""
echo "To update the skill content, run: git pull"
exit 0
fi
echo "Updating existing symlink (was pointing to $EXISTING_TARGET)..."
rm "$SKILL_LINK"
else
echo "Error: $SKILL_LINK already exists and is not a symlink."
echo "Remove it manually and re-run this installer."
exit 1
fi
fi
# Create symlink
ln -s "$SKILL_DIR" "$SKILL_LINK"
echo "Installation complete!"
echo ""
echo "Skill '$SKILL_NAME' is now available in Claude Code."
echo "Symlink: $SKILL_LINK -> $SKILL_DIR"
echo ""
echo "Usage:"
echo " - Invoke directly: /xpr-network-dev"
echo " - Claude auto-invokes when relevant to XPR Network development"
echo ""
echo "To update the skill content in the future, run:"
echo " git pull (inside the xpr-network-dev-skill directory)"
echo ""
echo "Try asking Claude:"
echo " - How do I deploy a smart contract on XPR Network?"
echo " - Query a table using proton CLI"
echo " - Create a token transfer action"
echo ""