maestro-flow 0.4.10 → 0.4.11

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 (226) hide show
  1. package/.agents/agents/cli-explore-agent.md +189 -0
  2. package/.agents/agents/conceptual-planning-agent.md +247 -0
  3. package/.agents/agents/impeccable-agent.md +101 -0
  4. package/.agents/agents/team-supervisor.md +145 -0
  5. package/.agents/agents/team-worker.md +239 -0
  6. package/.agents/agents/ui-design-agent.md +289 -0
  7. package/.agents/agents/workflow-analyzer.md +117 -0
  8. package/.agents/agents/workflow-codebase-mapper.md +79 -0
  9. package/.agents/agents/workflow-collab-planner.md +145 -0
  10. package/.agents/agents/workflow-debugger.md +105 -0
  11. package/.agents/agents/workflow-executor.md +134 -0
  12. package/.agents/agents/workflow-external-researcher.md +88 -0
  13. package/.agents/agents/workflow-integration-checker.md +85 -0
  14. package/.agents/agents/workflow-nyquist-auditor.md +87 -0
  15. package/.agents/agents/workflow-phase-researcher.md +87 -0
  16. package/.agents/agents/workflow-plan-checker.md +92 -0
  17. package/.agents/agents/workflow-planner.md +197 -0
  18. package/.agents/agents/workflow-project-researcher.md +76 -0
  19. package/.agents/agents/workflow-research-synthesizer.md +72 -0
  20. package/.agents/agents/workflow-reviewer.md +84 -0
  21. package/.agents/agents/workflow-roadmapper.md +83 -0
  22. package/.agents/agents/workflow-verifier.md +122 -0
  23. package/.agents/skills/codify-to-knowhow/SKILL.md +169 -0
  24. package/.agents/skills/codify-to-knowhow/phases/01-load-manifest.md +101 -0
  25. package/.agents/skills/codify-to-knowhow/phases/02-generate-knowhow.md +97 -0
  26. package/.agents/skills/codify-to-knowhow/phases/03-generate-specs.md +92 -0
  27. package/.agents/skills/codify-to-knowhow/phases/04-index-verify.md +119 -0
  28. package/.agents/skills/learn-decompose/SKILL.md +118 -0
  29. package/.agents/skills/learn-follow/SKILL.md +129 -0
  30. package/.agents/skills/learn-investigate/SKILL.md +154 -0
  31. package/.agents/skills/learn-retro/SKILL.md +159 -0
  32. package/.agents/skills/learn-second-opinion/SKILL.md +124 -0
  33. package/.agents/skills/maestro/SKILL.md +224 -0
  34. package/.agents/skills/maestro-amend/SKILL.md +165 -0
  35. package/.agents/skills/maestro-analyze/SKILL.md +135 -0
  36. package/.agents/skills/maestro-brainstorm/SKILL.md +118 -0
  37. package/.agents/skills/maestro-collab/SKILL.md +174 -0
  38. package/.agents/skills/maestro-composer/SKILL.md +181 -0
  39. package/.agents/skills/maestro-execute/SKILL.md +133 -0
  40. package/.agents/skills/maestro-fork/SKILL.md +88 -0
  41. package/.agents/skills/maestro-guard/SKILL.md +103 -0
  42. package/.agents/skills/maestro-help/SKILL.md +266 -0
  43. package/.agents/skills/maestro-help/index/catalog.json +184 -0
  44. package/.agents/skills/maestro-help/phases/01-parse-intent.md +122 -0
  45. package/.agents/skills/maestro-help/phases/02-search-present.md +181 -0
  46. package/.agents/skills/maestro-help/phases/03-workflow-guide.md +186 -0
  47. package/.agents/skills/maestro-impeccable/SKILL.md +251 -0
  48. package/.agents/skills/maestro-init/SKILL.md +80 -0
  49. package/.agents/skills/maestro-learn/SKILL.md +142 -0
  50. package/.agents/skills/maestro-merge/SKILL.md +66 -0
  51. package/.agents/skills/maestro-milestone-audit/SKILL.md +70 -0
  52. package/.agents/skills/maestro-milestone-complete/SKILL.md +77 -0
  53. package/.agents/skills/maestro-milestone-release/SKILL.md +98 -0
  54. package/.agents/skills/maestro-overlay/SKILL.md +180 -0
  55. package/.agents/skills/maestro-plan/SKILL.md +172 -0
  56. package/.agents/skills/maestro-player/SKILL.md +177 -0
  57. package/.agents/skills/maestro-quick/SKILL.md +67 -0
  58. package/.agents/skills/maestro-ralph/SKILL.md +685 -0
  59. package/.agents/skills/maestro-ralph-execute/SKILL.md +259 -0
  60. package/.agents/skills/maestro-roadmap/SKILL.md +170 -0
  61. package/.agents/skills/maestro-tools-execute/SKILL.md +119 -0
  62. package/.agents/skills/maestro-tools-register/SKILL.md +159 -0
  63. package/.agents/skills/maestro-ui-codify/SKILL.md +82 -0
  64. package/.agents/skills/maestro-update/SKILL.md +178 -0
  65. package/.agents/skills/maestro-verify/SKILL.md +111 -0
  66. package/.agents/skills/manage-codebase-rebuild/SKILL.md +77 -0
  67. package/.agents/skills/manage-codebase-refresh/SKILL.md +59 -0
  68. package/.agents/skills/manage-harvest/SKILL.md +96 -0
  69. package/.agents/skills/manage-issue/SKILL.md +75 -0
  70. package/.agents/skills/manage-issue-discover/SKILL.md +83 -0
  71. package/.agents/skills/manage-knowhow/SKILL.md +79 -0
  72. package/.agents/skills/manage-knowhow-capture/SKILL.md +81 -0
  73. package/.agents/skills/manage-learn/SKILL.md +67 -0
  74. package/.agents/skills/manage-status/SKILL.md +54 -0
  75. package/.agents/skills/manage-wiki/SKILL.md +64 -0
  76. package/.agents/skills/quality-auto-test/SKILL.md +138 -0
  77. package/.agents/skills/quality-debug/SKILL.md +122 -0
  78. package/.agents/skills/quality-refactor/SKILL.md +69 -0
  79. package/.agents/skills/quality-retrospective/SKILL.md +79 -0
  80. package/.agents/skills/quality-review/SKILL.md +130 -0
  81. package/.agents/skills/quality-sync/SKILL.md +53 -0
  82. package/.agents/skills/quality-test/SKILL.md +119 -0
  83. package/.agents/skills/security-audit/SKILL.md +157 -0
  84. package/.agents/skills/skill-iter-tune/SKILL.md +384 -0
  85. package/.agents/skills/skill-iter-tune/phases/01-setup.md +144 -0
  86. package/.agents/skills/skill-iter-tune/phases/02-execute.md +292 -0
  87. package/.agents/skills/skill-iter-tune/phases/03-evaluate.md +312 -0
  88. package/.agents/skills/skill-iter-tune/phases/04-improve.md +186 -0
  89. package/.agents/skills/skill-iter-tune/phases/05-report.md +166 -0
  90. package/.agents/skills/skill-iter-tune/specs/evaluation-criteria.md +63 -0
  91. package/.agents/skills/skill-iter-tune/templates/eval-prompt.md +134 -0
  92. package/.agents/skills/skill-iter-tune/templates/execute-prompt.md +97 -0
  93. package/.agents/skills/spec-add/SKILL.md +70 -0
  94. package/.agents/skills/spec-load/SKILL.md +73 -0
  95. package/.agents/skills/spec-remove/SKILL.md +53 -0
  96. package/.agents/skills/spec-setup/SKILL.md +50 -0
  97. package/.agents/skills/team-coordinate/SKILL.md +268 -0
  98. package/.agents/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +247 -0
  99. package/.agents/skills/team-coordinate/roles/coordinator/commands/dispatch.md +131 -0
  100. package/.agents/skills/team-coordinate/roles/coordinator/commands/monitor.md +358 -0
  101. package/.agents/skills/team-coordinate/roles/coordinator/role.md +365 -0
  102. package/.agents/skills/team-coordinate/specs/knowledge-transfer.md +111 -0
  103. package/.agents/skills/team-coordinate/specs/pipelines.md +97 -0
  104. package/.agents/skills/team-coordinate/specs/quality-gates.md +112 -0
  105. package/.agents/skills/team-coordinate/specs/role-spec-template.md +198 -0
  106. package/.agents/skills/team-executor/SKILL.md +191 -0
  107. package/.agents/skills/team-executor/roles/executor/commands/monitor.md +239 -0
  108. package/.agents/skills/team-executor/roles/executor/role.md +171 -0
  109. package/.agents/skills/team-executor/specs/session-schema.md +264 -0
  110. package/.agents/skills/team-lifecycle-v4/SKILL.md +211 -0
  111. package/.agents/skills/team-lifecycle-v4/roles/analyst/role.md +96 -0
  112. package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +56 -0
  113. package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +56 -0
  114. package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +206 -0
  115. package/.agents/skills/team-lifecycle-v4/roles/coordinator/role.md +130 -0
  116. package/.agents/skills/team-lifecycle-v4/roles/executor/commands/fix.md +35 -0
  117. package/.agents/skills/team-lifecycle-v4/roles/executor/commands/implement.md +62 -0
  118. package/.agents/skills/team-lifecycle-v4/roles/executor/role.md +69 -0
  119. package/.agents/skills/team-lifecycle-v4/roles/planner/role.md +87 -0
  120. package/.agents/skills/team-lifecycle-v4/roles/reviewer/commands/review-code.md +34 -0
  121. package/.agents/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +44 -0
  122. package/.agents/skills/team-lifecycle-v4/roles/reviewer/role.md +71 -0
  123. package/.agents/skills/team-lifecycle-v4/roles/supervisor/role.md +194 -0
  124. package/.agents/skills/team-lifecycle-v4/roles/tester/role.md +89 -0
  125. package/.agents/skills/team-lifecycle-v4/roles/writer/role.md +97 -0
  126. package/.agents/skills/team-lifecycle-v4/specs/knowledge-transfer.md +114 -0
  127. package/.agents/skills/team-lifecycle-v4/specs/pipelines.md +140 -0
  128. package/.agents/skills/team-lifecycle-v4/specs/quality-gates.md +130 -0
  129. package/.agents/skills/team-lifecycle-v4/templates/architecture.md +254 -0
  130. package/.agents/skills/team-lifecycle-v4/templates/epics.md +196 -0
  131. package/.agents/skills/team-lifecycle-v4/templates/product-brief.md +133 -0
  132. package/.agents/skills/team-lifecycle-v4/templates/requirements.md +224 -0
  133. package/.agents/skills/team-quality-assurance/SKILL.md +149 -0
  134. package/.agents/skills/team-quality-assurance/roles/analyst/role.md +90 -0
  135. package/.agents/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -0
  136. package/.agents/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +111 -0
  137. package/.agents/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +250 -0
  138. package/.agents/skills/team-quality-assurance/roles/coordinator/role.md +143 -0
  139. package/.agents/skills/team-quality-assurance/roles/executor/role.md +68 -0
  140. package/.agents/skills/team-quality-assurance/roles/generator/role.md +70 -0
  141. package/.agents/skills/team-quality-assurance/roles/scout/role.md +77 -0
  142. package/.agents/skills/team-quality-assurance/roles/strategist/role.md +73 -0
  143. package/.agents/skills/team-quality-assurance/specs/pipelines.md +115 -0
  144. package/.agents/skills/team-quality-assurance/specs/team-config.json +131 -0
  145. package/.agents/skills/team-review/SKILL.md +149 -0
  146. package/.agents/skills/team-review/roles/coordinator/commands/analyze.md +71 -0
  147. package/.agents/skills/team-review/roles/coordinator/commands/dispatch.md +91 -0
  148. package/.agents/skills/team-review/roles/coordinator/commands/monitor.md +224 -0
  149. package/.agents/skills/team-review/roles/coordinator/role.md +132 -0
  150. package/.agents/skills/team-review/roles/fixer/role.md +78 -0
  151. package/.agents/skills/team-review/roles/reviewer/role.md +70 -0
  152. package/.agents/skills/team-review/roles/scanner/role.md +81 -0
  153. package/.agents/skills/team-review/specs/dimensions.md +82 -0
  154. package/.agents/skills/team-review/specs/finding-schema.json +82 -0
  155. package/.agents/skills/team-review/specs/pipelines.md +102 -0
  156. package/.agents/skills/team-review/specs/team-config.json +27 -0
  157. package/.agents/skills/team-tech-debt/SKILL.md +130 -0
  158. package/.agents/skills/team-tech-debt/roles/assessor/role.md +79 -0
  159. package/.agents/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -0
  160. package/.agents/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +156 -0
  161. package/.agents/skills/team-tech-debt/roles/coordinator/commands/monitor.md +209 -0
  162. package/.agents/skills/team-tech-debt/roles/coordinator/role.md +123 -0
  163. package/.agents/skills/team-tech-debt/roles/executor/role.md +78 -0
  164. package/.agents/skills/team-tech-debt/roles/planner/role.md +71 -0
  165. package/.agents/skills/team-tech-debt/roles/scanner/role.md +92 -0
  166. package/.agents/skills/team-tech-debt/roles/validator/role.md +80 -0
  167. package/.agents/skills/team-tech-debt/specs/pipelines.md +47 -0
  168. package/.agents/skills/team-tech-debt/specs/team-config.json +129 -0
  169. package/.agents/skills/team-testing/SKILL.md +145 -0
  170. package/.agents/skills/team-testing/roles/analyst/role.md +105 -0
  171. package/.agents/skills/team-testing/roles/coordinator/commands/analyze.md +70 -0
  172. package/.agents/skills/team-testing/roles/coordinator/commands/dispatch.md +108 -0
  173. package/.agents/skills/team-testing/roles/coordinator/commands/monitor.md +257 -0
  174. package/.agents/skills/team-testing/roles/coordinator/role.md +134 -0
  175. package/.agents/skills/team-testing/roles/executor/role.md +101 -0
  176. package/.agents/skills/team-testing/roles/generator/role.md +100 -0
  177. package/.agents/skills/team-testing/roles/strategist/role.md +85 -0
  178. package/.agents/skills/team-testing/specs/pipelines.md +101 -0
  179. package/.agents/skills/team-testing/specs/team-config.json +93 -0
  180. package/.agents/skills/wiki-connect/SKILL.md +64 -0
  181. package/.agents/skills/wiki-digest/SKILL.md +70 -0
  182. package/.agents/skills/workflow-skill-designer/SKILL.md +498 -0
  183. package/.agents/skills/workflow-skill-designer/phases/01-requirements-analysis.md +356 -0
  184. package/.agents/skills/workflow-skill-designer/phases/02-orchestrator-design.md +444 -0
  185. package/.agents/skills/workflow-skill-designer/phases/03-phase-design.md +458 -0
  186. package/.agents/skills/workflow-skill-designer/phases/04-validation.md +471 -0
  187. package/.agy/skills/maestro/SKILL.md +13 -11
  188. package/.agy/skills/maestro-ralph/SKILL.md +222 -87
  189. package/.claude/commands/maestro-ralph.md +222 -87
  190. package/.claude/commands/maestro.md +13 -11
  191. package/.codex/skills/maestro/SKILL.md +23 -17
  192. package/.codex/skills/maestro-ralph/SKILL.md +177 -67
  193. package/dist/src/commands/install-backend.d.ts +12 -0
  194. package/dist/src/commands/install-backend.d.ts.map +1 -1
  195. package/dist/src/commands/install-backend.js +144 -0
  196. package/dist/src/commands/install-backend.js.map +1 -1
  197. package/dist/src/core/component-defs.d.ts +6 -0
  198. package/dist/src/core/component-defs.d.ts.map +1 -1
  199. package/dist/src/core/component-defs.js +97 -0
  200. package/dist/src/core/component-defs.js.map +1 -1
  201. package/dist/src/tui/install-ui/ExtraMcpConfig.d.ts +11 -0
  202. package/dist/src/tui/install-ui/ExtraMcpConfig.d.ts.map +1 -0
  203. package/dist/src/tui/install-ui/ExtraMcpConfig.js +61 -0
  204. package/dist/src/tui/install-ui/ExtraMcpConfig.js.map +1 -0
  205. package/dist/src/tui/install-ui/InstallConfirm.d.ts +3 -0
  206. package/dist/src/tui/install-ui/InstallConfirm.d.ts.map +1 -1
  207. package/dist/src/tui/install-ui/InstallConfirm.js +1 -1
  208. package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
  209. package/dist/src/tui/install-ui/InstallExecution.d.ts +2 -0
  210. package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
  211. package/dist/src/tui/install-ui/InstallExecution.js +14 -2
  212. package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
  213. package/dist/src/tui/install-ui/InstallFlow.d.ts +1 -1
  214. package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
  215. package/dist/src/tui/install-ui/InstallFlow.js +16 -3
  216. package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
  217. package/dist/src/tui/install-ui/InstallHub.d.ts +2 -0
  218. package/dist/src/tui/install-ui/InstallHub.d.ts.map +1 -1
  219. package/dist/src/tui/install-ui/InstallHub.js +8 -0
  220. package/dist/src/tui/install-ui/InstallHub.js.map +1 -1
  221. package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
  222. package/dist/src/tui/install-ui/InstallResult.js +3 -1
  223. package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
  224. package/dist/src/utils/update-notices.js +19 -0
  225. package/dist/src/utils/update-notices.js.map +1 -1
  226. package/package.json +5 -2
