catalyst-os 0.1.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 (75) hide show
  1. package/.catalyst/main/project-config.yaml +11 -0
  2. package/.catalyst/spec-structure.yaml +241 -0
  3. package/.catalyst/specs/spec-config.yaml +109 -0
  4. package/.catalyst/standards/coding.md +187 -0
  5. package/.catalyst/standards/git-workflow.md +181 -0
  6. package/.catalyst/standards/testing.md +185 -0
  7. package/.catalyst/workflows/approve-spec.md +413 -0
  8. package/.catalyst/workflows/build-spec.md +527 -0
  9. package/.catalyst/workflows/build-task.md +434 -0
  10. package/.catalyst/workflows/catalyze-project.md +212 -0
  11. package/.catalyst/workflows/catalyze-spec.md +265 -0
  12. package/.catalyst/workflows/validate-spec.md +388 -0
  13. package/.claude/agents/alchemist.md +84 -0
  14. package/.claude/agents/arbiter.md +142 -0
  15. package/.claude/agents/catalyst.md +102 -0
  16. package/.claude/agents/enforcer.md +62 -0
  17. package/.claude/agents/forge-master.md +318 -0
  18. package/.claude/agents/forger.md +216 -0
  19. package/.claude/agents/inquisitor.md +70 -0
  20. package/.claude/agents/necromancer.md +84 -0
  21. package/.claude/agents/oracle.md +67 -0
  22. package/.claude/agents/scout.md +74 -0
  23. package/.claude/agents/scribe.md +163 -0
  24. package/.claude/agents/seer.md +108 -0
  25. package/.claude/agents/sentinel.md +58 -0
  26. package/.claude/agents/shaper.md +85 -0
  27. package/.claude/agents/smith.md +85 -0
  28. package/.claude/agents/surveyor.md +52 -0
  29. package/.claude/agents/watcher.md +69 -0
  30. package/.claude/commands/approve-spec.md +383 -0
  31. package/.claude/commands/build-spec.md +381 -0
  32. package/.claude/commands/build-task.md +210 -0
  33. package/.claude/commands/catalyze-project.md +112 -0
  34. package/.claude/commands/catalyze-spec.md +197 -0
  35. package/.claude/commands/mission.md +48 -0
  36. package/.claude/commands/reject-spec.md +125 -0
  37. package/.claude/commands/roadmap.md +62 -0
  38. package/.claude/commands/status-spec.md +289 -0
  39. package/.claude/commands/tech-stack.md +75 -0
  40. package/.claude/commands/update-spec.md +265 -0
  41. package/.claude/commands/validate-spec.md +265 -0
  42. package/.claude/settings.local.json +13 -0
  43. package/.claude/skills/catalysts/build-orchestration/SKILL.md +54 -0
  44. package/.claude/skills/catalysts/spec-orchestration/SKILL.md +52 -0
  45. package/.claude/skills/catalysts/validation-orchestration/SKILL.md +50 -0
  46. package/.claude/skills/guardians/browser-automation/SKILL.md +58 -0
  47. package/.claude/skills/guardians/code-review/SKILL.md +60 -0
  48. package/.claude/skills/guardians/dependency-audit/SKILL.md +63 -0
  49. package/.claude/skills/guardians/e2e-test-execution/SKILL.md +52 -0
  50. package/.claude/skills/guardians/lint-checking/SKILL.md +46 -0
  51. package/.claude/skills/guardians/secret-scanning/SKILL.md +69 -0
  52. package/.claude/skills/guardians/test-fixture-creation/SKILL.md +54 -0
  53. package/.claude/skills/guardians/unit-test-writing/SKILL.md +57 -0
  54. package/.claude/skills/seekers/codebase-analysis/SKILL.md +67 -0
  55. package/.claude/skills/seekers/context7-lookup/SKILL.md +59 -0
  56. package/.claude/skills/seekers/documentation-management/SKILL.md +190 -0
  57. package/.claude/skills/seekers/figma-analysis/SKILL.md +57 -0
  58. package/.claude/skills/seekers/github-research/SKILL.md +57 -0
  59. package/.claude/skills/seekers/reddit-research/SKILL.md +55 -0
  60. package/.claude/skills/seekers/requirement-elicitation/SKILL.md +53 -0
  61. package/.claude/skills/seekers/ui-pattern-hunting/SKILL.md +62 -0
  62. package/.claude/skills/seekers/web-research/SKILL.md +61 -0
  63. package/.claude/skills/technologists/ai-integration/SKILL.md +53 -0
  64. package/.claude/skills/technologists/api-development/SKILL.md +51 -0
  65. package/.claude/skills/technologists/migration-creation/SKILL.md +58 -0
  66. package/.claude/skills/technologists/ml-pipeline/SKILL.md +54 -0
  67. package/.claude/skills/technologists/react-development/SKILL.md +61 -0
  68. package/.claude/skills/technologists/schema-design/SKILL.md +54 -0
  69. package/.claude/skills/technologists/service-implementation/SKILL.md +49 -0
  70. package/.claude/skills/technologists/task-breakdown/SKILL.md +60 -0
  71. package/.claude/skills/technologists/ui-component-building/SKILL.md +58 -0
  72. package/.claude-plugin/plugin.json +43 -0
  73. package/README.md +440 -0
  74. package/bin/install.js +174 -0
  75. package/package.json +40 -0
