agileflow 3.3.0 → 3.4.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 (210) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +6 -6
  3. package/lib/skill-loader.js +0 -1
  4. package/package.json +1 -1
  5. package/scripts/agileflow-statusline.sh +81 -0
  6. package/scripts/agileflow-welcome.js +79 -0
  7. package/scripts/claude-tmux.sh +90 -23
  8. package/scripts/claude-watchdog.sh +225 -0
  9. package/scripts/generators/agent-registry.js +14 -1
  10. package/scripts/generators/inject-babysit.js +22 -9
  11. package/scripts/generators/inject-help.js +19 -9
  12. package/scripts/lib/ac-test-matcher.js +452 -0
  13. package/scripts/lib/audit-cleanup.js +250 -0
  14. package/scripts/lib/audit-registry.js +304 -0
  15. package/scripts/lib/configure-features.js +35 -0
  16. package/scripts/lib/feature-catalog.js +3 -3
  17. package/scripts/lib/gate-enforcer.js +295 -0
  18. package/scripts/lib/model-profiles.js +118 -0
  19. package/scripts/lib/quality-gates.js +163 -0
  20. package/scripts/lib/signal-detectors.js +44 -1
  21. package/scripts/lib/skill-catalog.js +557 -0
  22. package/scripts/lib/skill-recommender.js +311 -0
  23. package/scripts/lib/status-writer.js +255 -0
  24. package/scripts/lib/story-claiming.js +128 -45
  25. package/scripts/lib/task-sync.js +32 -38
  26. package/scripts/lib/tdd-phase-manager.js +455 -0
  27. package/scripts/lib/team-events.js +34 -3
  28. package/scripts/lib/tmux-audit-monitor.js +611 -0
  29. package/scripts/lib/tmux-group-colors.js +113 -0
  30. package/scripts/lib/tool-registry.yaml +241 -0
  31. package/scripts/lib/tool-shed.js +441 -0
  32. package/scripts/messaging-bridge.js +209 -1
  33. package/scripts/native-team-observer.js +219 -0
  34. package/scripts/obtain-context.js +14 -0
  35. package/scripts/ralph-loop.js +30 -5
  36. package/scripts/smart-detect.js +21 -0
  37. package/scripts/spawn-audit-sessions.js +877 -0
  38. package/scripts/team-manager.js +56 -16
  39. package/scripts/tmux-close-windows.sh +180 -0
  40. package/src/core/agents/a11y-analyzer-aria.md +155 -0
  41. package/src/core/agents/a11y-analyzer-forms.md +162 -0
  42. package/src/core/agents/a11y-analyzer-keyboard.md +175 -0
  43. package/src/core/agents/a11y-analyzer-semantic.md +153 -0
  44. package/src/core/agents/a11y-analyzer-visual.md +158 -0
  45. package/src/core/agents/a11y-consensus.md +248 -0
  46. package/src/core/agents/ads-audit-budget.md +181 -0
  47. package/src/core/agents/ads-audit-compliance.md +169 -0
  48. package/src/core/agents/ads-audit-creative.md +164 -0
  49. package/src/core/agents/ads-audit-google.md +226 -0
  50. package/src/core/agents/ads-audit-meta.md +183 -0
  51. package/src/core/agents/ads-audit-tracking.md +197 -0
  52. package/src/core/agents/ads-consensus.md +396 -0
  53. package/src/core/agents/ads-generate.md +145 -0
  54. package/src/core/agents/ads-performance-tracker.md +197 -0
  55. package/src/core/agents/api-quality-analyzer-conventions.md +148 -0
  56. package/src/core/agents/api-quality-analyzer-docs.md +176 -0
  57. package/src/core/agents/api-quality-analyzer-errors.md +183 -0
  58. package/src/core/agents/api-quality-analyzer-pagination.md +171 -0
  59. package/src/core/agents/api-quality-analyzer-versioning.md +143 -0
  60. package/src/core/agents/api-quality-consensus.md +214 -0
  61. package/src/core/agents/arch-analyzer-circular.md +148 -0
  62. package/src/core/agents/arch-analyzer-complexity.md +171 -0
  63. package/src/core/agents/arch-analyzer-coupling.md +146 -0
  64. package/src/core/agents/arch-analyzer-layering.md +151 -0
  65. package/src/core/agents/arch-analyzer-patterns.md +162 -0
  66. package/src/core/agents/arch-consensus.md +227 -0
  67. package/src/core/agents/brainstorm-analyzer-features.md +169 -0
  68. package/src/core/agents/brainstorm-analyzer-growth.md +161 -0
  69. package/src/core/agents/brainstorm-analyzer-integration.md +172 -0
  70. package/src/core/agents/brainstorm-analyzer-market.md +147 -0
  71. package/src/core/agents/brainstorm-analyzer-ux.md +167 -0
  72. package/src/core/agents/brainstorm-consensus.md +237 -0
  73. package/src/core/agents/completeness-consensus.md +5 -5
  74. package/src/core/agents/perf-consensus.md +2 -2
  75. package/src/core/agents/security-consensus.md +2 -2
  76. package/src/core/agents/seo-analyzer-content.md +167 -0
  77. package/src/core/agents/seo-analyzer-images.md +187 -0
  78. package/src/core/agents/seo-analyzer-performance.md +206 -0
  79. package/src/core/agents/seo-analyzer-schema.md +176 -0
  80. package/src/core/agents/seo-analyzer-sitemap.md +172 -0
  81. package/src/core/agents/seo-analyzer-technical.md +144 -0
  82. package/src/core/agents/seo-consensus.md +289 -0
  83. package/src/core/agents/test-consensus.md +2 -2
  84. package/src/core/commands/adr.md +1 -0
  85. package/src/core/commands/ads/audit.md +375 -0
  86. package/src/core/commands/ads/budget.md +97 -0
  87. package/src/core/commands/ads/competitor.md +112 -0
  88. package/src/core/commands/ads/creative.md +85 -0
  89. package/src/core/commands/ads/generate.md +238 -0
  90. package/src/core/commands/ads/google.md +112 -0
  91. package/src/core/commands/ads/health.md +327 -0
  92. package/src/core/commands/ads/landing.md +119 -0
  93. package/src/core/commands/ads/linkedin.md +112 -0
  94. package/src/core/commands/ads/meta.md +91 -0
  95. package/src/core/commands/ads/microsoft.md +115 -0
  96. package/src/core/commands/ads/plan.md +321 -0
  97. package/src/core/commands/ads/test-plan.md +317 -0
  98. package/src/core/commands/ads/tiktok.md +129 -0
  99. package/src/core/commands/ads/track.md +288 -0
  100. package/src/core/commands/ads/youtube.md +124 -0
  101. package/src/core/commands/ads.md +140 -0
  102. package/src/core/commands/assign.md +1 -0
  103. package/src/core/commands/audit.md +43 -6
  104. package/src/core/commands/babysit.md +315 -1266
  105. package/src/core/commands/baseline.md +1 -0
  106. package/src/core/commands/blockers.md +1 -0
  107. package/src/core/commands/board.md +1 -0
  108. package/src/core/commands/changelog.md +1 -0
  109. package/src/core/commands/choose.md +1 -0
  110. package/src/core/commands/ci.md +1 -0
  111. package/src/core/commands/code/accessibility.md +347 -0
  112. package/src/core/commands/code/api.md +297 -0
  113. package/src/core/commands/code/architecture.md +297 -0
  114. package/src/core/commands/{audit → code}/completeness.md +72 -25
  115. package/src/core/commands/{audit → code}/legal.md +63 -16
  116. package/src/core/commands/{audit → code}/logic.md +64 -16
  117. package/src/core/commands/{audit → code}/performance.md +67 -20
  118. package/src/core/commands/{audit → code}/security.md +69 -19
  119. package/src/core/commands/{audit → code}/test.md +67 -20
  120. package/src/core/commands/configure.md +1 -0
  121. package/src/core/commands/council.md +1 -0
  122. package/src/core/commands/deploy.md +1 -0
  123. package/src/core/commands/diagnose.md +1 -0
  124. package/src/core/commands/docs.md +1 -0
  125. package/src/core/commands/epic/edit.md +213 -0
  126. package/src/core/commands/epic.md +1 -0
  127. package/src/core/commands/export.md +238 -0
  128. package/src/core/commands/help.md +16 -1
  129. package/src/core/commands/{discovery → ideate}/brief.md +12 -12
  130. package/src/core/commands/{discovery/new.md → ideate/discover.md} +20 -16
  131. package/src/core/commands/ideate/features.md +496 -0
  132. package/src/core/commands/ideate/new.md +158 -124
  133. package/src/core/commands/impact.md +1 -0
  134. package/src/core/commands/learn/explain.md +118 -0
  135. package/src/core/commands/learn/glossary.md +135 -0
  136. package/src/core/commands/learn/patterns.md +138 -0
  137. package/src/core/commands/learn/tour.md +126 -0
  138. package/src/core/commands/migrate/codemods.md +151 -0
  139. package/src/core/commands/migrate/plan.md +131 -0
  140. package/src/core/commands/migrate/scan.md +114 -0
  141. package/src/core/commands/migrate/validate.md +119 -0
  142. package/src/core/commands/multi-expert.md +1 -0
  143. package/src/core/commands/pr.md +1 -0
  144. package/src/core/commands/review.md +1 -0
  145. package/src/core/commands/seo/audit.md +373 -0
  146. package/src/core/commands/seo/competitor.md +174 -0
  147. package/src/core/commands/seo/content.md +107 -0
  148. package/src/core/commands/seo/geo.md +229 -0
  149. package/src/core/commands/seo/hreflang.md +140 -0
  150. package/src/core/commands/seo/images.md +96 -0
  151. package/src/core/commands/seo/page.md +198 -0
  152. package/src/core/commands/seo/plan.md +163 -0
  153. package/src/core/commands/seo/programmatic.md +131 -0
  154. package/src/core/commands/seo/references/cwv-thresholds.md +64 -0
  155. package/src/core/commands/seo/references/eeat-framework.md +110 -0
  156. package/src/core/commands/seo/references/quality-gates.md +91 -0
  157. package/src/core/commands/seo/references/schema-types.md +102 -0
  158. package/src/core/commands/seo/schema.md +183 -0
  159. package/src/core/commands/seo/sitemap.md +97 -0
  160. package/src/core/commands/seo/technical.md +100 -0
  161. package/src/core/commands/seo.md +107 -0
  162. package/src/core/commands/skill/list.md +68 -212
  163. package/src/core/commands/skill/recommend.md +216 -0
  164. package/src/core/commands/sprint.md +1 -0
  165. package/src/core/commands/status/undo.md +191 -0
  166. package/src/core/commands/status.md +1 -0
  167. package/src/core/commands/story/edit.md +204 -0
  168. package/src/core/commands/story/view.md +29 -7
  169. package/src/core/commands/story-validate.md +1 -0
  170. package/src/core/commands/story.md +1 -0
  171. package/src/core/commands/tdd-next.md +238 -0
  172. package/src/core/commands/tdd.md +211 -0
  173. package/src/core/commands/team/start.md +10 -6
  174. package/src/core/commands/tests.md +1 -0
  175. package/src/core/commands/verify.md +27 -1
  176. package/src/core/commands/workflow.md +2 -0
  177. package/src/core/experts/_core-expertise.yaml +105 -0
  178. package/src/core/experts/analytics/expertise.yaml +5 -99
  179. package/src/core/experts/codebase-query/expertise.yaml +3 -72
  180. package/src/core/experts/compliance/expertise.yaml +6 -72
  181. package/src/core/experts/database/expertise.yaml +9 -52
  182. package/src/core/experts/documentation/expertise.yaml +7 -140
  183. package/src/core/experts/integrations/expertise.yaml +7 -127
  184. package/src/core/experts/mentor/expertise.yaml +8 -35
  185. package/src/core/experts/monitoring/expertise.yaml +7 -49
  186. package/src/core/experts/performance/expertise.yaml +1 -26
  187. package/src/core/experts/security/expertise.yaml +9 -34
  188. package/src/core/experts/ui/expertise.yaml +6 -36
  189. package/src/core/knowledge/ads/ad-audit-checklist-scoring.md +424 -0
  190. package/src/core/knowledge/ads/ad-optimization-logic.md +590 -0
  191. package/src/core/knowledge/ads/ad-technical-specifications.md +385 -0
  192. package/src/core/knowledge/ads/definitive-advertising-reference-2026.md +506 -0
  193. package/src/core/knowledge/ads/paid-advertising-research-2026.md +445 -0
  194. package/src/core/teams/backend.json +41 -0
  195. package/src/core/teams/frontend.json +41 -0
  196. package/src/core/teams/qa.json +41 -0
  197. package/src/core/teams/solo.json +35 -0
  198. package/src/core/templates/agileflow-metadata.json +20 -1
  199. package/tools/cli/commands/setup.js +85 -3
  200. package/tools/cli/commands/update.js +42 -0
  201. package/tools/cli/installers/ide/_base-ide.js +42 -5
  202. package/tools/cli/installers/ide/claude-code.js +71 -3
  203. package/tools/cli/lib/content-injector.js +160 -12
  204. package/tools/cli/lib/docs-setup.js +1 -1
  205. package/src/core/commands/skill/create.md +0 -698
  206. package/src/core/commands/skill/delete.md +0 -316
  207. package/src/core/commands/skill/edit.md +0 -359
  208. package/src/core/commands/skill/test.md +0 -394
  209. package/src/core/commands/skill/upgrade.md +0 -552
  210. package/src/core/templates/skill-template.md +0 -117
