@workingpayload/agent-skills 1.0.1 → 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 (129) hide show
  1. package/APIForge/skill.md +165 -0
  2. package/AccessPlus/skill.md +136 -0
  3. package/AlgoMaster/skill.md +125 -0
  4. package/Architekt AI/skill.md +140 -0
  5. package/AuthCraft/skill.md +144 -0
  6. package/AutoScriptor/skill.md +137 -0
  7. package/BoilerCore/skill.md +136 -0
  8. package/BugHunter Pro/skill.md +133 -0
  9. package/ChangeScribe/skill.md +113 -0
  10. package/CodeSage/skill.md +163 -0
  11. package/CommitCraft/skill.md +113 -0
  12. package/CoverageMax/skill.md +161 -0
  13. package/CronGenius/skill.md +157 -0
  14. package/DataPolish/skill.md +142 -0
  15. package/DataWeaver/skill.md +151 -0
  16. package/DockMaster/skill.md +158 -0
  17. package/DocuGenie/skill.md +138 -0
  18. package/EdgeGuard/skill.md +160 -0
  19. package/EnvWizard/skill.md +156 -0
  20. package/ErrorMedic/skill.md +152 -0
  21. package/FeatureSmith/skill.md +139 -0
  22. package/FlexiLayout/skill.md +144 -0
  23. package/FlowTester/skill.md +154 -0
  24. package/FunctionForge/skill.md +136 -0
  25. package/InputShield/skill.md +144 -0
  26. package/IssueForge/skill.md +148 -0
  27. package/KubeCrafter/skill.md +149 -0
  28. package/LogicLens/skill.md +132 -0
  29. package/MockSmith/skill.md +146 -0
  30. package/ModelSensei/skill.md +138 -0
  31. package/PRMentor/skill.md +103 -0
  32. package/PerfDetective/skill.md +90 -0
  33. package/PipelinePro/skill.md +146 -0
  34. package/PolyglotShift/skill.md +94 -0
  35. package/PromptForge/skill.md +118 -0
  36. package/QueryPulse/skill.md +123 -0
  37. package/README.md +416 -329
  38. package/ReadMeCraft/skill.md +127 -0
  39. package/RefactorX/skill.md +84 -0
  40. package/RenderBoost/skill.md +148 -0
  41. package/SEOMancer/skill.md +156 -0
  42. package/ScrapeMaster/skill.md +157 -0
  43. package/SecretSniffer/skill.md +123 -0
  44. package/SecureScan/skill.md +130 -0
  45. package/ServiceSplitter/skill.md +153 -0
  46. package/SpeedSmith/skill.md +155 -0
  47. package/StackWise/skill.md +155 -0
  48. package/TaskOrchestrator/skill.md +135 -0
  49. package/TestCrafter/skill.md +158 -0
  50. package/TraceMind/skill.md +143 -0
  51. package/UISmith/skill.md +131 -0
  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 -32
  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/cli.js +0 -181
  68. package/skills/APIForge/skill.md +0 -32
  69. package/skills/AccessPlus/skill.md +0 -32
  70. package/skills/AlgoMaster/skill.md +0 -32
  71. package/skills/Architekt AI/skill.md +0 -32
  72. package/skills/AuthCraft/skill.md +0 -32
  73. package/skills/AutoScriptor/skill.md +0 -32
  74. package/skills/BoilerCore/skill.md +0 -32
  75. package/skills/BugHunter Pro/skill.md +0 -32
  76. package/skills/ChangeScribe/skill.md +0 -32
  77. package/skills/CodeSage/skill.md +0 -32
  78. package/skills/CommitCraft/skill.md +0 -32
  79. package/skills/CoverageMax/skill.md +0 -32
  80. package/skills/CronGenius/skill.md +0 -32
  81. package/skills/DataPolish/skill.md +0 -32
  82. package/skills/DataWeaver/skill.md +0 -32
  83. package/skills/DockMaster/skill.md +0 -32
  84. package/skills/DocuGenie/skill.md +0 -32
  85. package/skills/EdgeGuard/skill.md +0 -32
  86. package/skills/EnvWizard/skill.md +0 -32
  87. package/skills/ErrorMedic/skill.md +0 -32
  88. package/skills/Extension-Extender/SKILL.md +0 -41
  89. package/skills/Extension-Extender/references/ui-guidelines.md +0 -26
  90. package/skills/Fastapi-Furious/README.md +0 -16
  91. package/skills/Fastapi-Furious/SKILL.md +0 -37
  92. package/skills/FeatureSmith/skill.md +0 -32
  93. package/skills/FlexiLayout/skill.md +0 -32
  94. package/skills/FlowTester/skill.md +0 -32
  95. package/skills/FunctionForge/skill.md +0 -32
  96. package/skills/InputShield/skill.md +0 -32
  97. package/skills/IssueForge/skill.md +0 -32
  98. package/skills/KubeCrafter/skill.md +0 -32
  99. package/skills/LogicLens/skill.md +0 -32
  100. package/skills/MockSmith/skill.md +0 -32
  101. package/skills/ModelSensei/skill.md +0 -32
  102. package/skills/PRMentor/skill.md +0 -32
  103. package/skills/PerfDetective/skill.md +0 -32
  104. package/skills/PipelinePro/skill.md +0 -32
  105. package/skills/PolyglotShift/skill.md +0 -32
  106. package/skills/PromptForge/skill.md +0 -32
  107. package/skills/Python-Master/README.md +0 -11
  108. package/skills/Python-Master/SKILL.md +0 -37
  109. package/skills/QueryPulse/skill.md +0 -32
  110. package/skills/React-Ranger/README.md +0 -17
  111. package/skills/React-Ranger/SKILL.md +0 -37
  112. package/skills/ReadMeCraft/skill.md +0 -32
  113. package/skills/RefactorX/skill.md +0 -32
  114. package/skills/RenderBoost/skill.md +0 -32
  115. package/skills/SEOMancer/skill.md +0 -32
  116. package/skills/ScrapeMaster/skill.md +0 -32
  117. package/skills/SecretSniffer/skill.md +0 -32
  118. package/skills/SecureScan/skill.md +0 -32
  119. package/skills/ServiceSplitter/skill.md +0 -32
  120. package/skills/SpeedSmith/skill.md +0 -32
  121. package/skills/StackWise/skill.md +0 -32
  122. package/skills/TaskOrchestrator/skill.md +0 -32
  123. package/skills/TestCrafter/skill.md +0 -32
  124. package/skills/TraceMind/skill.md +0 -32
  125. package/skills/UISmith/skill.md +0 -32
  126. /package/{skills/Extension-Extender → extension-extender}/assets/manifest.json +0 -0
  127. /package/{skills/Extension-Extender → extension-extender}/assets/popup.css +0 -0
  128. /package/{skills/Extension-Extender → extension-extender}/assets/popup.html +0 -0
  129. /package/{skills/Extension-Extender → extension-extender}/assets/popup.js +0 -0