@@ -0,0 +1,527 @@
1
+ # /build-spec Workflow
2
+
3
+ > Implement a specification using **strict TDD**.
4
+
5
+ ---
6
+
7
+ ## Quick Reference
8
+
9
+ ```
10
+ Command: /build-spec @2026-01-11-supabase-auth
11
+ Orchestrator: Forge-Master (Opus)
12
+ Agents: Forger → Enforcer → Alchemist → Contracts → [Smith × N + Shaper × M] → Integration
13
+ Output: tasks.md (with Build DAG and progress)
14
+ ```
15
+
16
+ ---
17
+
18
+ ## TDD Is Mandatory
19
+
20
+ ```
21
+ ╔═══════════════════════════════════════════════════════════════════════════╗
22
+ ║ ║
23
+ ║ ⚠️ IMPLEMENTATION WITHOUT TESTS IS FORBIDDEN ║
24
+ ║ ║
25
+ ║ The build MUST follow this exact sequence: ║
26
+ ║ ║
27
+ ║ 1. Forger → Create tasks.md ║
28
+ ║ 2. Enforcer → Write ALL tests (must FAIL) ← GATE 1: RED ║
29
+ ║ 3. Verify → Run tests, confirm RED ← BLOCKING ║
30
+ ║ 4. Builders → Implement until GREEN ← Only after gate ║
31
+ ║ ║
32
+ ╚═══════════════════════════════════════════════════════════════════════════╝
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Workflow Diagram
38
+
39
+ ```
40
+ ┌─────────────────────────────────────────────────────────────────────────────┐
41
+ │ /build-spec @2026-01-11-supabase-auth │
42
+ └─────────────────────────────────────────────────────────────────────────────┘
43
+
44
+
45
+ ┌─────────────────────────────────────────────────────────────────────────────┐
46
+ │ 🔨 FORGE-MASTER (Build Orchestrator) │
47
+ └─────────────────────────────────────────────────────────────────────────────┘
48
+
49
+ ┌──────────────────┴──────────────────┐
50
+ ▼ │
51
+ ┌───────────────┐ │
52
+ │ PHASE 1 │ │
53
+ │ Forger │ │
54
+ │ (Build DAG) │ │
55
+ └───────────────┘ │
56
+ │ │
57
+ ▼ │
58
+ ┌───────────────┐ │
59
+ │ PHASE 2 │ │
60
+ │ Enforcer │ │
61
+ │ (Tests) │ │
62
+ └───────────────┘ │
63
+ │ │
64
+ ▼ │
65
+ ┌──────────────────────────────┐ │
66
+ │ 🚧 GATE 1: RED VERIFICATION │ │
67
+ │ All tests must FAIL │ │
68
+ └──────────────────────────────┘ │
69
+ │ │
70
+ ▼ │
71
+ ┌───────────────┐ │
72
+ │ PHASE 3 │ │
73
+ │ Alchemist │ │
74
+ │ (Foundation) │ │
75
+ └───────────────┘ │
76
+ │ │
77
+ ▼ │
78
+ ┌──────────────────────────────┐ │
79
+ │ 🚧 GATE 2: FOUNDATION │ │
80
+ │ DB tests must PASS │ │
81
+ └──────────────────────────────┘ │
82
+ │ │
83
+ ▼ │
84
+ ┌───────────────┐ │
85
+ │ PHASE 4 │ │
86
+ │ Smith │ │
87
+ │ (Contracts) │ │
88
+ └───────────────┘ │
89
+ │ │
90
+ ▼ │
91
+ ┌──────────────────────────────┐ │
92
+ │ 🚧 GATE 3: CONTRACTS │ │
93
+ │ Type-check must PASS │ │
94
+ └──────────────────────────────┘ │
95
+ │ │
96
+ ▼ │
97
+ ┌──────────────────────────────────────────────┐ │
98
+ │ PHASE 5: PARALLEL (DAG-Driven) │ │
99
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
100
+ │ │ SMITH-1 │ │ SMITH-2 │ │ SHAPER-1 │ │ │
101
+ │ │ api/auth │ │ api/post │ │ pages/ │ │ │
102
+ │ └──────────┘ └──────────┘ │ profile │ │ │
103
+ │ ┌──────────┐ ┌──────────┐ └──────────┘ │ │
104
+ │ │ SHAPER-2 │ │ SHAPER-3 │ │ │
105
+ │ │ pages/ │ │ pages/ │ scope-isolated │ │
106
+ │ │ feed │ │ settings │ parallel exec │ │
107
+ │ └──────────┘ └──────────┘ │ │
108
+ └──────────────────────────────────────────────┘ │
109
+ │ │
110
+ ▼ │
111
+ ┌──────────────────────────────┐ │
112
+ │ 🚧 GATE 4: PARALLEL DONE │ │
113
+ │ All parallel tests PASS │ │
114
+ └──────────────────────────────┘ │
115
+ │ │
116
+ ▼ │
117
+ ┌───────────────┐ │
118
+ │ PHASE 6 │ │
119
+ │ Enforcer │ │
120
+ │ (Integration) │ │
121
+ └───────────────┘ │
122
+ │ │
123
+ ▼ │
124
+ ┌──────────────────────────────┐ │
125
+ │ 🚧 GATE 5: GREEN VERIFY │ │
126
+ │ ALL tests must PASS │ │
127
+ └──────────────────────────────┘ │
128
+ │ │
129
+ ▼ │
130
+ ┌───────────────┐ │
131
+ │ OUTPUT │◀─────────────────────────────┘
132
+ └───────────────┘
133
+ ```
134
+
135
+ ---
136
+
137
+ ## Phase Details
138
+
139
+ ### Phase 1: Task Breakdown (Forger) - Build DAG
140
+
141
+ ```
142
+ ┌─────────────────────────────────────────────────────────────────┐
143
+ │ 📍 TASK BREAKDOWN (Build DAG) │
144
+ │ ───────────────────────────── │
145
+ │ │
146
+ │ ┌──────────────────────────────────────────────────────────┐ │
147
+ │ │ ⚒️ FORGER │ │
148
+ │ │ │ │
149
+ │ │ 1. Read spec.md requirements │ │
150
+ │ │ 2. Break into atomic tasks │ │
151
+ │ │ 3. Identify parallelizable work units │ │
152
+ │ │ 4. Define scope boundaries per task │ │
153
+ │ │ 5. Extract shared contracts │ │
154
+ │ │ 6. Create tasks.md with Build DAG │ │
155
+ │ └──────────────────────────────────────────────────────────┘ │
156
+ │ │
157
+ │ Output: tasks.md with Build DAG │
158
+ │ ┌──────────────────────────────────────────────────────────┐ │
159
+ │ │ # Tasks: Supabase Authentication │ │
160
+ │ │ │ │
161
+ │ │ ## Build DAG │ │
162
+ │ │ │ │
163
+ │ │ ### Phase 1: Foundation (Sequential) │ │
164
+ │ │ | ID | Agent | Scope | Blocks | │ │
165
+ │ │ | db-schema | alchemist | prisma/* | api-*, ui-* | │ │
166
+ │ │ │ │
167
+ │ │ ### Phase 2: Contracts (Sequential) │ │
168
+ │ │ | ID | Agent | Scope | Depends On | Blocks | │ │
169
+ │ │ | api-types | smith | src/types/* | db-schema | api-* | │ │
170
+ │ │ │ │
171
+ │ │ ### Phase 3: Parallel Backend (smith × 2) │ │
172
+ │ │ | ID | Agent | Scope | Reads | Depends On | │ │
173
+ │ │ | api-auth | smith-1 | src/api/auth/** | types | ... | │ │
174
+ │ │ | api-session | smith-2 | src/api/session/** | ... | │ │
175
+ │ │ │ │
176
+ │ │ ### Phase 4: Parallel Frontend (shaper × 2) │ │
177
+ │ │ | ID | Agent | Scope | Reads | Depends On | │ │
178
+ │ │ | ui-login | shaper-1 | src/pages/login/** | ... | │ │
179
+ │ │ | ui-signup | shaper-2 | src/pages/signup/** | ... | │ │
180
+ │ │ │ │
181
+ │ │ ### Phase 5: Integration │ │
182
+ │ │ | ID | Agent | Scope | Depends On | │ │
183
+ │ │ | integration | enforcer | tests/integration/** | all | │ │
184
+ │ │ │ │
185
+ │ │ ## Progress │ │
186
+ │ │ | ID | Status | Agent | Tests | Notes | │ │
187
+ │ │ |------|--------|-------|-------| │ │
188
+ │ └──────────────────────────────────────────────────────────┘ │
189
+ │ │
190
+ └─────────────────────────────────────────────────────────────────┘
191
+ ```
192
+
193
+ ### Phase 2: Write Tests First (Enforcer) - RED PHASE
194
+
195
+ ```
196
+ ┌─────────────────────────────────────────────────────────────────┐
197
+ │ 📍 RED PHASE - WRITE FAILING TESTS │
198
+ │ ────────────────────────────────── │
199
+ │ │
200
+ │ ⚠️ CRITICAL: This phase MUST complete before ANY │
201
+ │ implementation starts │
202
+ │ │
203
+ │ ┌──────────────────────────────────────────────────────────┐ │
204
+ │ │ 🛡️ ENFORCER │ │
205
+ │ │ │ │
206
+ │ │ For EVERY task, write failing tests: │ │
207
+ │ │ │ │
208
+ │ │ T-001: User profiles schema │ │
209
+ │ │ └── tests/db/user-profiles.test.ts │ │
210
+ │ │ │ │
211
+ │ │ T-002: Sessions table │ │
212
+ │ │ └── tests/db/sessions.test.ts │ │
213
+ │ │ │ │
214
+ │ │ T-003: Auth service │ │
215
+ │ │ └── tests/services/auth.test.ts │ │
216
+ │ │ │ │
217
+ │ │ T-004: API endpoints │ │
218
+ │ │ └── tests/api/auth.test.ts │ │
219
+ │ │ │ │
220
+ │ │ T-005: Middleware │ │
221
+ │ │ └── tests/middleware/auth.test.ts │ │
222
+ │ │ │ │
223
+ │ │ T-006-008: UI components │ │
224
+ │ │ └── tests/components/auth/*.test.tsx │ │
225
+ │ │ │ │
226
+ │ │ Update tasks.md Progress section with test locations │ │
227
+ │ └──────────────────────────────────────────────────────────┘ │
228
+ │ │
229
+ └─────────────────────────────────────────────────────────────────┘
230
+ ```
231
+
232
+ ### Gate 1: Red Phase Verification
233
+
234
+ ```
235
+ ╔═══════════════════════════════════════════════════════════════════════════╗
236
+ ║ 🚧 GATE 1: RED PHASE VERIFICATION ║
237
+ ╠═══════════════════════════════════════════════════════════════════════════╣
238
+ ║ ║
239
+ ║ STOP! Before proceeding to implementation: ║
240
+ ║ ║
241
+ ║ $ npm test ║
242
+ ║ ║
243
+ ║ Expected output: ║
244
+ ║ ┌─────────────────────────────────────────────────────────────────────┐ ║
245
+ ║ │ Tests: 0 passed, 45 failed │ ║
246
+ ║ │ Status: RED ❌ │ ║
247
+ ║ └─────────────────────────────────────────────────────────────────────┘ ║
248
+ ║ ║
249
+ ║ Gate Checklist: ║
250
+ ║ [ ] Every task has at least one test ║
251
+ ║ [ ] All tests have been executed ║
252
+ ║ [ ] All tests FAIL (none pass) ║
253
+ ║ ║
254
+ ║ ⚠️ If ANY test passes → STOP and investigate ║
255
+ ║ Tests passing before code = wrong tests ║
256
+ ║ ║
257
+ ╚═══════════════════════════════════════════════════════════════════════════╝
258
+ ```
259
+
260
+ ### Phase 3-4: Foundation & Contracts (Sequential)
261
+
262
+ ```
263
+ ┌─────────────────────────────────────────────────────────────────┐
264
+ │ 📍 FOUNDATION & CONTRACTS │
265
+ │ ───────────────────────── │
266
+ │ │
267
+ │ ⚠️ Only start AFTER Gate 1 (Red Phase) passes! │
268
+ │ │
269
+ │ ┌─────────────────────────────────────────────────────────┐ │
270
+ │ │ 🧪 ALCHEMIST (Foundation) │ │
271
+ │ │ │ │ │
272
+ │ │ └── db-schema: Database schema & migrations │ │
273
+ │ │ SCOPE: prisma/*, src/db/* │ │
274
+ │ │ │ │ │
275
+ │ │ ▼ GATE 2: Foundation tests pass │ │
276
+ │ │ │ │
277
+ │ │ ⚔️ SMITH (Contracts) │ │
278
+ │ │ │ │ │
279
+ │ │ └── api-types: Shared types & interfaces │ │
280
+ │ │ SCOPE: src/types/api.ts │ │
281
+ │ │ Defines contracts for parallel agents │ │
282
+ │ │ │ │ │
283
+ │ │ ▼ GATE 3: Type-check passes │ │
284
+ │ └─────────────────────────────────────────────────────────┘ │
285
+ │ │
286
+ └─────────────────────────────────────────────────────────────────┘
287
+ ```
288
+
289
+ ### Phase 5: Parallel Implementation (DAG-Driven)
290
+
291
+ ```
292
+ ┌─────────────────────────────────────────────────────────────────┐
293
+ │ 📍 PARALLEL IMPLEMENTATION (DAG-Driven) │
294
+ │ ─────────────────────────────────────── │
295
+ │ │
296
+ │ ⚠️ Only start AFTER contracts phase completes! │
297
+ │ │
298
+ │ Spawn ALL ready agents in ONE message with scope boundaries: │
299
+ │ │
300
+ │ ┌─────────────────────────────────────────────────────────┐ │
301
+ │ │ PARALLEL BLOCK (Scope-Isolated) │ │
302
+ │ │ │ │
303
+ │ │ ⚔️ SMITH-1 ⚔️ SMITH-2 │ │
304
+ │ │ └── api-auth └── api-session │ │
305
+ │ │ SCOPE: src/api/ SCOPE: src/api/ │ │
306
+ │ │ auth/** session/** │ │
307
+ │ │ READS: src/types/** READS: src/types/** │ │
308
+ │ │ │ │
309
+ │ │ 🎨 SHAPER-1 🎨 SHAPER-2 │ │
310
+ │ │ └── ui-login └── ui-signup │ │
311
+ │ │ SCOPE: src/pages/ SCOPE: src/pages/ │ │
312
+ │ │ login/** signup/** │ │
313
+ │ │ READS: src/types/** READS: src/types/** │ │
314
+ │ │ src/components/ src/components/ │ │
315
+ │ │ shared/** shared/** │ │
316
+ │ │ │ │
317
+ │ └─────────────────────────────────────────────────────────┘ │
318
+ │ │
319
+ │ ⚠️ CRITICAL: Each agent has EXCLUSIVE scope │
320
+ │ Agents must NOT modify files outside their scope │
321
+ │ │
322
+ └─────────────────────────────────────────────────────────────────┘
323
+ ```
324
+
325
+ ### Phase 6: Integration (Sequential)
326
+
327
+ ```
328
+ ┌─────────────────────────────────────────────────────────────────┐
329
+ │ 📍 INTEGRATION │
330
+ │ ───────────── │
331
+ │ │
332
+ │ ⚠️ Only start AFTER all parallel tasks complete! │
333
+ │ │
334
+ │ ┌─────────────────────────────────────────────────────────┐ │
335
+ │ │ 🛡️ ENFORCER (Integration) │ │
336
+ │ │ │ │
337
+ │ │ Run cross-boundary tests: │ │
338
+ │ │ └── tests/integration/** │ │
339
+ │ │ │ │
340
+ │ │ Verify all components work together │ │
341
+ │ └─────────────────────────────────────────────────────────┘ │
342
+ │ │
343
+ └─────────────────────────────────────────────────────────────────┘
344
+ ```
345
+
346
+ ### TDD Loop (For Each Task)
347
+
348
+ ```
349
+ ┌─────────────────────────────────────────────────────────────────┐
350
+ │ 🔄 TDD LOOP │
351
+ │ ─────────── │
352
+ │ │
353
+ │ For EACH task, builders follow this cycle: │
354
+ │ │
355
+ │ ┌──────────────────────────────────────────────┐ │
356
+ │ │ │ │
357
+ │ │ 1. Verify test exists and FAILS │ │
358
+ │ │ │ │ │
359
+ │ │ ▼ │ │
360
+ │ │ 2. Write MINIMAL code to make test pass │ │
361
+ │ │ │ │ │
362
+ │ │ ▼ │ │
363
+ │ │ 3. Run test → must PASS │ │
364
+ │ │ │ │ │
365
+ │ │ ▼ │ │
366
+ │ │ 4. Refactor if needed │ │
367
+ │ │ │ │ │
368
+ │ │ ▼ │ │
369
+ │ │ 5. Run test → must still PASS │ │
370
+ │ │ │ │ │
371
+ │ │ ▼ │ │
372
+ │ │ 6. Update tasks.md Progress │ │
373
+ │ │ │ │
374
+ │ └──────────────────────────────────────────────┘ │
375
+ │ │
376
+ │ ❌ NEVER write code without a failing test first │
377
+ │ ❌ NEVER write more code than needed to pass the test │
378
+ │ ❌ NEVER modify files outside your SCOPE │
379
+ │ │
380
+ └─────────────────────────────────────────────────────────────────┘
381
+ ```
382
+
383
+ ### Gate 2: Green Phase Verification
384
+
385
+ ```
386
+ ╔═══════════════════════════════════════════════════════════════════════════╗
387
+ ║ 🚧 GATE 2: GREEN PHASE VERIFICATION ║
388
+ ╠═══════════════════════════════════════════════════════════════════════════╣
389
+ ║ ║
390
+ ║ Before completing build: ║
391
+ ║ ║
392
+ ║ $ npm test ║
393
+ ║ ║
394
+ ║ Expected output: ║
395
+ ║ ┌─────────────────────────────────────────────────────────────────────┐ ║
396
+ ║ │ Tests: 45 passed, 0 failed │ ║
397
+ ║ │ Status: GREEN ✅ │ ║
398
+ ║ └─────────────────────────────────────────────────────────────────────┘ ║
399
+ ║ ║
400
+ ╚═══════════════════════════════════════════════════════════════════════════╝
401
+ ```
402
+
403
+ ---
404
+
405
+ ## Output
406
+
407
+ ```
408
+ ✅ Build complete!
409
+
410
+ Spec: 2026-01-11-supabase-auth
411
+
412
+ TDD Compliance: VERIFIED
413
+ ├── Red Phase: 45 tests written, all failed
414
+ └── Green Phase: 45 tests passing
415
+
416
+ DAG Execution:
417
+ ├── Foundation: 1 task (alchemist)
418
+ ├── Contracts: 1 task (smith)
419
+ ├── Parallel: 4 tasks (smith-1, smith-2, shaper-1, shaper-2)
420
+ └── Integration: 1 task (enforcer)
421
+
422
+ Tasks: 7/7 completed
423
+ Tests: 45 passing, 0 failing
424
+ Scope Violations: 0
425
+
426
+ Updated: .catalyst/specs/2026-01-11-supabase-auth/tasks.md
427
+
428
+ ➡️ Next: Run /validate-spec @2026-01-11-supabase-auth
429
+ ```
430
+
431
+ ---
432
+
433
+ ## Agents Involved
434
+
435
+ | Agent | Role | Model | Phase | Execution |
436
+ |-------|------|-------|-------|-----------|
437
+ | **Forge-Master** | Orchestrator | Opus | All | Coordinates |
438
+ | **Forger** | Task Breakdown (DAG) | Opus | 1 | Sequential |
439
+ | **Enforcer** | Test Writer | Sonnet | 2, 6 | Sequential (blocking) |
440
+ | **Alchemist** | Database | Opus | 3 | Sequential (foundation) |
441
+ | **Smith** | Backend/Contracts | Opus | 4, 5 | Sequential then Parallel × N |
442
+ | **Shaper** | Frontend | Opus | 5 | Parallel × M |
443
+
444
+ ---
445
+
446
+ ## Execution Rules
447
+
448
+ ```
449
+ DAG-BASED PARALLEL EXECUTION
450
+
451
+ Forger ──▶ Enforcer ──▶ GATE 1 ──▶ Alchemist ──▶ GATE 2 ──▶ Contracts ──▶ GATE 3
452
+ │ │ │ │ │ │ │
453
+ Build DAG tests verify foundation verify shared verify
454
+ written all FAIL DB schema DB pass types types OK
455
+
456
+
457
+ ┌─────────────────────────────────────────────────┐
458
+ │ PARALLEL (scope-isolated) │
459
+ │ [smith-1 + smith-2 + shaper-1 + shaper-2 + ...]│
460
+ └─────────────────────────────────────────────────┘
461
+
462
+
463
+ GATE 4 ──▶ Enforcer ──▶ GATE 5
464
+ │ integration │
465
+ parallel all tests
466
+ tests OK PASS
467
+
468
+
469
+ ❌ WRONG: forger → [enforcer + smith + shaper]
470
+ (Tests parallel with code = NO TDD!)
471
+
472
+ ❌ WRONG: forger → enforcer → [alchemist + smith + shaper]
473
+ (No contracts = type drift in parallel!)
474
+
475
+ ✅ CORRECT: forger → enforcer → GATE → alchemist → contracts → [smith × N + shaper × M]
476
+ (Tests first, contracts before parallel, scope-isolated execution)
477
+ ```
478
+
479
+ ---
480
+
481
+ ## Failure Modes
482
+
483
+ ### Gate 1 Fails (tests pass before implementation)
484
+
485
+ ```
486
+ ⚠️ PROBLEM: Some tests pass before code exists
487
+ ACTION: Stop and fix tests - they're testing wrong things
488
+ ```
489
+
490
+ ### Implementation Starts Without Tests
491
+
492
+ ```
493
+ ⚠️ PROBLEM: Builder agent started without tests
494
+ ACTION: STOP immediately
495
+ Delete any code written
496
+ Return to Phase 2
497
+ Write tests first
498
+ ```
499
+
500
+ ### Scope Violation Detected
501
+
502
+ ```
503
+ ⚠️ PROBLEM: Agent modified files outside its scope
504
+ ACTION: STOP that agent
505
+ Revert out-of-scope changes (git checkout)
506
+ Re-run task with stricter prompt
507
+ Report violation to user
508
+ ```
509
+
510
+ ### Parallel Agents Conflict
511
+
512
+ ```
513
+ ⚠️ PROBLEM: Two agents wrote to same file
514
+ ACTION: STOP build immediately
515
+ Revert conflicting changes
516
+ Return to Forger
517
+ Re-structure DAG with non-overlapping scopes
518
+ ```
519
+
520
+ ### Dependency Deadlock
521
+
522
+ ```
523
+ ⚠️ PROBLEM: Circular dependency detected in DAG
524
+ ACTION: STOP all execution
525
+ Report to user
526
+ Request Forger to restructure DAG
527
+ ```