@@ -1,698 +0,0 @@
1
- ---
2
- description: Generate a custom skill with web research, cookbook pattern, and MCP integration
3
- argument-hint: "[<name>]"
4
- compact_context:
5
- priority: high
6
- preserve_rules:
7
- - "ACTIVE COMMAND: /agileflow:skill:create - Generates custom research-backed skills"
8
- - "MUST enter Plan Mode FIRST to research THREE sources: web docs, local docs, codebase patterns"
9
- - "MUST output to .claude/skills/<skill-name>/ (directly usable by Claude Code)"
10
- - "MUST include references.md linking web docs, local docs, and codebase patterns"
11
- - "MUST use cookbook pattern for complex skills (2+ use cases)"
12
- - "NEVER copy entire docs - reference URLs instead"
13
- - "CRITICAL: Ask for approval of plan before generating skill files"
14
- state_fields:
15
- - skill_name
16
- - research_sources
17
- - use_cases_count
18
- - mcp_server_found
19
- ---
20
-
21
- # /agileflow:skill:create
22
-
23
- Generate dynamic, research-backed skills that combine web documentation, user's local docs, and codebase patterns.
24
-
25
- ---
26
-
27
- <!-- COMPACT_SUMMARY_START -->
28
-
29
- ## 🚨 COMPACT SUMMARY - /agileflow:skill:create IS ACTIVE
30
-
31
- **CRITICAL**: This command creates custom skills by researching THREE sources and building research-backed workflows.
32
-
33
- ### 🚨 RULE #1: Enter Plan Mode First
34
- ALWAYS start with Plan Mode to explore before generating ANY skill files.
35
- ```
36
- EnterPlanMode
37
- ```
38
- This prevents wasted generations and gets user approval on research findings.
39
-
40
- ### 🚨 RULE #2: Research Three Sources
41
- In Plan Mode, research and collect (DON'T generate):
42
- 1. **Web docs**: Official documentation URLs, API reference URLs, best practices links
43
- 2. **Local docs**: Files in `docs/02-practices/`, `docs/04-architecture/`, `docs/03-decisions/`
44
- 3. **Codebase patterns**: Existing code using Glob/Grep to find patterns
45
-
46
- ### 🚨 RULE #3: Link, Never Copy
47
- - Link to external docs with URLs (don't copy entire docs)
48
- - Point to local files that exist (don't reference user's docs/02-practices/ directly)
49
- - Show codebase patterns with file locations and code snippets
50
-
51
- ### 🚨 RULE #4: Output Structure
52
- Output ALWAYS goes to `.claude/skills/<skill-name>/` with:
53
- - `SKILL.md` (main file with activation triggers and cookbook references)
54
- - `references.md` (all documentation links)
55
- - `cookbook/` directory (one .md per use case)
56
- - `.mcp.json` (if MCP server found)
57
-
58
- ### 🚨 RULE #5: Cookbook Pattern
59
- - **Simple skill** (1 use case): SKILL.md only
60
- - **Complex skill** (2+ use cases): SKILL.md + cookbook/ directory with per-use-case files
61
-
62
- ### 🚨 RULE #6: Get Approval Before Writing
63
- After research and plan creation:
64
- 1. Show plan findings to user
65
- 2. Ask for approval
66
- 3. Exit Plan Mode with approval
67
- 4. THEN write the skill files
68
-
69
- ### Critical Files Generated
70
- | File | Purpose | Required? |
71
- |------|---------|-----------|
72
- | SKILL.md | Main skill file with activation triggers | Yes |
73
- | references.md | Links to all web/local/codebase docs | Yes |
74
- | cookbook/<use-case>.md | Per-use-case workflow | If 2+ cases |
75
- | .mcp.json | MCP server configuration | If found |
76
-
77
- ### Anti-Patterns
78
- - ❌ DON'T write skill files without Plan Mode approval
79
- - ❌ DON'T copy entire external documentation
80
- - ❌ DON'T reference docs/02-practices/ that user hasn't created
81
- - ❌ DON'T skip cookbook pattern for complex skills
82
- - ❌ DON'T forget references.md (critical for user context)
83
-
84
- ### REMEMBER AFTER COMPACTION
85
- - Skill creation is 5 phases: Requirements → Plan Mode Research → Get Approval → Generate → Write Files
86
- - Plan Mode research finds URLs and local patterns (don't generate from plan)
87
- - User must approve plan before ANY files are written
88
- - Complex skills need cookbook/ for each use case
89
- - references.md is the pivot file linking all sources
90
-
91
- <!-- COMPACT_SUMMARY_END -->
92
-
93
- ---
94
-
95
- ## Workflow
96
-
97
- ### Phase 1: Requirements Gathering
98
-
99
- **STEP 1**: Ask what skill the user wants
100
-
101
- ```xml
102
- <invoke name="AskUserQuestion">
103
- <parameter name="questions">[{
104
- "question": "What skill would you like to create?",
105
- "header": "Skill Purpose",
106
- "multiSelect": false,
107
- "options": [
108
- {"label": "Describe what I need", "description": "I'll explain the skill I want to build"},
109
- {"label": "Database integration", "description": "Supabase, PostgreSQL, MongoDB, etc."},
110
- {"label": "API integration", "description": "REST APIs, GraphQL, webhooks"},
111
- {"label": "UI/Frontend", "description": "Components, styling, design system"},
112
- {"label": "Development workflow", "description": "Testing, deployment, CI/CD"}
113
- ]
114
- }]</parameter>
115
- </invoke>
116
- ```
117
-
118
- **STEP 2**: Gather details based on response
119
-
120
- Extract from user's description:
121
- - Technology/framework
122
- - Primary use cases
123
- - Target workflow
124
-
125
- **STEP 2b**: Ask for skill metadata (model and category)
126
-
127
- ```xml
128
- <invoke name="AskUserQuestion">
129
- <parameter name="questions">[{
130
- "question": "Which AI model should this skill prefer?",
131
- "header": "Model",
132
- "multiSelect": false,
133
- "options": [
134
- {"label": "Haiku (Recommended)", "description": "Fast and cheap - good for most skills"},
135
- {"label": "Sonnet", "description": "Balanced - good for complex analysis"},
136
- {"label": "Opus", "description": "Most capable - for critical decisions"},
137
- {"label": "No preference", "description": "Let the caller decide"}
138
- ]
139
- }, {
140
- "question": "What category best describes this skill?",
141
- "header": "Category",
142
- "multiSelect": false,
143
- "options": [
144
- {"label": "Database", "description": "Database operations, queries, migrations"},
145
- {"label": "API", "description": "REST APIs, GraphQL, webhooks"},
146
- {"label": "UI", "description": "Components, styling, design system"},
147
- {"label": "DevOps", "description": "CI/CD, deployment, infrastructure"}
148
- ]
149
- }]</parameter>
150
- </invoke>
151
- ```
152
-
153
- ---
154
-
155
- ### Phase 2: Plan Mode Research (CRITICAL)
156
-
157
- **STEP 3**: Enter Plan Mode
158
-
159
- ```
160
- EnterPlanMode
161
- ```
162
-
163
- **In plan mode, you will explore THREE sources:**
164
-
165
- #### Source 1: Web Documentation
166
-
167
- Search for official documentation and best practices:
168
-
169
- ```
170
- WebSearch: "<technology> official documentation"
171
- WebSearch: "<technology> best practices 2025"
172
- WebSearch: "<technology> <use-case> guide"
173
- ```
174
-
175
- **Collect URLs** - don't copy content, just gather links:
176
- - Official docs URL (e.g., `https://supabase.com/docs`)
177
- - API reference URL
178
- - GitHub repository URL
179
- - Tutorial/guide URLs
180
-
181
- #### Source 2: User's Local Documentation
182
-
183
- Check the user's `docs/` directory for relevant practices:
184
-
185
- ```
186
- Glob: "docs/**/*.md"
187
- Grep: "<technology>" in docs/
188
- Grep: "design system" in docs/ (for UI skills)
189
- Grep: "style guide" in docs/ (for UI skills)
190
- ```
191
-
192
- **Look for:**
193
- - `docs/02-practices/` - Development practices (testing, styling, security)
194
- - `docs/04-architecture/` - Architecture decisions
195
- - `docs/03-decisions/` - ADRs that affect this skill's domain
196
- - Any existing documentation about the technology
197
-
198
- **Example for UI skill:**
199
- ```
200
- Read: docs/02-practices/styling.md (if exists)
201
- Read: docs/02-practices/components.md (if exists)
202
- Read: docs/04-architecture/design-system.md (if exists)
203
- ```
204
-
205
- #### Source 3: User's Codebase
206
-
207
- Explore the actual code for existing patterns:
208
-
209
- ```
210
- Glob: "src/**/*.<extension>"
211
- Grep: "<pattern>" in src/
212
- ```
213
-
214
- **For UI skills, look for:**
215
- - Existing component patterns: `Glob: "src/components/**/*.tsx"`
216
- - Design tokens/theme: `Grep: "theme" or "colors" or "spacing"`
217
- - Styling approach: Check for Tailwind, CSS modules, styled-components
218
- - Existing design system: `Glob: "**/design-system/**/*"`
219
-
220
- **For Database skills, look for:**
221
- - Existing models: `Glob: "src/models/**/*"`
222
- - Database client setup: `Grep: "createClient" or "prisma"`
223
- - Migration patterns: `Glob: "**/migrations/**/*"`
224
-
225
- **For API skills, look for:**
226
- - Existing routes: `Glob: "src/api/**/*" or "src/routes/**/*"`
227
- - Middleware patterns: `Grep: "middleware"`
228
- - Error handling: `Grep: "catch" or "error"`
229
-
230
- **STEP 4**: Research MCP servers
231
-
232
- ```
233
- WebSearch: "<technology> MCP server official"
234
- WebSearch: "Model Context Protocol <technology>"
235
- ```
236
-
237
- If found, note the package name and documentation URL.
238
-
239
- **STEP 5**: Write plan with findings
240
-
241
- Write to plan file:
242
-
243
- ```markdown
244
- # Skill: <skill-name>
245
-
246
- ## Research Findings
247
-
248
- ### Web Documentation
249
- - Official docs: <URL>
250
- - API reference: <URL>
251
- - Best practices: <URL>
252
-
253
- ### Local Documentation Found
254
- - `docs/02-practices/styling.md` - Design system guidelines
255
- - `docs/04-architecture/components.md` - Component patterns
256
- - (or "No relevant local docs found")
257
-
258
- ### Codebase Patterns Found
259
- - Design system: `src/styles/theme.ts` - Color tokens, spacing
260
- - Component pattern: `src/components/Button/` - Standard component structure
261
- - (or "No existing patterns found for this domain")
262
-
263
- ### MCP Server
264
- - Found: @supabase/mcp-server
265
- - Docs: <URL>
266
-
267
- ## Proposed Skill Structure
268
- - SKILL.md with references to all sources
269
- - cookbook/ for <use-case-1>, <use-case-2>
270
- - references.md linking everything
271
-
272
- ## Questions for User
273
- - Should I include the MCP server?
274
- - Any other local patterns I should incorporate?
275
- ```
276
-
277
- **STEP 6**: Exit plan mode for approval
278
-
279
- ```
280
- ExitPlanMode
281
- ```
282
-
283
- User reviews the plan and approves or requests changes.
284
-
285
- ---
286
-
287
- ### Phase 3: Skill Generation
288
-
289
- **STEP 7**: Determine skill complexity
290
-
291
- - **Simple skill** (1 use case): SKILL.md only, no cookbook
292
- - **Complex skill** (2+ use cases): SKILL.md + cookbook/ directory
293
-
294
- **STEP 8**: Generate SKILL.md
295
-
296
- Include enhanced metadata frontmatter for skill discovery and delegation:
297
-
298
- ```markdown
299
- ---
300
- name: <skill-name-with-hyphens>
301
- type: skill
302
- description: Use when <triggering conditions and symptoms>
303
- model: <haiku|sonnet|opus>
304
- category: <database|api|ui|testing|devops|security|custom>
305
- version: 1.0.0
306
- ---
307
-
308
- # <Skill Title>
309
-
310
- <One sentence description.>
311
-
312
- ## When to Use
313
-
314
- This skill activates when:
315
- - <Symptom 1>
316
- - <Symptom 2>
317
- - Keywords: "<keyword1>", "<keyword2>", "<keyword3>"
318
-
319
- ## Project Context
320
-
321
- **IMPORTANT**: This skill is tailored to THIS project. Before implementing:
322
-
323
- 1. **Check local practices first**: Read `references.md` for project-specific patterns
324
- 2. **Follow existing code patterns**: The codebase patterns section shows how this project does things
325
- 3. **Use external docs for details**: Official documentation URLs are in references.md
326
-
327
- ## Cookbook
328
-
329
- Based on context, select the appropriate workflow:
330
-
331
- ### <Use Case 1>
332
- If <condition>:
333
- Then read cookbook/<use-case-1>.md
334
-
335
- Examples:
336
- - "<example request>"
337
-
338
- ### <Use Case 2>
339
- If <condition>:
340
- Then read cookbook/<use-case-2>.md
341
-
342
- Examples:
343
- - "<example request>"
344
-
345
- ## Quick Reference
346
-
347
- | Action | Command/Pattern |
348
- |--------|-----------------|
349
- | <action1> | <pattern1> |
350
-
351
- ## When You're Stuck
352
-
353
- 1. **Read `references.md`** - Links to all documentation sources
354
- 2. **Check local docs** - Project practices in docs/02-practices/
355
- 3. **Look at existing code** - See codebase patterns in references.md
356
- 4. **Fetch external docs** - Use WebFetch on URLs in references.md
357
-
358
- ## MCP Integration
359
-
360
- This skill uses the **<server-name>** MCP server.
361
-
362
- **Setup**: The `.mcp.json` in this skill folder contains the configuration.
363
- To activate, copy to your project's `.mcp.json` or merge with existing.
364
-
365
- ## Common Mistakes
366
-
367
- - <Mistake 1>: <How to avoid>
368
- ```
369
-
370
- **STEP 9**: Generate references.md
371
-
372
- This file links ALL documentation sources - web, local, and codebase:
373
-
374
- ```markdown
375
- # References for <Skill Name>
376
-
377
- ## External Documentation
378
-
379
- | Resource | URL | Use For |
380
- |----------|-----|---------|
381
- | Official Docs | <URL> | Core concepts, getting started |
382
- | API Reference | <URL> | Method signatures, parameters |
383
- | GitHub Repo | <URL> | Examples, issues, updates |
384
- | Best Practices | <URL> | Patterns, anti-patterns |
385
-
386
- ## Local Project Documentation
387
-
388
- | File | Contains |
389
- |------|----------|
390
- | `docs/02-practices/<file>.md` | <description> |
391
- | `docs/04-architecture/<file>.md` | <description> |
392
- | (or "No local docs found for this domain") |
393
-
394
- ## Codebase Patterns
395
-
396
- Existing patterns in this project that you MUST follow:
397
-
398
- ### <Pattern Name>
399
- - **Location**: `src/path/to/file.ts`
400
- - **Pattern**: <description of what it does>
401
- - **Example**:
402
- ```typescript
403
- // Code snippet showing the pattern
404
- ```
405
-
406
- ### <Another Pattern>
407
- - **Location**: `src/path/to/other.ts`
408
- - **Pattern**: <description>
409
-
410
- (or "No existing patterns found - follow external docs")
411
-
412
- ## MCP Server
413
-
414
- | Package | Docs | Tools Provided |
415
- |---------|------|----------------|
416
- | <package-name> | <URL> | <list of tools> |
417
-
418
- ## How to Use These References
419
-
420
- 1. **First**: Check "Codebase Patterns" - follow existing project conventions
421
- 2. **Second**: Read "Local Project Documentation" for team practices
422
- 3. **Third**: Use "External Documentation" URLs for syntax and details
423
- 4. **To fetch docs**: `WebFetch: <URL>` with prompt "Extract <specific info>"
424
- ```
425
-
426
- **STEP 10**: Generate cookbook entries (if complex skill)
427
-
428
- For each use case, create `cookbook/<use-case>.md`:
429
-
430
- ```markdown
431
- # <Use Case Title>
432
-
433
- <Brief description of this workflow.>
434
-
435
- ## Prerequisites
436
-
437
- - <Prerequisite 1>
438
- - <Prerequisite 2>
439
-
440
- ## Instructions
441
-
442
- 1. **<Step 1>**:
443
- <Details>
444
-
445
- 2. **<Step 2>**:
446
- ```<language>
447
- <code example>
448
- ```
449
-
450
- 3. **<Step 3>**:
451
- <Details>
452
-
453
- ## Example
454
-
455
- **Input**: <sample>
456
- **Output**: <result>
457
-
458
- ## Troubleshooting
459
-
460
- - **<Problem>**: <Solution>
461
- ```
462
-
463
- **STEP 11**: Generate .mcp.json (if user approved MCP)
464
-
465
- ```json
466
- {
467
- "mcpServers": {
468
- "<server-name>": {
469
- "command": "npx",
470
- "args": ["-y", "<package-name>"],
471
- "env": {
472
- "<ENV_VAR>": "${<ENV_VAR>}"
473
- }
474
- }
475
- }
476
- }
477
- ```
478
-
479
- ---
480
-
481
- ### Phase 4: Preview & Confirmation
482
-
483
- **STEP 12**: Show skill structure
484
-
485
- Display the generated structure:
486
-
487
- ```
488
- .claude/skills/<skill-name>/
489
- ├── SKILL.md (XX lines)
490
- ├── references.md # Links to web docs, local docs, codebase patterns
491
- ├── cookbook/
492
- │ ├── <use-case-1>.md
493
- │ └── <use-case-2>.md
494
- └── .mcp.json
495
- ```
496
-
497
- **STEP 13**: Preview SKILL.md content
498
-
499
- Show the first 50 lines of SKILL.md for review.
500
-
501
- **STEP 14**: Confirm creation
502
-
503
- ```xml
504
- <invoke name="AskUserQuestion">
505
- <parameter name="questions">[{
506
- "question": "Create this skill?",
507
- "header": "Confirm",
508
- "multiSelect": false,
509
- "options": [
510
- {"label": "Yes, create skill", "description": "Write all files to .claude/skills/"},
511
- {"label": "No, start over", "description": "Cancel and restart"},
512
- {"label": "Edit requirements", "description": "Modify before creating"}
513
- ]
514
- }]</parameter>
515
- </invoke>
516
- ```
517
-
518
- ---
519
-
520
- ### Phase 5: Write Files
521
-
522
- **STEP 15**: Create skill directory and files
523
-
524
- ```bash
525
- mkdir -p .claude/skills/<skill-name>/cookbook
526
- ```
527
-
528
- Write files:
529
- 1. `.claude/skills/<skill-name>/SKILL.md` - Main skill file
530
- 2. `.claude/skills/<skill-name>/references.md` - Links to web docs, local docs, codebase patterns
531
- 3. `.claude/skills/<skill-name>/cookbook/<use-case>.md` (for each use case)
532
- 4. `.claude/skills/<skill-name>/.mcp.json` (if MCP enabled)
533
-
534
- **STEP 16**: Verify creation
535
-
536
- ```bash
537
- ls -la .claude/skills/<skill-name>/
538
- ```
539
-
540
- **STEP 17**: Present next steps
541
-
542
- ```xml
543
- <invoke name="AskUserQuestion">
544
- <parameter name="questions">[{
545
- "question": "Skill created! What next?",
546
- "header": "Next Steps",
547
- "multiSelect": false,
548
- "options": [
549
- {"label": "Test the skill now", "description": "Try using the skill in this session"},
550
- {"label": "Create another skill", "description": "Generate a new skill"},
551
- {"label": "Done", "description": "Finish skill creation"}
552
- ]
553
- }]</parameter>
554
- </invoke>
555
- ```
556
-
557
- ---
558
-
559
- ## Error Handling
560
-
561
- ### Web Search Fails
562
-
563
- If WebSearch returns no results:
564
- 1. Ask user for documentation URL
565
- 2. Use generic patterns
566
- 3. Note "manual review recommended" in SKILL.md
567
-
568
- ### MCP Not Found
569
-
570
- If no MCP server found for technology:
571
- 1. Create skill without .mcp.json
572
- 2. Add note in SKILL.md: "No MCP server found for <technology>. MCP integration can be added later."
573
- 3. Provide instructions for manual MCP setup
574
-
575
- ### Validation Errors
576
-
577
- Before writing, validate:
578
- - `name` uses only letters, numbers, hyphens
579
- - `description` is under 1024 characters
580
- - SKILL.md body is under 500 lines
581
- - All cookbook files referenced in SKILL.md exist
582
-
583
- If validation fails:
584
- 1. Show specific errors
585
- 2. Offer to fix automatically
586
- 3. Don't write until valid
587
-
588
- ---
589
-
590
- ## Examples
591
-
592
- ### Example 1: Supabase Swift Skill
593
-
594
- **User**: "I want a skill for database management in Supabase for Swift"
595
-
596
- **Plan mode research finds:**
597
- - Web docs: supabase.com/docs/guides/getting-started/quickstarts/swift
598
- - Local docs: None found
599
- - Codebase: `src/lib/supabase.ts` - existing client setup
600
- - MCP: @supabase/mcp-server available
601
-
602
- **Generated**:
603
- ```
604
- .claude/skills/supabase-swift/
605
- ├── SKILL.md
606
- ├── references.md # Links to Supabase docs + local client pattern
607
- ├── cookbook/
608
- │ ├── crud-operations.md
609
- │ ├── authentication.md
610
- │ ├── migrations.md
611
- │ └── realtime-subscriptions.md
612
- └── .mcp.json
613
- ```
614
-
615
- **references.md includes:**
616
- - External: Supabase Swift SDK docs URL, API reference URL
617
- - Codebase: Points to `src/lib/supabase.ts` for client pattern
618
- - MCP: @supabase/mcp-server docs and tools
619
-
620
- ### Example 2: UI Component Skill
621
-
622
- **User**: "I need a skill for building UI components"
623
-
624
- **Plan mode research finds:**
625
- - Web docs: React docs, Tailwind docs
626
- - Local docs: `docs/02-practices/styling.md` - design system guidelines
627
- - Codebase: `src/components/Button/` - existing component pattern, `src/styles/theme.ts` - color tokens
628
-
629
- **Generated**:
630
- ```
631
- .claude/skills/ui-components/
632
- ├── SKILL.md
633
- ├── references.md # Links to React/Tailwind + local design system
634
- └── cookbook/
635
- ├── create-component.md
636
- ├── styling-patterns.md
637
- └── accessibility.md
638
- ```
639
-
640
- **references.md includes:**
641
- - External: React docs URL, Tailwind docs URL
642
- - Local docs: `docs/02-practices/styling.md`
643
- - Codebase patterns: Button component structure, theme tokens location
644
-
645
- ---
646
-
647
- ## Usage
648
-
649
- ```bash
650
- # Interactive mode (recommended)
651
- /agileflow:skill:create
652
-
653
- # With skill name hint
654
- /agileflow:skill:create supabase-swift
655
- ```
656
-
657
- ---
658
-
659
- ## POST-CREATION ACTIONS
660
-
661
- After successfully creating a skill, offer next steps:
662
-
663
- ```xml
664
- <invoke name="AskUserQuestion">
665
- <parameter name="questions">[{
666
- "question": "Skill '<skill-name>' created! What would you like to do next?",
667
- "header": "Next Steps",
668
- "multiSelect": false,
669
- "options": [
670
- {"label": "Test the skill (Recommended)", "description": "Verify the skill works correctly"},
671
- {"label": "View all skills", "description": "See full skill inventory with /agileflow:skill:list"},
672
- {"label": "Create another skill", "description": "Build another custom skill"},
673
- {"label": "Done", "description": "Exit"}
674
- ]
675
- }]</parameter>
676
- </invoke>
677
- ```
678
-
679
- **If "Test the skill"**:
680
- - Run `/agileflow:skill:test SKILL=<skill-name>`
681
- - Provide sample input scenarios
682
- - Verify output matches expectations
683
-
684
- **If "View all skills"**:
685
- - Run `/agileflow:skill:list`
686
-
687
- **If "Create another skill"**:
688
- - Re-run `/agileflow:skill:create`
689
-
690
- ---
691
-
692
- ## Related Commands
693
-
694
- - `/agileflow:skill:list` - View all installed skills
695
- - `/agileflow:skill:test` - Test a skill with sample inputs
696
- - `/agileflow:skill:edit` - Modify an existing skill
697
- - `/agileflow:skill:delete` - Remove a skill
698
- - `/agileflow:skill:upgrade` - Update skill with new patterns