claude-code-workflow 7.2.23 → 7.2.24

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 (181) hide show
  1. package/.codex/skills/team-arch-opt/SKILL.md +242 -175
  2. package/.codex/skills/team-arch-opt/roles/analyzer/role.md +78 -78
  3. package/.codex/skills/team-arch-opt/roles/coordinator/commands/analyze.md +57 -57
  4. package/.codex/skills/team-arch-opt/roles/coordinator/commands/monitor.md +246 -204
  5. package/.codex/skills/team-arch-opt/roles/coordinator/role.md +196 -184
  6. package/.codex/skills/team-arch-opt/roles/designer/role.md +115 -115
  7. package/.codex/skills/team-arch-opt/roles/refactorer/role.md +102 -102
  8. package/.codex/skills/team-arch-opt/roles/reviewer/role.md +111 -111
  9. package/.codex/skills/team-arch-opt/roles/validator/role.md +115 -115
  10. package/.codex/skills/team-arch-opt/specs/pipelines.md +102 -102
  11. package/.codex/skills/team-brainstorm/SKILL.md +72 -4
  12. package/.codex/skills/team-brainstorm/roles/challenger/role.md +61 -61
  13. package/.codex/skills/team-brainstorm/roles/coordinator/commands/analyze.md +58 -58
  14. package/.codex/skills/team-brainstorm/roles/coordinator/commands/monitor.md +212 -171
  15. package/.codex/skills/team-brainstorm/roles/coordinator/role.md +172 -160
  16. package/.codex/skills/team-brainstorm/roles/evaluator/role.md +56 -56
  17. package/.codex/skills/team-brainstorm/roles/ideator/role.md +69 -69
  18. package/.codex/skills/team-brainstorm/roles/synthesizer/role.md +57 -57
  19. package/.codex/skills/team-brainstorm/specs/pipelines.md +72 -72
  20. package/.codex/skills/team-coordinate/SKILL.md +71 -3
  21. package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +45 -5
  22. package/.codex/skills/team-coordinate/roles/coordinator/role.md +402 -389
  23. package/.codex/skills/team-coordinate/specs/knowledge-transfer.md +111 -111
  24. package/.codex/skills/team-coordinate/specs/pipelines.md +97 -97
  25. package/.codex/skills/team-coordinate/specs/quality-gates.md +112 -112
  26. package/.codex/skills/team-designer/SKILL.md +153 -153
  27. package/.codex/skills/team-designer/phases/01-requirements-analysis.md +250 -250
  28. package/.codex/skills/team-designer/phases/02-scaffold-generation.md +228 -228
  29. package/.codex/skills/team-designer/phases/03-content-generation.md +330 -330
  30. package/.codex/skills/team-designer/phases/04-validation.md +320 -320
  31. package/.codex/skills/team-executor/SKILL.md +29 -2
  32. package/.codex/skills/team-executor/roles/executor/commands/monitor.md +23 -15
  33. package/.codex/skills/team-frontend/SKILL.md +77 -3
  34. package/.codex/skills/team-frontend/roles/analyst/role.md +92 -92
  35. package/.codex/skills/team-frontend/roles/architect/role.md +86 -86
  36. package/.codex/skills/team-frontend/roles/coordinator/commands/analyze.md +52 -52
  37. package/.codex/skills/team-frontend/roles/coordinator/commands/monitor.md +222 -188
  38. package/.codex/skills/team-frontend/roles/coordinator/role.md +189 -177
  39. package/.codex/skills/team-frontend/roles/developer/role.md +93 -93
  40. package/.codex/skills/team-frontend/roles/qa/role.md +79 -79
  41. package/.codex/skills/team-frontend/specs/pipelines.md +76 -76
  42. package/.codex/skills/team-frontend-debug/SKILL.md +66 -3
  43. package/.codex/skills/team-frontend-debug/roles/analyzer/role.md +208 -208
  44. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +174 -174
  45. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/dispatch.md +198 -198
  46. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/monitor.md +177 -143
  47. package/.codex/skills/team-frontend-debug/roles/coordinator/role.md +164 -152
  48. package/.codex/skills/team-frontend-debug/roles/fixer/role.md +147 -147
  49. package/.codex/skills/team-frontend-debug/roles/reproducer/role.md +147 -147
  50. package/.codex/skills/team-frontend-debug/roles/tester/role.md +231 -231
  51. package/.codex/skills/team-frontend-debug/roles/verifier/role.md +172 -172
  52. package/.codex/skills/team-frontend-debug/specs/debug-tools.md +215 -215
  53. package/.codex/skills/team-frontend-debug/specs/pipelines.md +94 -94
  54. package/.codex/skills/team-issue/SKILL.md +83 -4
  55. package/.codex/skills/team-issue/roles/coordinator/commands/analyze.md +64 -64
  56. package/.codex/skills/team-issue/roles/coordinator/commands/dispatch.md +273 -273
  57. package/.codex/skills/team-issue/roles/coordinator/commands/monitor.md +235 -194
  58. package/.codex/skills/team-issue/roles/coordinator/role.md +206 -194
  59. package/.codex/skills/team-issue/roles/explorer/role.md +94 -94
  60. package/.codex/skills/team-issue/roles/implementer/role.md +87 -87
  61. package/.codex/skills/team-issue/roles/integrator/role.md +84 -84
  62. package/.codex/skills/team-issue/roles/planner/role.md +81 -81
  63. package/.codex/skills/team-issue/roles/reviewer/role.md +86 -86
  64. package/.codex/skills/team-issue/specs/pipelines.md +124 -124
  65. package/.codex/skills/team-iterdev/SKILL.md +64 -3
  66. package/.codex/skills/team-iterdev/roles/architect/role.md +65 -65
  67. package/.codex/skills/team-iterdev/roles/coordinator/commands/analyze.md +62 -62
  68. package/.codex/skills/team-iterdev/roles/coordinator/commands/monitor.md +227 -186
  69. package/.codex/skills/team-iterdev/roles/coordinator/role.md +193 -181
  70. package/.codex/skills/team-iterdev/roles/developer/role.md +74 -74
  71. package/.codex/skills/team-iterdev/roles/reviewer/role.md +66 -66
  72. package/.codex/skills/team-iterdev/roles/tester/role.md +88 -88
  73. package/.codex/skills/team-iterdev/specs/pipelines.md +94 -94
  74. package/.codex/skills/team-lifecycle-v4/MIGRATION-PLAN.md +6 -6
  75. package/.codex/skills/team-lifecycle-v4/SKILL.md +305 -242
  76. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +1 -1
  77. package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +66 -24
  78. package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +13 -1
  79. package/.codex/skills/team-lifecycle-v4/roles/supervisor/role.md +1 -1
  80. package/.codex/skills/team-lifecycle-v4/templates/architecture.md +254 -254
  81. package/.codex/skills/team-lifecycle-v4/templates/epics.md +196 -196
  82. package/.codex/skills/team-lifecycle-v4/templates/product-brief.md +133 -133
  83. package/.codex/skills/team-lifecycle-v4/templates/requirements.md +224 -224
  84. package/.codex/skills/team-perf-opt/SKILL.md +68 -3
  85. package/.codex/skills/team-perf-opt/roles/benchmarker/role.md +89 -89
  86. package/.codex/skills/team-perf-opt/roles/coordinator/commands/analyze.md +61 -61
  87. package/.codex/skills/team-perf-opt/roles/coordinator/commands/monitor.md +35 -1
  88. package/.codex/skills/team-perf-opt/roles/coordinator/role.md +179 -167
  89. package/.codex/skills/team-perf-opt/roles/optimizer/role.md +97 -97
  90. package/.codex/skills/team-perf-opt/roles/profiler/role.md +73 -73
  91. package/.codex/skills/team-perf-opt/roles/reviewer/role.md +75 -75
  92. package/.codex/skills/team-perf-opt/roles/strategist/role.md +94 -94
  93. package/.codex/skills/team-perf-opt/specs/pipelines.md +65 -65
  94. package/.codex/skills/team-planex/SKILL.md +65 -3
  95. package/.codex/skills/team-planex/roles/coordinator/commands/analyze.md +52 -52
  96. package/.codex/skills/team-planex/roles/coordinator/commands/monitor.md +210 -164
  97. package/.codex/skills/team-planex/roles/coordinator/role.md +171 -159
  98. package/.codex/skills/team-planex/roles/executor/role.md +91 -91
  99. package/.codex/skills/team-planex/roles/planner/role.md +112 -112
  100. package/.codex/skills/team-planex/specs/pipelines.md +93 -93
  101. package/.codex/skills/team-quality-assurance/SKILL.md +60 -3
  102. package/.codex/skills/team-quality-assurance/roles/analyst/role.md +80 -80
  103. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -72
  104. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +108 -108
  105. package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +243 -209
  106. package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +176 -164
  107. package/.codex/skills/team-quality-assurance/roles/executor/role.md +66 -66
  108. package/.codex/skills/team-quality-assurance/roles/generator/role.md +68 -68
  109. package/.codex/skills/team-quality-assurance/roles/scout/role.md +67 -67
  110. package/.codex/skills/team-quality-assurance/roles/strategist/role.md +71 -71
  111. package/.codex/skills/team-quality-assurance/specs/pipelines.md +115 -115
  112. package/.codex/skills/team-review/SKILL.md +58 -3
  113. package/.codex/skills/team-review/roles/coordinator/commands/analyze.md +71 -71
  114. package/.codex/skills/team-review/roles/coordinator/commands/dispatch.md +90 -90
  115. package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +225 -185
  116. package/.codex/skills/team-review/roles/coordinator/role.md +175 -163
  117. package/.codex/skills/team-review/roles/fixer/role.md +76 -76
  118. package/.codex/skills/team-review/roles/reviewer/role.md +68 -68
  119. package/.codex/skills/team-review/roles/scanner/role.md +71 -71
  120. package/.codex/skills/team-review/specs/pipelines.md +102 -102
  121. package/.codex/skills/team-roadmap-dev/SKILL.md +55 -3
  122. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/analyze.md +61 -61
  123. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/monitor.md +502 -468
  124. package/.codex/skills/team-roadmap-dev/roles/coordinator/role.md +335 -322
  125. package/.codex/skills/team-roadmap-dev/roles/executor/role.md +71 -71
  126. package/.codex/skills/team-roadmap-dev/roles/planner/role.md +76 -76
  127. package/.codex/skills/team-roadmap-dev/roles/verifier/role.md +74 -74
  128. package/.codex/skills/team-roadmap-dev/specs/pipelines.md +93 -93
  129. package/.codex/skills/team-tech-debt/SKILL.md +56 -3
  130. package/.codex/skills/team-tech-debt/roles/assessor/role.md +69 -69
  131. package/.codex/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -47
  132. package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +272 -231
  133. package/.codex/skills/team-tech-debt/roles/coordinator/role.md +172 -160
  134. package/.codex/skills/team-tech-debt/roles/executor/role.md +76 -76
  135. package/.codex/skills/team-tech-debt/roles/planner/role.md +69 -69
  136. package/.codex/skills/team-tech-debt/roles/scanner/role.md +82 -82
  137. package/.codex/skills/team-tech-debt/roles/validator/role.md +75 -75
  138. package/.codex/skills/team-tech-debt/specs/pipelines.md +47 -47
  139. package/.codex/skills/team-testing/SKILL.md +72 -3
  140. package/.codex/skills/team-testing/roles/analyst/role.md +95 -95
  141. package/.codex/skills/team-testing/roles/coordinator/commands/analyze.md +70 -70
  142. package/.codex/skills/team-testing/roles/coordinator/commands/dispatch.md +106 -106
  143. package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +283 -242
  144. package/.codex/skills/team-testing/roles/coordinator/role.md +184 -172
  145. package/.codex/skills/team-testing/roles/executor/role.md +96 -96
  146. package/.codex/skills/team-testing/roles/generator/role.md +95 -95
  147. package/.codex/skills/team-testing/roles/strategist/role.md +83 -83
  148. package/.codex/skills/team-testing/specs/pipelines.md +101 -101
  149. package/.codex/skills/team-uidesign/SKILL.md +65 -3
  150. package/.codex/skills/team-uidesign/roles/coordinator/commands/analyze.md +59 -59
  151. package/.codex/skills/team-uidesign/roles/coordinator/commands/dispatch.md +156 -156
  152. package/.codex/skills/team-uidesign/roles/coordinator/commands/monitor.md +234 -194
  153. package/.codex/skills/team-uidesign/roles/coordinator/role.md +211 -199
  154. package/.codex/skills/team-uidesign/roles/designer/role.md +69 -69
  155. package/.codex/skills/team-uidesign/roles/implementer/role.md +72 -72
  156. package/.codex/skills/team-uidesign/roles/researcher/role.md +82 -82
  157. package/.codex/skills/team-uidesign/roles/reviewer/role.md +67 -67
  158. package/.codex/skills/team-uidesign/specs/pipelines.md +76 -76
  159. package/.codex/skills/team-ultra-analyze/SKILL.md +73 -3
  160. package/.codex/skills/team-ultra-analyze/roles/analyst/role.md +90 -90
  161. package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/analyze.md +73 -73
  162. package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +50 -9
  163. package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +255 -243
  164. package/.codex/skills/team-ultra-analyze/roles/discussant/role.md +104 -104
  165. package/.codex/skills/team-ultra-analyze/roles/explorer/role.md +74 -74
  166. package/.codex/skills/team-ultra-analyze/roles/synthesizer/role.md +78 -78
  167. package/.codex/skills/team-ultra-analyze/specs/pipelines.md +64 -64
  168. package/.codex/skills/team-ux-improve/SKILL.md +64 -3
  169. package/.codex/skills/team-ux-improve/roles/coordinator/commands/analyze.md +62 -62
  170. package/.codex/skills/team-ux-improve/roles/coordinator/commands/dispatch.md +233 -233
  171. package/.codex/skills/team-ux-improve/roles/coordinator/commands/monitor.md +195 -160
  172. package/.codex/skills/team-ux-improve/roles/coordinator/role.md +170 -158
  173. package/.codex/skills/team-ux-improve/roles/designer/role.md +122 -122
  174. package/.codex/skills/team-ux-improve/roles/diagnoser/role.md +93 -93
  175. package/.codex/skills/team-ux-improve/roles/explorer/role.md +77 -77
  176. package/.codex/skills/team-ux-improve/roles/implementer/role.md +102 -102
  177. package/.codex/skills/team-ux-improve/roles/scanner/role.md +93 -93
  178. package/.codex/skills/team-ux-improve/roles/tester/role.md +84 -84
  179. package/.codex/skills/team-ux-improve/specs/pipelines.md +54 -54
  180. package/README.md +1 -0
  181. package/package.json +1 -1
