-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·187 lines (172 loc) · 9.15 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·187 lines (172 loc) · 9.15 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#!/usr/bin/env bash
# =============================================================================
# OpenSite Agent Skills Setup
# Sets up symlinks from all supported AI agent platforms to this shared repo.
# Run from anywhere; SKILLS_DIR is resolved to the repo root automatically.
# =============================================================================
set -euo pipefail
SKILLS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PLATFORMS=()
echo ""
echo "╔══════════════════════════════════════════════════════════════╗"
echo "║ OpenSite Agent Skills Setup ║"
echo "╚══════════════════════════════════════════════════════════════╝"
echo ""
echo "Source: $SKILLS_DIR"
echo ""
# Helper: create symlink for one skill into a target directory
link_skill() {
local skill_path="$1"
local target_dir="$2"
local skill_name
skill_name="$(basename "$skill_path")"
# Skip non-skill entries (README, CLAUDE.md, scripts)
[[ -f "$skill_path/SKILL.md" ]] || return 0
mkdir -p "$target_dir"
ln -sfn "$skill_path" "$target_dir/$skill_name"
echo " ✓ $skill_name → $target_dir/$skill_name"
}
# ── Claude Code ──────────────────────────────────────────────────────────────
CLAUDE_SKILLS="$HOME/.claude/skills"
if command -v claude &>/dev/null || [ -d "$HOME/.claude" ]; then
echo "── Claude Code ──────────────────────────────────────────────"
mkdir -p "$CLAUDE_SKILLS"
for skill in "$SKILLS_DIR"/*/; do
link_skill "$skill" "$CLAUDE_SKILLS"
done
# CLAUDE.md root context
if [ -f "$SKILLS_DIR/CLAUDE.md" ]; then
ln -sfn "$SKILLS_DIR/CLAUDE.md" "$HOME/.claude/CLAUDE.md"
echo " ✓ CLAUDE.md → $HOME/.claude/CLAUDE.md"
fi
PLATFORMS+=("Claude Code")
else
echo "── Claude Code — SKIPPED (not installed)"
fi
echo ""
# ── Codex ────────────────────────────────────────────────────────────────────
CODEX_SKILLS="$HOME/.codex/skills"
if command -v codex &>/dev/null || [ -d "$HOME/.codex" ]; then
echo "── Codex ─────────────────────────────────────────────────────"
mkdir -p "$CODEX_SKILLS"
for skill in "$SKILLS_DIR"/*/; do
link_skill "$skill" "$CODEX_SKILLS"
done
PLATFORMS+=("Codex")
else
echo "── Codex — SKIPPED (not installed)"
fi
echo ""
# ── Cursor ───────────────────────────────────────────────────────────────────
CURSOR_SKILLS="$HOME/.cursor/skills"
if command -v cursor &>/dev/null || [ -d "$HOME/.cursor" ]; then
echo "── Cursor ────────────────────────────────────────────────────"
mkdir -p "$CURSOR_SKILLS"
for skill in "$SKILLS_DIR"/*/; do
link_skill "$skill" "$CURSOR_SKILLS"
done
PLATFORMS+=("Cursor")
else
echo "── Cursor — SKIPPED (not installed)"
fi
echo ""
# ── GitHub Copilot ───────────────────────────────────────────────────────────
COPILOT_SKILLS="$HOME/.copilot/skills"
if command -v gh &>/dev/null || [ -d "$HOME/.copilot" ]; then
echo "── GitHub Copilot ────────────────────────────────────────────"
mkdir -p "$COPILOT_SKILLS"
for skill in "$SKILLS_DIR"/*/; do
link_skill "$skill" "$COPILOT_SKILLS"
done
PLATFORMS+=("GitHub Copilot")
else
echo "── GitHub Copilot — SKIPPED (not installed)"
fi
echo ""
# ── Factory/Droid ────────────────────────────────────────────────────────────
FACTORY_SKILLS="$HOME/.factory/skills"
if command -v droid &>/dev/null || [ -d "$HOME/.factory" ]; then
echo "── Factory/Droid ─────────────────────────────────────────────"
mkdir -p "$FACTORY_SKILLS"
for skill in "$SKILLS_DIR"/*/; do
link_skill "$skill" "$FACTORY_SKILLS"
done
PLATFORMS+=("Factory/Droid")
else
echo "── Factory/Droid — SKIPPED (not installed)"
fi
echo ""
# ── Mistral Vibe ──────────────────────────────────────────────────────────────
VIBE_SKILLS="$HOME/.vibe/skills"
if [ -d "$HOME/.vibe" ]; then
echo "── Mistral Vibe ────────────────────────────────────────────────"
mkdir -p "$VIBE_SKILLS"
for skill in "$SKILLS_DIR"/*/; do
link_skill "$skill" "$VIBE_SKILLS"
done
PLATFORMS+=("Mistral Vibe")
else
echo "── Mistral Vibe — SKIPPED (not installed)"
fi
echo ""
# ── OpenCode ──────────────────────────────────────────────────────────────────
# OpenCode searches multiple global locations for skills. We target its primary
# global path: ~/.config/opencode/skills/<name>/SKILL.md
# OpenCode also reads from ~/.claude/skills (already linked above) and
# ~/.agents/skills (linked below when present), so any skills you install for
# Claude Code automatically work in OpenCode too.
OPENCODE_SKILLS="$HOME/.config/opencode/skills"
if command -v opencode &>/dev/null || [ -d "$HOME/.config/opencode" ]; then
echo "── OpenCode ──────────────────────────────────────────────────"
mkdir -p "$OPENCODE_SKILLS"
for skill in "$SKILLS_DIR"/*/; do
link_skill "$skill" "$OPENCODE_SKILLS"
done
PLATFORMS+=("OpenCode")
else
echo "── OpenCode — SKIPPED (not installed)"
fi
echo ""
# ── ~/.agents/skills (shared global) ──────────────────────────────────────────
# OpenCode (and some other agents) also discover skills from ~/.agents/skills.
# Link here only if the directory already exists, so we don't create stray dirs
# on machines that don't use this convention.
AGENTS_GLOBAL_SKILLS="$HOME/.agents/skills"
if [ -d "$HOME/.agents" ]; then
echo "── ~/.agents/skills (shared) ─────────────────────────────────"
mkdir -p "$AGENTS_GLOBAL_SKILLS"
for skill in "$SKILLS_DIR"/*/; do
link_skill "$skill" "$AGENTS_GLOBAL_SKILLS"
done
PLATFORMS+=("~/.agents/skills")
else
echo "── ~/.agents/skills — SKIPPED (directory not present)"
fi
echo ""
# ── Repo-level (optional) ────────────────────────────────────────────────────
if [ "${LINK_REPO:-0}" = "1" ]; then
echo "── Repo-level (.agents/skills) ───────────────────────────────"
REPO_SKILLS=".agents/skills"
mkdir -p "$REPO_SKILLS"
for skill in "$SKILLS_DIR"/*/; do
link_skill "$skill" "$REPO_SKILLS"
done
echo ""
fi
# ── Summary ──────────────────────────────────────────────────────────────────
SKILL_COUNT=$(find "$SKILLS_DIR" -name "SKILL.md" | wc -l | tr -d ' ')
echo "══════════════════════════════════════════════════════════════"
if [ ${#PLATFORMS[@]} -gt 0 ]; then
echo " Linked $SKILL_COUNT skills across: ${PLATFORMS[*]}"
else
echo " No platforms detected. Install Claude Code, Codex, Copilot (gh), Cursor, Factory/Droid, Mistral Vibe, or OpenCode first."
echo " Then re-run this script."
fi
echo ""
echo " To update skills: edit files in $SKILLS_DIR"
echo " Changes are live immediately (no reinstall needed)."
echo ""
echo " To Sync Perplexity Cloud Skills: run ./sync-perplexity.sh"
echo " To Sync Claude Desktop Skills: run ./sync-claude.sh"
echo "══════════════════════════════════════════════════════════════"
echo ""