@@ -0,0 +1,131 @@
1
+ ---
2
+ name: uismith
3
+ description: Builds accessible, composable UI components using Atomic Design principles, WCAG AA compliance, design tokens, and CSS Modules or Tailwind CSS. Use when asked to create UI components, audit accessibility, implement ARIA roles, set up a design system, or decompose a UI into reusable components.
4
+ ---
5
+
6
+ # UISmith
7
+
8
+ ## Overview
9
+
10
+ Translates designs into accessible, composable, and maintainable UI components. Every component targets WCAG 2.2 Level AA compliance, uses Atomic Design decomposition, implements correct ARIA roles and keyboard navigation, and is styled with design tokens (CSS custom properties or Tailwind config). No component ships without accessibility attributes and keyboard interaction support.
11
+
12
+ ## Workflow
13
+
14
+ ### 1. Component Decomposition (Atomic Design)
15
+
16
+ Before coding, classify the component in the Atomic Design hierarchy:
17
+
18
+ | Level | Examples | Key Trait |
19
+ |-------|---------|-----------|
20
+ | **Atom** | Button, Input, Label, Icon, Badge | No children components; single HTML element or small group |
21
+ | **Molecule** | SearchBar (Input + Button), FormField (Label + Input + Error) | Combines 2–4 atoms; one focused function |
22
+ | **Organism** | NavigationBar, DataTable, ProductCard, Modal | Combines molecules/atoms; owns its own state |
23
+ | **Template** | PageLayout, DashboardShell | Layout skeleton; no data, only slots/children |
24
+ | **Page** | DashboardPage, ProfilePage | Template + real data; maps to a route |
25
+
26
+ Decision rule: if you find yourself writing the same markup in 3+ places, extract to the appropriate atom/molecule level.
27
+
28
+ ### 2. Accessibility — WCAG 2.2 AA Checklist
29
+
30
+ Apply to every component before marking it complete:
31
+
32
+ **Semantic HTML first**:
33
+ - Use `<button>` for actions (never `<div onClick>`), `<a href>` for navigation, `<input>` for data entry.
34
+ - Use heading hierarchy (`h1` → `h2` → `h3`) that reflects document structure, not visual size.
35
+ - Use landmark elements: `<main>`, `<nav>`, `<aside>`, `<header>`, `<footer>`.
36
+
37
+ **ARIA roles and labels**:
38
+ ```html
39
+ <!-- Incorrect: div with no role -->
40
+ <div onClick={handleClose}>X</div>
41
+
42
+ <!-- Correct: semantic button with accessible label -->
43
+ <button type="button" aria-label="Close dialog" onClick={handleClose}>
44
+ <XIcon aria-hidden="true" />
45
+ </button>
46
+
47
+ <!-- Modal dialog -->
48
+ <div
49
+ role="dialog"
50
+ aria-modal="true"
51
+ aria-labelledby="dialog-title"
52
+ aria-describedby="dialog-description"
53
+ >
54
+ <h2 id="dialog-title">Confirm Delete</h2>
55
+ <p id="dialog-description">This action cannot be undone.</p>
56
+ </div>
57
+
58
+ <!-- Navigation with label to distinguish multiple navs -->
59
+ <nav aria-label="Main navigation">...</nav>
60
+ <nav aria-label="Breadcrumb">...</nav>
61
+
62
+ <!-- Live region for dynamic content -->
63
+ <div aria-live="polite" aria-atomic="true" role="status">
64
+ {statusMessage}
65
+ </div>
66
+ ```
67
+
68
+ **Color contrast**: Text must meet 4.5:1 contrast ratio (normal text) or 3:1 (large text ≥ 18pt/14pt bold) against background. Use tooling: `axe-core`, `@radix-ui/colors` (APCA-compliant scale), or Figma's Contrast plugin. Never convey information by color alone — add icon, pattern, or text.
69
+
70
+ **Focus management**:
71
+ - Visible focus indicator: `outline: 2px solid currentColor; outline-offset: 2px` (never `outline: none` without an equally visible custom focus style).
72
+ - Focus trap in modals/drawers: implement with `focus-trap-react` or Radix UI's Dialog primitive.
73
+ - Return focus to trigger element when modal closes.
74
+
75
+ ### 3. Keyboard Navigation Patterns
76
+
77
+ Per ARIA Authoring Practices Guide (APG): Button = Enter/Space; Radio group = Arrow keys; Dropdown = Enter opens, Arrow navigates, Escape closes; Dialog = Tab/Shift+Tab within, Escape closes; Tabs = Arrow keys between tabs.
78
+
79
+ **Prefer Radix UI or Headless UI primitives** over hand-rolling keyboard nav — they implement APG patterns correctly. For custom dropdowns, handle `ArrowDown`/`ArrowUp` to move `activeIndex`, `Escape` to close and return focus to the trigger, and `ArrowUp`/`ArrowDown` to prevent page scroll with `e.preventDefault()`.
80
+
81
+ ### 4. Design Tokens
82
+
83
+ Define all visual decisions as CSS custom properties — never hardcode values:
84
+
85
+ ```css
86
+ :root {
87
+ --color-primary-500: #2563eb; --color-primary-600: #1d4ed8;
88
+ --color-error-500: #dc2626;
89
+ --color-surface-default: #ffffff; --color-text-primary: #0f172a;
90
+ --space-1: 0.25rem; --space-2: 0.5rem; --space-4: 1rem; --space-8: 2rem;
91
+ --font-size-base: 1rem; --line-height-normal: 1.5;
92
+ --radius-md: 0.375rem;
93
+ --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
94
+ }
95
+ ```
96
+
97
+ Tailwind: extend `colors`, `spacing`, and `borderRadius` in `tailwind.config.ts` to match your token scale. Never use magic numbers.
98
+
99
+ ### 5. CSS Modules vs. Tailwind
100
+
101
+ **CSS Modules**: choose for strict encapsulation, complex animations, or pseudo-element logic. Reference tokens via `var(--space-2)` in module files.
102
+
103
+ **Tailwind**: choose for rapid iteration, shadcn/ui, or Radix primitives. Use `cn()` to merge variant classes and keep focus-visible styles always present:
104
+ ```tsx
105
+ <button className={cn('px-4 py-2 rounded-md focus-visible:outline focus-visible:outline-2',
106
+ variant === 'primary' && 'bg-primary-500 text-white')} {...props} />
107
+ ```
108
+
109
+ ### 6. Component Output Requirements
110
+
111
+ Every component delivered must include:
112
+
113
+ 1. **Component file** with TypeScript props interface (no `any`)
114
+ 2. **Accessible markup**: correct roles, labels, live regions where needed
115
+ 3. **Keyboard interaction**: all interactions operable by keyboard
116
+ 4. **Story or usage example** (Storybook story or plain code example)
117
+ 5. **Accessibility note**: list of WCAG criteria addressed and any known limitations
118
+
119
+ ## Edge Cases
120
+
121
+ **RTL layout support:** Use logical CSS properties (`margin-inline-start` instead of `margin-left`, `padding-inline-end` instead of `padding-right`) so layouts flip automatically when `dir="rtl"` is set on `<html>`. Set `dir="rtl"` at the root for RTL languages. Mirror icons that imply direction (arrows, chevrons) using `transform: scaleX(-1)` under `[dir="rtl"]`. Test with Arabic or Hebrew `lang` attributes.
122
+
123
+ **Windows High Contrast mode:** Use `@media (forced-colors: active)` to adapt components that rely on custom colors, box-shadows, or background images for contrast — these are overridden by the OS. Replace `box-shadow` focus rings with `outline`, use `ButtonText`, `ButtonFace`, and `CanvasText` CSS system color keywords for forced-colors-aware styling. Test in Windows Accessibility → High Contrast Black/White themes.
124
+
125
+ **Touch gesture accessibility (WCAG 2.5.1):** All touch gestures (swipe, pinch, multi-finger) must have a single-pointer alternative (a button, link, or drag handle). Pointer cancellation (WCAG 2.5.2): actions that trigger on `pointerdown` must be reversible on `pointerup`. Provide keyboard equivalents for all custom drag-and-drop interactions.
126
+
127
+ **Dynamic content and screen readers**: Content that updates without a page reload (toasts, form validation errors, loading states) must be announced to screen readers. Use `role="alert"` (assertive, interrupts) for errors, `role="status"` / `aria-live="polite"` for non-urgent updates. Inject the element into the DOM before updating its text content — some screen readers miss updates to pre-existing live regions.
128
+
129
+ **Icon-only buttons without visible labels**: A button containing only an icon must have an `aria-label` describing the action, not the icon. `aria-label="Close"` not `aria-label="X icon"`. The icon itself must have `aria-hidden="true"` to prevent duplicate announcement. If using SVG, add `focusable="false"` to prevent IE11 SVG focus behavior.
130
+
131
+ **Responsive component behavior**: A component that changes its DOM structure at different breakpoints (e.g., a horizontal nav that collapses to a hamburger menu) must maintain accessibility at all breakpoints. The collapsed menu must be announced as expanded/collapsed (`aria-expanded`), and the full nav landmark must remain in the DOM (use CSS to hide, not `display:none` without `aria-hidden`) or the aria-hidden state must be updated when hiding.
package/bin/cli.js ADDED
@@ -0,0 +1,377 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execSync, spawnSync } = require("child_process");
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+ const os = require("os");
7
+
8
+ // ── Resolve paths ──────────────────────────────────────────────────
9
+ const PKG_ROOT = path.resolve(__dirname, "..");
10
+ const SCRIPTS_DIR = path.join(PKG_ROOT, "scripts");
11
+ const HOME = os.homedir();
12
+
13
+ const TARGETS = {
14
+ claude: path.join(HOME, ".claude", "commands"),
15
+ gemini: path.join(HOME, ".gemini", "commands"),
16
+ };
17
+
18
+ // ── Helpers ────────────────────────────────────────────────────────
19
+ function hasPython() {
20
+ for (const cmd of ["python3", "python"]) {
21
+ try {
22
+ execSync(`${cmd} --version`, { stdio: "ignore" });
23
+ return cmd;
24
+ } catch (_) {}
25
+ }
26
+ return null;
27
+ }
28
+
29
+ function runPythonScript(scriptName, args = []) {
30
+ const py = hasPython();
31
+ if (!py) {
32
+ console.error("Error: Python 3 is required but not found in PATH.");
33
+ console.error("Install Python 3: https://python.org/downloads/");
34
+ process.exit(1);
35
+ }
36
+ const scriptPath = path.join(SCRIPTS_DIR, scriptName);
37
+ if (!fs.existsSync(scriptPath)) {
38
+ console.error(`Error: Script not found: ${scriptPath}`);
39
+ process.exit(1);
40
+ }
41
+ const result = spawnSync(py, [scriptPath, ...args], {
42
+ stdio: "inherit",
43
+ cwd: PKG_ROOT,
44
+ });
45
+ process.exit(result.status || 0);
46
+ }
47
+
48
+ function findSkillFiles() {
49
+ const skills = [];
50
+ const entries = fs.readdirSync(PKG_ROOT, { withFileTypes: true });
51
+ for (const entry of entries) {
52
+ if (!entry.isDirectory() || entry.name.startsWith(".") || entry.name === "node_modules" || entry.name === "bin" || entry.name === "scripts") continue;
53
+ const dir = path.join(PKG_ROOT, entry.name);
54
+ for (const fname of ["skill.md", "SKILL.md"]) {
55
+ const fpath = path.join(dir, fname);
56
+ if (fs.existsSync(fpath)) {
57
+ skills.push({ name: entry.name, file: fname, fullPath: fpath, dir: entry.name });
58
+ break;
59
+ }
60
+ }
61
+ }
62
+ return skills;
63
+ }
64
+
65
+ function slugify(name) {
66
+ return name.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "");
67
+ }
68
+
69
+ // ── Commands ───────────────────────────────────────────────────────
70
+
71
+ function cmdInstall(args) {
72
+ const flags = parseFlags(args, { target: "t", skills: "s", force: null, "dry-run": null, validate: null });
73
+
74
+ // Detect target
75
+ let target = flags.target;
76
+ if (!target) {
77
+ if (fs.existsSync(TARGETS.claude)) target = "claude";
78
+ else if (fs.existsSync(TARGETS.gemini)) target = "gemini";
79
+ else target = "claude"; // default
80
+ }
81
+ if (!TARGETS[target]) {
82
+ console.error(`Unknown target: ${target}. Use "claude" or "gemini".`);
83
+ process.exit(1);
84
+ }
85
+
86
+ const installDir = TARGETS[target];
87
+ const dryRun = flags["dry-run"] || false;
88
+ const force = flags.force || false;
89
+
90
+ // Ensure install directory
91
+ if (!dryRun) {
92
+ fs.mkdirSync(installDir, { recursive: true });
93
+ }
94
+
95
+ // Find skills
96
+ let skills = findSkillFiles();
97
+ if (flags.skills) {
98
+ const wanted = new Set(flags.skills.split(",").map(s => s.trim().toLowerCase()));
99
+ skills = skills.filter(s => wanted.has(s.name.toLowerCase()) || wanted.has(slugify(s.name)));
100
+ }
101
+
102
+ console.log(`Target : ${target}`);
103
+ console.log(`Install: ${installDir}`);
104
+ console.log(`Skills : ${skills.length}`);
105
+ if (dryRun) console.log("[DRY RUN — no files will be written]\n");
106
+ else console.log();
107
+
108
+ let installed = 0, skipped = 0, failed = 0;
109
+ const meta = loadMeta(installDir);
110
+
111
+ for (const skill of skills) {
112
+ const slug = slugify(skill.name);
113
+ const dest = path.join(installDir, `${slug}.md`);
114
+
115
+ if (fs.existsSync(dest) && !force) {
116
+ if (!dryRun) console.log(` SKIP ${slug} (already exists, use --force to overwrite)`);
117
+ skipped++;
118
+ continue;
119
+ }
120
+
121
+ if (flags.validate) {
122
+ const content = fs.readFileSync(skill.fullPath, "utf8");
123
+ const issues = validateSkill(content);
124
+ if (issues.length > 0) {
125
+ console.log(` FAIL ${slug} — validation errors:`);
126
+ issues.forEach(i => console.log(` - ${i}`));
127
+ failed++;
128
+ continue;
129
+ }
130
+ }
131
+
132
+ if (dryRun) {
133
+ console.log(` Would install ${slug}`);
134
+ console.log(` src : ${skill.fullPath}`);
135
+ console.log(` dest: ${dest}`);
136
+ } else {
137
+ try {
138
+ fs.copyFileSync(skill.fullPath, dest);
139
+ meta[slug] = {
140
+ name: slug,
141
+ source: skill.fullPath,
142
+ installed_at: new Date().toISOString(),
143
+ directory: skill.dir,
144
+ };
145
+ installed++;
146
+ console.log(` OK ${slug}`);
147
+ } catch (err) {
148
+ console.log(` FAIL ${slug} — ${err.message}`);
149
+ failed++;
150
+ }
151
+ }
152
+ }
153
+
154
+ if (!dryRun) {
155
+ saveMeta(installDir, meta);
156
+ }
157
+
158
+ console.log(`\n${installed} installed, ${skipped} skipped, ${failed} failed.`);
159
+
160
+ if (!dryRun && installed > 0) {
161
+ console.log(`\n How to use:`);
162
+ if (target === "claude") {
163
+ console.log(` In Claude Code, type /<skill-name> to invoke a skill.`);
164
+ console.log(` Examples: /codesage, /testcrafter, /dockmaster, /python-master`);
165
+ } else {
166
+ console.log(` Skills are now available in your Gemini context.`);
167
+ }
168
+ }
169
+ }
170
+
171
+ function cmdUninstall(args) {
172
+ const flags = parseFlags(args, { target: "t" });
173
+ const target = flags.target || "claude";
174
+ const installDir = TARGETS[target];
175
+ const names = flags._.filter(n => n !== "uninstall");
176
+
177
+ if (names.length === 0) {
178
+ console.error("Usage: agent-skills uninstall <skill-name> [<skill-name>...] [-t claude|gemini]");
179
+ process.exit(1);
180
+ }
181
+
182
+ const meta = loadMeta(installDir);
183
+ let removed = 0;
184
+
185
+ for (const name of names) {
186
+ const slug = slugify(name);
187
+ const dest = path.join(installDir, `${slug}.md`);
188
+ if (fs.existsSync(dest)) {
189
+ fs.unlinkSync(dest);
190
+ delete meta[slug];
191
+ console.log(` Removed ${slug}`);
192
+ removed++;
193
+ } else {
194
+ console.log(` Not found: ${slug}`);
195
+ }
196
+ }
197
+
198
+ saveMeta(installDir, meta);
199
+ console.log(`\n${removed} skill(s) removed.`);
200
+ }
201
+
202
+ function cmdList(args) {
203
+ const flags = parseFlags(args, { target: "t" });
204
+ const target = flags.target || "claude";
205
+ const installDir = TARGETS[target];
206
+
207
+ if (!fs.existsSync(installDir)) {
208
+ console.log(`No skills installed for ${target} (${installDir} does not exist).`);
209
+ return;
210
+ }
211
+
212
+ const meta = loadMeta(installDir);
213
+ const entries = Object.values(meta);
214
+
215
+ if (entries.length === 0) {
216
+ console.log(`No skills installed for ${target}.`);
217
+ return;
218
+ }
219
+
220
+ console.log(`Installed skills (${target}): ${entries.length}\n`);
221
+ console.log(" Name Installed At");
222
+ console.log(" " + "-".repeat(60));
223
+ for (const e of entries.sort((a, b) => a.name.localeCompare(b.name))) {
224
+ const date = e.installed_at ? e.installed_at.slice(0, 19).replace("T", " ") : "unknown";
225
+ console.log(` ${e.name.padEnd(30)} ${date}`);
226
+ }
227
+ }
228
+
229
+ function cmdDoctor(args) {
230
+ runPythonScript("doctor.py", args);
231
+ }
232
+
233
+ function cmdRoute(args) {
234
+ runPythonScript("route.py", args);
235
+ }
236
+
237
+ function cmdValidate(args) {
238
+ runPythonScript("validate.py", args);
239
+ }
240
+
241
+ function cmdScore(args) {
242
+ runPythonScript("score.py", args);
243
+ }
244
+
245
+ function cmdTest(args) {
246
+ runPythonScript("test_skill.py", args);
247
+ }
248
+
249
+ function cmdBuildIndex(args) {
250
+ runPythonScript("build_index.py", args);
251
+ }
252
+
253
+ function cmdHelp() {
254
+ console.log(`
255
+ agent-skills — AI-powered developer skills for Claude and Gemini
256
+
257
+ Usage:
258
+ agent-skills <command> [options]
259
+
260
+ Commands:
261
+ install Install skills to Claude or Gemini
262
+ -t, --target Target: "claude" or "gemini" (default: auto-detect)
263
+ -s, --skills Comma-separated skill names (default: all)
264
+ --force Overwrite existing skills
265
+ --dry-run Preview without writing files
266
+ --validate Validate skills before installing
267
+
268
+ uninstall <names> Remove installed skills
269
+ -t, --target Target: "claude" or "gemini"
270
+
271
+ list List installed skills
272
+ -t, --target Target: "claude" or "gemini"
273
+
274
+ route "<prompt>" Find the best skill for a task
275
+ -n, --top-n Number of results (default: 3)
276
+ --json Output as JSON
277
+ --interactive Interactive prompt mode
278
+
279
+ doctor Check health of installed skills
280
+ -t, --target Target: "claude" or "gemini" (default: both)
281
+
282
+ validate Lint all skill files
283
+ --fix Auto-fix known issues
284
+
285
+ score Score all skills on quality metrics
286
+ --json Output as JSON
287
+
288
+ test Run adversarial tests on all skills
289
+
290
+ build-index Regenerate skills.json and skills-routing.json
291
+
292
+ Examples:
293
+ npx agent-skills install # Install all to Claude
294
+ npx agent-skills install -t gemini -s CodeSage,TestCrafter
295
+ npx agent-skills route "review my Python code"
296
+ npx agent-skills doctor
297
+ npx agent-skills list
298
+ npx agent-skills score --json > report.json
299
+ `);
300
+ }
301
+
302
+ // ── Utilities ──────────────────────────────────────────────────────
303
+
304
+ function parseFlags(args, aliases = {}) {
305
+ const result = { _: [] };
306
+ let i = 0;
307
+ while (i < args.length) {
308
+ const arg = args[i];
309
+ if (arg.startsWith("--")) {
310
+ const key = arg.slice(2);
311
+ if (i + 1 < args.length && !args[i + 1].startsWith("-")) {
312
+ result[key] = args[++i];
313
+ } else {
314
+ result[key] = true;
315
+ }
316
+ } else if (arg.startsWith("-") && arg.length === 2) {
317
+ const short = arg.slice(1);
318
+ const long = Object.entries(aliases).find(([, v]) => v === short)?.[0];
319
+ const key = long || short;
320
+ if (i + 1 < args.length && !args[i + 1].startsWith("-")) {
321
+ result[key] = args[++i];
322
+ } else {
323
+ result[key] = true;
324
+ }
325
+ } else {
326
+ result._.push(arg);
327
+ }
328
+ i++;
329
+ }
330
+ return result;
331
+ }
332
+
333
+ function validateSkill(content) {
334
+ const issues = [];
335
+ if (!content.startsWith("---")) issues.push("Missing frontmatter (---)");
336
+ if (!content.match(/^#{1}\s/m)) issues.push("No H1 heading found");
337
+ if (!content.match(/^#{2}\s/m)) issues.push("No H2 section found");
338
+ if (!content.includes("```")) issues.push("No code examples found");
339
+ if (content.length < 500) issues.push("Content too short (< 500 chars)");
340
+ return issues;
341
+ }
342
+
343
+ function loadMeta(installDir) {
344
+ const metaPath = path.join(installDir, ".skills-meta.json");
345
+ if (fs.existsSync(metaPath)) {
346
+ try { return JSON.parse(fs.readFileSync(metaPath, "utf8")); } catch (_) {}
347
+ }
348
+ return {};
349
+ }
350
+
351
+ function saveMeta(installDir, meta) {
352
+ const metaPath = path.join(installDir, ".skills-meta.json");
353
+ fs.writeFileSync(metaPath, JSON.stringify(meta, null, 2) + "\n");
354
+ }
355
+
356
+ // ── Main ───────────────────────────────────────────────────────────
357
+
358
+ const [, , command, ...args] = process.argv;
359
+
360
+ switch (command) {
361
+ case "install": cmdInstall(args); break;
362
+ case "uninstall": cmdUninstall(args); break;
363
+ case "list": cmdList(args); break;
364
+ case "route": cmdRoute(args); break;
365
+ case "doctor": cmdDoctor(args); break;
366
+ case "validate": cmdValidate(args); break;
367
+ case "score": cmdScore(args); break;
368
+ case "test": cmdTest(args); break;
369
+ case "build-index": cmdBuildIndex(args); break;
370
+ case "help":
371
+ case "--help":
372
+ case "-h":
373
+ case undefined: cmdHelp(); break;
374
+ default:
375
+ console.error(`Unknown command: ${command}\nRun "agent-skills help" for usage.`);
376
+ process.exit(1);
377
+ }
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: extension-extender
3
+ description: Creates, fixes, and debugs Manifest V3 browser extensions for Chrome and Firefox with secure permissions scoping, CSP compliance, cross-browser compatibility, storage management, and version migration. Use when a user asks to build, fix, or debug a Chrome/Firefox extension, create a popup, or handle extension manifest issues.
4
+ ---
5
+
6
+ # Extension Extender
7
+
8
+ ## Overview
9
+
10
+ Builds modern Manifest V3 browser extensions with secure permissions, cross-browser compatibility (Chrome + Firefox), CSP compliance, storage management, and structured debugging. Produces `chrome://extensions`-ready code.
11
+
12
+ ## Workflow
13
+
14
+ ### 1. Project Initialization
15
+
16
+ Use `assets/manifest.json`, `assets/popup.html`, `assets/popup.css`, `assets/popup.js` as boilerplate if available. If assets are missing, generate inline:
17
+
18
+ ```json
19
+ {
20
+ "manifest_version": 3,
21
+ "name": "My Extension",
22
+ "version": "1.0",
23
+ "action": { "default_popup": "popup.html" },
24
+ "permissions": [],
25
+ "host_permissions": []
26
+ }
27
+ ```
28
+
29
+ ### 2. Permissions Scoping (Principle of Least Privilege)
30
+
31
+ 1. List every browser API the extension uses (`storage`, `tabs`, `scripting`).
32
+ 2. Use `optional_permissions` where possible — granted at runtime via `chrome.permissions.request()`, reduces install friction.
33
+ 3. URL patterns go in `host_permissions`, not `permissions`. Be specific: `"https://example.com/*"` over `"<all_urls>"`.
34
+ 4. Never request `"tabs"` just for current tab URL — use `"activeTab"` instead.
35
+ 5. After editing permissions, reload in `chrome://extensions` and verify no errors.
36
+
37
+ ### 3. Firefox WebExtensions Compatibility
38
+
39
+ - Replace `chrome.*` with `browser.*` using `webextension-polyfill` for cross-browser support.
40
+ - Firefox MV3 background support differs: use `"background": { "scripts": ["background.js"] }` for Firefox (check MDN for current MV3 status).
41
+ - `chrome.scripting.executeScript` → `browser.tabs.executeScript` (MV2) or `browser.scripting` (MV3 when supported).
42
+ - `browser.action` is standard in both Chrome/Firefox MV3. Do not use `browser.browserAction`.
43
+ - Test Firefox: `about:debugging#/runtime/this-firefox` → "Load Temporary Add-on".
44
+
45
+ ### 4. Content Security Policy (CSP)
46
+
47
+ - No inline `<script>` or `onclick="..."` — move all JS to external `.js` files.
48
+ - No `eval()`, `new Function()`, or dynamic code execution.
49
+ - Remote resources (fonts, images): explicitly allow in manifest:
50
+ ```json
51
+ "content_security_policy": {
52
+ "extension_pages": "script-src 'self'; object-src 'self'; img-src 'self' https://cdn.example.com"
53
+ }
54
+ ```
55
+ - Never relax `script-src` beyond `'self'`. Vendor third-party code locally.
56
+
57
+ ### 5. Storage Management
58
+
59
+ **`chrome.storage.sync` vs `local`:**
60
+
61
+ | Feature | `sync` | `local` |
62
+ |---------|--------|---------|
63
+ | Synced across devices | Yes (Google account) | No |
64
+ | Quota | 100KB total, 8KB/item, 512 items | 5MB default (2GB with `unlimitedStorage`) |
65
+ | Use for | Preferences, small config | Cached data, history, large datasets |
66
+
67
+ Always check `chrome.runtime.lastError` after storage calls. Batch writes to avoid hitting quota.
68
+
69
+ **Version upgrade data migration:**
70
+ ```javascript
71
+ chrome.runtime.onInstalled.addListener(({ reason, previousVersion }) => {
72
+ if (reason === 'update') {
73
+ chrome.storage.local.get(['settings'], ({ settings }) => {
74
+ if (settings && !settings.schemaVersion) {
75
+ chrome.storage.local.set({
76
+ settings: { ...settings, schemaVersion: 2, newKey: settings.oldKey }
77
+ });
78
+ }
79
+ });
80
+ }
81
+ });
82
+ ```
83
+ Always track a `schemaVersion` field. Test migrations by loading the old version, saving data, then upgrading.
84
+
85
+ ### 6. Styling (Beautiful UI Defaults)
86
+
87
+ - CSS custom properties for theming (`--color-primary`, `--bg-surface`).
88
+ - Dark mode: `@media (prefers-color-scheme: dark)`.
89
+ - Popup: 300–400px width, under 600px height. `rem` for fonts, `px` for borders/shadows.
90
+
91
+ ### 7. Debugging Decision Workflow
92
+
93
+ 1. **Manifest errors** → confirm `"manifest_version": 3`. Service worker: `"background": { "service_worker": "background.js" }` (not `"scripts"` array).
94
+ 2. **Popup errors** → right-click popup → Inspect. Background errors → `chrome://extensions` → service worker → Inspect.
95
+ 3. **Content script not injecting** → verify `content_scripts` in manifest or programmatic `chrome.scripting.executeScript`. Content scripts run in isolated world — can't access page JS vars.
96
+ 4. **DOM not ready** → wrap logic in `document.addEventListener('DOMContentLoaded', ...)`.
97
+ 5. **Message passing fails** → verify both sides use matching `type` fields in `chrome.runtime.sendMessage`/`onMessage`. Return `true` in listener if response is async.
98
+ 6. **Permission denied at runtime** → add missing permission to manifest, reload, re-test.
99
+ 7. **Service worker terminates mid-task** → MV3 service workers are ephemeral (30s idle timeout). Use `chrome.alarms` for periodic tasks; persist state in `chrome.storage` rather than in-memory variables.
100
+
101
+ ### 8. Content Script vs Host Page
102
+
103
+ Content scripts share the DOM but not JS context (isolated world). Host page CSP does **not** block content scripts. To interact with page JS:
104
+ - Inject via `chrome.scripting.executeScript({ world: "MAIN" })` (Chrome 95+).
105
+ - Code in `MAIN` world **is** subject to host page CSP — no `eval()` or inline scripts.
106
+
107
+ ## Edge Cases
108
+
109
+ 1. **Service worker killed during long operation**: MV3 service workers terminate after ~30s of inactivity. For long-running work, use `chrome.offscreen.createDocument()` to get a persistent page, or break work into chunks persisted in storage.
110
+ 2. **Storage quota exceeded silently**: `chrome.storage.sync.set()` fails silently if quota is exceeded. Always check `chrome.runtime.lastError` and implement a fallback to `local` storage.
111
+ 3. **Cross-browser manifest differences**: Chrome requires `"service_worker"` for background; Firefox uses `"scripts"` array. Maintain two manifests or use a build step (webpack/vite) to generate platform-specific versions.
112
+
113
+ ## Testing
114
+
115
+ - **Manual**: load unpacked via `chrome://extensions` (Chrome) or `about:debugging` (Firefox).
116
+ - **Automated**: use `web-ext lint` (Mozilla) for manifest/CSP validation. For E2E: Playwright supports Chrome extensions via `--load-extension` launch arg.
117
+ - **Web Store submission checklist**: single-purpose description, minimal permissions justification, privacy policy if using `host_permissions` or user data.
118
+
119
+ ## Output Format
120
+
121
+ - Provide complete updated files.
122
+ - State: (a) root cause (if debugging), (b) what changed, (c) how to verify.