@cluesmith/codev 2.0.0-rc.1 → 2.0.0-rc.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 (146) hide show
  1. package/bin/porch.js +9 -4
  2. package/dist/agent-farm/cli.d.ts.map +1 -1
  3. package/dist/agent-farm/cli.js +2 -14
  4. package/dist/agent-farm/cli.js.map +1 -1
  5. package/dist/agent-farm/commands/kickoff.d.ts +1 -0
  6. package/dist/agent-farm/commands/kickoff.d.ts.map +1 -1
  7. package/dist/agent-farm/commands/kickoff.js +82 -78
  8. package/dist/agent-farm/commands/kickoff.js.map +1 -1
  9. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  10. package/dist/agent-farm/commands/spawn.js +30 -54
  11. package/dist/agent-farm/commands/spawn.js.map +1 -1
  12. package/dist/agent-farm/commands/start.d.ts.map +1 -1
  13. package/dist/agent-farm/commands/start.js +8 -50
  14. package/dist/agent-farm/commands/start.js.map +1 -1
  15. package/dist/agent-farm/servers/dashboard-server.js +0 -14
  16. package/dist/agent-farm/servers/dashboard-server.js.map +1 -1
  17. package/dist/agent-farm/state.d.ts +0 -10
  18. package/dist/agent-farm/state.d.ts.map +1 -1
  19. package/dist/agent-farm/state.js +0 -24
  20. package/dist/agent-farm/state.js.map +1 -1
  21. package/dist/cli.d.ts.map +1 -1
  22. package/dist/cli.js +5 -17
  23. package/dist/cli.js.map +1 -1
  24. package/dist/commands/adopt.d.ts.map +1 -1
  25. package/dist/commands/adopt.js +17 -1
  26. package/dist/commands/adopt.js.map +1 -1
  27. package/dist/commands/consult/index.d.ts.map +1 -1
  28. package/dist/commands/consult/index.js +2 -1
  29. package/dist/commands/consult/index.js.map +1 -1
  30. package/dist/commands/init.d.ts.map +1 -1
  31. package/dist/commands/init.js +17 -1
  32. package/dist/commands/init.js.map +1 -1
  33. package/dist/commands/porch/checks.d.ts +16 -29
  34. package/dist/commands/porch/checks.d.ts.map +1 -1
  35. package/dist/commands/porch/checks.js +90 -144
  36. package/dist/commands/porch/checks.js.map +1 -1
  37. package/dist/commands/porch/claude.d.ts +29 -0
  38. package/dist/commands/porch/claude.d.ts.map +1 -0
  39. package/dist/commands/porch/claude.js +80 -0
  40. package/dist/commands/porch/claude.js.map +1 -0
  41. package/dist/commands/porch/index.d.ts +21 -43
  42. package/dist/commands/porch/index.d.ts.map +1 -1
  43. package/dist/commands/porch/index.js +449 -753
  44. package/dist/commands/porch/index.js.map +1 -1
  45. package/dist/commands/porch/plan.d.ts +60 -0
  46. package/dist/commands/porch/plan.d.ts.map +1 -0
  47. package/dist/commands/porch/plan.js +162 -0
  48. package/dist/commands/porch/plan.js.map +1 -0
  49. package/dist/commands/porch/prompts.d.ts +19 -0
  50. package/dist/commands/porch/prompts.d.ts.map +1 -0
  51. package/dist/commands/porch/prompts.js +270 -0
  52. package/dist/commands/porch/prompts.js.map +1 -0
  53. package/dist/commands/porch/protocol.d.ts +59 -0
  54. package/dist/commands/porch/protocol.d.ts.map +1 -0
  55. package/dist/commands/porch/protocol.js +252 -0
  56. package/dist/commands/porch/protocol.js.map +1 -0
  57. package/dist/commands/porch/repl.d.ts +33 -0
  58. package/dist/commands/porch/repl.d.ts.map +1 -0
  59. package/dist/commands/porch/repl.js +206 -0
  60. package/dist/commands/porch/repl.js.map +1 -0
  61. package/dist/commands/porch/run.d.ts +15 -0
  62. package/dist/commands/porch/run.d.ts.map +1 -0
  63. package/dist/commands/porch/run.js +718 -0
  64. package/dist/commands/porch/run.js.map +1 -0
  65. package/dist/commands/porch/signals.d.ts +38 -0
  66. package/dist/commands/porch/signals.d.ts.map +1 -0
  67. package/dist/commands/porch/signals.js +81 -0
  68. package/dist/commands/porch/signals.js.map +1 -0
  69. package/dist/commands/porch/state.d.ts +19 -112
  70. package/dist/commands/porch/state.d.ts.map +1 -1
  71. package/dist/commands/porch/state.js +78 -685
  72. package/dist/commands/porch/state.js.map +1 -1
  73. package/dist/commands/porch/types.d.ts +69 -173
  74. package/dist/commands/porch/types.d.ts.map +1 -1
  75. package/dist/commands/porch/types.js +2 -1
  76. package/dist/commands/porch/types.js.map +1 -1
  77. package/dist/commands/update.d.ts.map +1 -1
  78. package/dist/commands/update.js +19 -0
  79. package/dist/commands/update.js.map +1 -1
  80. package/dist/lib/scaffold.d.ts +24 -0
  81. package/dist/lib/scaffold.d.ts.map +1 -1
  82. package/dist/lib/scaffold.js +78 -0
  83. package/dist/lib/scaffold.js.map +1 -1
  84. package/package.json +7 -2
  85. package/skeleton/protocols/bugfix/protocol.json +1 -1
  86. package/skeleton/protocols/spider/prompts/implement.md +201 -0
  87. package/skeleton/protocols/spider/prompts/plan.md +214 -0
  88. package/skeleton/protocols/spider/prompts/review.md +217 -0
  89. package/skeleton/protocols/spider/prompts/specify.md +174 -0
  90. package/skeleton/protocols/spider/protocol.json +81 -147
  91. package/skeleton/protocols/spider/protocol.md +26 -16
  92. package/skeleton/protocols/spider/templates/plan.md +14 -0
  93. package/skeleton/protocols/tick/protocol.json +1 -1
  94. package/skeleton/roles/architect.md +40 -48
  95. package/skeleton/roles/builder.md +135 -213
  96. package/templates/dashboard/index.html +0 -27
  97. package/templates/dashboard/js/utils.js +0 -86
  98. package/dist/agent-farm/commands/rename.d.ts +0 -13
  99. package/dist/agent-farm/commands/rename.d.ts.map +0 -1
  100. package/dist/agent-farm/commands/rename.js +0 -33
  101. package/dist/agent-farm/commands/rename.js.map +0 -1
  102. package/dist/commands/pcheck/cache.d.ts +0 -48
  103. package/dist/commands/pcheck/cache.d.ts.map +0 -1
  104. package/dist/commands/pcheck/cache.js +0 -170
  105. package/dist/commands/pcheck/cache.js.map +0 -1
  106. package/dist/commands/pcheck/evaluator.d.ts +0 -15
  107. package/dist/commands/pcheck/evaluator.d.ts.map +0 -1
  108. package/dist/commands/pcheck/evaluator.js +0 -246
  109. package/dist/commands/pcheck/evaluator.js.map +0 -1
  110. package/dist/commands/pcheck/index.d.ts +0 -12
  111. package/dist/commands/pcheck/index.d.ts.map +0 -1
  112. package/dist/commands/pcheck/index.js +0 -249
  113. package/dist/commands/pcheck/index.js.map +0 -1
  114. package/dist/commands/pcheck/parser.d.ts +0 -39
  115. package/dist/commands/pcheck/parser.d.ts.map +0 -1
  116. package/dist/commands/pcheck/parser.js +0 -155
  117. package/dist/commands/pcheck/parser.js.map +0 -1
  118. package/dist/commands/pcheck/types.d.ts +0 -82
  119. package/dist/commands/pcheck/types.d.ts.map +0 -1
  120. package/dist/commands/pcheck/types.js +0 -5
  121. package/dist/commands/pcheck/types.js.map +0 -1
  122. package/dist/commands/porch/consultation.d.ts +0 -56
  123. package/dist/commands/porch/consultation.d.ts.map +0 -1
  124. package/dist/commands/porch/consultation.js +0 -330
  125. package/dist/commands/porch/consultation.js.map +0 -1
  126. package/dist/commands/porch/notifications.d.ts +0 -99
  127. package/dist/commands/porch/notifications.d.ts.map +0 -1
  128. package/dist/commands/porch/notifications.js +0 -223
  129. package/dist/commands/porch/notifications.js.map +0 -1
  130. package/dist/commands/porch/plan-parser.d.ts +0 -38
  131. package/dist/commands/porch/plan-parser.d.ts.map +0 -1
  132. package/dist/commands/porch/plan-parser.js +0 -166
  133. package/dist/commands/porch/plan-parser.js.map +0 -1
  134. package/dist/commands/porch/protocol-loader.d.ts +0 -46
  135. package/dist/commands/porch/protocol-loader.d.ts.map +0 -1
  136. package/dist/commands/porch/protocol-loader.js +0 -249
  137. package/dist/commands/porch/protocol-loader.js.map +0 -1
  138. package/dist/commands/porch/signal-parser.d.ts +0 -88
  139. package/dist/commands/porch/signal-parser.d.ts.map +0 -1
  140. package/dist/commands/porch/signal-parser.js +0 -148
  141. package/dist/commands/porch/signal-parser.js.map +0 -1
  142. package/skeleton/porch/protocols/bugfix.json +0 -85
  143. package/skeleton/porch/protocols/spider.json +0 -135
  144. package/skeleton/porch/protocols/tick.json +0 -76
  145. package/templates/dashboard/css/activity.css +0 -151
  146. package/templates/dashboard/js/activity.js +0 -112
