pi-maestro-flow 0.2.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 (179) hide show
  1. package/README.md +124 -0
  2. package/agents/aggregator.md +27 -0
  3. package/agents/cli-explore-agent.md +188 -0
  4. package/agents/cross-role-reviewer.md +171 -0
  5. package/agents/delegate.md +19 -0
  6. package/agents/explorer.md +23 -0
  7. package/agents/impeccable-agent.md +99 -0
  8. package/agents/ralph-executor.md +81 -0
  9. package/agents/reference.md +24 -0
  10. package/agents/role-design-author.md +220 -0
  11. package/agents/team-supervisor.md +143 -0
  12. package/agents/team-worker.md +237 -0
  13. package/agents/ui-design-agent.md +270 -0
  14. package/agents/workflow-analyzer.md +116 -0
  15. package/agents/workflow-codebase-mapper.md +77 -0
  16. package/agents/workflow-collab-planner.md +147 -0
  17. package/agents/workflow-debugger.md +104 -0
  18. package/agents/workflow-executor.md +133 -0
  19. package/agents/workflow-external-researcher.md +86 -0
  20. package/agents/workflow-integration-checker.md +83 -0
  21. package/agents/workflow-nyquist-auditor.md +85 -0
  22. package/agents/workflow-phase-researcher.md +85 -0
  23. package/agents/workflow-plan-checker.md +100 -0
  24. package/agents/workflow-planner.md +200 -0
  25. package/agents/workflow-project-researcher.md +74 -0
  26. package/agents/workflow-research-synthesizer.md +70 -0
  27. package/agents/workflow-reviewer.md +82 -0
  28. package/agents/workflow-roadmapper.md +81 -0
  29. package/agents/workflow-verifier.md +120 -0
  30. package/package.json +58 -0
  31. package/skills/codify-to-knowhow/SKILL.md +167 -0
  32. package/skills/delegation-check/SKILL.md +297 -0
  33. package/skills/domain-add/SKILL.md +75 -0
  34. package/skills/insight-challenge/SKILL.md +226 -0
  35. package/skills/learn-decompose/SKILL.md +124 -0
  36. package/skills/learn-follow/SKILL.md +163 -0
  37. package/skills/learn-investigate/SKILL.md +160 -0
  38. package/skills/learn-second-opinion/SKILL.md +128 -0
  39. package/skills/maestro/SKILL.md +239 -0
  40. package/skills/maestro-amend/SKILL.md +169 -0
  41. package/skills/maestro-analyze/SKILL.md +173 -0
  42. package/skills/maestro-blueprint/SKILL.md +159 -0
  43. package/skills/maestro-brainstorm/SKILL.md +193 -0
  44. package/skills/maestro-collab/SKILL.md +181 -0
  45. package/skills/maestro-companion/SKILL.md +536 -0
  46. package/skills/maestro-composer/SKILL.md +192 -0
  47. package/skills/maestro-execute/SKILL.md +193 -0
  48. package/skills/maestro-fork/SKILL.md +104 -0
  49. package/skills/maestro-grill/SKILL.md +151 -0
  50. package/skills/maestro-guard/SKILL.md +124 -0
  51. package/skills/maestro-help/SKILL.md +328 -0
  52. package/skills/maestro-impeccable/SKILL.md +302 -0
  53. package/skills/maestro-init/SKILL.md +151 -0
  54. package/skills/maestro-merge/SKILL.md +90 -0
  55. package/skills/maestro-milestone-audit/SKILL.md +117 -0
  56. package/skills/maestro-milestone-complete/SKILL.md +133 -0
  57. package/skills/maestro-milestone-release/SKILL.md +131 -0
  58. package/skills/maestro-next/SKILL.md +269 -0
  59. package/skills/maestro-overlay/SKILL.md +203 -0
  60. package/skills/maestro-plan/SKILL.md +194 -0
  61. package/skills/maestro-player/SKILL.md +184 -0
  62. package/skills/maestro-quick/SKILL.md +117 -0
  63. package/skills/maestro-ralph/SKILL.md +905 -0
  64. package/skills/maestro-ralph-cli/SKILL.md +976 -0
  65. package/skills/maestro-ralph-cli-execute/SKILL.md +229 -0
  66. package/skills/maestro-ralph-execute/SKILL.md +409 -0
  67. package/skills/maestro-ralph-v2/SKILL.md +1198 -0
  68. package/skills/maestro-roadmap/SKILL.md +157 -0
  69. package/skills/maestro-swarm-workflow/SKILL.md +272 -0
  70. package/skills/maestro-tools-execute/SKILL.md +143 -0
  71. package/skills/maestro-tools-register/SKILL.md +192 -0
  72. package/skills/maestro-ui-codify/SKILL.md +127 -0
  73. package/skills/maestro-universal-workflow/SKILL.md +622 -0
  74. package/skills/maestro-update/SKILL.md +156 -0
  75. package/skills/manage-codebase-rebuild/SKILL.md +111 -0
  76. package/skills/manage-drift-realign/SKILL.md +159 -0
  77. package/skills/manage-harvest/SKILL.md +121 -0
  78. package/skills/manage-issue/SKILL.md +88 -0
  79. package/skills/manage-issue-discover/SKILL.md +104 -0
  80. package/skills/manage-kg-extractors/SKILL.md +147 -0
  81. package/skills/manage-knowhow/SKILL.md +102 -0
  82. package/skills/manage-knowhow-capture/SKILL.md +109 -0
  83. package/skills/manage-knowledge-audit/SKILL.md +147 -0
  84. package/skills/manage-status/SKILL.md +80 -0
  85. package/skills/manage-wiki/SKILL.md +104 -0
  86. package/skills/odyssey-debug/SKILL.md +344 -0
  87. package/skills/odyssey-improve/SKILL.md +423 -0
  88. package/skills/odyssey-planex/SKILL.md +542 -0
  89. package/skills/odyssey-review-test-fix/SKILL.md +392 -0
  90. package/skills/odyssey-ui/SKILL.md +388 -0
  91. package/skills/prompt-generator/SKILL.md +470 -0
  92. package/skills/quality-auto-test/SKILL.md +168 -0
  93. package/skills/quality-debug/SKILL.md +176 -0
  94. package/skills/quality-refactor/SKILL.md +108 -0
  95. package/skills/quality-retrospective/SKILL.md +134 -0
  96. package/skills/quality-review/SKILL.md +169 -0
  97. package/skills/quality-sync/SKILL.md +90 -0
  98. package/skills/quality-test/SKILL.md +183 -0
  99. package/skills/scholar-anti-ai-writing/SKILL.md +173 -0
  100. package/skills/scholar-anti-ai-writing/references/patterns-chinese.md +242 -0
  101. package/skills/scholar-anti-ai-writing/references/patterns-english.md +242 -0
  102. package/skills/scholar-citation-verify/SKILL.md +166 -0
  103. package/skills/scholar-citation-verify/references/api-usage.md +372 -0
  104. package/skills/scholar-citation-verify/references/common-errors.md +384 -0
  105. package/skills/scholar-citation-verify/references/verification-rules.md +399 -0
  106. package/skills/scholar-experiment/SKILL.md +321 -0
  107. package/skills/scholar-ideation/SKILL.md +288 -0
  108. package/skills/scholar-latex-organizer/SKILL.md +186 -0
  109. package/skills/scholar-publish/SKILL.md +220 -0
  110. package/skills/scholar-rebuttal-pro/README.md +313 -0
  111. package/skills/scholar-rebuttal-pro/SKILL.md +511 -0
  112. package/skills/scholar-review/SKILL.md +227 -0
  113. package/skills/scholar-thesis-docx/README.md +111 -0
  114. package/skills/scholar-thesis-docx/README_EN.md +108 -0
  115. package/skills/scholar-thesis-docx/SKILL.md +212 -0
  116. package/skills/scholar-thesis-docx/references/failure-patterns-and-quality-gates.md +178 -0
  117. package/skills/scholar-thesis-docx/references/figure-and-code-rules.md +33 -0
  118. package/skills/scholar-thesis-docx/references/paper-format-workflow.md +68 -0
  119. package/skills/scholar-thesis-docx/references/script-usage.md +157 -0
  120. package/skills/scholar-thesis-docx/scripts/audit_docx_ooxml.py +429 -0
  121. package/skills/scholar-thesis-docx/scripts/check_word_com.ps1 +50 -0
  122. package/skills/scholar-thesis-docx/scripts/export_word_pdf.ps1 +62 -0
  123. package/skills/scholar-thesis-docx/scripts/normalize_word_styles.ps1 +498 -0
  124. package/skills/scholar-thesis-docx/scripts/render_mermaid_figure.ps1 +148 -0
  125. package/skills/scholar-writing/SKILL.md +296 -0
  126. package/skills/security-audit/SKILL.md +244 -0
  127. package/skills/skill-generator/SKILL.md +472 -0
  128. package/skills/skill-iter-tune/SKILL.md +382 -0
  129. package/skills/skill-simplify/SKILL.md +63 -0
  130. package/skills/skill-tuning/SKILL.md +174 -0
  131. package/skills/spec-add/SKILL.md +105 -0
  132. package/skills/spec-load/SKILL.md +98 -0
  133. package/skills/spec-remove/SKILL.md +74 -0
  134. package/skills/spec-setup/SKILL.md +75 -0
  135. package/skills/team-adversarial-swarm/SKILL.md +233 -0
  136. package/skills/team-adversarial-swarm/scripts/__pycache__/pheromone.cpython-313.pyc +0 -0
  137. package/skills/team-adversarial-swarm/scripts/__pycache__/scoring.cpython-313.pyc +0 -0
  138. package/skills/team-adversarial-swarm/scripts/aco.py +473 -0
  139. package/skills/team-adversarial-swarm/scripts/pheromone.py +144 -0
  140. package/skills/team-adversarial-swarm/scripts/scoring.py +92 -0
  141. package/skills/team-adversarial-swarm/scripts/test_aco.py +475 -0
  142. package/skills/team-arch-opt/SKILL.md +158 -0
  143. package/skills/team-brainstorm/SKILL.md +171 -0
  144. package/skills/team-coordinate/SKILL.md +266 -0
  145. package/skills/team-designer/SKILL.md +160 -0
  146. package/skills/team-executor/SKILL.md +189 -0
  147. package/skills/team-frontend/SKILL.md +136 -0
  148. package/skills/team-frontend-debug/SKILL.md +198 -0
  149. package/skills/team-interactive-craft/SKILL.md +141 -0
  150. package/skills/team-issue/SKILL.md +171 -0
  151. package/skills/team-lifecycle-v4/SKILL.md +209 -0
  152. package/skills/team-motion-design/SKILL.md +142 -0
  153. package/skills/team-perf-opt/SKILL.md +175 -0
  154. package/skills/team-planex/SKILL.md +137 -0
  155. package/skills/team-quality-assurance/SKILL.md +147 -0
  156. package/skills/team-review/SKILL.md +147 -0
  157. package/skills/team-roadmap-dev/SKILL.md +169 -0
  158. package/skills/team-swarm/SKILL.md +178 -0
  159. package/skills/team-swarm/scripts/aco.py +473 -0
  160. package/skills/team-swarm/scripts/pheromone.py +144 -0
  161. package/skills/team-swarm/scripts/scoring.py +92 -0
  162. package/skills/team-swarm/scripts/test_aco.py +475 -0
  163. package/skills/team-tech-debt/SKILL.md +128 -0
  164. package/skills/team-testing/SKILL.md +143 -0
  165. package/skills/team-ui-polish/SKILL.md +141 -0
  166. package/skills/team-uidesign/SKILL.md +144 -0
  167. package/skills/team-ultra-analyze/SKILL.md +173 -0
  168. package/skills/team-ux-improve/SKILL.md +151 -0
  169. package/skills/team-visual-a11y/SKILL.md +156 -0
  170. package/skills/workflow-skill-designer/SKILL.md +496 -0
  171. package/src/extension/index.ts +222 -0
  172. package/src/extension/schemas.ts +131 -0
  173. package/src/providers/cli-tools-loader.ts +74 -0
  174. package/src/providers/provider-registry.ts +130 -0
  175. package/src/tools/delegate.ts +85 -0
  176. package/src/tools/explore.ts +134 -0
  177. package/src/tools/moa.ts +213 -0
  178. package/src/tools/status.ts +99 -0
  179. package/src/tools/wait.ts +166 -0
