specweave 0.23.18 → 0.24.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.
Files changed (174) hide show
  1. package/.claude-plugin/marketplace.json +144 -45
  2. package/CLAUDE.md +137 -4
  3. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts +89 -0
  4. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -0
  5. package/dist/src/cli/helpers/ado-area-path-mapper.js +213 -0
  6. package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -0
  7. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts +29 -0
  8. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -0
  9. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +109 -0
  10. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -0
  11. package/dist/src/cli/helpers/issue-tracker/ado.d.ts +1 -0
  12. package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
  13. package/dist/src/cli/helpers/issue-tracker/ado.js +2 -0
  14. package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
  15. package/dist/src/cli/helpers/smart-filter.d.ts +83 -0
  16. package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -0
  17. package/dist/src/cli/helpers/smart-filter.js +265 -0
  18. package/dist/src/cli/helpers/smart-filter.js.map +1 -0
  19. package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
  20. package/dist/src/core/qa/quality-gate-decider.js +2 -2
  21. package/dist/src/core/qa/quality-gate-decider.js.map +1 -1
  22. package/dist/src/core/qa/risk-calculator.d.ts +2 -2
  23. package/dist/src/core/qa/risk-calculator.js +2 -2
  24. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  25. package/dist/src/core/repo-structure/repo-structure-manager.js +76 -43
  26. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  27. package/dist/src/core/validators/ac-presence-validator.d.ts +56 -0
  28. package/dist/src/core/validators/ac-presence-validator.d.ts.map +1 -0
  29. package/dist/src/core/validators/ac-presence-validator.js +149 -0
  30. package/dist/src/core/validators/ac-presence-validator.js.map +1 -0
  31. package/dist/src/integrations/ado/area-path-mapper.d.ts +137 -0
  32. package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -0
  33. package/dist/src/integrations/ado/area-path-mapper.js +267 -0
  34. package/dist/src/integrations/ado/area-path-mapper.js.map +1 -0
  35. package/dist/src/integrations/jira/filter-processor.d.ts +126 -0
  36. package/dist/src/integrations/jira/filter-processor.d.ts.map +1 -0
  37. package/dist/src/integrations/jira/filter-processor.js +207 -0
  38. package/dist/src/integrations/jira/filter-processor.js.map +1 -0
  39. package/dist/src/integrations/jira/jira-client.d.ts +13 -0
  40. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
  41. package/dist/src/integrations/jira/jira-client.js +33 -0
  42. package/dist/src/integrations/jira/jira-client.js.map +1 -1
  43. package/dist/src/utils/ac-embedder.d.ts +63 -0
  44. package/dist/src/utils/ac-embedder.d.ts.map +1 -0
  45. package/dist/src/utils/ac-embedder.js +217 -0
  46. package/dist/src/utils/ac-embedder.js.map +1 -0
  47. package/dist/src/utils/env-manager.d.ts +86 -0
  48. package/dist/src/utils/env-manager.d.ts.map +1 -0
  49. package/dist/src/utils/env-manager.js +188 -0
  50. package/dist/src/utils/env-manager.js.map +1 -0
  51. package/package.json +1 -1
  52. package/plugins/specweave/.claude-plugin/plugin.json +1 -1
  53. package/plugins/specweave/agents/AGENTS-INDEX.md +1 -1
  54. package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +9 -9
  55. package/plugins/specweave/commands/specweave-do.md +37 -0
  56. package/plugins/specweave/commands/specweave-done.md +159 -0
  57. package/plugins/specweave/commands/specweave-embed-acs.md +446 -0
  58. package/plugins/specweave/commands/specweave-next.md +148 -3
  59. package/plugins/specweave/commands/specweave-qa.md +2 -2
  60. package/plugins/specweave/hooks/pre-increment-start.sh +168 -0
  61. package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
  62. package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
  63. package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +331 -0
  64. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +10 -0
  65. package/plugins/specweave-alternatives/commands/alternatives-analyze.md +336 -0
  66. package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +651 -0
  67. package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +420 -0
  68. package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +487 -0
  69. package/plugins/specweave-backend/commands/api-scaffold.md +80 -0
  70. package/plugins/specweave-backend/commands/crud-generate.md +109 -0
  71. package/plugins/specweave-backend/commands/migration-generate.md +139 -0
  72. package/plugins/specweave-confluent/commands/connector-deploy.md +154 -0
  73. package/plugins/specweave-confluent/commands/ksqldb-query.md +179 -0
  74. package/plugins/specweave-confluent/commands/schema-register.md +123 -0
  75. package/plugins/specweave-core/.claude-plugin/plugin.json +21 -0
  76. package/plugins/specweave-core/commands/architecture-review.md +288 -0
  77. package/plugins/specweave-core/commands/code-review.md +213 -0
  78. package/plugins/specweave-core/commands/refactor-plan.md +249 -0
  79. package/plugins/specweave-core/skills/code-quality/SKILL.md +157 -0
  80. package/plugins/specweave-core/skills/design-patterns/SKILL.md +244 -0
  81. package/plugins/specweave-core/skills/software-architecture/SKILL.md +83 -0
  82. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +22 -0
  83. package/plugins/specweave-cost-optimizer/commands/cost-analyze.md +360 -0
  84. package/plugins/specweave-cost-optimizer/commands/cost-optimize.md +480 -0
  85. package/plugins/specweave-cost-optimizer/skills/aws-cost-expert/SKILL.md +416 -0
  86. package/plugins/specweave-cost-optimizer/skills/cloud-pricing/SKILL.md +325 -0
  87. package/plugins/specweave-cost-optimizer/skills/cost-optimization/SKILL.md +337 -0
  88. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
  89. package/plugins/specweave-diagrams/commands/diagrams-generate.md +168 -0
  90. package/plugins/specweave-docs/.claude-plugin/plugin.json +10 -0
  91. package/plugins/specweave-docs/commands/docs-generate.md +441 -0
  92. package/plugins/specweave-docs/commands/docs-init.md +334 -0
  93. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +581 -0
  94. package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +689 -0
  95. package/plugins/specweave-docs/skills/technical-writing/SKILL.md +1039 -0
  96. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
  97. package/plugins/specweave-figma/.claude-plugin/plugin.json +23 -0
  98. package/plugins/specweave-figma/commands/figma-import.md +690 -0
  99. package/plugins/specweave-figma/commands/figma-to-react.md +834 -0
  100. package/plugins/specweave-figma/commands/figma-tokens.md +815 -0
  101. package/plugins/specweave-frontend/.claude-plugin/plugin.json +21 -0
  102. package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +408 -0
  103. package/plugins/specweave-frontend/agents/frontend-architect/README.md +385 -0
  104. package/plugins/specweave-frontend/agents/frontend-architect/examples.md +590 -0
  105. package/plugins/specweave-frontend/agents/frontend-architect/templates/component-template.tsx +152 -0
  106. package/plugins/specweave-frontend/agents/frontend-architect/templates/hook-template.ts +311 -0
  107. package/plugins/specweave-frontend/agents/frontend-architect/templates/page-template.tsx +228 -0
  108. package/plugins/specweave-frontend/commands/component-generate.md +510 -0
  109. package/plugins/specweave-frontend/commands/design-system-init.md +494 -0
  110. package/plugins/specweave-frontend/commands/frontend-scaffold.md +207 -0
  111. package/plugins/specweave-frontend/commands/nextjs-setup.md +396 -0
  112. package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +278 -0
  113. package/plugins/specweave-frontend/skills/frontend/SKILL.md +420 -0
  114. package/plugins/specweave-frontend/skills/nextjs/SKILL.md +546 -0
  115. package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
  116. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +212 -0
  117. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
  118. package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
  119. package/plugins/specweave-jira/commands/import-projects.js +183 -0
  120. package/plugins/specweave-jira/commands/import-projects.md +97 -0
  121. package/plugins/specweave-jira/commands/import-projects.ts +288 -0
  122. package/plugins/specweave-jira/commands/specweave-jira-import-projects.md +298 -0
  123. package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
  124. package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
  125. package/plugins/specweave-kubernetes/commands/cluster-setup.md +262 -0
  126. package/plugins/specweave-kubernetes/commands/deployment-generate.md +242 -0
  127. package/plugins/specweave-kubernetes/commands/helm-scaffold.md +333 -0
  128. package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
  129. package/plugins/specweave-mobile/commands/app-scaffold.md +233 -0
  130. package/plugins/specweave-mobile/commands/build-config.md +256 -0
  131. package/plugins/specweave-mobile/commands/screen-generate.md +289 -0
  132. package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
  133. package/plugins/specweave-payments/commands/stripe-setup.md +931 -0
  134. package/plugins/specweave-payments/commands/subscription-flow.md +1193 -0
  135. package/plugins/specweave-payments/commands/subscription-manage.md +386 -0
  136. package/plugins/specweave-payments/commands/webhook-setup.md +295 -0
  137. package/plugins/specweave-plugin-dev/.claude-plugin/plugin.json +13 -12
  138. package/plugins/specweave-plugin-dev/commands/plugin-create.md +333 -0
  139. package/plugins/specweave-plugin-dev/commands/plugin-publish.md +339 -0
  140. package/plugins/specweave-plugin-dev/commands/plugin-test.md +293 -0
  141. package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +162 -0
  142. package/plugins/specweave-plugin-dev/skills/marketplace-publishing/SKILL.md +263 -0
  143. package/plugins/specweave-plugin-dev/skills/plugin-development/SKILL.md +316 -0
  144. package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
  145. package/plugins/specweave-release/commands/specweave-release-npm.md +110 -0
  146. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +168 -0
  147. package/plugins/specweave-testing/.claude-plugin/plugin.json +21 -0
  148. package/plugins/specweave-testing/agents/qa-engineer/AGENT.md +818 -0
  149. package/plugins/specweave-testing/agents/qa-engineer/README.md +443 -0
  150. package/plugins/specweave-testing/agents/qa-engineer/templates/playwright-e2e-test.ts +470 -0
  151. package/plugins/specweave-testing/agents/qa-engineer/templates/test-data-factory.ts +507 -0
  152. package/plugins/specweave-testing/agents/qa-engineer/templates/vitest-unit-test.ts +400 -0
  153. package/plugins/specweave-testing/agents/qa-engineer/test-strategies.md +726 -0
  154. package/plugins/specweave-testing/commands/e2e-setup.md +1081 -0
  155. package/plugins/specweave-testing/commands/test-coverage.md +979 -0
  156. package/plugins/specweave-testing/commands/test-generate.md +1156 -0
  157. package/plugins/specweave-testing/commands/test-init.md +409 -0
  158. package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +769 -0
  159. package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +934 -0
  160. package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +1011 -0
  161. package/plugins/specweave-tooling/.claude-plugin/plugin.json +22 -0
  162. package/plugins/specweave-tooling/commands/specweave-tooling-skill-create.md +691 -0
  163. package/plugins/specweave-tooling/commands/specweave-tooling-skill-package.md +751 -0
  164. package/plugins/specweave-tooling/commands/specweave-tooling-skill-validate.md +858 -0
  165. package/plugins/specweave-ui/.claude-plugin/plugin.json +10 -0
  166. package/plugins/specweave-ui/commands/ui-automate.md +199 -0
  167. package/plugins/specweave-ui/commands/ui-inspect.md +70 -0
  168. package/plugins/specweave-ui/skills/browser-automation/SKILL.md +314 -0
  169. package/plugins/specweave-ui/skills/ui-testing/SKILL.md +716 -0
  170. package/plugins/specweave-ui/skills/visual-regression/SKILL.md +728 -0
  171. package/plugins/specweave/commands/check-hooks.md +0 -257
  172. package/plugins/specweave/commands/specweave-archive-increments.md +0 -82
  173. package/plugins/specweave-plugin-dev/skills/plugin-expert/SKILL.md +0 -1231
  174. /package/plugins/specweave/{agents/code-reviewer.md → skills/code-reviewer/SKILL.md} +0 -0
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "specweave-tooling",
3
+ "description": "Plugin development toolkit for SpecWeave. Provides skill creation, validation, packaging, and plugin scaffolding tools. Expert guidance for YAML frontmatter, skill routing, activation patterns, and best practices. Essential for SpecWeave plugin developers.",
4
+ "version": "0.24.0",
5
+ "author": {
6
+ "name": "SpecWeave Team",
7
+ "url": "https://spec-weave.com"
8
+ },
9
+ "homepage": "https://spec-weave.com",
10
+ "repository": "https://github.com/anton-abyzov/specweave",
11
+ "license": "MIT",
12
+ "keywords": [
13
+ "specweave",
14
+ "tooling",
15
+ "skill-creation",
16
+ "plugin-development",
17
+ "yaml-frontmatter",
18
+ "skill-routing",
19
+ "plugin-scaffolding",
20
+ "developer-tools"
21
+ ]
22
+ }
@@ -0,0 +1,691 @@
1
+ ---
2
+ name: specweave-tooling:skill-create
3
+ description: Create new Claude Code skill with proper YAML frontmatter, directory structure, and activation triggers. Interactive wizard for skill creation with validation and best practices.
4
+ ---
5
+
6
+ # Create New Skill
7
+
8
+ **Interactive Wizard**: From concept to production-ready skill with proper structure and validation.
9
+
10
+ You are helping the user create a new Claude Code skill following best practices and the required structure.
11
+
12
+ ## Critical Structure Rules (Get This Right First!)
13
+
14
+ ### 1. Directory Structure
15
+
16
+ **MANDATORY format**:
17
+ ```
18
+ ~/.claude/skills/ ← Personal skills
19
+ └── your-skill-name/ ← MUST be in subdirectory!
20
+ └── SKILL.md ← Must be named exactly SKILL.md
21
+
22
+ .claude/skills/ ← Project skills (in project root)
23
+ └── your-skill-name/ ← MUST be in subdirectory!
24
+ └── SKILL.md ← Must be named exactly SKILL.md
25
+ ```
26
+
27
+ **Common mistake**: Putting `SKILL.md` directly in `~/.claude/skills/` ❌
28
+
29
+ ### 2. SKILL.md Format (Mandatory YAML Frontmatter)
30
+
31
+ ```yaml
32
+ ---
33
+ name: your-skill-name
34
+ description: What it does AND when to use it. Include trigger keywords users might say.
35
+ ---
36
+
37
+ # Your Skill Title
38
+
39
+ Rest of your markdown content here...
40
+ ```
41
+
42
+ **Critical rules**:
43
+ - Opening `---` MUST be on line 1
44
+ - `name` field: lowercase, hyphens only, max 64 chars
45
+ - `description` field: max 1024 chars, MUST include activation triggers
46
+ - Closing `---` before any markdown content
47
+ - No YAML frontmatter = skill won't work!
48
+
49
+ ## Steps
50
+
51
+ ### Step 1: Gather Skill Information
52
+
53
+ Ask the user for the following information (use AskUserQuestion if appropriate):
54
+
55
+ 1. **Skill Name**:
56
+ - Lowercase, hyphens only
57
+ - Max 64 characters
58
+ - Example: `python-data-science`, `kubernetes-expert`, `react-hooks`
59
+
60
+ 2. **Skill Purpose**:
61
+ - What expertise does this skill provide?
62
+ - What questions should it answer?
63
+ - Example: "Python data science best practices"
64
+
65
+ 3. **Activation Triggers**:
66
+ - Keywords users might say
67
+ - Commands or patterns to detect
68
+ - Example: "pandas, numpy, matplotlib, jupyter notebooks, Python data analysis"
69
+
70
+ 4. **Skill Location**:
71
+ - Personal skill: `~/.claude/skills/`
72
+ - Project skill: `.claude/skills/` (in project root)
73
+
74
+ 5. **Optional Tool Restrictions**:
75
+ - Should this skill be read-only?
76
+ - Allowed tools: Read, Grep, Glob, WebSearch, etc.
77
+ - Leave empty for no restrictions
78
+
79
+ ### Step 2: Validate Skill Name
80
+
81
+ **Validation rules**:
82
+ ```bash
83
+ # Check format (lowercase, hyphens only)
84
+ if [[ ! "$skill_name" =~ ^[a-z0-9-]+$ ]]; then
85
+ echo "❌ Invalid name: must be lowercase with hyphens only"
86
+ exit 1
87
+ fi
88
+
89
+ # Check length (max 64 chars)
90
+ if [ ${#skill_name} -gt 64 ]; then
91
+ echo "❌ Invalid name: must be 64 characters or less"
92
+ exit 1
93
+ fi
94
+
95
+ # Check no consecutive hyphens
96
+ if [[ "$skill_name" =~ -- ]]; then
97
+ echo "❌ Invalid name: no consecutive hyphens allowed"
98
+ exit 1
99
+ fi
100
+
101
+ # Check doesn't start/end with hyphen
102
+ if [[ "$skill_name" =~ ^- ]] || [[ "$skill_name" =~ -$ ]]; then
103
+ echo "❌ Invalid name: cannot start or end with hyphen"
104
+ exit 1
105
+ fi
106
+ ```
107
+
108
+ ### Step 3: Generate Skill Description
109
+
110
+ **Requirements**:
111
+ - Max 1024 characters
112
+ - Must include activation triggers
113
+ - Must explain when to use the skill
114
+ - Include keyword variations (e.g., "k8s, kubernetes, kubectl")
115
+
116
+ **Template**:
117
+ ```
118
+ [What the skill does]. [When to use it]. Activates for: [keyword1], [keyword2], [keyword3], [phrase1], [phrase2].
119
+ ```
120
+
121
+ **Examples**:
122
+
123
+ ```yaml
124
+ # Command-based skill
125
+ description: Kubernetes expert. Explains kubectl commands, pod management, deployments. Activates for: kubectl, k8s, kubernetes, pods, deployments, services, namespaces.
126
+
127
+ # Framework skill
128
+ description: React expert for hooks, components, state management. Activates for: React, useState, useEffect, components, JSX, props, virtual DOM, React hooks.
129
+
130
+ # Project-specific skill
131
+ description: MyCompany API documentation. Explains endpoints, authentication, rate limits. Activates for: MyCompany API, /api/v1, authentication token, rate limit, API key.
132
+ ```
133
+
134
+ ### Step 4: Create Skill Content Structure
135
+
136
+ **Recommended sections**:
137
+
138
+ ```markdown
139
+ ---
140
+ name: your-skill-name
141
+ description: [Generated description with triggers]
142
+ ---
143
+
144
+ # [Skill Title]
145
+
146
+ ## What I Know
147
+
148
+ [Bullet list of expertise areas]
149
+ - Topic 1
150
+ - Topic 2
151
+ - Topic 3
152
+
153
+ ## When to Use This Skill
154
+
155
+ Ask me about:
156
+ - "How do I [use case 1]..."
157
+ - "What's the best way to [use case 2]..."
158
+ - "[Topic] tips and best practices"
159
+
160
+ ## Key Concepts
161
+
162
+ ### [Concept 1]
163
+
164
+ [Explanation]
165
+
166
+ ### [Concept 2]
167
+
168
+ [Explanation]
169
+
170
+ ## Examples
171
+
172
+ ### [Example 1: Common Task]
173
+
174
+ ```[language]
175
+ [code example]
176
+ ```
177
+
178
+ **Explanation**: [Why this works]
179
+
180
+ ### [Example 2: Advanced Usage]
181
+
182
+ ```[language]
183
+ [code example]
184
+ ```
185
+
186
+ **Explanation**: [When to use this pattern]
187
+
188
+ ## Best Practices
189
+
190
+ 1. ✅ **[Practice 1]**: [Explanation]
191
+ 2. ✅ **[Practice 2]**: [Explanation]
192
+ 3. ⚠️ **[Anti-pattern to avoid]**: [Why to avoid]
193
+
194
+ ## Common Patterns
195
+
196
+ ### [Pattern 1]
197
+ [Implementation details]
198
+
199
+ ### [Pattern 2]
200
+ [Implementation details]
201
+
202
+ ## Resources
203
+
204
+ - [Documentation link]
205
+ - [Tutorial link]
206
+ - [Reference link]
207
+ ```
208
+
209
+ ### Step 5: Handle Optional Tool Restrictions
210
+
211
+ **If user wants read-only skill**:
212
+
213
+ ```yaml
214
+ ---
215
+ name: documentation-helper
216
+ description: Documentation expert for project docs
217
+ allowed-tools: Read, Grep, Glob, WebSearch
218
+ ---
219
+ ```
220
+
221
+ **Available tools**:
222
+ - `Read` - Read files
223
+ - `Write` - Create/overwrite files
224
+ - `Edit` - Edit existing files
225
+ - `Grep` - Search file contents
226
+ - `Glob` - Find files by pattern
227
+ - `Bash` - Execute bash commands
228
+ - `WebSearch` - Search the web
229
+ - `WebFetch` - Fetch web content
230
+ - `TodoWrite` - Manage todos
231
+ - `AskUserQuestion` - Ask user questions
232
+
233
+ **Tool restriction patterns**:
234
+
235
+ ```yaml
236
+ # Read-only (no modifications)
237
+ allowed-tools: Read, Grep, Glob, WebSearch
238
+
239
+ # Documentation expert (can create docs)
240
+ allowed-tools: Read, Grep, Glob, Write, Edit
241
+
242
+ # Analysis expert (no file modifications)
243
+ allowed-tools: Read, Grep, Glob, Bash
244
+
245
+ # Full access (no restrictions)
246
+ # (omit allowed-tools field)
247
+ ```
248
+
249
+ ### Step 6: Create Skill Directory and File
250
+
251
+ **Implementation**:
252
+
253
+ ```bash
254
+ # Determine full path
255
+ if [ "$location" = "personal" ]; then
256
+ skill_dir="$HOME/.claude/skills/$skill_name"
257
+ else
258
+ skill_dir="$PWD/.claude/skills/$skill_name"
259
+ fi
260
+
261
+ # Create directory
262
+ mkdir -p "$skill_dir"
263
+
264
+ # Create SKILL.md
265
+ cat > "$skill_dir/SKILL.md" <<'EOF'
266
+ ---
267
+ name: $skill_name
268
+ description: $description
269
+ $allowed_tools_line
270
+ ---
271
+
272
+ # $skill_title
273
+
274
+ $skill_content
275
+ EOF
276
+
277
+ echo "✅ Skill created at: $skill_dir/SKILL.md"
278
+ ```
279
+
280
+ ### Step 7: Validate Skill Structure
281
+
282
+ **Validation checklist**:
283
+
284
+ ```bash
285
+ # 1. Check SKILL.md exists
286
+ if [ ! -f "$skill_dir/SKILL.md" ]; then
287
+ echo "❌ SKILL.md not found"
288
+ exit 1
289
+ fi
290
+
291
+ # 2. Check YAML frontmatter
292
+ if ! head -1 "$skill_dir/SKILL.md" | grep -q '^---$'; then
293
+ echo "❌ SKILL.md must start with '---'"
294
+ exit 1
295
+ fi
296
+
297
+ # 3. Check required fields
298
+ if ! grep -q '^name:' "$skill_dir/SKILL.md"; then
299
+ echo "❌ Missing 'name' field in YAML frontmatter"
300
+ exit 1
301
+ fi
302
+
303
+ if ! grep -q '^description:' "$skill_dir/SKILL.md"; then
304
+ echo "❌ Missing 'description' field in YAML frontmatter"
305
+ exit 1
306
+ fi
307
+
308
+ # 4. Check closing ---
309
+ if ! sed -n '2,10p' "$skill_dir/SKILL.md" | grep -q '^---$'; then
310
+ echo "❌ Missing closing '---' in YAML frontmatter"
311
+ exit 1
312
+ fi
313
+
314
+ # 5. Check description length
315
+ desc_length=$(grep '^description:' "$skill_dir/SKILL.md" | sed 's/^description: *//' | wc -c)
316
+ if [ "$desc_length" -gt 1024 ]; then
317
+ echo "⚠️ Warning: Description is ${desc_length} characters (max 1024)"
318
+ fi
319
+
320
+ echo "✅ Skill structure validated successfully"
321
+ ```
322
+
323
+ ### Step 8: Provide Next Steps
324
+
325
+ **User instructions**:
326
+
327
+ ```
328
+ ✅ Skill created successfully!
329
+
330
+ 📁 Location: $skill_dir/SKILL.md
331
+
332
+ 📝 Next steps:
333
+
334
+ 1. Review the skill content and customize as needed
335
+ 2. Test the skill by asking a trigger question
336
+ 3. Restart Claude Code to load the skill
337
+ 4. Verify activation with a test question
338
+
339
+ 🔄 To restart Claude Code:
340
+ - Close and reopen the application
341
+ - OR use /restart command (if available)
342
+
343
+ 🧪 Test your skill:
344
+ Ask: "[example trigger question based on description]"
345
+
346
+ 📚 Documentation:
347
+ - Skill format: ~/CLAUDE.md (your quick reference)
348
+ - Activation patterns: Description keywords determine when skill loads
349
+ - Tool restrictions: Optional 'allowed-tools' field limits capabilities
350
+
351
+ ⚠️ Common issues:
352
+ - Skill doesn't activate → Check description has clear triggers
353
+ - YAML errors → Verify frontmatter format (opening/closing ---)
354
+ - File not found → Ensure SKILL.md is in subdirectory
355
+ ```
356
+
357
+ ## Examples
358
+
359
+ ### Example 1: Python Data Science Skill
360
+
361
+ **Input**:
362
+ - Name: `python-data-science`
363
+ - Purpose: "Python best practices for data science projects"
364
+ - Triggers: "pandas, numpy, matplotlib, jupyter notebooks, Python data analysis"
365
+ - Location: Personal
366
+ - Tool restrictions: None
367
+
368
+ **Output** (`~/.claude/skills/python-data-science/SKILL.md`):
369
+
370
+ ```yaml
371
+ ---
372
+ name: python-data-science
373
+ description: Python best practices for data science projects. Explains pandas DataFrame operations, NumPy arrays, matplotlib visualizations, and Jupyter notebook workflows. Activates for: pandas, numpy, matplotlib, jupyter notebooks, Python data analysis, data science, scientific computing.
374
+ ---
375
+
376
+ # Python Data Science Skill
377
+
378
+ ## What I Know
379
+
380
+ - Pandas DataFrame operations and transformations
381
+ - NumPy array manipulation and vectorization
382
+ - Matplotlib and Seaborn visualizations
383
+ - Jupyter notebook best practices
384
+ - Data cleaning and preprocessing
385
+ - Statistical analysis and modeling
386
+
387
+ ## When to Use This Skill
388
+
389
+ Ask me about:
390
+ - "How do I use pandas to..."
391
+ - "What's the best way to visualize..."
392
+ - "Python data analysis tips"
393
+ - "NumPy array operations"
394
+ - "Jupyter notebook shortcuts"
395
+
396
+ ## Key Concepts
397
+
398
+ ### Pandas DataFrames
399
+
400
+ DataFrames are the core data structure for tabular data in Python:
401
+ - Rows and columns with labels
402
+ - Rich indexing and selection capabilities
403
+ - Built-in aggregation and transformation methods
404
+
405
+ ### NumPy Arrays
406
+
407
+ Efficient numerical computing with multi-dimensional arrays:
408
+ - Vectorized operations (avoid loops!)
409
+ - Broadcasting for element-wise operations
410
+ - Linear algebra and statistical functions
411
+
412
+ ## Examples
413
+
414
+ ### Example 1: Loading and Exploring Data
415
+
416
+ ```python
417
+ import pandas as pd
418
+
419
+ # Load CSV file
420
+ df = pd.read_csv('data.csv')
421
+
422
+ # Quick exploration
423
+ print(df.head()) # First 5 rows
424
+ print(df.info()) # Column types and nulls
425
+ print(df.describe()) # Statistical summary
426
+ ```
427
+
428
+ **Explanation**: Always start with exploration to understand your data structure, types, and missing values.
429
+
430
+ ### Example 2: Data Cleaning
431
+
432
+ ```python
433
+ # Handle missing values
434
+ df_clean = df.dropna() # Drop rows with any nulls
435
+ df_filled = df.fillna(0) # Fill nulls with 0
436
+ df_ffill = df.fillna(method='ffill') # Forward fill
437
+
438
+ # Remove duplicates
439
+ df_unique = df.drop_duplicates()
440
+ ```
441
+
442
+ **Explanation**: Choose the right strategy based on your data and analysis goals.
443
+
444
+ ## Best Practices
445
+
446
+ 1. ✅ **Use vectorized operations**: Avoid Python loops, use pandas/numpy methods
447
+ 2. ✅ **Chain operations**: `df.groupby('col').agg('mean').sort_values()`
448
+ 3. ✅ **Copy data explicitly**: Use `.copy()` to avoid SettingWithCopyWarning
449
+ 4. ⚠️ **Avoid iterrows()**: Extremely slow, use `.apply()` or vectorization instead
450
+
451
+ ## Common Patterns
452
+
453
+ ### Groupby-Aggregation
454
+ ```python
455
+ df.groupby('category').agg({
456
+ 'sales': 'sum',
457
+ 'quantity': 'mean',
458
+ 'price': ['min', 'max']
459
+ })
460
+ ```
461
+
462
+ ### Time Series Resampling
463
+ ```python
464
+ df.set_index('date').resample('M').mean()
465
+ ```
466
+
467
+ ## Resources
468
+
469
+ - [Pandas Documentation](https://pandas.pydata.org/docs/)
470
+ - [NumPy User Guide](https://numpy.org/doc/stable/user/)
471
+ - [Matplotlib Gallery](https://matplotlib.org/stable/gallery/index.html)
472
+ ```
473
+
474
+ ### Example 2: Read-Only Documentation Skill
475
+
476
+ **Input**:
477
+ - Name: `project-docs-helper`
478
+ - Purpose: "Project documentation expert"
479
+ - Triggers: "documentation, docs, readme, API reference"
480
+ - Location: Project (`.claude/skills/`)
481
+ - Tool restrictions: Read, Grep, Glob, WebSearch
482
+
483
+ **Output** (`.claude/skills/project-docs-helper/SKILL.md`):
484
+
485
+ ```yaml
486
+ ---
487
+ name: project-docs-helper
488
+ description: Project documentation expert. Helps find and explain documentation, API references, and README files. Read-only access for safe documentation browsing. Activates for: documentation, docs, readme, API reference, how to use, user guide.
489
+ allowed-tools: Read, Grep, Glob, WebSearch
490
+ ---
491
+
492
+ # Project Documentation Helper
493
+
494
+ ## What I Know
495
+
496
+ - Location of all project documentation
497
+ - API reference structure
498
+ - README and getting started guides
499
+ - Architecture documentation
500
+ - Contributing guidelines
501
+
502
+ ## When to Use This Skill
503
+
504
+ Ask me about:
505
+ - "Where is the documentation for..."
506
+ - "How do I use [feature]..."
507
+ - "What APIs are available..."
508
+ - "Getting started with this project"
509
+
510
+ ## Documentation Structure
511
+
512
+ This project follows standard documentation patterns:
513
+ - `/docs/` - Main documentation folder
514
+ - `README.md` - Getting started guide
515
+ - `API.md` - API reference
516
+ - `CONTRIBUTING.md` - Contribution guidelines
517
+ - `ARCHITECTURE.md` - System design
518
+
519
+ ## How to Find Information
520
+
521
+ ### Search by Topic
522
+ I can search through all documentation files to find information about specific topics.
523
+
524
+ ### Navigate by Structure
525
+ I understand the documentation hierarchy and can guide you to the right files.
526
+
527
+ ### Explain Concepts
528
+ I can read and explain complex documentation sections in simpler terms.
529
+
530
+ ## Best Practices
531
+
532
+ 1. ✅ **Check README first**: Start with README.md for project overview
533
+ 2. ✅ **Use search**: Ask me to search docs instead of browsing manually
534
+ 3. ✅ **Verify versions**: Documentation may be version-specific
535
+ 4. ⚠️ **Read-only**: This skill cannot modify documentation
536
+ ```
537
+
538
+ ## Validation and Testing
539
+
540
+ ### Post-Creation Validation
541
+
542
+ **Run these checks after creation**:
543
+
544
+ ```bash
545
+ # 1. File exists in correct location
546
+ ls "$skill_dir/SKILL.md"
547
+
548
+ # 2. YAML frontmatter is valid
549
+ head -10 "$skill_dir/SKILL.md"
550
+
551
+ # Should see:
552
+ # ---
553
+ # name: your-skill-name
554
+ # description: ...
555
+ # ---
556
+
557
+ # 3. No syntax errors
558
+ node -e "
559
+ const fs = require('fs');
560
+ const yaml = require('js-yaml');
561
+ const content = fs.readFileSync('$skill_dir/SKILL.md', 'utf-8');
562
+ const match = content.match(/^---\\n([\\s\\S]*?)\\n---/);
563
+ if (!match) {
564
+ console.error('❌ No YAML frontmatter found');
565
+ process.exit(1);
566
+ }
567
+ try {
568
+ const data = yaml.load(match[1]);
569
+ console.log('✅ Valid YAML:', JSON.stringify(data, null, 2));
570
+ } catch (e) {
571
+ console.error('❌ YAML parsing error:', e.message);
572
+ process.exit(1);
573
+ }
574
+ "
575
+ ```
576
+
577
+ ### Testing Activation
578
+
579
+ **Steps**:
580
+ 1. Create skill
581
+ 2. Restart Claude Code
582
+ 3. Ask a question with trigger keywords
583
+ 4. Verify skill activates (should see skill content in context)
584
+
585
+ **Test questions based on examples**:
586
+ - Python Data Science: "How do I use pandas to read a CSV file?"
587
+ - Documentation Helper: "Where is the API documentation?"
588
+ - Kubernetes Expert: "How do I list all pods in a namespace?"
589
+
590
+ ## Troubleshooting
591
+
592
+ ### Skill Doesn't Activate
593
+
594
+ **Possible causes**:
595
+
596
+ 1. **Claude Code not restarted**: Skills only load on startup
597
+ - **Fix**: Restart Claude Code
598
+
599
+ 2. **Missing trigger keywords**: Description doesn't match user's question
600
+ - **Fix**: Add more keyword variations to description
601
+
602
+ 3. **YAML syntax errors**: Frontmatter is invalid
603
+ - **Fix**: Validate YAML format (use checker above)
604
+
605
+ 4. **Wrong file location**: SKILL.md not in subdirectory
606
+ - **Fix**: Move to `skills/skill-name/SKILL.md`
607
+
608
+ 5. **Name mismatch**: YAML name doesn't match directory name
609
+ - **Fix**: Ensure consistency (can be different, but confusing)
610
+
611
+ ### YAML Parsing Errors
612
+
613
+ **Common mistakes**:
614
+
615
+ ```yaml
616
+ # ❌ WRONG: Missing closing ---
617
+ ---
618
+ name: my-skill
619
+ description: My skill description
620
+
621
+ # ✅ CORRECT: Closing --- present
622
+ ---
623
+ name: my-skill
624
+ description: My skill description
625
+ ---
626
+
627
+ # ❌ WRONG: Invalid characters in name
628
+ ---
629
+ name: My Skill Name
630
+ ---
631
+
632
+ # ✅ CORRECT: Lowercase with hyphens
633
+ ---
634
+ name: my-skill-name
635
+ ---
636
+
637
+ # ❌ WRONG: Description too long (>1024 chars)
638
+ ---
639
+ name: skill
640
+ description: [2000 character description]
641
+ ---
642
+
643
+ # ✅ CORRECT: Concise description (<1024 chars)
644
+ ---
645
+ name: skill
646
+ description: Focused description with key triggers
647
+ ---
648
+ ```
649
+
650
+ ## Best Practices
651
+
652
+ ### Naming Conventions
653
+
654
+ 1. **Be specific**: `react-hooks` not `react`
655
+ 2. **Use domain language**: `kubernetes-expert` not `k8s-helper`
656
+ 3. **Avoid redundancy**: `python-data-science` not `python-data-science-skill`
657
+ 4. **Max 3 words**: Keep names concise
658
+
659
+ ### Description Writing
660
+
661
+ 1. **Front-load purpose**: Start with what the skill does
662
+ 2. **List all variations**: Include abbreviations (k8s, kubernetes)
663
+ 3. **Use action words**: "Explains", "Helps with", "Provides guidance"
664
+ 4. **Include examples**: "React hooks (useState, useEffect, useContext)"
665
+
666
+ ### Content Structure
667
+
668
+ 1. **Start simple**: Basic examples before advanced patterns
669
+ 2. **Use headings**: Clear section organization
670
+ 3. **Include code**: Concrete examples over abstract explanations
671
+ 4. **Anti-patterns**: Show what NOT to do (⚠️ warnings)
672
+
673
+ ### Tool Restrictions
674
+
675
+ 1. **Read-only by default**: Start restrictive, expand if needed
676
+ 2. **Justify access**: Only grant Write/Edit if skill creates files
677
+ 3. **Document reasons**: Explain why tools are needed
678
+
679
+ ## Summary
680
+
681
+ **Key steps**:
682
+ 1. ✅ Validate skill name (lowercase, hyphens, max 64 chars)
683
+ 2. ✅ Create description with triggers (max 1024 chars)
684
+ 3. ✅ Choose skill location (personal vs project)
685
+ 4. ✅ Add tool restrictions if read-only
686
+ 5. ✅ Generate SKILL.md with YAML frontmatter
687
+ 6. ✅ Validate structure (frontmatter, fields, format)
688
+ 7. ✅ Restart Claude Code
689
+ 8. ✅ Test with trigger question
690
+
691
+ **Remember**: Restart Claude Code after creating or modifying skills!