@@ -0,0 +1,471 @@
1
+ # Phase 4: Validation & Integration
2
+
3
+ Validate the generated skill package for structural completeness, reference integrity, and content quality. Produce a validation report and integration summary.
4
+
5
+ ## Objective
6
+
7
+ - Verify all required files exist
8
+ - Validate SKILL.md references match actual phase files
9
+ - Check content preservation (for command extraction source)
10
+ - Verify cross-phase data flow consistency
11
+ - Report validation results to user
12
+
13
+ ## Step 4.1: Structural Validation
14
+
15
+ ```javascript
16
+ function validateStructure(config) {
17
+ const skillDir = `.claude/skills/${config.skillName}`;
18
+ const results = { errors: [], warnings: [], info: [] };
19
+
20
+ // Check SKILL.md exists
21
+ const skillMdExists = fileExists(`${skillDir}/SKILL.md`);
22
+ if (!skillMdExists) {
23
+ results.errors.push('SKILL.md not found');
24
+ }
25
+
26
+ // Check all phase files exist
27
+ for (const phase of config.phases) {
28
+ const filename = `${String(phase.number).padStart(2, '0')}-${phase.slug}.md`;
29
+ const filepath = `${skillDir}/phases/${filename}`;
30
+ if (!fileExists(filepath)) {
31
+ results.errors.push(`Phase file missing: ${filepath}`);
32
+ }
33
+ }
34
+
35
+ // Check SKILL.md frontmatter
36
+ if (skillMdExists) {
37
+ const skillMd = read_file(`${skillDir}/SKILL.md`);
38
+ const fm = extractYAMLFrontmatter(skillMd);
39
+
40
+ if (!fm.name) results.errors.push('Frontmatter missing: name');
41
+ if (!fm.description) results.errors.push('Frontmatter missing: description');
42
+ if (!fm['allowed-tools']) results.errors.push('Frontmatter missing: allowed-tools');
43
+
44
+ // Check description has trigger phrase
45
+ if (fm.description && !fm.description.includes('Triggers on')) {
46
+ results.warnings.push('Description missing trigger phrase (Triggers on "...")');
47
+ }
48
+ }
49
+
50
+ return results;
51
+ }
52
+ ```
53
+
54
+ ## Step 4.2: Reference Integrity
55
+
56
+ ```javascript
57
+ function validateReferences(config) {
58
+ const skillDir = `.claude/skills/${config.skillName}`;
59
+ const results = { errors: [], warnings: [], info: [] };
60
+ const skillMd = read_file(`${skillDir}/SKILL.md`);
61
+
62
+ // Extract all Ref: markers from SKILL.md
63
+ const refMarkers = skillMd.match(/Ref: phases\/\S+\.md/g) || [];
64
+ const linkedFiles = skillMd.match(/\[phases\/\S+\.md\]\(phases\/\S+\.md\)/g) || [];
65
+
66
+ // Collect all referenced phase files
67
+ const referencedFiles = new Set();
68
+ for (const ref of refMarkers) {
69
+ referencedFiles.add(ref.replace('Ref: ', ''));
70
+ }
71
+ for (const link of linkedFiles) {
72
+ const match = link.match(/\(phases\/\S+\.md\)/);
73
+ if (match) referencedFiles.add(match[0].replace(/[()]/g, ''));
74
+ }
75
+
76
+ // Check each referenced file exists
77
+ for (const refFile of referencedFiles) {
78
+ if (!fileExists(`${skillDir}/${refFile}`)) {
79
+ results.errors.push(`Referenced file not found: ${refFile}`);
80
+ }
81
+ }
82
+
83
+ // Check each phase file is referenced in SKILL.md
84
+ for (const phase of config.phases) {
85
+ const filename = `phases/${String(phase.number).padStart(2, '0')}-${phase.slug}.md`;
86
+ if (!referencedFiles.has(filename)) {
87
+ results.warnings.push(`Phase file not referenced in SKILL.md: ${filename}`);
88
+ }
89
+ }
90
+
91
+ // Check Phase Reference Documents table exists
92
+ if (!skillMd.includes('Phase Reference Documents')) {
93
+ results.errors.push('SKILL.md missing Phase Reference Documents table');
94
+ }
95
+
96
+ // Check Phase Reference Documents table has entries for all phases
97
+ for (const phase of config.phases) {
98
+ const filename = `${String(phase.number).padStart(2, '0')}-${phase.slug}.md`;
99
+ if (!skillMd.includes(filename)) {
100
+ results.errors.push(`Phase Reference table missing entry for: ${filename}`);
101
+ }
102
+ }
103
+
104
+ return results;
105
+ }
106
+ ```
107
+
108
+ ## Step 4.3: Content Quality (Command Extraction Only)
109
+
110
+ ```javascript
111
+ function validateContentQuality(config) {
112
+ const skillDir = `.claude/skills/${config.skillName}`;
113
+ const results = { errors: [], warnings: [], info: [] };
114
+
115
+ if (config.source.type !== 'command_set') {
116
+ results.info.push('Content quality check skipped (not command extraction)');
117
+ return results;
118
+ }
119
+
120
+ for (const phase of config.phases) {
121
+ if (!phase.sourcePath) continue;
122
+
123
+ const sourceContent = read_file(phase.sourcePath);
124
+ const sourceBody = removeYAMLFrontmatter(sourceContent);
125
+ const filename = `${String(phase.number).padStart(2, '0')}-${phase.slug}.md`;
126
+ const phaseContent = read_file(`${skillDir}/phases/${filename}`);
127
+
128
+ // Line count comparison
129
+ const sourceLines = sourceBody.split('\n').length;
130
+ const phaseLines = phaseContent.split('\n').length;
131
+ const ratio = phaseLines / sourceLines;
132
+
133
+ if (ratio < 0.7) {
134
+ results.errors.push(
135
+ `Phase ${phase.number} content loss: source=${sourceLines} lines, phase=${phaseLines} lines (${Math.round(ratio * 100)}%)`
136
+ );
137
+ } else if (ratio < 0.9) {
138
+ results.warnings.push(
139
+ `Phase ${phase.number} possible content reduction: source=${sourceLines}, phase=${phaseLines} (${Math.round(ratio * 100)}%)`
140
+ );
141
+ } else {
142
+ results.info.push(
143
+ `Phase ${phase.number} content preserved: source=${sourceLines}, phase=${phaseLines} (${Math.round(ratio * 100)}%)`
144
+ );
145
+ }
146
+
147
+ // Code block count comparison
148
+ const sourceBlocks = (sourceBody.match(/```/g) || []).length / 2;
149
+ const phaseBlocks = (phaseContent.match(/```/g) || []).length / 2;
150
+ if (phaseBlocks < sourceBlocks) {
151
+ results.warnings.push(
152
+ `Phase ${phase.number} missing code blocks: source=${sourceBlocks}, phase=${phaseBlocks}`
153
+ );
154
+ }
155
+
156
+ // Agent prompt preservation
157
+ const sourceAgents = (sourceBody.match(/Task\(|subagent_type/g) || []).length;
158
+ const phaseAgents = (phaseContent.match(/Task\(|subagent_type/g) || []).length;
159
+ if (phaseAgents < sourceAgents) {
160
+ results.errors.push(
161
+ `Phase ${phase.number} missing agent calls: source=${sourceAgents}, phase=${phaseAgents}`
162
+ );
163
+ }
164
+ }
165
+
166
+ return results;
167
+ }
168
+ ```
169
+
170
+ ## Step 4.4: Data Flow Consistency
171
+
172
+ ```javascript
173
+ function validateDataFlow(config) {
174
+ const skillDir = `.claude/skills/${config.skillName}`;
175
+ const results = { errors: [], warnings: [], info: [] };
176
+ const skillMd = read_file(`${skillDir}/SKILL.md`);
177
+
178
+ // Check all data flow variables are mentioned in SKILL.md
179
+ for (const flow of config.dataFlow) {
180
+ for (const variable of flow.variables) {
181
+ if (!skillMd.includes(variable)) {
182
+ results.warnings.push(
183
+ `Data flow variable '${variable}' (${flow.from} → ${flow.to}) not found in SKILL.md`
184
+ );
185
+ }
186
+ }
187
+ }
188
+
189
+ // Check conditional phases have their condition in SKILL.md
190
+ for (const phase of config.phases) {
191
+ if (phase.isConditional && phase.condition) {
192
+ // Extract the key variable from condition
193
+ const condVar = phase.condition.match(/\w+/)?.[0];
194
+ if (condVar && !skillMd.includes(condVar)) {
195
+ results.errors.push(
196
+ `Conditional Phase ${phase.number} condition variable '${condVar}' not found in SKILL.md`
197
+ );
198
+ }
199
+ }
200
+ }
201
+
202
+ return results;
203
+ }
204
+ ```
205
+
206
+ ## Step 4.5: SKILL.md Section Completeness
207
+
208
+ ```javascript
209
+ function validateSkillMdSections(config) {
210
+ const skillDir = `.claude/skills/${config.skillName}`;
211
+ const results = { errors: [], warnings: [], info: [] };
212
+ const skillMd = read_file(`${skillDir}/SKILL.md`);
213
+
214
+ // Required sections
215
+ const requiredSections = [
216
+ { name: 'Architecture Overview', pattern: /## Architecture Overview/ },
217
+ { name: 'Execution Flow', pattern: /## Execution Flow/ },
218
+ { name: 'Core Rules', pattern: /## Core Rules/ },
219
+ { name: 'Data Flow', pattern: /## Data Flow/ },
220
+ { name: 'Error Handling', pattern: /## Error Handling/ }
221
+ ];
222
+
223
+ // Recommended sections
224
+ const recommendedSections = [
225
+ { name: 'Key Design Principles', pattern: /## Key Design Principles/ },
226
+ { name: 'Input Processing', pattern: /## Input Processing/ },
227
+ { name: 'track_tasks Pattern', pattern: /## track_tasks Pattern/ },
228
+ { name: 'Coordinator Checklist', pattern: /## Coordinator Checklist/ },
229
+ { name: 'Related Commands', pattern: /## Related Commands/ }
230
+ ];
231
+
232
+ // Conditional sections
233
+ const conditionalSections = [
234
+ { name: 'Interactive Preference Collection', pattern: /## Interactive Preference Collection/, condition: config.features.hasAutoMode },
235
+ { name: 'Auto Mode Defaults', pattern: /## Auto Mode Defaults/, condition: config.features.hasAutoMode },
236
+ { name: 'Post-Phase Updates', pattern: /## Post-Phase Updates/, condition: config.features.hasPostPhaseUpdates }
237
+ ];
238
+
239
+ for (const section of requiredSections) {
240
+ if (!section.pattern.test(skillMd)) {
241
+ results.errors.push(`Missing required section: ${section.name}`);
242
+ }
243
+ }
244
+
245
+ for (const section of recommendedSections) {
246
+ if (!section.pattern.test(skillMd)) {
247
+ results.warnings.push(`Missing recommended section: ${section.name}`);
248
+ }
249
+ }
250
+
251
+ for (const section of conditionalSections) {
252
+ if (section.condition && !section.pattern.test(skillMd)) {
253
+ results.warnings.push(`Missing conditional section: ${section.name} (feature enabled but section absent)`);
254
+ }
255
+ }
256
+
257
+ return results;
258
+ }
259
+ ```
260
+
261
+ ## Step 4.6: Phase File Hygiene
262
+
263
+ Scan generated phase files for prohibited content patterns. Phase files are internal execution documents and must not contain user-facing syntax, flag parsing, or inter-phase routing.
264
+
265
+ ```javascript
266
+ function validatePhaseFileHygiene(config) {
267
+ const skillDir = `.claude/skills/${config.skillName}`;
268
+ const results = { errors: [], warnings: [], info: [] };
269
+
270
+ const prohibitedPatterns = [
271
+ {
272
+ name: 'Flag parsing ($ARGUMENTS)',
273
+ regex: /\$ARGUMENTS\.includes/g,
274
+ severity: 'error',
275
+ fix: 'Replace with workflowPreferences.{key} reference'
276
+ },
277
+ {
278
+ name: 'Invocation syntax (/skill-name)',
279
+ regex: /\/\w+[\-:]\w+\s+["']/g,
280
+ severity: 'warning',
281
+ fix: 'Remove (phase files are not user-facing docs)'
282
+ },
283
+ {
284
+ name: 'Conversion provenance (Source: Converted from)',
285
+ regex: /Source:.*Converted from/g,
286
+ severity: 'warning',
287
+ fix: 'Remove (implementation detail)'
288
+ },
289
+ {
290
+ name: 'Skill routing for inter-phase (invoke_skill(skill=...)',
291
+ regex: /Skill\(skill=/g,
292
+ severity: 'error',
293
+ fix: 'Replace with direct read_file("phases/0N-xxx.md")'
294
+ },
295
+ {
296
+ name: 'CLI flag definitions (--flag)',
297
+ regex: /^\s*-\w,\s+--\w+\s+/gm,
298
+ severity: 'warning',
299
+ fix: 'Move flag definitions to SKILL.md Interactive Preference Collection'
300
+ }
301
+ ];
302
+
303
+ for (const phase of config.phases) {
304
+ const filename = `${String(phase.number).padStart(2, '0')}-${phase.slug}.md`;
305
+ const filepath = `${skillDir}/phases/${filename}`;
306
+ if (!fileExists(filepath)) continue;
307
+
308
+ const content = read_file(filepath);
309
+
310
+ for (const pattern of prohibitedPatterns) {
311
+ const matches = content.match(pattern.regex);
312
+ if (matches && matches.length > 0) {
313
+ const msg = `Phase ${phase.number} (${filename}): ${pattern.name} found (${matches.length} occurrence(s)). Fix: ${pattern.fix}`;
314
+ if (pattern.severity === 'error') {
315
+ results.errors.push(msg);
316
+ } else {
317
+ results.warnings.push(msg);
318
+ }
319
+ }
320
+ }
321
+ }
322
+
323
+ if (results.errors.length === 0 && results.warnings.length === 0) {
324
+ results.info.push('Phase file hygiene: All phase files clean ✓');
325
+ }
326
+
327
+ return results;
328
+ }
329
+ ```
330
+
331
+ ## Step 4.7: Aggregate Results and Report
332
+
333
+ ```javascript
334
+ function generateValidationReport(config) {
335
+ const structural = validateStructure(config);
336
+ const references = validateReferences(config);
337
+ const content = validateContentQuality(config);
338
+ const dataFlow = validateDataFlow(config);
339
+ const sections = validateSkillMdSections(config);
340
+ const hygiene = validatePhaseFileHygiene(config);
341
+
342
+ // Aggregate
343
+ const allErrors = [
344
+ ...structural.errors,
345
+ ...references.errors,
346
+ ...content.errors,
347
+ ...dataFlow.errors,
348
+ ...sections.errors,
349
+ ...hygiene.errors
350
+ ];
351
+ const allWarnings = [
352
+ ...structural.warnings,
353
+ ...references.warnings,
354
+ ...content.warnings,
355
+ ...dataFlow.warnings,
356
+ ...sections.warnings,
357
+ ...hygiene.warnings
358
+ ];
359
+ const allInfo = [
360
+ ...structural.info,
361
+ ...references.info,
362
+ ...content.info,
363
+ ...dataFlow.info,
364
+ ...sections.info,
365
+ ...hygiene.info
366
+ ];
367
+
368
+ // Quality gate
369
+ const gate = allErrors.length === 0 ? 'PASS' :
370
+ allErrors.length <= 2 ? 'REVIEW' : 'FAIL';
371
+
372
+ // Display report
373
+ const skillDir = `.claude/skills/${config.skillName}`;
374
+
375
+ console.log(`
376
+ ╔══════════════════════════════════════╗
377
+ ║ Workflow Skill Validation Report ║
378
+ ╠══════════════════════════════════════╣
379
+ ║ Skill: ${config.skillName.padEnd(28)}║
380
+ ║ Gate: ${gate.padEnd(28)}║
381
+ ╚══════════════════════════════════════╝
382
+
383
+ Structure:
384
+ ${skillDir}/
385
+ ├── SKILL.md ${fileExists(`${skillDir}/SKILL.md`) ? '✓' : '✗'}
386
+ └── phases/
387
+ ${config.phases.map(p => {
388
+ const fn = `${String(p.number).padStart(2, '0')}-${p.slug}.md`;
389
+ return ` ├── ${fn.padEnd(30)} ${fileExists(`${skillDir}/phases/${fn}`) ? '✓' : '✗'}`;
390
+ }).join('\n')}
391
+
392
+ ${allErrors.length > 0 ? `Errors (${allErrors.length}):\n${allErrors.map(e => ` ✗ ${e}`).join('\n')}` : 'Errors: None ✓'}
393
+
394
+ ${allWarnings.length > 0 ? `Warnings (${allWarnings.length}):\n${allWarnings.map(w => ` ⚠ ${w}`).join('\n')}` : 'Warnings: None ✓'}
395
+
396
+ ${allInfo.length > 0 ? `Info:\n${allInfo.map(i => ` ℹ ${i}`).join('\n')}` : ''}
397
+ `);
398
+
399
+ return { gate, errors: allErrors, warnings: allWarnings, info: allInfo };
400
+ }
401
+ ```
402
+
403
+ ## Step 4.8: Error Recovery
404
+
405
+ If validation fails, offer recovery options:
406
+
407
+ ```javascript
408
+ if (report.gate === 'FAIL') {
409
+ const recovery = ask_user({
410
+ questions: [{
411
+ question: `Validation found ${report.errors.length} errors. How to proceed?`,
412
+ header: "Recovery",
413
+ multiSelect: false,
414
+ options: [
415
+ { label: "Auto-fix", description: "Attempt automatic fixes for common issues" },
416
+ { label: "Regenerate phases", description: "Re-run Phase 3 with stricter preservation" },
417
+ { label: "Accept as-is", description: "Proceed despite errors (manual fix later)" }
418
+ ]
419
+ }]
420
+ });
421
+
422
+ if (recovery === 'Auto-fix') {
423
+ // Common auto-fixes:
424
+ // 1. Missing Next Phase links → add them
425
+ // 2. Missing Output sections → add from config
426
+ // 3. Missing Phase Reference table → generate from config
427
+ autoFixCommonIssues(config, report.errors);
428
+ // Re-validate
429
+ return generateValidationReport(config);
430
+ }
431
+ }
432
+ ```
433
+
434
+ ## Step 4.9: Integration Summary
435
+
436
+ ```javascript
437
+ function displayIntegrationSummary(config) {
438
+ console.log(`
439
+ Integration Complete:
440
+ Location: .claude/skills/${config.skillName}/
441
+ Files: ${config.phases.length + 1} (SKILL.md + ${config.phases.length} phases)
442
+
443
+ Usage:
444
+ Trigger: ${config.triggers.map(t => `"${t}"`).join(', ')}
445
+ Design Patterns Applied:
446
+ ✓ Progressive phase loading (Ref: markers)
447
+ ✓ Phase Reference Documents table
448
+ ✓ Phase file hygiene (no flag parsing, no invocation syntax)
449
+ ${config.features.hasTodoWriteSubTasks ? '✓' : '○'} track_tasks attachment/collapse
450
+ ${config.features.hasConditionalPhases ? '✓' : '○'} Conditional phase execution
451
+ ${config.features.hasAutoMode ? '✓' : '○'} Interactive preference collection (ask_user)
452
+ ${config.features.hasPostPhaseUpdates ? '✓' : '○'} Post-phase state updates
453
+ ${config.features.hasPlanningNotes ? '✓' : '○'} Accumulated planning notes
454
+
455
+ Next Steps:
456
+ 1. Review SKILL.md orchestrator logic
457
+ 2. Review each phase file for completeness
458
+ 3. Test skill invocation with trigger phrase
459
+ 4. Iterate based on execution results
460
+ `);
461
+ }
462
+ ```
463
+
464
+ ## Output
465
+
466
+ - **Report**: Validation results with quality gate (PASS/REVIEW/FAIL)
467
+ - **track_tasks**: Mark Phase 4 completed (all tasks done)
468
+
469
+ ## Completion
470
+
471
+ Workflow Skill Designer has completed. The generated skill package is ready at `.claude/skills/{skillName}/`.
@@ -139,18 +139,20 @@ S_FALLBACK:
139
139
 
140
140
  ### A_DECOMPOSE_TASKS
141
141
 
142
- Shares the decomposition contract with maestro-ralph `A_DECOMPOSE_TASKS` **reference that spec; do not duplicate the table logic here.** Condensed:
143
-
144
- 1. Classify intent breadth (broad: 重构/全面/重写/迁移/overhaul/migrate/rewrite; narrow: single file/function/bug). Skip entirely for narrow / single-step / {status,init,quick} chains
145
- 2. Broad/medium → `ask_question` ≤3 rounds: Scope (in/out) | Constraints (compat/API/perf/test bar) | Definition of Done
146
- 3. Derive `execution_criteria` (3-6 imperative rules) + `task_decomposition` (outcome sub-goals, each `done_when` objectively verifiable and mapped to a ralph evidence artifact: verification.json / review.json / uat.md / test path)
147
- 4. Write `{session_dir}/goal-checklist.md` (same template as maestro-ralph) with `ALL_GOALS_DONE` sentinel; set `goal_checklist_path`
148
- 5. Append a `{ type: "decision", decision: "post-goal-audit", retry_count: 0, max_retries: 2 }` node as the FINAL node — after the last evidence-producing step (verify/review/test), before a milestone-complete/close-out step if the chain ends with one. (Audit needs evidence artifacts to exist.) ralph-execute then dynamically grows `steps[]` for unmet sub-goals
149
- 6. **Emit the `/goal` bind prompt:**
142
+ maestro-ralph `A_DECOMPOSE_TASKS` 共享分解契约 —— 引用该规范,不重复表格。Condensed:
143
+
144
+ 1. 分类意图广度(broad: 重构/全面/重写/迁移/overhaul/migrate/rewritenarrow: 单文件/函数/bug)。narrow / 单步 / `{status,init,quick}` 链直接跳过
145
+ 2. broad/medium → `ask_question` ≤3 轮:Scopein/out)| Constraints(兼容/API/perf/test)| Definition of Done
146
+ 3. 派生 `execution_criteria`(3-6 条命令式规则)+ `task_decomposition`(outcome 子目标,`done_when` 客观可校验,绑定到 ralph 产物:verification.json / review.json / uat.md / test path
147
+ 4. **status.json 为唯一真源**:写入 `boundary_contract` / `execution_criteria` / `task_decomposition` / `goal_checklist_path`;从 status.json 投影渲染 `{session_dir}/goal-checklist.md`(同 maestro-ralph Sync Rule,含 Resume 区块指向 `/maestro-ralph continue`)
148
+ 5. 在链路末尾(evidence 产出步骤之后、milestone-complete/close-out 之前)追加 `{ type: "decision", decision: "post-goal-audit", retry_count: 0, max_retries: 2 }`。ralph-execute 在该节点动态生长 `steps[]` 以收敛未达成子目标
149
+ 6. **输出 `/goal` 绑定提示词(参考文档 + 内嵌 ralph 调用):**
150
150
  ```
151
- 📋 任务分解完成。复制下面一行设定目标(推荐):
152
- /goal 当 {session_dir}/goal-checklist.md 中子目标全 [x] 且含 ALL_GOALS_DONE 时达成;否则按执行准则继续推进且不越边界契约
151
+ 📋 任务分解完成。复制下面一行设定目标,会话在子目标全部达成前不停:
152
+
153
+ /goal 目标达成条件: {session_dir}/status.json 中 task_decomposition[*].status 全部为 "done"(等价: {session_dir}/goal-checklist.md 末尾含 ALL_GOALS_DONE)。未达成时: 阅读 {session_dir}/goal-checklist.md 取得"执行准则/边界契约/子目标"作为行动手册, 然后调用 /maestro-ralph continue 推进下一步; 严禁手动执行 skill 或越界。
153
154
  ```
155
+ `/goal` 仅用户可输入;判据以 status.json 为权威,哨兵为等价信号。
154
156
 
155
157
  ### A_CREATE_SESSION
156
158
 
@@ -208,7 +210,7 @@ Unlisted commands have no auto flags.
208
210
 
209
211
  - [ ] Intent classified with task_type, complexity, clarity_score
210
212
  - [ ] Broad lifecycle intents decomposed (S_DECOMPOSE, ≤3 boundary questions) sharing maestro-ralph contract; narrow/single-step skip
211
- - [ ] Decomposition writes additive block + goal-checklist.md + post-goal-audit node; emits /goal bind prompt (no self-call, no phantom create_goal)
213
+ - [ ] status.json 为唯一真源;goal-checklist.md 为投影视图(Resume 区块内嵌 `/maestro-ralph continue`);post-goal-audit 节点追加;/goal 提示词内含"读 checklist + /maestro-ralph continue"双重指引
212
214
  - [ ] Chain selected and confirmed (or auto-confirmed)
213
215
  - [ ] Session dir created with status.json before execution; decomposition fields additive-only
214
216
  - [ ] Tracking via TodoWrite (Claude); status.json steps[] grown dynamically by ralph-execute post-goal-audit