@@ -0,0 +1,472 @@
1
+ ---
2
+ name: skill-generator
3
+ description: "Meta-skill for creating new Claude Code skills with configurable execution modes. Supports sequential (fixed order) and autonomous (stateless) phase patterns. Use for skill scaffolding, skill creation, or building new workflows. Triggers on \"create skill\", \"new skill\", \"skill generator\"."
4
+ allowed-tools: Agent AskUserQuestion Read Bash Glob Grep Write
5
+ ---
6
+
7
+ # Skill Generator
8
+
9
+ Meta-skill for creating new Claude Code skills with configurable execution modes.
10
+
11
+ ## Pre-load (before execution)
12
+
13
+ 1. **Codebase docs**: If `.workflow/codebase/ARCHITECTURE.md` exists, read for project context
14
+ 2. **Specs**: `maestro load --type spec --category coding` — load coding conventions
15
+ 3. **Wiki knowledge**: `maestro search "skill design optimization" --json` — top 5 entries as prior context
16
+ 4. All optional — proceed without if unavailable
17
+
18
+ ## Architecture Overview
19
+
20
+ ```
21
+ ┌─────────────────────────────────────────────────────────────────┐
22
+ │ Skill Generator │
23
+ │ │
24
+ │ Input: User Request (skill name, purpose, mode) │
25
+ │ ↓ │
26
+ │ ┌─────────────────────────────────────────────────────────┐ │
27
+ │ │ Phase 0-5: Sequential Pipeline │ │
28
+ │ │ ┌────┐ ┌────┐ ┌────┐ ┌────┐ ┌────┐ ┌────┐ │ │
29
+ │ │ │ P0 │→│ P1 │→│ P2 │→│ P3 │→│ P4 │→│ P5 │ │ │
30
+ │ │ │Spec│ │Req │ │Dir │ │Gen │ │Spec│ │Val │ │ │
31
+ │ │ └────┘ └────┘ └────┘ └─┬──┘ └────┘ └────┘ │ │
32
+ │ │ │ │ │
33
+ │ │ ┌────┴────┐ │ │
34
+ │ │ ↓ ↓ │ │
35
+ │ │ Sequential Autonomous │ │
36
+ │ │ (phases/) (actions/) │ │
37
+ │ └─────────────────────────────────────────────────────────┘ │
38
+ │ ↓ │
39
+ │ Output: .claude/skills/{skill-name}/ (complete package) │
40
+ │ │
41
+ └─────────────────────────────────────────────────────────────────┘
42
+ ```
43
+
44
+ ## Execution Modes
45
+
46
+ ### Mode 1: Sequential (Fixed Order)
47
+
48
+ Traditional linear execution model, phases execute in numeric prefix order.
49
+
50
+ ```
51
+ Phase 01 -> Phase 02 -> Phase 03 -> ... -> Phase N
52
+ ```
53
+
54
+ **Use Cases**:
55
+ - Pipeline tasks (collect -> analyze -> generate)
56
+ - Strong dependencies between phases
57
+ - Fixed output structure
58
+
59
+ **Examples**: `software-manual`, `copyright-docs`
60
+
61
+ ### Mode 2: Autonomous (Stateless Auto-Select)
62
+
63
+ Intelligent routing model, dynamically selects execution path based on context.
64
+
65
+ ```
66
+ ---------------------------------------------------
67
+ Orchestrator Agent
68
+ (Read state -> Select Phase -> Execute -> Update)
69
+ ---------------------------------------------------
70
+ |
71
+ ---------+----------+----------
72
+ | | |
73
+ Phase A Phase B Phase C
74
+ (standalone) (standalone) (standalone)
75
+ ```
76
+
77
+ **Use Cases**:
78
+ - Interactive tasks (chat, Q&A)
79
+ - No strong dependencies between phases
80
+ - Dynamic user intent response required
81
+
82
+ **Examples**: `issue-manage`, `workflow-debug`
83
+
84
+ ## Key Design Principles
85
+
86
+ 1. **Mode Awareness**: Automatically recommend execution mode based on task characteristics
87
+ 2. **Skeleton Generation**: Generate complete directory structure and file skeletons
88
+ 3. **Standards Compliance**: Strictly follow `_shared/SKILL-DESIGN-SPEC.md`
89
+ 4. **Extensibility**: Generated Skills are easy to extend and modify
90
+
91
+ ---
92
+
93
+ ## Required Prerequisites
94
+
95
+ IMPORTANT: Before any generation operation, read the following specification documents. Generating without understanding these standards will result in non-conforming output.
96
+
97
+ ### Core Specifications (Mandatory Read)
98
+
99
+ | Document | Purpose | Priority |
100
+ |----------|---------|----------|
101
+ | [../_shared/SKILL-DESIGN-SPEC.md](../_shared/SKILL-DESIGN-SPEC.md) | Universal design spec - defines structure, naming, quality standards for all Skills | **P0 - Critical** |
102
+ | [specs/reference-docs-spec.md](specs/reference-docs-spec.md) | Reference document generation spec - ensures generated Skills have proper phase-based Reference Documents with usage timing guidance | **P0 - Critical** |
103
+
104
+ ### Template Files (Read Before Generation)
105
+
106
+ | Document | Purpose |
107
+ |----------|---------|
108
+ | [templates/skill-md.md](templates/skill-md.md) | SKILL.md entry file template |
109
+ | [templates/sequential-phase.md](templates/sequential-phase.md) | Sequential Phase template |
110
+ | [templates/autonomous-orchestrator.md](templates/autonomous-orchestrator.md) | Autonomous Orchestrator template |
111
+ | [templates/autonomous-action.md](templates/autonomous-action.md) | Autonomous Action template |
112
+ | [templates/code-analysis-action.md](templates/code-analysis-action.md) | Code Analysis Action template |
113
+ | [templates/llm-action.md](templates/llm-action.md) | LLM Action template |
114
+ | [templates/script-template.md](templates/script-template.md) | Unified Script Template (Bash + Python) |
115
+
116
+ ### Specification Documents (Read as Needed)
117
+
118
+ | Document | Purpose |
119
+ |----------|---------|
120
+ | [specs/execution-modes.md](specs/execution-modes.md) | Execution Modes Specification |
121
+ | [specs/skill-requirements.md](specs/skill-requirements.md) | Skill Requirements Specification |
122
+ | [specs/cli-integration.md](specs/cli-integration.md) | CLI Integration Specification |
123
+ | [specs/scripting-integration.md](specs/scripting-integration.md) | Script Integration Specification |
124
+
125
+ ### Phase Execution Guides (Reference During Execution)
126
+
127
+ | Document | Purpose |
128
+ |----------|---------|
129
+ | [phases/01-requirements-discovery.md](phases/01-requirements-discovery.md) | Collect Skill Requirements |
130
+ | [phases/02-structure-generation.md](phases/02-structure-generation.md) | Generate Directory Structure |
131
+ | [phases/03-phase-generation.md](phases/03-phase-generation.md) | Generate Phase Files |
132
+ | [phases/04-specs-templates.md](phases/04-specs-templates.md) | Generate Specs and Templates |
133
+ | [phases/05-validation.md](phases/05-validation.md) | Validation and Documentation |
134
+
135
+ ---
136
+
137
+ ## Execution Flow
138
+
139
+ ```
140
+ Input Parsing:
141
+ └─ Convert user request to structured format (skill-name/purpose/mode)
142
+
143
+ Phase 0: Specification Study (MANDATORY - Must complete before proceeding)
144
+ - Read specification documents
145
+ - Load: ../_shared/SKILL-DESIGN-SPEC.md
146
+ - Load: All templates/*.md files
147
+ - Understand: Structure rules, naming conventions, quality standards
148
+ - Output: Internalized requirements (in-memory, no file output)
149
+ - Validation: MUST complete before Phase 1
150
+
151
+ Phase 1: Requirements Discovery
152
+ - Gather skill requirements via user interaction
153
+ - Tool: AskUserQuestion
154
+ - Collect: Skill name, purpose, execution mode
155
+ - Collect: Phase/Action definition
156
+ - Collect: Tool dependencies, output format
157
+ - Process: Generate configuration object
158
+ - Output: skill-config.json
159
+ - Contains: skill_name, execution_mode, phases/actions, allowed_tools
160
+
161
+ Phase 2: Structure Generation
162
+ - Create directory structure and entry file
163
+ - Input: skill-config.json (from Phase 1)
164
+ - Tool: Bash
165
+ - Execute: mkdir -p .claude/skills/{skill-name}/{phases,specs,templates,scripts}
166
+ - Tool: Write
167
+ - Generate: SKILL.md (entry point with architecture diagram)
168
+ - Output: Complete directory structure
169
+
170
+ Phase 3: Phase/Action Generation
171
+ - Decision (execution_mode check):
172
+ - IF execution_mode === "sequential": Generate Sequential Phases
173
+ - Read template: templates/sequential-phase.md
174
+ - Loop: For each phase in config.sequential_config.phases
175
+ - Generate: phases/{phase-id}.md
176
+ - Link: Previous phase output -> Current phase input
177
+ - Write: phases/_orchestrator.md
178
+ - Write: workflow.json
179
+ - Output: phases/01-{name}.md, phases/02-{name}.md, ...
180
+
181
+ - ELSE IF execution_mode === "autonomous": Generate Orchestrator + Actions
182
+ - Read template: templates/autonomous-orchestrator.md
183
+ - Write: phases/state-schema.md
184
+ - Write: phases/orchestrator.md
185
+ - Write: specs/action-catalog.md
186
+ - Loop: For each action in config.autonomous_config.actions
187
+ - Read template: templates/autonomous-action.md
188
+ - Generate: phases/actions/{action-id}.md
189
+ - Output: phases/orchestrator.md, phases/actions/*.md
190
+
191
+ Phase 4: Specs & Templates
192
+ - Generate domain specifications and templates
193
+ - Input: skill-config.json (domain context)
194
+ - Reference: [specs/reference-docs-spec.md](specs/reference-docs-spec.md) for document organization
195
+ - Tool: Write
196
+ - Generate: specs/{domain}-requirements.md
197
+ - Generate: specs/quality-standards.md
198
+ - Generate: templates/agent-base.md (if needed)
199
+ - Output: Domain-specific documentation
200
+
201
+ Phase 5: Validation & Documentation
202
+ - Verify completeness and generate usage guide
203
+ - Input: All generated files from previous phases
204
+ - Tool: Glob + Read
205
+ - Check: Required files exist and contain proper structure
206
+ - Tool: Write
207
+ - Generate: README.md (usage instructions)
208
+ - Generate: validation-report.json (completeness check)
209
+ - Output: Final documentation
210
+ ```
211
+
212
+ **Execution Protocol**:
213
+
214
+ ```javascript
215
+ // Phase 0: Read specifications (in-memory)
216
+ Read('.claude/skills/_shared/SKILL-DESIGN-SPEC.md');
217
+ Read('.claude/skills/skill-generator/templates/*.md'); // All templates
218
+
219
+ // Phase 1: Gather requirements
220
+ const answers = AskUserQuestion({
221
+ questions: [
222
+ { question: "Skill name?", header: "Name", options: [...] },
223
+ { question: "Execution mode?", header: "Mode", options: ["Sequential", "Autonomous"] }
224
+ ]
225
+ });
226
+
227
+ const config = generateConfig(answers);
228
+ const workDir = `.workflow/.scratchpad/skill-gen-${timestamp}`;
229
+ Write(`${workDir}/skill-config.json`, JSON.stringify(config));
230
+
231
+ // Phase 2: Create structure
232
+ const skillDir = `.claude/skills/${config.skill_name}`;
233
+ Bash(`mkdir -p "${skillDir}/phases" "${skillDir}/specs" "${skillDir}/templates"`);
234
+ Write(`${skillDir}/SKILL.md`, generateSkillEntry(config));
235
+
236
+ // Phase 3: Generate phases (mode-dependent)
237
+ if (config.execution_mode === 'sequential') {
238
+ Write(`${skillDir}/phases/_orchestrator.md`, generateOrchestrator(config));
239
+ Write(`${skillDir}/workflow.json`, generateWorkflowDef(config));
240
+ config.sequential_config.phases.forEach(phase => {
241
+ Write(`${skillDir}/phases/${phase.id}.md`, generatePhase(phase, config));
242
+ });
243
+ } else {
244
+ Write(`${skillDir}/phases/orchestrator.md`, generateAutonomousOrchestrator(config));
245
+ Write(`${skillDir}/phases/state-schema.md`, generateStateSchema(config));
246
+ config.autonomous_config.actions.forEach(action => {
247
+ Write(`${skillDir}/phases/actions/${action.id}.md`, generateAction(action, config));
248
+ });
249
+ }
250
+
251
+ // Phase 4: Generate specs
252
+ Write(`${skillDir}/specs/${config.skill_name}-requirements.md`, generateRequirements(config));
253
+ Write(`${skillDir}/specs/quality-standards.md`, generateQualityStandards(config));
254
+
255
+
256
+ // Phase 5: Validate & Document
257
+ const validation = validateStructure(skillDir);
258
+ Write(`${skillDir}/validation-report.json`, JSON.stringify(validation));
259
+ Write(`${skillDir}/README.md`, generateReadme(config, validation));
260
+ ```
261
+
262
+ ---
263
+
264
+
265
+ ## Reference Documents by Phase
266
+
267
+ IMPORTANT: This section demonstrates how skill-generator organizes its own reference documentation. This is the pattern that all generated Skills should emulate. See [specs/reference-docs-spec.md](specs/reference-docs-spec.md) for details.
268
+
269
+ ### Phase 0: Specification Study (Mandatory Prerequisites)
270
+
271
+ Specification documents that must be read before any generation operation
272
+
273
+ | Document | Purpose | When to Use |
274
+ |----------|---------|-------------|
275
+ | [../_shared/SKILL-DESIGN-SPEC.md](../_shared/SKILL-DESIGN-SPEC.md) | Universal Skill design specification | Understand Skill structure and naming conventions - **REQUIRED** |
276
+ | [specs/reference-docs-spec.md](specs/reference-docs-spec.md) | Reference document generation specification | Ensure Reference Documents have proper phase-based organization - **REQUIRED** |
277
+
278
+ ### Phase 1: Requirements Discovery
279
+
280
+ Collect Skill requirements and configuration
281
+
282
+ | Document | Purpose | When to Use |
283
+ |----------|---------|-------------|
284
+ | [phases/01-requirements-discovery.md](phases/01-requirements-discovery.md) | Phase 1 execution guide | Understand how to collect user requirements and generate configuration |
285
+ | [specs/skill-requirements.md](specs/skill-requirements.md) | Skill requirements specification | Understand what information a Skill should contain |
286
+
287
+ ### Phase 2: Structure Generation
288
+
289
+ Generate directory structure and entry file
290
+
291
+ | Document | Purpose | When to Use |
292
+ |----------|---------|-------------|
293
+ | [phases/02-structure-generation.md](phases/02-structure-generation.md) | Phase 2 execution guide | Understand how to generate directory structure |
294
+ | [templates/skill-md.md](templates/skill-md.md) | SKILL.md template | Learn how to generate the entry file |
295
+
296
+ ### Phase 3: Phase/Action Generation
297
+
298
+ Generate specific phase or action files based on execution mode
299
+
300
+ | Document | Purpose | When to Use |
301
+ |----------|---------|-------------|
302
+ | [phases/03-phase-generation.md](phases/03-phase-generation.md) | Phase 3 execution guide | Understand Sequential vs Autonomous generation logic |
303
+ | [templates/sequential-phase.md](templates/sequential-phase.md) | Sequential Phase template | Generate phase files for Sequential mode |
304
+ | [templates/autonomous-orchestrator.md](templates/autonomous-orchestrator.md) | Orchestrator template | Generate orchestrator for Autonomous mode |
305
+ | [templates/autonomous-action.md](templates/autonomous-action.md) | Action template | Generate action files for Autonomous mode |
306
+
307
+ ### Phase 4: Specs & Templates
308
+
309
+ Generate domain-specific specifications and templates
310
+
311
+ | Document | Purpose | When to Use |
312
+ |----------|---------|-------------|
313
+ | [phases/04-specs-templates.md](phases/04-specs-templates.md) | Phase 4 execution guide | Understand how to generate domain-specific documentation |
314
+ | [specs/reference-docs-spec.md](specs/reference-docs-spec.md) | Reference document specification | IMPORTANT: Follow this spec when generating Specs |
315
+
316
+ ### Phase 5: Validation & Documentation
317
+
318
+ Verify results and generate final documentation
319
+
320
+ | Document | Purpose | When to Use |
321
+ |----------|---------|-------------|
322
+ | [phases/05-validation.md](phases/05-validation.md) | Phase 5 execution guide | Understand how to verify generated Skill completeness |
323
+
324
+ ### Debugging & Troubleshooting
325
+
326
+ Reference documents when encountering issues
327
+
328
+ | Issue | Solution Document |
329
+ |-------|------------------|
330
+ | Generated Skill missing Reference Documents | [specs/reference-docs-spec.md](specs/reference-docs-spec.md) - verify phase-based organization is followed |
331
+ | Reference document organization unclear | [specs/reference-docs-spec.md](specs/reference-docs-spec.md) - Core Principles section |
332
+ | Generated documentation does not meet quality standards | [../_shared/SKILL-DESIGN-SPEC.md](../_shared/SKILL-DESIGN-SPEC.md) |
333
+
334
+ ### Reference & Background
335
+
336
+ Documents for deep learning and design decisions
337
+
338
+ | Document | Purpose | Notes |
339
+ |----------|---------|-------|
340
+ | [specs/execution-modes.md](specs/execution-modes.md) | Detailed execution modes specification | Comparison and use cases for Sequential vs Autonomous |
341
+ | [specs/cli-integration.md](specs/cli-integration.md) | CLI integration specification | How generated Skills integrate with CLI |
342
+ | [specs/scripting-integration.md](specs/scripting-integration.md) | Script integration specification | How to use scripts in Phases |
343
+ | [templates/script-template.md](templates/script-template.md) | Script template | Unified Bash + Python template |
344
+
345
+ ---
346
+
347
+ ## Output Structure
348
+
349
+ ### Sequential Mode
350
+
351
+ ```
352
+ .claude/skills/{skill-name}/
353
+ ├── SKILL.md # Entry file
354
+ ├── phases/
355
+ │ ├── _orchestrator.md # Declarative orchestrator
356
+ │ ├── workflow.json # Workflow definition
357
+ │ ├── 01-{step-one}.md # Phase 1
358
+ │ ├── 02-{step-two}.md # Phase 2
359
+ │ └── 03-{step-three}.md # Phase 3
360
+ ├── specs/
361
+ │ ├── {skill-name}-requirements.md
362
+ │ └── quality-standards.md
363
+ ├── templates/
364
+ │ └── agent-base.md
365
+ ├── scripts/
366
+ └── README.md
367
+ ```
368
+
369
+ ### Autonomous Mode
370
+
371
+ ```
372
+ .claude/skills/{skill-name}/
373
+ ├── SKILL.md # Entry file
374
+ ├── phases/
375
+ │ ├── orchestrator.md # Orchestrator (state-driven)
376
+ │ ├── state-schema.md # State schema definition
377
+ │ └── actions/
378
+ │ ├── action-init.md
379
+ │ ├── action-create.md
380
+ │ └── action-list.md
381
+ ├── specs/
382
+ │ ├── {skill-name}-requirements.md
383
+ │ ├── action-catalog.md
384
+ │ └── quality-standards.md
385
+ ├── templates/
386
+ │ ├── orchestrator-base.md
387
+ │ └── action-base.md
388
+ ├── scripts/
389
+ └── README.md
390
+ ```
391
+
392
+ ---
393
+
394
+ ## Reference Documents by Phase
395
+
396
+ IMPORTANT: This section demonstrates how skill-generator organizes its own reference documentation. This is the pattern that all generated Skills should emulate. See [specs/reference-docs-spec.md](specs/reference-docs-spec.md) for details.
397
+
398
+ ### Phase 0: Specification Study (Mandatory Prerequisites)
399
+
400
+ Specification documents that must be read before any generation operation
401
+
402
+ | Document | Purpose | When to Use |
403
+ |----------|---------|-------------|
404
+ | [../_shared/SKILL-DESIGN-SPEC.md](../_shared/SKILL-DESIGN-SPEC.md) | Universal Skill design specification | Understand Skill structure and naming conventions - **REQUIRED** |
405
+ | [specs/reference-docs-spec.md](specs/reference-docs-spec.md) | Reference document generation specification | Ensure Reference Documents have proper phase-based organization - **REQUIRED** |
406
+
407
+ ### Phase 1: Requirements Discovery
408
+
409
+ Collect Skill requirements and configuration
410
+
411
+ | Document | Purpose | When to Use |
412
+ |----------|---------|-------------|
413
+ | [phases/01-requirements-discovery.md](phases/01-requirements-discovery.md) | Phase 1 execution guide | Understand how to collect user requirements and generate configuration |
414
+ | [specs/skill-requirements.md](specs/skill-requirements.md) | Skill requirements specification | Understand what information a Skill should contain |
415
+
416
+ ### Phase 2: Structure Generation
417
+
418
+ Generate directory structure and entry file
419
+
420
+ | Document | Purpose | When to Use |
421
+ |----------|---------|-------------|
422
+ | [phases/02-structure-generation.md](phases/02-structure-generation.md) | Phase 2 execution guide | Understand how to generate directory structure |
423
+ | [templates/skill-md.md](templates/skill-md.md) | SKILL.md template | Learn how to generate the entry file |
424
+
425
+ ### Phase 3: Phase/Action Generation
426
+
427
+ Generate specific phase or action files based on execution mode
428
+
429
+ | Document | Purpose | When to Use |
430
+ |----------|---------|-------------|
431
+ | [phases/03-phase-generation.md](phases/03-phase-generation.md) | Phase 3 execution guide | Understand Sequential vs Autonomous generation logic |
432
+ | [templates/sequential-phase.md](templates/sequential-phase.md) | Sequential Phase template | Generate phase files for Sequential mode |
433
+ | [templates/autonomous-orchestrator.md](templates/autonomous-orchestrator.md) | Orchestrator template | Generate orchestrator for Autonomous mode |
434
+ | [templates/autonomous-action.md](templates/autonomous-action.md) | Action template | Generate action files for Autonomous mode |
435
+
436
+ ### Phase 4: Specs & Templates
437
+
438
+ Generate domain-specific specifications and templates
439
+
440
+ | Document | Purpose | When to Use |
441
+ |----------|---------|-------------|
442
+ | [phases/04-specs-templates.md](phases/04-specs-templates.md) | Phase 4 execution guide | Understand how to generate domain-specific documentation |
443
+ | [specs/reference-docs-spec.md](specs/reference-docs-spec.md) | Reference document specification | IMPORTANT: Follow this spec when generating Specs |
444
+
445
+ ### Phase 5: Validation & Documentation
446
+
447
+ Verify results and generate final documentation
448
+
449
+ | Document | Purpose | When to Use |
450
+ |----------|---------|-------------|
451
+ | [phases/05-validation.md](phases/05-validation.md) | Phase 5 execution guide | Understand how to verify generated Skill completeness |
452
+
453
+ ### Debugging & Troubleshooting
454
+
455
+ Reference documents when encountering issues
456
+
457
+ | Issue | Solution Document |
458
+ |-------|------------------|
459
+ | Generated Skill missing Reference Documents | [specs/reference-docs-spec.md](specs/reference-docs-spec.md) - verify phase-based organization is followed |
460
+ | Reference document organization unclear | [specs/reference-docs-spec.md](specs/reference-docs-spec.md) - Core Principles section |
461
+ | Generated documentation does not meet quality standards | [../_shared/SKILL-DESIGN-SPEC.md](../_shared/SKILL-DESIGN-SPEC.md) |
462
+
463
+ ### Reference & Background
464
+
465
+ Documents for deep learning and design decisions
466
+
467
+ | Document | Purpose | Notes |
468
+ |----------|---------|-------|
469
+ | [specs/execution-modes.md](specs/execution-modes.md) | Detailed execution modes specification | Comparison and use cases for Sequential vs Autonomous |
470
+ | [specs/cli-integration.md](specs/cli-integration.md) | CLI integration specification | How generated Skills integrate with CLI |
471
+ | [specs/scripting-integration.md](specs/scripting-integration.md) | Script integration specification | How to use scripts in Phases |
472
+ | [templates/script-template.md](templates/script-template.md) | Script template | Unified Bash + Python template |