@workingpayload/agent-skills 1.0.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/APIForge/skill.md +165 -0
- package/AccessPlus/skill.md +136 -0
- package/AlgoMaster/skill.md +125 -0
- package/Architekt AI/skill.md +140 -0
- package/AuthCraft/skill.md +144 -0
- package/AutoScriptor/skill.md +137 -0
- package/BoilerCore/skill.md +136 -0
- package/BugHunter Pro/skill.md +133 -0
- package/ChangeScribe/skill.md +113 -0
- package/CodeMap/skill.md +194 -0
- package/CodeSage/skill.md +163 -0
- package/CommitCraft/skill.md +113 -0
- package/CoverageMax/skill.md +161 -0
- package/CronGenius/skill.md +157 -0
- package/DataPolish/skill.md +142 -0
- package/DataWeaver/skill.md +151 -0
- package/DockMaster/skill.md +158 -0
- package/DocuGenie/skill.md +138 -0
- package/EdgeGuard/skill.md +160 -0
- package/EnvWizard/skill.md +156 -0
- package/ErrorMedic/skill.md +152 -0
- package/FeatureSmith/skill.md +139 -0
- package/FlexiLayout/skill.md +144 -0
- package/FlowTester/skill.md +154 -0
- package/FunctionForge/skill.md +136 -0
- package/InputShield/skill.md +144 -0
- package/IssueForge/skill.md +148 -0
- package/KubeCrafter/skill.md +149 -0
- package/LogicLens/skill.md +132 -0
- package/MockSmith/skill.md +146 -0
- package/ModelSensei/skill.md +138 -0
- package/PRMentor/skill.md +103 -0
- package/PerfDetective/skill.md +90 -0
- package/PipelinePro/skill.md +146 -0
- package/PolyglotShift/skill.md +94 -0
- package/PromptForge/skill.md +118 -0
- package/QueryPulse/skill.md +123 -0
- package/README.md +327 -216
- package/ReadMeCraft/skill.md +127 -0
- package/RefactorX/skill.md +110 -0
- package/RenderBoost/skill.md +148 -0
- package/SEOMancer/skill.md +156 -0
- package/ScrapeMaster/skill.md +157 -0
- package/SecretSniffer/skill.md +123 -0
- package/SecureScan/skill.md +130 -0
- package/ServiceSplitter/skill.md +153 -0
- package/SpeedSmith/skill.md +155 -0
- package/StackWise/skill.md +155 -0
- package/TaskOrchestrator/skill.md +135 -0
- package/TestCrafter/skill.md +158 -0
- package/TraceMind/skill.md +143 -0
- package/UISmith/skill.md +131 -0
- package/bin/cli.js +436 -0
- package/extension-extender/SKILL.md +122 -0
- package/fastapi-furious/SKILL.md +148 -0
- package/package.json +42 -32
- package/python-master/SKILL.md +108 -0
- package/react-ranger/SKILL.md +93 -0
- package/scripts/build_index.py +282 -0
- package/scripts/doctor.py +542 -0
- package/scripts/install.py +436 -0
- package/scripts/route.py +348 -0
- package/scripts/score.py +355 -0
- package/scripts/test_skill.py +501 -0
- package/scripts/validate.py +254 -0
- package/skills-routing.json +1156 -0
- package/skills.json +3389 -0
- package/cli.js +0 -181
- package/skills/APIForge/skill.md +0 -32
- package/skills/AccessPlus/skill.md +0 -32
- package/skills/AlgoMaster/skill.md +0 -32
- package/skills/Architekt AI/skill.md +0 -32
- package/skills/AuthCraft/skill.md +0 -32
- package/skills/AutoScriptor/skill.md +0 -32
- package/skills/BoilerCore/skill.md +0 -32
- package/skills/BugHunter Pro/skill.md +0 -32
- package/skills/ChangeScribe/skill.md +0 -32
- package/skills/CodeSage/skill.md +0 -32
- package/skills/CommitCraft/skill.md +0 -32
- package/skills/CoverageMax/skill.md +0 -32
- package/skills/CronGenius/skill.md +0 -32
- package/skills/DataPolish/skill.md +0 -32
- package/skills/DataWeaver/skill.md +0 -32
- package/skills/DockMaster/skill.md +0 -32
- package/skills/DocuGenie/skill.md +0 -32
- package/skills/EdgeGuard/skill.md +0 -32
- package/skills/EnvWizard/skill.md +0 -32
- package/skills/ErrorMedic/skill.md +0 -32
- package/skills/Extension-Extender/SKILL.md +0 -41
- package/skills/Extension-Extender/references/ui-guidelines.md +0 -26
- package/skills/Fastapi-Furious/README.md +0 -16
- package/skills/Fastapi-Furious/SKILL.md +0 -37
- package/skills/FeatureSmith/skill.md +0 -32
- package/skills/FlexiLayout/skill.md +0 -32
- package/skills/FlowTester/skill.md +0 -32
- package/skills/FunctionForge/skill.md +0 -32
- package/skills/InputShield/skill.md +0 -32
- package/skills/IssueForge/skill.md +0 -32
- package/skills/KubeCrafter/skill.md +0 -32
- package/skills/LogicLens/skill.md +0 -32
- package/skills/MockSmith/skill.md +0 -32
- package/skills/ModelSensei/skill.md +0 -32
- package/skills/PRMentor/skill.md +0 -32
- package/skills/PerfDetective/skill.md +0 -32
- package/skills/PipelinePro/skill.md +0 -32
- package/skills/PolyglotShift/skill.md +0 -32
- package/skills/PromptForge/skill.md +0 -32
- package/skills/Python-Master/README.md +0 -11
- package/skills/Python-Master/SKILL.md +0 -37
- package/skills/QueryPulse/skill.md +0 -32
- package/skills/React-Ranger/README.md +0 -17
- package/skills/React-Ranger/SKILL.md +0 -37
- package/skills/ReadMeCraft/skill.md +0 -32
- package/skills/RefactorX/skill.md +0 -32
- package/skills/RenderBoost/skill.md +0 -32
- package/skills/SEOMancer/skill.md +0 -32
- package/skills/ScrapeMaster/skill.md +0 -32
- package/skills/SecretSniffer/skill.md +0 -32
- package/skills/SecureScan/skill.md +0 -32
- package/skills/ServiceSplitter/skill.md +0 -32
- package/skills/SpeedSmith/skill.md +0 -32
- package/skills/StackWise/skill.md +0 -32
- package/skills/TaskOrchestrator/skill.md +0 -32
- package/skills/TestCrafter/skill.md +0 -32
- package/skills/TraceMind/skill.md +0 -32
- package/skills/UISmith/skill.md +0 -32
- /package/{skills/Extension-Extender → extension-extender}/assets/manifest.json +0 -0
- /package/{skills/Extension-Extender → extension-extender}/assets/popup.css +0 -0
- /package/{skills/Extension-Extender → extension-extender}/assets/popup.html +0 -0
- /package/{skills/Extension-Extender → extension-extender}/assets/popup.js +0 -0
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
install.py - Install Agent Skills to Claude or Gemini commands directories.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
python scripts/install.py # install all skills (auto-detect target)
|
|
7
|
+
python scripts/install.py --target claude # install to Claude
|
|
8
|
+
python scripts/install.py --target gemini # install to Gemini
|
|
9
|
+
python scripts/install.py --skills CodeSage,UISmith # install specific skills
|
|
10
|
+
python scripts/install.py --force # overwrite existing installs
|
|
11
|
+
python scripts/install.py --dry-run # preview without writing
|
|
12
|
+
python scripts/install.py --validate # validate before installing
|
|
13
|
+
python scripts/install.py --list-installed # show installed skills
|
|
14
|
+
python scripts/install.py --uninstall CodeSage # remove specific skills
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
import argparse
|
|
18
|
+
import hashlib
|
|
19
|
+
import json
|
|
20
|
+
import os
|
|
21
|
+
import shutil
|
|
22
|
+
import subprocess
|
|
23
|
+
import sys
|
|
24
|
+
from datetime import datetime, timezone
|
|
25
|
+
from pathlib import Path
|
|
26
|
+
|
|
27
|
+
# ---------------------------------------------------------------------------
|
|
28
|
+
# Constants
|
|
29
|
+
# ---------------------------------------------------------------------------
|
|
30
|
+
|
|
31
|
+
SKILL_FILENAMES = ("skill.md", "SKILL.md")
|
|
32
|
+
META_FILE = ".skills-meta.json"
|
|
33
|
+
|
|
34
|
+
INSTALL_DIRS = {
|
|
35
|
+
"claude": Path.home() / ".claude" / "commands",
|
|
36
|
+
"gemini": Path.home() / ".gemini" / "commands",
|
|
37
|
+
"antigravity": Path.home() / ".gemini" / "antigravity" / "skills",
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
POST_INSTALL_INSTRUCTIONS = {
|
|
41
|
+
"claude": "Use skills by typing /skill-name in Claude Code",
|
|
42
|
+
"gemini": "Skills are available in your Gemini context",
|
|
43
|
+
"antigravity": "Skills are available in Google Antigravity via semantic triggering",
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
# ---------------------------------------------------------------------------
|
|
47
|
+
# Repo helpers
|
|
48
|
+
# ---------------------------------------------------------------------------
|
|
49
|
+
|
|
50
|
+
def repo_root() -> Path:
|
|
51
|
+
"""Return the root of this repository (parent of this script's directory)."""
|
|
52
|
+
return Path(__file__).resolve().parent.parent
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def find_all_skill_dirs(root: Path) -> dict[str, Path]:
|
|
56
|
+
"""
|
|
57
|
+
Scan repo root for directories containing a skill file.
|
|
58
|
+
Returns {skill_name: skill_file_path}.
|
|
59
|
+
Skill name is derived from the directory name (lowercased, spaces→hyphens).
|
|
60
|
+
"""
|
|
61
|
+
skills: dict[str, Path] = {}
|
|
62
|
+
for d in sorted(root.iterdir()):
|
|
63
|
+
if not d.is_dir():
|
|
64
|
+
continue
|
|
65
|
+
# Skip hidden dirs and the scripts dir itself
|
|
66
|
+
if d.name.startswith(".") or d.name == "scripts":
|
|
67
|
+
continue
|
|
68
|
+
for filename in SKILL_FILENAMES:
|
|
69
|
+
candidate = d / filename
|
|
70
|
+
if candidate.is_file():
|
|
71
|
+
skill_name = d.name.lower().replace(" ", "-")
|
|
72
|
+
skills[skill_name] = candidate
|
|
73
|
+
break
|
|
74
|
+
return skills
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def git_hash(path: Path) -> str:
|
|
78
|
+
"""Return the git object hash for a file, or a content SHA256 fallback."""
|
|
79
|
+
try:
|
|
80
|
+
result = subprocess.run(
|
|
81
|
+
["git", "hash-object", str(path)],
|
|
82
|
+
capture_output=True,
|
|
83
|
+
text=True,
|
|
84
|
+
cwd=str(path.parent),
|
|
85
|
+
)
|
|
86
|
+
if result.returncode == 0:
|
|
87
|
+
return result.stdout.strip()
|
|
88
|
+
except FileNotFoundError:
|
|
89
|
+
pass # git not available
|
|
90
|
+
# Fallback: SHA256 of file content
|
|
91
|
+
digest = hashlib.sha256(path.read_bytes()).hexdigest()
|
|
92
|
+
return f"sha256:{digest[:16]}"
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
# ---------------------------------------------------------------------------
|
|
96
|
+
# Meta file helpers
|
|
97
|
+
# ---------------------------------------------------------------------------
|
|
98
|
+
|
|
99
|
+
def load_meta(install_dir: Path) -> dict:
|
|
100
|
+
meta_path = install_dir / META_FILE
|
|
101
|
+
if meta_path.is_file():
|
|
102
|
+
try:
|
|
103
|
+
return json.loads(meta_path.read_text(encoding="utf-8"))
|
|
104
|
+
except json.JSONDecodeError:
|
|
105
|
+
return {}
|
|
106
|
+
return {}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def save_meta(install_dir: Path, meta: dict) -> None:
|
|
110
|
+
install_dir.mkdir(parents=True, exist_ok=True)
|
|
111
|
+
meta_path = install_dir / META_FILE
|
|
112
|
+
meta_path.write_text(json.dumps(meta, indent=2), encoding="utf-8")
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
# ---------------------------------------------------------------------------
|
|
116
|
+
# Validation helper (delegates to scripts/validate.py if available)
|
|
117
|
+
# ---------------------------------------------------------------------------
|
|
118
|
+
|
|
119
|
+
def validate_skill(skill_file: Path) -> tuple[bool, str]:
|
|
120
|
+
"""
|
|
121
|
+
Run a lightweight inline validation on a single skill file.
|
|
122
|
+
Returns (passed, message).
|
|
123
|
+
"""
|
|
124
|
+
try:
|
|
125
|
+
text = skill_file.read_text(encoding="utf-8")
|
|
126
|
+
except OSError as exc:
|
|
127
|
+
return False, f"Cannot read file: {exc}"
|
|
128
|
+
|
|
129
|
+
lines = text.splitlines()
|
|
130
|
+
if len(lines) < 10:
|
|
131
|
+
return False, f"Too short ({len(lines)} lines)"
|
|
132
|
+
|
|
133
|
+
# Check for frontmatter
|
|
134
|
+
if not lines or lines[0].strip() != "---":
|
|
135
|
+
return False, "Missing YAML frontmatter (file must start with ---)"
|
|
136
|
+
|
|
137
|
+
# Extract frontmatter fields
|
|
138
|
+
end_idx = None
|
|
139
|
+
for i, line in enumerate(lines[1:], start=1):
|
|
140
|
+
if line.strip() == "---":
|
|
141
|
+
end_idx = i
|
|
142
|
+
break
|
|
143
|
+
if end_idx is None:
|
|
144
|
+
return False, "Unclosed YAML frontmatter"
|
|
145
|
+
|
|
146
|
+
fm_text = "\n".join(lines[1:end_idx])
|
|
147
|
+
if "name:" not in fm_text:
|
|
148
|
+
return False, "Frontmatter missing 'name' field"
|
|
149
|
+
if "description:" not in fm_text:
|
|
150
|
+
return False, "Frontmatter missing 'description' field"
|
|
151
|
+
|
|
152
|
+
return True, "OK"
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
# ---------------------------------------------------------------------------
|
|
156
|
+
# Auto-detect target
|
|
157
|
+
# ---------------------------------------------------------------------------
|
|
158
|
+
|
|
159
|
+
def auto_detect_target() -> str | None:
|
|
160
|
+
"""Return 'claude' or 'gemini' based on which install dirs already exist."""
|
|
161
|
+
for target, path in INSTALL_DIRS.items():
|
|
162
|
+
if path.exists():
|
|
163
|
+
return target
|
|
164
|
+
# Fall back to claude as the primary target
|
|
165
|
+
return "claude"
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
# ---------------------------------------------------------------------------
|
|
169
|
+
# Core operations
|
|
170
|
+
# ---------------------------------------------------------------------------
|
|
171
|
+
|
|
172
|
+
def list_installed(install_dir: Path) -> None:
|
|
173
|
+
meta = load_meta(install_dir)
|
|
174
|
+
if not meta:
|
|
175
|
+
print("No skills installed.")
|
|
176
|
+
return
|
|
177
|
+
|
|
178
|
+
print(f"Installed skills in {install_dir}:\n")
|
|
179
|
+
header = f"{'Skill':<30} {'Version':<20} {'Installed At'}"
|
|
180
|
+
print(header)
|
|
181
|
+
print("-" * len(header))
|
|
182
|
+
for name, info in sorted(meta.items()):
|
|
183
|
+
version = info.get("version", "unknown")[:12]
|
|
184
|
+
installed_at = info.get("installed_at", "unknown")
|
|
185
|
+
print(f"{name:<30} {version:<20} {installed_at}")
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def uninstall_skills(names: list[str], install_dir: Path, dry_run: bool) -> None:
|
|
189
|
+
meta = load_meta(install_dir)
|
|
190
|
+
removed, missing = 0, 0
|
|
191
|
+
|
|
192
|
+
for name in names:
|
|
193
|
+
dest = install_dir / f"{name}.md"
|
|
194
|
+
if dest.exists():
|
|
195
|
+
print(f" {'[dry-run] ' if dry_run else ''}Removing {dest}")
|
|
196
|
+
if not dry_run:
|
|
197
|
+
dest.unlink()
|
|
198
|
+
removed += 1
|
|
199
|
+
else:
|
|
200
|
+
print(f" Skill not installed: {name}")
|
|
201
|
+
missing += 1
|
|
202
|
+
|
|
203
|
+
if name in meta and not dry_run:
|
|
204
|
+
del meta[name]
|
|
205
|
+
|
|
206
|
+
if not dry_run:
|
|
207
|
+
save_meta(install_dir, meta)
|
|
208
|
+
|
|
209
|
+
print(f"\nUninstall summary: {removed} removed, {missing} not found.")
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def install_skills(
|
|
213
|
+
skill_map: dict[str, Path],
|
|
214
|
+
install_dir: Path,
|
|
215
|
+
target: str,
|
|
216
|
+
force: bool,
|
|
217
|
+
dry_run: bool,
|
|
218
|
+
do_validate: bool,
|
|
219
|
+
) -> None:
|
|
220
|
+
install_dir.mkdir(parents=True, exist_ok=True)
|
|
221
|
+
meta = load_meta(install_dir)
|
|
222
|
+
|
|
223
|
+
installed_count = 0
|
|
224
|
+
skipped_count = 0
|
|
225
|
+
failed_count = 0
|
|
226
|
+
|
|
227
|
+
for skill_name, skill_file in sorted(skill_map.items()):
|
|
228
|
+
dest = install_dir / f"{skill_name}.md"
|
|
229
|
+
|
|
230
|
+
# Validation gate
|
|
231
|
+
if do_validate:
|
|
232
|
+
passed, msg = validate_skill(skill_file)
|
|
233
|
+
if not passed:
|
|
234
|
+
print(f" FAIL {skill_name}: validation error — {msg}")
|
|
235
|
+
failed_count += 1
|
|
236
|
+
continue
|
|
237
|
+
|
|
238
|
+
# Skip if already installed and not forcing
|
|
239
|
+
exists_already = (
|
|
240
|
+
(install_dir / skill_name / "SKILL.md").exists()
|
|
241
|
+
if target == "antigravity"
|
|
242
|
+
else dest.exists()
|
|
243
|
+
)
|
|
244
|
+
if exists_already and not force:
|
|
245
|
+
print(f" SKIP {skill_name} (already installed; use --force to overwrite)")
|
|
246
|
+
skipped_count += 1
|
|
247
|
+
continue
|
|
248
|
+
|
|
249
|
+
if target == "antigravity":
|
|
250
|
+
# Antigravity: directory-based skills with SKILL.md
|
|
251
|
+
skill_dir = install_dir / skill_name
|
|
252
|
+
dest_file = skill_dir / "SKILL.md"
|
|
253
|
+
action = "Would install" if dry_run else "Installing"
|
|
254
|
+
print(f" {action} {skill_name}")
|
|
255
|
+
print(f" src : {skill_file}")
|
|
256
|
+
print(f" dest: {dest_file}")
|
|
257
|
+
|
|
258
|
+
if not dry_run:
|
|
259
|
+
skill_dir.mkdir(parents=True, exist_ok=True)
|
|
260
|
+
shutil.copy2(str(skill_file), str(dest_file))
|
|
261
|
+
# Copy optional asset directories (scripts/, references/, assets/)
|
|
262
|
+
src_dir = skill_file.parent
|
|
263
|
+
for subdir_name in ("scripts", "references", "assets"):
|
|
264
|
+
src_sub = src_dir / subdir_name
|
|
265
|
+
if src_sub.is_dir():
|
|
266
|
+
dest_sub = skill_dir / subdir_name
|
|
267
|
+
if dest_sub.exists():
|
|
268
|
+
shutil.rmtree(str(dest_sub))
|
|
269
|
+
shutil.copytree(str(src_sub), str(dest_sub))
|
|
270
|
+
meta[skill_name] = {
|
|
271
|
+
"name": skill_name,
|
|
272
|
+
"version": git_hash(skill_file),
|
|
273
|
+
"installed_at": datetime.now(timezone.utc).isoformat(),
|
|
274
|
+
"source_path": str(skill_file),
|
|
275
|
+
}
|
|
276
|
+
else:
|
|
277
|
+
action = "Would install" if dry_run else "Installing"
|
|
278
|
+
print(f" {action} {skill_name}")
|
|
279
|
+
print(f" src : {skill_file}")
|
|
280
|
+
print(f" dest: {dest}")
|
|
281
|
+
|
|
282
|
+
if not dry_run:
|
|
283
|
+
shutil.copy2(str(skill_file), str(dest))
|
|
284
|
+
meta[skill_name] = {
|
|
285
|
+
"name": skill_name,
|
|
286
|
+
"version": git_hash(skill_file),
|
|
287
|
+
"installed_at": datetime.now(timezone.utc).isoformat(),
|
|
288
|
+
"source_path": str(skill_file),
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
installed_count += 1
|
|
292
|
+
|
|
293
|
+
if not dry_run:
|
|
294
|
+
save_meta(install_dir, meta)
|
|
295
|
+
|
|
296
|
+
prefix = "[dry-run] " if dry_run else ""
|
|
297
|
+
print(
|
|
298
|
+
f"\n{prefix}Summary: {installed_count} installed, "
|
|
299
|
+
f"{skipped_count} skipped (already exists), "
|
|
300
|
+
f"{failed_count} failed."
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
if not dry_run and installed_count > 0:
|
|
304
|
+
instruction = POST_INSTALL_INSTRUCTIONS.get(target, "")
|
|
305
|
+
print(f"\nHow to use your skills ({target}):")
|
|
306
|
+
if target == "claude":
|
|
307
|
+
print(f" {instruction}")
|
|
308
|
+
print(f" Example: /codesage, /uismith, /bugHunter-pro")
|
|
309
|
+
elif target == "antigravity":
|
|
310
|
+
print(f" {instruction}")
|
|
311
|
+
print(f" The agent will automatically match skills to your tasks.")
|
|
312
|
+
print(f" Skills installed as directories with SKILL.md files.")
|
|
313
|
+
else:
|
|
314
|
+
print(f" {instruction}")
|
|
315
|
+
print(f"\nInstall directory: {install_dir}")
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
# ---------------------------------------------------------------------------
|
|
319
|
+
# CLI
|
|
320
|
+
# ---------------------------------------------------------------------------
|
|
321
|
+
|
|
322
|
+
def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
|
|
323
|
+
parser = argparse.ArgumentParser(
|
|
324
|
+
description="Install Agent Skills to Claude or Gemini commands directories.",
|
|
325
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
326
|
+
epilog=__doc__,
|
|
327
|
+
)
|
|
328
|
+
|
|
329
|
+
parser.add_argument(
|
|
330
|
+
"--target", "-t",
|
|
331
|
+
choices=["claude", "gemini", "antigravity"],
|
|
332
|
+
default=None,
|
|
333
|
+
help="Target platform (default: auto-detect based on existing directories).",
|
|
334
|
+
)
|
|
335
|
+
parser.add_argument(
|
|
336
|
+
"--skills", "-s",
|
|
337
|
+
default=None,
|
|
338
|
+
help="Comma-separated skill names to install (default: all).",
|
|
339
|
+
)
|
|
340
|
+
parser.add_argument(
|
|
341
|
+
"--force",
|
|
342
|
+
action="store_true",
|
|
343
|
+
help="Overwrite existing installed skills.",
|
|
344
|
+
)
|
|
345
|
+
parser.add_argument(
|
|
346
|
+
"--dry-run",
|
|
347
|
+
action="store_true",
|
|
348
|
+
help="Show what would be done without making any changes.",
|
|
349
|
+
)
|
|
350
|
+
parser.add_argument(
|
|
351
|
+
"--validate",
|
|
352
|
+
action="store_true",
|
|
353
|
+
help="Run validation on each skill before installing; skip invalid skills.",
|
|
354
|
+
)
|
|
355
|
+
parser.add_argument(
|
|
356
|
+
"--list-installed",
|
|
357
|
+
action="store_true",
|
|
358
|
+
help="Show currently installed skills with version info.",
|
|
359
|
+
)
|
|
360
|
+
parser.add_argument(
|
|
361
|
+
"--uninstall",
|
|
362
|
+
metavar="NAMES",
|
|
363
|
+
default=None,
|
|
364
|
+
help="Comma-separated skill names to uninstall.",
|
|
365
|
+
)
|
|
366
|
+
|
|
367
|
+
return parser.parse_args(argv)
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
def main(argv: list[str] | None = None) -> int:
|
|
371
|
+
args = parse_args(argv)
|
|
372
|
+
|
|
373
|
+
# Resolve target platform
|
|
374
|
+
target = args.target or auto_detect_target()
|
|
375
|
+
install_dir = INSTALL_DIRS[target]
|
|
376
|
+
|
|
377
|
+
print(f"Target : {target}")
|
|
378
|
+
print(f"Install: {install_dir}")
|
|
379
|
+
print()
|
|
380
|
+
|
|
381
|
+
# --list-installed
|
|
382
|
+
if args.list_installed:
|
|
383
|
+
list_installed(install_dir)
|
|
384
|
+
return 0
|
|
385
|
+
|
|
386
|
+
# --uninstall
|
|
387
|
+
if args.uninstall:
|
|
388
|
+
names = [n.strip().lower().replace(" ", "-") for n in args.uninstall.split(",") if n.strip()]
|
|
389
|
+
print(f"Uninstalling {len(names)} skill(s) from {install_dir}:\n")
|
|
390
|
+
uninstall_skills(names, install_dir, dry_run=args.dry_run)
|
|
391
|
+
return 0
|
|
392
|
+
|
|
393
|
+
# Discover all skills in the repo
|
|
394
|
+
root = repo_root()
|
|
395
|
+
all_skills = find_all_skill_dirs(root)
|
|
396
|
+
|
|
397
|
+
if not all_skills:
|
|
398
|
+
print("ERROR: No skill files found in the repository.")
|
|
399
|
+
return 1
|
|
400
|
+
|
|
401
|
+
# Filter to requested skills if --skills was given
|
|
402
|
+
if args.skills:
|
|
403
|
+
requested = {
|
|
404
|
+
n.strip().lower().replace(" ", "-")
|
|
405
|
+
for n in args.skills.split(",")
|
|
406
|
+
if n.strip()
|
|
407
|
+
}
|
|
408
|
+
unknown = requested - all_skills.keys()
|
|
409
|
+
if unknown:
|
|
410
|
+
print(f"WARNING: Unknown skill(s): {', '.join(sorted(unknown))}")
|
|
411
|
+
skill_map = {k: v for k, v in all_skills.items() if k in requested}
|
|
412
|
+
if not skill_map:
|
|
413
|
+
print("ERROR: No matching skills found.")
|
|
414
|
+
return 1
|
|
415
|
+
else:
|
|
416
|
+
skill_map = all_skills
|
|
417
|
+
|
|
418
|
+
print(f"Skills to process: {len(skill_map)}")
|
|
419
|
+
if args.dry_run:
|
|
420
|
+
print("[DRY RUN — no files will be written]\n")
|
|
421
|
+
print()
|
|
422
|
+
|
|
423
|
+
install_skills(
|
|
424
|
+
skill_map=skill_map,
|
|
425
|
+
install_dir=install_dir,
|
|
426
|
+
target=target,
|
|
427
|
+
force=args.force,
|
|
428
|
+
dry_run=args.dry_run,
|
|
429
|
+
do_validate=args.validate,
|
|
430
|
+
)
|
|
431
|
+
|
|
432
|
+
return 0
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
if __name__ == "__main__":
|
|
436
|
+
sys.exit(main())
|