@workingpayload/agent-skills 1.0.0 → 2.0.0

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