@@ -1,320 +1,320 @@
1
- # Phase 4: Validation
2
-
3
- Validate the generated team skill package for structural completeness, reference integrity, role consistency, and team-worker compatibility.
4
-
5
- ## Objective
6
-
7
- - Verify all required files exist
8
- - Validate SKILL.md role registry matches actual role files
9
- - Check role.md frontmatter format for team-worker compatibility
10
- - Verify pipeline task references match existing roles
11
- - Report validation results
12
-
13
- ## Step 4.1: Structural Validation
14
-
15
- ```javascript
16
- function validateStructure(teamConfig) {
17
- const skillDir = `.claude/skills/${teamConfig.skillName}`;
18
- const results = { errors: [], warnings: [], info: [] };
19
-
20
- // Check SKILL.md exists
21
- if (!fileExists(`${skillDir}/SKILL.md`)) {
22
- results.errors.push('SKILL.md not found');
23
- }
24
-
25
- // Check coordinator structure
26
- if (!fileExists(`${skillDir}/roles/coordinator/role.md`)) {
27
- results.errors.push('Coordinator role.md not found');
28
- }
29
- for (const cmd of ['analyze', 'dispatch', 'monitor']) {
30
- if (!fileExists(`${skillDir}/roles/coordinator/commands/${cmd}.md`)) {
31
- results.errors.push(`Coordinator command ${cmd}.md not found`);
32
- }
33
- }
34
-
35
- // Check worker roles
36
- for (const role of teamConfig.roles.filter(r => r.name !== 'coordinator')) {
37
- if (!fileExists(`${skillDir}/roles/${role.name}/role.md`)) {
38
- results.errors.push(`Worker role.md not found: ${role.name}`);
39
- }
40
- if (role.hasCommands) {
41
- for (const cmd of role.commands) {
42
- if (!fileExists(`${skillDir}/roles/${role.name}/commands/${cmd}.md`)) {
43
- results.errors.push(`Worker command not found: ${role.name}/commands/${cmd}.md`);
44
- }
45
- }
46
- }
47
- }
48
-
49
- // Check specs
50
- if (!fileExists(`${skillDir}/specs/pipelines.md`)) {
51
- results.errors.push('specs/pipelines.md not found');
52
- }
53
-
54
- return results;
55
- }
56
- ```
57
-
58
- ## Step 4.2: SKILL.md Content Validation
59
-
60
- ```javascript
61
- function validateSkillMd(teamConfig) {
62
- const skillDir = `.claude/skills/${teamConfig.skillName}`;
63
- const results = { errors: [], warnings: [], info: [] };
64
- const skillMd = Read(`${skillDir}/SKILL.md`);
65
-
66
- // Required sections
67
- const requiredSections = [
68
- 'Role Registry', 'Role Router', 'Shared Constants',
69
- 'Worker Spawn Template', 'User Commands', 'Session Directory'
70
- ];
71
- for (const section of requiredSections) {
72
- if (!skillMd.includes(section)) {
73
- results.errors.push(`SKILL.md missing section: ${section}`);
74
- }
75
- }
76
-
77
- // Verify role registry completeness
78
- for (const role of teamConfig.roles) {
79
- if (!skillMd.includes(role.path || `roles/${role.name}/role.md`)) {
80
- results.errors.push(`Role registry missing path for: ${role.name}`);
81
- }
82
- }
83
-
84
- // Verify session prefix
85
- if (!skillMd.includes(teamConfig.sessionPrefix)) {
86
- results.warnings.push(`Session prefix ${teamConfig.sessionPrefix} not found in SKILL.md`);
87
- }
88
-
89
- // Verify NO beat model content in SKILL.md
90
- const beatModelPatterns = [
91
- 'ONE_STEP_PER_INVOCATION',
92
- 'spawn-and-stop',
93
- 'SPAWN_MODE',
94
- 'handleCallback',
95
- 'handleSpawnNext'
96
- ];
97
- for (const pattern of beatModelPatterns) {
98
- if (skillMd.includes(pattern)) {
99
- results.errors.push(`SKILL.md contains beat model content: ${pattern} (should be in coordinator only)`);
100
- }
101
- }
102
-
103
- return results;
104
- }
105
- ```
106
-
107
- ## Step 4.3: Role Frontmatter Validation
108
-
109
- Verify role.md files have correct YAML frontmatter for team-worker agent compatibility:
110
-
111
- ```javascript
112
- function validateRoleFrontmatter(teamConfig) {
113
- const skillDir = `.claude/skills/${teamConfig.skillName}`;
114
- const results = { errors: [], warnings: [], info: [] };
115
-
116
- for (const role of teamConfig.roles.filter(r => r.name !== 'coordinator')) {
117
- const roleMd = Read(`${skillDir}/roles/${role.name}/role.md`);
118
-
119
- // Check frontmatter exists
120
- if (!roleMd.startsWith('---')) {
121
- results.errors.push(`${role.name}/role.md missing YAML frontmatter`);
122
- continue;
123
- }
124
-
125
- // Extract frontmatter
126
- const fmMatch = roleMd.match(/^---\n([\s\S]*?)\n---/);
127
- if (!fmMatch) {
128
- results.errors.push(`${role.name}/role.md malformed frontmatter`);
129
- continue;
130
- }
131
-
132
- const fm = fmMatch[1];
133
-
134
- // Required fields
135
- if (!fm.includes(`role: ${role.name}`)) {
136
- results.errors.push(`${role.name}/role.md frontmatter missing 'role: ${role.name}'`);
137
- }
138
- if (!fm.includes(`prefix: ${role.prefix}`)) {
139
- results.errors.push(`${role.name}/role.md frontmatter missing 'prefix: ${role.prefix}'`);
140
- }
141
- if (!fm.includes(`inner_loop: ${role.inner_loop}`)) {
142
- results.warnings.push(`${role.name}/role.md frontmatter missing 'inner_loop: ${role.inner_loop}'`);
143
- }
144
- if (!fm.includes('message_types:')) {
145
- results.warnings.push(`${role.name}/role.md frontmatter missing 'message_types'`);
146
- }
147
- }
148
-
149
- return results;
150
- }
151
- ```
152
-
153
- ## Step 4.4: Pipeline Consistency
154
-
155
- ```javascript
156
- function validatePipelines(teamConfig) {
157
- const skillDir = `.claude/skills/${teamConfig.skillName}`;
158
- const results = { errors: [], warnings: [], info: [] };
159
-
160
- // Check every role referenced in pipelines exists
161
- const definedRoles = new Set(teamConfig.roles.map(r => r.name));
162
-
163
- for (const pipeline of teamConfig.pipelines) {
164
- for (const task of pipeline.tasks) {
165
- if (!definedRoles.has(task.role)) {
166
- results.errors.push(
167
- `Pipeline '${pipeline.name}' task ${task.id} references undefined role: ${task.role}`
168
- );
169
- }
170
- }
171
-
172
- // Check for circular dependencies
173
- const visited = new Set();
174
- const stack = new Set();
175
- for (const task of pipeline.tasks) {
176
- if (hasCycle(task, pipeline.tasks, visited, stack)) {
177
- results.errors.push(`Pipeline '${pipeline.name}' has circular dependency involving ${task.id}`);
178
- }
179
- }
180
- }
181
-
182
- // Verify specs/pipelines.md contains all pipelines
183
- const pipelinesMd = Read(`${skillDir}/specs/pipelines.md`);
184
- for (const pipeline of teamConfig.pipelines) {
185
- if (!pipelinesMd.includes(pipeline.name)) {
186
- results.warnings.push(`specs/pipelines.md missing pipeline: ${pipeline.name}`);
187
- }
188
- }
189
-
190
- return results;
191
- }
192
- ```
193
-
194
- ## Step 4.5: Commands Distribution Validation
195
-
196
- ```javascript
197
- function validateCommandsDistribution(teamConfig) {
198
- const skillDir = `.claude/skills/${teamConfig.skillName}`;
199
- const results = { errors: [], warnings: [], info: [] };
200
-
201
- for (const role of teamConfig.roles.filter(r => r.name !== 'coordinator')) {
202
- if (role.hasCommands) {
203
- // Verify commands/ directory exists and has files
204
- const cmdDir = `${skillDir}/roles/${role.name}/commands`;
205
- if (role.commands.length < 2) {
206
- results.warnings.push(
207
- `${role.name} has commands/ but only ${role.commands.length} command(s) — consider inline`
208
- );
209
- }
210
- // Verify role.md references commands
211
- const roleMd = Read(`${skillDir}/roles/${role.name}/role.md`);
212
- for (const cmd of role.commands) {
213
- if (!roleMd.includes(`commands/${cmd}.md`)) {
214
- results.warnings.push(
215
- `${role.name}/role.md doesn't reference commands/${cmd}.md`
216
- );
217
- }
218
- }
219
- } else {
220
- // Verify no commands/ directory exists
221
- const cmdDir = `${skillDir}/roles/${role.name}/commands`;
222
- if (directoryExists(cmdDir)) {
223
- results.warnings.push(
224
- `${role.name} is inline but has commands/ directory`
225
- );
226
- }
227
- }
228
- }
229
-
230
- return results;
231
- }
232
- ```
233
-
234
- ## Step 4.6: Aggregate Results and Report
235
-
236
- ```javascript
237
- function generateValidationReport(teamConfig) {
238
- const structural = validateStructure(teamConfig);
239
- const skillMd = validateSkillMd(teamConfig);
240
- const frontmatter = validateRoleFrontmatter(teamConfig);
241
- const pipelines = validatePipelines(teamConfig);
242
- const commands = validateCommandsDistribution(teamConfig);
243
-
244
- const allErrors = [
245
- ...structural.errors, ...skillMd.errors,
246
- ...frontmatter.errors, ...pipelines.errors, ...commands.errors
247
- ];
248
- const allWarnings = [
249
- ...structural.warnings, ...skillMd.warnings,
250
- ...frontmatter.warnings, ...pipelines.warnings, ...commands.warnings
251
- ];
252
-
253
- const gate = allErrors.length === 0 ? 'PASS' :
254
- allErrors.length <= 2 ? 'REVIEW' : 'FAIL';
255
-
256
- const skillDir = `.claude/skills/${teamConfig.skillName}`;
257
-
258
- console.log(`
259
- ╔══════════════════════════════════════╗
260
- ║ Team Skill Validation Report ║
261
- ╠══════════════════════════════════════╣
262
- ║ Skill: ${teamConfig.skillName.padEnd(28)}║
263
- ║ Gate: ${gate.padEnd(28)}║
264
- ╚══════════════════════════════════════╝
265
-
266
- Structure:
267
- ${skillDir}/
268
- ├── SKILL.md ✓
269
- ├── roles/
270
- │ ├── coordinator/
271
- │ │ ├── role.md ✓
272
- │ │ └── commands/ (analyze, dispatch, monitor)
273
- ${teamConfig.roles.filter(r => r.name !== 'coordinator').map(r => {
274
- const structure = r.hasCommands
275
- ? ` │ ├── ${r.name}/ (role.md + commands/)`
276
- : ` │ ├── ${r.name}/role.md`;
277
- return `${structure.padEnd(50)}✓`;
278
- }).join('\n')}
279
- ├── specs/
280
- │ └── pipelines.md ✓
281
- └── templates/ ${teamConfig.templates.length > 0 ? '✓' : '(empty)'}
282
-
283
- ${allErrors.length > 0 ? `Errors (${allErrors.length}):\n${allErrors.map(e => ` ✗ ${e}`).join('\n')}` : 'Errors: None ✓'}
284
-
285
- ${allWarnings.length > 0 ? `Warnings (${allWarnings.length}):\n${allWarnings.map(w => ` ⚠ ${w}`).join('\n')}` : 'Warnings: None ✓'}
286
-
287
- Usage:
288
- Skill(skill="${teamConfig.skillName}", args="<task description>")
289
- `);
290
-
291
- return { gate, errors: allErrors, warnings: allWarnings };
292
- }
293
- ```
294
-
295
- ## Step 4.7: Error Recovery
296
-
297
- ```javascript
298
- if (report.gate === 'FAIL') {
299
- const recovery = request_user_input({
300
- prompt: `Validation found ${report.errors.length} errors. How to proceed?\n\nOptions:\n1. Auto-fix - Attempt automatic fixes (missing files, frontmatter)\n2. Regenerate - Re-run Phase 3 with fixes\n3. Accept as-is - Manual fix later`
301
- });
302
- }
303
- ```
304
-
305
- ## Output
306
-
307
- - **Report**: Validation results with quality gate (PASS/REVIEW/FAIL)
308
- - **Completion**: Team skill package ready at `.claude/skills/${teamConfig.skillName}/`
309
-
310
- ## Completion
311
-
312
- Team Skill Designer has completed. The generated team skill is ready for use.
313
-
314
- ```
315
- Next Steps:
316
- 1. Review SKILL.md router for correctness
317
- 2. Review each role.md for domain accuracy
318
- 3. Test: Skill(skill="${teamConfig.skillName}", args="<test task>")
319
- 4. Iterate based on execution results
320
- ```
1
+ # Phase 4: Validation
2
+
3
+ Validate the generated team skill package for structural completeness, reference integrity, role consistency, and team-worker compatibility.
4
+
5
+ ## Objective
6
+
7
+ - Verify all required files exist
8
+ - Validate SKILL.md role registry matches actual role files
9
+ - Check role.md frontmatter format for team-worker compatibility
10
+ - Verify pipeline task references match existing roles
11
+ - Report validation results
12
+
13
+ ## Step 4.1: Structural Validation
14
+
15
+ ```javascript
16
+ function validateStructure(teamConfig) {
17
+ const skillDir = `.claude/skills/${teamConfig.skillName}`;
18
+ const results = { errors: [], warnings: [], info: [] };
19
+
20
+ // Check SKILL.md exists
21
+ if (!fileExists(`${skillDir}/SKILL.md`)) {
22
+ results.errors.push('SKILL.md not found');
23
+ }
24
+
25
+ // Check coordinator structure
26
+ if (!fileExists(`${skillDir}/roles/coordinator/role.md`)) {
27
+ results.errors.push('Coordinator role.md not found');
28
+ }
29
+ for (const cmd of ['analyze', 'dispatch', 'monitor']) {
30
+ if (!fileExists(`${skillDir}/roles/coordinator/commands/${cmd}.md`)) {
31
+ results.errors.push(`Coordinator command ${cmd}.md not found`);
32
+ }
33
+ }
34
+
35
+ // Check worker roles
36
+ for (const role of teamConfig.roles.filter(r => r.name !== 'coordinator')) {
37
+ if (!fileExists(`${skillDir}/roles/${role.name}/role.md`)) {
38
+ results.errors.push(`Worker role.md not found: ${role.name}`);
39
+ }
40
+ if (role.hasCommands) {
41
+ for (const cmd of role.commands) {
42
+ if (!fileExists(`${skillDir}/roles/${role.name}/commands/${cmd}.md`)) {
43
+ results.errors.push(`Worker command not found: ${role.name}/commands/${cmd}.md`);
44
+ }
45
+ }
46
+ }
47
+ }
48
+
49
+ // Check specs
50
+ if (!fileExists(`${skillDir}/specs/pipelines.md`)) {
51
+ results.errors.push('specs/pipelines.md not found');
52
+ }
53
+
54
+ return results;
55
+ }
56
+ ```
57
+
58
+ ## Step 4.2: SKILL.md Content Validation
59
+
60
+ ```javascript
61
+ function validateSkillMd(teamConfig) {
62
+ const skillDir = `.claude/skills/${teamConfig.skillName}`;
63
+ const results = { errors: [], warnings: [], info: [] };
64
+ const skillMd = Read(`${skillDir}/SKILL.md`);
65
+
66
+ // Required sections
67
+ const requiredSections = [
68
+ 'Role Registry', 'Role Router', 'Shared Constants',
69
+ 'Worker Spawn Template', 'User Commands', 'Session Directory'
70
+ ];
71
+ for (const section of requiredSections) {
72
+ if (!skillMd.includes(section)) {
73
+ results.errors.push(`SKILL.md missing section: ${section}`);
74
+ }
75
+ }
76
+
77
+ // Verify role registry completeness
78
+ for (const role of teamConfig.roles) {
79
+ if (!skillMd.includes(role.path || `roles/${role.name}/role.md`)) {
80
+ results.errors.push(`Role registry missing path for: ${role.name}`);
81
+ }
82
+ }
83
+
84
+ // Verify session prefix
85
+ if (!skillMd.includes(teamConfig.sessionPrefix)) {
86
+ results.warnings.push(`Session prefix ${teamConfig.sessionPrefix} not found in SKILL.md`);
87
+ }
88
+
89
+ // Verify NO beat model content in SKILL.md
90
+ const beatModelPatterns = [
91
+ 'ONE_STEP_PER_INVOCATION',
92
+ 'spawn-and-stop',
93
+ 'SPAWN_MODE',
94
+ 'handleCallback',
95
+ 'handleSpawnNext'
96
+ ];
97
+ for (const pattern of beatModelPatterns) {
98
+ if (skillMd.includes(pattern)) {
99
+ results.errors.push(`SKILL.md contains beat model content: ${pattern} (should be in coordinator only)`);
100
+ }
101
+ }
102
+
103
+ return results;
104
+ }
105
+ ```
106
+
107
+ ## Step 4.3: Role Frontmatter Validation
108
+
109
+ Verify role.md files have correct YAML frontmatter for team-worker agent compatibility:
110
+
111
+ ```javascript
112
+ function validateRoleFrontmatter(teamConfig) {
113
+ const skillDir = `.claude/skills/${teamConfig.skillName}`;
114
+ const results = { errors: [], warnings: [], info: [] };
115
+
116
+ for (const role of teamConfig.roles.filter(r => r.name !== 'coordinator')) {
117
+ const roleMd = Read(`${skillDir}/roles/${role.name}/role.md`);
118
+
119
+ // Check frontmatter exists
120
+ if (!roleMd.startsWith('---')) {
121
+ results.errors.push(`${role.name}/role.md missing YAML frontmatter`);
122
+ continue;
123
+ }
124
+
125
+ // Extract frontmatter
126
+ const fmMatch = roleMd.match(/^---\n([\s\S]*?)\n---/);
127
+ if (!fmMatch) {
128
+ results.errors.push(`${role.name}/role.md malformed frontmatter`);
129
+ continue;
130
+ }
131
+
132
+ const fm = fmMatch[1];
133
+
134
+ // Required fields
135
+ if (!fm.includes(`role: ${role.name}`)) {
136
+ results.errors.push(`${role.name}/role.md frontmatter missing 'role: ${role.name}'`);
137
+ }
138
+ if (!fm.includes(`prefix: ${role.prefix}`)) {
139
+ results.errors.push(`${role.name}/role.md frontmatter missing 'prefix: ${role.prefix}'`);
140
+ }
141
+ if (!fm.includes(`inner_loop: ${role.inner_loop}`)) {
142
+ results.warnings.push(`${role.name}/role.md frontmatter missing 'inner_loop: ${role.inner_loop}'`);
143
+ }
144
+ if (!fm.includes('message_types:')) {
145
+ results.warnings.push(`${role.name}/role.md frontmatter missing 'message_types'`);
146
+ }
147
+ }
148
+
149
+ return results;
150
+ }
151
+ ```
152
+
153
+ ## Step 4.4: Pipeline Consistency
154
+
155
+ ```javascript
156
+ function validatePipelines(teamConfig) {
157
+ const skillDir = `.claude/skills/${teamConfig.skillName}`;
158
+ const results = { errors: [], warnings: [], info: [] };
159
+
160
+ // Check every role referenced in pipelines exists
161
+ const definedRoles = new Set(teamConfig.roles.map(r => r.name));
162
+
163
+ for (const pipeline of teamConfig.pipelines) {
164
+ for (const task of pipeline.tasks) {
165
+ if (!definedRoles.has(task.role)) {
166
+ results.errors.push(
167
+ `Pipeline '${pipeline.name}' task ${task.id} references undefined role: ${task.role}`
168
+ );
169
+ }
170
+ }
171
+
172
+ // Check for circular dependencies
173
+ const visited = new Set();
174
+ const stack = new Set();
175
+ for (const task of pipeline.tasks) {
176
+ if (hasCycle(task, pipeline.tasks, visited, stack)) {
177
+ results.errors.push(`Pipeline '${pipeline.name}' has circular dependency involving ${task.id}`);
178
+ }
179
+ }
180
+ }
181
+
182
+ // Verify specs/pipelines.md contains all pipelines
183
+ const pipelinesMd = Read(`${skillDir}/specs/pipelines.md`);
184
+ for (const pipeline of teamConfig.pipelines) {
185
+ if (!pipelinesMd.includes(pipeline.name)) {
186
+ results.warnings.push(`specs/pipelines.md missing pipeline: ${pipeline.name}`);
187
+ }
188
+ }
189
+
190
+ return results;
191
+ }
192
+ ```
193
+
194
+ ## Step 4.5: Commands Distribution Validation
195
+
196
+ ```javascript
197
+ function validateCommandsDistribution(teamConfig) {
198
+ const skillDir = `.claude/skills/${teamConfig.skillName}`;
199
+ const results = { errors: [], warnings: [], info: [] };
200
+
201
+ for (const role of teamConfig.roles.filter(r => r.name !== 'coordinator')) {
202
+ if (role.hasCommands) {
203
+ // Verify commands/ directory exists and has files
204
+ const cmdDir = `${skillDir}/roles/${role.name}/commands`;
205
+ if (role.commands.length < 2) {
206
+ results.warnings.push(
207
+ `${role.name} has commands/ but only ${role.commands.length} command(s) — consider inline`
208
+ );
209
+ }
210
+ // Verify role.md references commands
211
+ const roleMd = Read(`${skillDir}/roles/${role.name}/role.md`);
212
+ for (const cmd of role.commands) {
213
+ if (!roleMd.includes(`commands/${cmd}.md`)) {
214
+ results.warnings.push(
215
+ `${role.name}/role.md doesn't reference commands/${cmd}.md`
216
+ );
217
+ }
218
+ }
219
+ } else {
220
+ // Verify no commands/ directory exists
221
+ const cmdDir = `${skillDir}/roles/${role.name}/commands`;
222
+ if (directoryExists(cmdDir)) {
223
+ results.warnings.push(
224
+ `${role.name} is inline but has commands/ directory`
225
+ );
226
+ }
227
+ }
228
+ }
229
+
230
+ return results;
231
+ }
232
+ ```
233
+
234
+ ## Step 4.6: Aggregate Results and Report
235
+
236
+ ```javascript
237
+ function generateValidationReport(teamConfig) {
238
+ const structural = validateStructure(teamConfig);
239
+ const skillMd = validateSkillMd(teamConfig);
240
+ const frontmatter = validateRoleFrontmatter(teamConfig);
241
+ const pipelines = validatePipelines(teamConfig);
242
+ const commands = validateCommandsDistribution(teamConfig);
243
+
244
+ const allErrors = [
245
+ ...structural.errors, ...skillMd.errors,
246
+ ...frontmatter.errors, ...pipelines.errors, ...commands.errors
247
+ ];
248
+ const allWarnings = [
249
+ ...structural.warnings, ...skillMd.warnings,
250
+ ...frontmatter.warnings, ...pipelines.warnings, ...commands.warnings
251
+ ];
252
+
253
+ const gate = allErrors.length === 0 ? 'PASS' :
254
+ allErrors.length <= 2 ? 'REVIEW' : 'FAIL';
255
+
256
+ const skillDir = `.claude/skills/${teamConfig.skillName}`;
257
+
258
+ console.log(`
259
+ ╔══════════════════════════════════════╗
260
+ ║ Team Skill Validation Report ║
261
+ ╠══════════════════════════════════════╣
262
+ ║ Skill: ${teamConfig.skillName.padEnd(28)}║
263
+ ║ Gate: ${gate.padEnd(28)}║
264
+ ╚══════════════════════════════════════╝
265
+
266
+ Structure:
267
+ ${skillDir}/
268
+ ├── SKILL.md ✓
269
+ ├── roles/
270
+ │ ├── coordinator/
271
+ │ │ ├── role.md ✓
272
+ │ │ └── commands/ (analyze, dispatch, monitor)
273
+ ${teamConfig.roles.filter(r => r.name !== 'coordinator').map(r => {
274
+ const structure = r.hasCommands
275
+ ? ` │ ├── ${r.name}/ (role.md + commands/)`
276
+ : ` │ ├── ${r.name}/role.md`;
277
+ return `${structure.padEnd(50)}✓`;
278
+ }).join('\n')}
279
+ ├── specs/
280
+ │ └── pipelines.md ✓
281
+ └── templates/ ${teamConfig.templates.length > 0 ? '✓' : '(empty)'}
282
+
283
+ ${allErrors.length > 0 ? `Errors (${allErrors.length}):\n${allErrors.map(e => ` ✗ ${e}`).join('\n')}` : 'Errors: None ✓'}
284
+
285
+ ${allWarnings.length > 0 ? `Warnings (${allWarnings.length}):\n${allWarnings.map(w => ` ⚠ ${w}`).join('\n')}` : 'Warnings: None ✓'}
286
+
287
+ Usage:
288
+ Skill(skill="${teamConfig.skillName}", args="<task description>")
289
+ `);
290
+
291
+ return { gate, errors: allErrors, warnings: allWarnings };
292
+ }
293
+ ```
294
+
295
+ ## Step 4.7: Error Recovery
296
+
297
+ ```javascript
298
+ if (report.gate === 'FAIL') {
299
+ const recovery = request_user_input({
300
+ prompt: `Validation found ${report.errors.length} errors. How to proceed?\n\nOptions:\n1. Auto-fix - Attempt automatic fixes (missing files, frontmatter)\n2. Regenerate - Re-run Phase 3 with fixes\n3. Accept as-is - Manual fix later`
301
+ });
302
+ }
303
+ ```
304
+
305
+ ## Output
306
+
307
+ - **Report**: Validation results with quality gate (PASS/REVIEW/FAIL)
308
+ - **Completion**: Team skill package ready at `.claude/skills/${teamConfig.skillName}/`
309
+
310
+ ## Completion
311
+
312
+ Team Skill Designer has completed. The generated team skill is ready for use.
313
+
314
+ ```
315
+ Next Steps:
316
+ 1. Review SKILL.md router for correctness
317
+ 2. Review each role.md for domain accuracy
318
+ 3. Test: Skill(skill="${teamConfig.skillName}", args="<test task>")
319
+ 4. Iterate based on execution results
320
+ ```