@@ -0,0 +1,217 @@
1
+ # REVIEW Phase Prompt
2
+
3
+ You are executing the **REVIEW** phase of the SPIDER protocol.
4
+
5
+ ## Your Goal
6
+
7
+ Perform a comprehensive review, document lessons learned, run final consultation, and prepare for PR submission.
8
+
9
+ ## CRITICAL: Final Consultation Before PR
10
+
11
+ The SPIDER protocol **requires** a final consultation with GPT-5 Codex AND Gemini Pro before submitting the PR. This ensures the complete implementation is reviewed.
12
+
13
+ ## Context
14
+
15
+ - **Project ID**: {{project_id}}
16
+ - **Project Title**: {{title}}
17
+ - **Current State**: {{current_state}}
18
+ - **Spec File**: `codev/specs/{{project_id}}-{{title}}.md`
19
+ - **Plan File**: `codev/plans/{{project_id}}-{{title}}.md`
20
+ - **Review File**: `codev/reviews/{{project_id}}-{{title}}.md`
21
+
22
+ ## Prerequisites
23
+
24
+ Before review, verify:
25
+ 1. All implementation phases are committed
26
+ 2. All tests are passing
27
+ 3. Build is passing
28
+ 4. Spec compliance verified for all phases
29
+
30
+ Verify commits: `git log --oneline | grep "[Spec {{project_id}}]"`
31
+
32
+ ## Process
33
+
34
+ ### 1. Comprehensive Review
35
+
36
+ Review the entire implementation:
37
+
38
+ **Code Quality**:
39
+ - Is the code readable and maintainable?
40
+ - Are there any code smells?
41
+ - Is error handling consistent?
42
+ - Are there any security concerns?
43
+
44
+ **Architecture**:
45
+ - Does the implementation fit well with existing code?
46
+ - Are there any architectural concerns?
47
+ - Is the design scalable if needed?
48
+
49
+ **Documentation**:
50
+ - Is code adequately commented where needed?
51
+ - Are public APIs documented?
52
+ - Is README updated if needed?
53
+
54
+ ### 2. Spec Comparison
55
+
56
+ Compare final implementation to original specification:
57
+
58
+ - What was delivered vs what was specified?
59
+ - Any deviations? Document why.
60
+ - All success criteria met?
61
+
62
+ ### 3. Create Review Document
63
+
64
+ Create `codev/reviews/{{project_id}}-{{title}}.md`:
65
+
66
+ ```markdown
67
+ # Review: {{title}}
68
+
69
+ ## Summary
70
+ Brief description of what was implemented.
71
+
72
+ ## Spec Compliance
73
+ - [x] Requirement 1: Implemented as specified
74
+ - [x] Requirement 2: Implemented with deviation (see below)
75
+ - [x] Requirement 3: Implemented as specified
76
+
77
+ ## Deviations from Plan
78
+ - **Phase X**: [What changed and why]
79
+
80
+ ## Lessons Learned
81
+
82
+ ### What Went Well
83
+ - [Positive observation 1]
84
+ - [Positive observation 2]
85
+
86
+ ### Challenges Encountered
87
+ - [Challenge 1]: [How it was resolved]
88
+ - [Challenge 2]: [How it was resolved]
89
+
90
+ ### What Would Be Done Differently
91
+ - [Insight 1]
92
+ - [Insight 2]
93
+
94
+ ### Methodology Improvements
95
+ - [Suggested improvement to SPIDER protocol]
96
+ - [Suggested improvement to tooling]
97
+
98
+ ## Technical Debt
99
+ - [Any shortcuts taken that should be addressed later]
100
+
101
+ ## Follow-up Items
102
+ - [Any items identified for future work]
103
+ ```
104
+
105
+ ### 4. Update Documentation
106
+
107
+ If needed, update:
108
+ - README.md (new features, changed behavior)
109
+ - API documentation
110
+ - Architecture documentation (`codev/resources/arch.md`)
111
+
112
+ ### 5. Final Verification
113
+
114
+ Before PR:
115
+ - [ ] All tests pass (use project-specific test command)
116
+ - [ ] Build passes (use project-specific build command)
117
+ - [ ] Lint passes (if configured)
118
+ - [ ] No uncommitted changes: `git status`
119
+ - [ ] Review document complete
120
+
121
+ ### 6. MANDATORY: Final Consultation (PR-Ready Review)
122
+
123
+ **Before creating the PR, run final consultation:**
124
+
125
+ ```bash
126
+ # Run consultations in parallel (REQUIRED)
127
+ consult --model gemini --type pr-ready spec {{project_id}} &
128
+ consult --model codex --type pr-ready spec {{project_id}} &
129
+ wait
130
+ ```
131
+
132
+ - Review ALL feedback from both models
133
+ - Address any final issues identified
134
+ - This is the last chance to catch problems before PR
135
+
136
+ ### 7. Create Pull Request
137
+
138
+ Prepare PR with:
139
+
140
+ **Title**: `[Spec {{project_id}}] {{title}}`
141
+
142
+ **Body**:
143
+ ```markdown
144
+ ## Summary
145
+ [Brief description of the implementation]
146
+
147
+ ## Changes
148
+ - [Change 1]
149
+ - [Change 2]
150
+
151
+ ## Testing
152
+ - All unit tests passing
153
+ - Integration tests added for [X]
154
+ - Manual testing completed for [Y]
155
+
156
+ ## Spec
157
+ Link: codev/specs/{{project_id}}-{{title}}.md
158
+
159
+ ## Review
160
+ Link: codev/reviews/{{project_id}}-{{title}}.md
161
+ ```
162
+
163
+ ## Output
164
+
165
+ - Review document at `codev/reviews/{{project_id}}-{{title}}.md`
166
+ - Updated documentation (if needed)
167
+ - Pull request ready for submission
168
+
169
+ ## Signals
170
+
171
+ Emit appropriate signals based on your progress:
172
+
173
+ - After review document is complete:
174
+ ```
175
+ <signal>REVIEW_COMPLETE</signal>
176
+ ```
177
+
178
+ - After PR is created:
179
+ ```
180
+ <signal>PR_CREATED</signal>
181
+ ```
182
+
183
+ - When ready for Architect review:
184
+ ```
185
+ <signal>PR_READY</signal>
186
+ ```
187
+
188
+ ## Important Notes
189
+
190
+ 1. **Final consultation is MANDATORY** - Cannot skip GPT-5 + Gemini reviews before PR
191
+ 2. **Be honest in lessons learned** - Future you will thank present you
192
+ 3. **Document deviations** - They're not failures, they're learnings
193
+ 4. **Update methodology** - If you found a better way, document it
194
+ 5. **Don't skip the checklist** - It catches last-minute issues
195
+ 6. **Clean PR description** - Makes review easier
196
+
197
+ ## What NOT to Do
198
+
199
+ - Don't skip final consultation (it's BLOCKING)
200
+ - Don't skip lessons learned ("nothing to report")
201
+ - Don't merge your own PR (Architect handles integration)
202
+ - Don't leave uncommitted changes
203
+ - Don't forget to update documentation
204
+ - Don't rush this phase - it's valuable for learning
205
+ - Don't use `git add .` or `git add -A` (security risk)
206
+
207
+ ## Review Prompts for Reflection
208
+
209
+ Ask yourself:
210
+ - What surprised me during implementation?
211
+ - Where did I spend the most time? Was it avoidable?
212
+ - What would have helped me go faster?
213
+ - Did the spec adequately describe what was needed?
214
+ - Did the plan phases make sense in hindsight?
215
+ - What tests caught issues? What tests were unnecessary?
216
+
217
+ Capture these reflections in the lessons learned section.
@@ -0,0 +1,174 @@
1
+ # SPECIFY Phase Prompt
2
+
3
+ You are executing the **SPECIFY** phase of the SPIDER protocol.
4
+
5
+ ## Your Goal
6
+
7
+ Create a comprehensive specification document that thoroughly explores the problem space and proposed solution.
8
+
9
+ ## Context
10
+
11
+ - **Project ID**: {{project_id}}
12
+ - **Project Title**: {{title}}
13
+ - **Current State**: {{current_state}}
14
+ - **Spec File**: `codev/specs/{{project_id}}-{{title}}.md`
15
+
16
+ ## CRITICAL: Multi-Agent Consultation is MANDATORY
17
+
18
+ The SPIDER protocol **requires** consultation with GPT-5 Codex AND Gemini Pro at specific checkpoints. This is BLOCKING - you cannot proceed without completing consultations.
19
+
20
+ ## Process
21
+
22
+ ### 1. Clarifying Questions (ALWAYS START HERE)
23
+
24
+ Before writing anything, ask clarifying questions to understand:
25
+ - What problem is being solved?
26
+ - Who are the stakeholders?
27
+ - What are the constraints?
28
+ - What's in scope vs out of scope?
29
+ - What does success look like?
30
+
31
+ If this is your first iteration, ask these questions now and wait for answers.
32
+
33
+ **On subsequent iterations**: If questions were already answered, acknowledge the answers and proceed to the next step.
34
+
35
+ ### 2. Problem Analysis
36
+
37
+ Once you have answers, document:
38
+ - The problem being solved (clearly articulated)
39
+ - Current state vs desired state
40
+ - Stakeholders and their needs
41
+ - Assumptions and constraints
42
+
43
+ ### 3. Solution Exploration
44
+
45
+ Generate multiple solution approaches. For each:
46
+ - Technical design overview
47
+ - Trade-offs (pros/cons)
48
+ - Complexity assessment
49
+ - Risk assessment
50
+
51
+ ### 4. Open Questions
52
+
53
+ List uncertainties categorized as:
54
+ - **Critical** - blocks progress
55
+ - **Important** - affects design
56
+ - **Nice-to-know** - optimization
57
+
58
+ ### 5. Success Criteria
59
+
60
+ Define measurable acceptance criteria:
61
+ - Functional requirements (MUST, SHOULD, COULD)
62
+ - Non-functional requirements (performance, security)
63
+ - Test scenarios
64
+
65
+ ### 6. MANDATORY: First Consultation (After Draft)
66
+
67
+ After completing the initial spec draft:
68
+
69
+ ```bash
70
+ # Run consultations in parallel (REQUIRED)
71
+ consult --model gemini spec {{project_id}} &
72
+ consult --model codex spec {{project_id}} &
73
+ wait
74
+ ```
75
+
76
+ - Review ALL feedback from both models
77
+ - Update the spec with incorporated feedback
78
+ - Add a **Consultation Log** section documenting:
79
+ - Key feedback received
80
+ - Changes made in response
81
+ - Any feedback intentionally not incorporated (with reasoning)
82
+
83
+ ### 7. Human Review
84
+
85
+ After consultation feedback is incorporated:
86
+ - Present the spec for human review
87
+ - Wait for approval or change requests
88
+ - If changes requested, make them and proceed to Step 8
89
+
90
+ ### 8. MANDATORY: Second Consultation (After Human Feedback)
91
+
92
+ After incorporating human feedback:
93
+
94
+ ```bash
95
+ # Run consultations again (REQUIRED)
96
+ consult --model gemini spec {{project_id}} &
97
+ consult --model codex spec {{project_id}} &
98
+ wait
99
+ ```
100
+
101
+ - Update Consultation Log with new feedback
102
+ - Incorporate changes
103
+ - Prepare final spec for approval
104
+
105
+ ## Output
106
+
107
+ Create or update the specification file at `codev/specs/{{project_id}}-{{title}}.md`.
108
+
109
+ **IMPORTANT**: Keep spec/plan/review filenames in sync:
110
+ - Spec: `codev/specs/{{project_id}}-{{title}}.md`
111
+ - Plan: `codev/plans/{{project_id}}-{{title}}.md`
112
+ - Review: `codev/reviews/{{project_id}}-{{title}}.md`
113
+
114
+ Include a **Consultation Log** section in the spec documenting all consultation feedback.
115
+
116
+ ## Signals
117
+
118
+ Emit appropriate signals based on your progress:
119
+
120
+ - When waiting for clarifying question answers, **include your questions in the signal**:
121
+ ```
122
+ <signal type=AWAITING_INPUT>
123
+ Please answer these questions:
124
+ 1. What should the primary use case be - internal tooling or customer-facing?
125
+ 2. What are the key constraints we should consider?
126
+ 3. Who are the main stakeholders?
127
+ </signal>
128
+ ```
129
+
130
+ The content inside the signal tag is displayed prominently to the user.
131
+
132
+ - After completing the initial spec draft:
133
+ ```
134
+ <signal>SPEC_DRAFTED</signal>
135
+ ```
136
+
137
+ - After incorporating consultation feedback:
138
+ ```
139
+ <signal>CONSULTATION_INCORPORATED</signal>
140
+ ```
141
+
142
+ - After final spec is ready for human approval:
143
+ ```
144
+ <signal>SPEC_READY_FOR_APPROVAL</signal>
145
+ ```
146
+
147
+ ## Commit Cadence
148
+
149
+ Make commits at these milestones:
150
+ 1. `[Spec {{project_id}}] Initial specification draft`
151
+ 2. `[Spec {{project_id}}] Specification with multi-agent review`
152
+ 3. `[Spec {{project_id}}] Specification with user feedback`
153
+ 4. `[Spec {{project_id}}] Final approved specification`
154
+
155
+ **CRITICAL**: Never use `git add .` or `git add -A`. Always stage specific files:
156
+ ```bash
157
+ git add codev/specs/{{project_id}}-{{title}}.md
158
+ ```
159
+
160
+ ## Important Notes
161
+
162
+ 1. **Consultation is MANDATORY** - Cannot skip GPT-5 + Gemini reviews
163
+ 2. **Be thorough** - A good spec prevents implementation problems
164
+ 3. **Be specific** - Vague specs lead to wrong implementations
165
+ 4. **Include examples** - Concrete examples clarify intent
166
+ 5. **Document consultations** - Maintain the Consultation Log section
167
+
168
+ ## What NOT to Do
169
+
170
+ - Don't skip consultations (they are BLOCKING)
171
+ - Don't include implementation details (that's for the Plan phase)
172
+ - Don't estimate time (AI makes time estimates meaningless)
173
+ - Don't start coding (you're in Specify, not Implement)
174
+ - Don't use `git add .` or `git add -A` (security risk)
@@ -1,147 +1,90 @@
1
1
  {
2
2
  "$schema": "../../protocol-schema.json",
3
3
  "name": "spider",
4
- "version": "1.0.0",
5
- "description": "Specification-driven development with multi-agent consultation",
4
+ "alias": "spir",
5
+ "version": "2.1.0",
6
+ "description": "SPIR: Specify → Plan → Implement → Review with build-verify cycles",
6
7
  "phases": [
7
8
  {
8
9
  "id": "specify",
9
10
  "name": "Specify",
10
- "description": "Collaborative design exploration and specification",
11
- "type": "once",
12
- "steps": [
13
- "clarifying_questions",
14
- "problem_analysis",
15
- "solution_exploration",
16
- "open_questions",
17
- "success_criteria",
18
- "spec_draft",
19
- "consultation_1",
20
- "human_review",
21
- "consultation_2",
22
- "spec_final"
23
- ],
24
- "consultation": {
25
- "on": "review",
26
- "models": ["gemini", "codex", "claude"],
11
+ "description": "Write specification with 3-way review",
12
+ "type": "build_verify",
13
+ "build": {
14
+ "prompt": "specify.md",
15
+ "artifact": "codev/specs/${PROJECT_ID}-*.md"
16
+ },
17
+ "verify": {
27
18
  "type": "spec-review",
28
- "parallel": true,
29
- "max_rounds": 3
19
+ "models": ["gemini", "codex", "claude"],
20
+ "parallel": true
30
21
  },
31
- "gate": {
32
- "name": "spec-approval",
33
- "description": "Human approves specification before planning",
34
- "requires": ["spec_final", "consultation_2"],
35
- "next": "plan"
36
- }
22
+ "max_iterations": 7,
23
+ "on_complete": {
24
+ "commit": true,
25
+ "push": true
26
+ },
27
+ "gate": "spec-approval",
28
+ "next": "plan"
37
29
  },
38
30
  {
39
31
  "id": "plan",
40
32
  "name": "Plan",
41
- "description": "Implementation planning with phased breakdown",
42
- "type": "once",
43
- "steps": [
44
- "analyze_spec",
45
- "identify_phases",
46
- "define_steps",
47
- "plan_draft",
48
- "consultation",
49
- "human_review",
50
- "plan_final"
51
- ],
52
- "consultation": {
53
- "on": "review",
54
- "models": ["gemini", "codex", "claude"],
33
+ "description": "Write implementation plan with 3-way review",
34
+ "type": "build_verify",
35
+ "build": {
36
+ "prompt": "plan.md",
37
+ "artifact": "codev/plans/${PROJECT_ID}-*.md"
38
+ },
39
+ "verify": {
55
40
  "type": "plan-review",
56
- "parallel": true,
57
- "max_rounds": 2
41
+ "models": ["gemini", "codex", "claude"],
42
+ "parallel": true
58
43
  },
59
- "gate": {
60
- "name": "plan-approval",
61
- "description": "Human approves plan before implementation",
62
- "requires": ["plan_final", "consultation"],
63
- "next": "implement"
64
- }
44
+ "max_iterations": 7,
45
+ "on_complete": {
46
+ "commit": true,
47
+ "push": true
48
+ },
49
+ "checks": {
50
+ "plan_exists": "test -f codev/plans/${PROJECT_ID}-*.md",
51
+ "has_phases_json": "grep -q '\"phases\":' codev/plans/${PROJECT_ID}-*.md",
52
+ "min_two_phases": "grep -o '\"id\": *\"[^\"]*\"' codev/plans/${PROJECT_ID}-*.md | wc -l | awk '$1 >= 2 {exit 0} {exit 1}'"
53
+ },
54
+ "gate": "plan-approval",
55
+ "next": "implement"
65
56
  },
66
57
  {
67
58
  "id": "implement",
68
59
  "name": "Implement",
69
- "description": "Code implementation following the plan",
60
+ "description": "Implement code with 3-way review per plan phase",
70
61
  "type": "per_plan_phase",
71
- "steps": [
72
- "read_phase",
73
- "implement_code",
74
- "self_review",
75
- "commit"
76
- ],
62
+ "build": {
63
+ "prompt": "implement.md",
64
+ "artifact": "src/**/*.{ts,tsx,js,jsx}"
65
+ },
66
+ "verify": {
67
+ "type": "impl-review",
68
+ "models": ["gemini", "codex", "claude"],
69
+ "parallel": true
70
+ },
71
+ "max_iterations": 7,
72
+ "on_complete": {
73
+ "commit": true,
74
+ "push": true
75
+ },
77
76
  "checks": {
78
77
  "build": {
79
78
  "command": "npm run build",
80
79
  "on_fail": "retry",
81
80
  "max_retries": 2
82
81
  },
83
- "typecheck": {
84
- "command": "npm run typecheck",
85
- "on_fail": "retry",
86
- "max_retries": 2
87
- }
88
- },
89
- "transition": {
90
- "on_complete": "defend",
91
- "on_fail": "implement"
92
- }
93
- },
94
- {
95
- "id": "defend",
96
- "name": "Defend",
97
- "description": "Testing and verification",
98
- "type": "per_plan_phase",
99
- "steps": [
100
- "write_tests",
101
- "run_tests",
102
- "fix_failures",
103
- "commit"
104
- ],
105
- "checks": {
106
82
  "tests": {
107
83
  "command": "npm test",
108
- "on_fail": "implement",
109
- "max_retries": 1
110
- },
111
- "lint": {
112
- "command": "npm run lint",
113
84
  "on_fail": "retry",
114
- "max_retries": 1
85
+ "max_retries": 2
115
86
  }
116
87
  },
117
- "consultation": {
118
- "on": "complete",
119
- "models": ["gemini", "codex", "claude"],
120
- "type": "impl-review",
121
- "parallel": true,
122
- "max_rounds": 2
123
- },
124
- "transition": {
125
- "on_complete": "evaluate",
126
- "on_fail": "implement"
127
- }
128
- },
129
- {
130
- "id": "evaluate",
131
- "name": "Evaluate",
132
- "description": "Verify implementation against spec",
133
- "type": "per_plan_phase",
134
- "steps": [
135
- "check_spec_compliance",
136
- "check_success_criteria",
137
- "document_deviations"
138
- ],
139
- "gate": {
140
- "name": "phase-complete",
141
- "description": "Plan phase implementation is verified",
142
- "requires": ["all_checks_pass", "spec_compliance"],
143
- "next": "implement"
144
- },
145
88
  "transition": {
146
89
  "on_complete": "implement",
147
90
  "on_all_phases_complete": "review"
@@ -150,55 +93,46 @@
150
93
  {
151
94
  "id": "review",
152
95
  "name": "Review",
153
- "description": "Final review and lessons learned",
154
- "type": "once",
155
- "steps": [
156
- "create_review_document",
157
- "document_lessons",
158
- "final_consultation",
159
- "create_pr"
160
- ],
161
- "consultation": {
162
- "on": "review",
163
- "models": ["gemini", "codex", "claude"],
96
+ "description": "Final review and PR with 3-way review",
97
+ "type": "build_verify",
98
+ "build": {
99
+ "prompt": "review.md",
100
+ "artifact": "codev/reviews/${PROJECT_ID}-*.md"
101
+ },
102
+ "verify": {
164
103
  "type": "pr-ready",
165
- "parallel": true,
166
- "max_rounds": 1
104
+ "models": ["gemini", "codex", "claude"],
105
+ "parallel": true
167
106
  },
168
- "gate": {
169
- "name": "pr-ready",
170
- "description": "Implementation ready for PR",
171
- "requires": ["review_complete", "all_tests_pass", "consultation"],
172
- "next": null
173
- }
107
+ "max_iterations": 7,
108
+ "on_complete": {
109
+ "commit": true,
110
+ "push": true
111
+ },
112
+ "gate": "pr-ready",
113
+ "next": null
174
114
  }
175
115
  ],
176
116
  "signals": {
177
117
  "PHASE_COMPLETE": {
178
- "description": "Signal current phase is complete",
179
- "transitions_to": "next_phase"
118
+ "description": "Signal current build phase is complete",
119
+ "transitions_to": "verify"
180
120
  },
181
121
  "BLOCKED": {
182
122
  "description": "Signal implementation is blocked",
183
123
  "requires": "reason"
184
- },
185
- "REVISION_NEEDED": {
186
- "description": "Signal changes requested",
187
- "transitions_to": "current_phase"
188
- },
189
- "APPROVED": {
190
- "description": "Signal gate approval received"
191
124
  }
192
125
  },
126
+ "phase_completion": {
127
+ "build_succeeds": "npm run build 2>&1",
128
+ "tests_pass": "npm test 2>&1",
129
+ "commit_has_code": "git log -1 --name-only --pretty=format: | grep -qE '\\.(ts|tsx|js|jsx|py|go|rs)$'"
130
+ },
193
131
  "defaults": {
194
- "consultation": {
195
- "enabled": true,
132
+ "max_iterations": 7,
133
+ "verify": {
196
134
  "models": ["gemini", "codex", "claude"],
197
135
  "parallel": true
198
- },
199
- "checks": {
200
- "build": "npm run build",
201
- "test": "npm test"
202
136
  }
203
137
  }
204
138
  }