@cluesmith/codev 1.6.2 → 2.0.0-rc.10

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 (121) hide show
  1. package/bin/porch.js +12 -0
  2. package/dist/agent-farm/cli.d.ts.map +1 -1
  3. package/dist/agent-farm/cli.js +25 -14
  4. package/dist/agent-farm/cli.js.map +1 -1
  5. package/dist/agent-farm/commands/index.d.ts +1 -0
  6. package/dist/agent-farm/commands/index.d.ts.map +1 -1
  7. package/dist/agent-farm/commands/index.js +1 -0
  8. package/dist/agent-farm/commands/index.js.map +1 -1
  9. package/dist/agent-farm/commands/kickoff.d.ts +20 -0
  10. package/dist/agent-farm/commands/kickoff.d.ts.map +1 -0
  11. package/dist/agent-farm/commands/kickoff.js +273 -0
  12. package/dist/agent-farm/commands/kickoff.js.map +1 -0
  13. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  14. package/dist/agent-farm/commands/spawn.js +30 -96
  15. package/dist/agent-farm/commands/spawn.js.map +1 -1
  16. package/dist/agent-farm/commands/start.d.ts.map +1 -1
  17. package/dist/agent-farm/commands/start.js +8 -50
  18. package/dist/agent-farm/commands/start.js.map +1 -1
  19. package/dist/agent-farm/servers/dashboard-server.js +0 -14
  20. package/dist/agent-farm/servers/dashboard-server.js.map +1 -1
  21. package/dist/agent-farm/state.d.ts +0 -10
  22. package/dist/agent-farm/state.d.ts.map +1 -1
  23. package/dist/agent-farm/state.js +0 -24
  24. package/dist/agent-farm/state.js.map +1 -1
  25. package/dist/cli.d.ts.map +1 -1
  26. package/dist/cli.js +17 -0
  27. package/dist/cli.js.map +1 -1
  28. package/dist/commands/adopt.d.ts.map +1 -1
  29. package/dist/commands/adopt.js +17 -1
  30. package/dist/commands/adopt.js.map +1 -1
  31. package/dist/commands/consult/index.d.ts.map +1 -1
  32. package/dist/commands/consult/index.js +2 -1
  33. package/dist/commands/consult/index.js.map +1 -1
  34. package/dist/commands/init.d.ts.map +1 -1
  35. package/dist/commands/init.js +17 -1
  36. package/dist/commands/init.js.map +1 -1
  37. package/dist/commands/porch/checks.d.ts +29 -0
  38. package/dist/commands/porch/checks.d.ts.map +1 -0
  39. package/dist/commands/porch/checks.js +141 -0
  40. package/dist/commands/porch/checks.js.map +1 -0
  41. package/dist/commands/porch/claude.d.ts +29 -0
  42. package/dist/commands/porch/claude.d.ts.map +1 -0
  43. package/dist/commands/porch/claude.js +79 -0
  44. package/dist/commands/porch/claude.js.map +1 -0
  45. package/dist/commands/porch/index.d.ts +38 -0
  46. package/dist/commands/porch/index.d.ts.map +1 -0
  47. package/dist/commands/porch/index.js +524 -0
  48. package/dist/commands/porch/index.js.map +1 -0
  49. package/dist/commands/porch/plan.d.ts +60 -0
  50. package/dist/commands/porch/plan.d.ts.map +1 -0
  51. package/dist/commands/porch/plan.js +162 -0
  52. package/dist/commands/porch/plan.js.map +1 -0
  53. package/dist/commands/porch/prompts.d.ts +19 -0
  54. package/dist/commands/porch/prompts.d.ts.map +1 -0
  55. package/dist/commands/porch/prompts.js +259 -0
  56. package/dist/commands/porch/prompts.js.map +1 -0
  57. package/dist/commands/porch/protocol.d.ts +57 -0
  58. package/dist/commands/porch/protocol.d.ts.map +1 -0
  59. package/dist/commands/porch/protocol.js +250 -0
  60. package/dist/commands/porch/protocol.js.map +1 -0
  61. package/dist/commands/porch/repl.d.ts +33 -0
  62. package/dist/commands/porch/repl.d.ts.map +1 -0
  63. package/dist/commands/porch/repl.js +206 -0
  64. package/dist/commands/porch/repl.js.map +1 -0
  65. package/dist/commands/porch/run.d.ts +15 -0
  66. package/dist/commands/porch/run.d.ts.map +1 -0
  67. package/dist/commands/porch/run.js +551 -0
  68. package/dist/commands/porch/run.js.map +1 -0
  69. package/dist/commands/porch/signals.d.ts +35 -0
  70. package/dist/commands/porch/signals.d.ts.map +1 -0
  71. package/dist/commands/porch/signals.js +76 -0
  72. package/dist/commands/porch/signals.js.map +1 -0
  73. package/dist/commands/porch/state.d.ts +40 -0
  74. package/dist/commands/porch/state.d.ts.map +1 -0
  75. package/dist/commands/porch/state.js +153 -0
  76. package/dist/commands/porch/state.js.map +1 -0
  77. package/dist/commands/porch/types.d.ts +124 -0
  78. package/dist/commands/porch/types.d.ts.map +1 -0
  79. package/dist/commands/porch/types.js +8 -0
  80. package/dist/commands/porch/types.js.map +1 -0
  81. package/dist/commands/update.d.ts.map +1 -1
  82. package/dist/commands/update.js +19 -0
  83. package/dist/commands/update.js.map +1 -1
  84. package/dist/lib/scaffold.d.ts +24 -0
  85. package/dist/lib/scaffold.d.ts.map +1 -1
  86. package/dist/lib/scaffold.js +78 -0
  87. package/dist/lib/scaffold.js.map +1 -1
  88. package/package.json +6 -2
  89. package/skeleton/porch/prompts/defend.md +103 -0
  90. package/skeleton/porch/prompts/diagnose.md +70 -0
  91. package/skeleton/porch/prompts/evaluate.md +132 -0
  92. package/skeleton/porch/prompts/fix.md +59 -0
  93. package/skeleton/porch/prompts/implement.md +79 -0
  94. package/skeleton/porch/prompts/plan.md +74 -0
  95. package/skeleton/porch/prompts/pr.md +84 -0
  96. package/skeleton/porch/prompts/review.md +179 -0
  97. package/skeleton/porch/prompts/specify.md +53 -0
  98. package/skeleton/porch/prompts/test.md +63 -0
  99. package/skeleton/porch/prompts/understand.md +61 -0
  100. package/skeleton/porch/prompts/verify.md +58 -0
  101. package/skeleton/protocols/bugfix/protocol.json +127 -0
  102. package/skeleton/protocols/protocol-schema.json +237 -0
  103. package/skeleton/protocols/spider/prompts/defend.md +215 -0
  104. package/skeleton/protocols/spider/prompts/evaluate.md +241 -0
  105. package/skeleton/protocols/spider/prompts/implement.md +149 -0
  106. package/skeleton/protocols/spider/prompts/plan.md +214 -0
  107. package/skeleton/protocols/spider/prompts/review.md +217 -0
  108. package/skeleton/protocols/spider/prompts/specify.md +174 -0
  109. package/skeleton/protocols/spider/protocol.json +136 -0
  110. package/skeleton/protocols/spider/templates/plan.md +14 -0
  111. package/skeleton/protocols/tick/protocol.json +151 -0
  112. package/skeleton/roles/architect.md +40 -48
  113. package/skeleton/roles/builder.md +152 -29
  114. package/templates/dashboard/index.html +0 -27
  115. package/templates/dashboard/js/utils.js +0 -86
  116. package/dist/agent-farm/commands/rename.d.ts +0 -13
  117. package/dist/agent-farm/commands/rename.d.ts.map +0 -1
  118. package/dist/agent-farm/commands/rename.js +0 -33
  119. package/dist/agent-farm/commands/rename.js.map +0 -1
  120. package/templates/dashboard/css/activity.css +0 -151
  121. package/templates/dashboard/js/activity.js +0 -112
@@ -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)
@@ -0,0 +1,136 @@
1
+ {
2
+ "$schema": "../../protocol-schema.json",
3
+ "name": "spider",
4
+ "version": "2.0.0",
5
+ "description": "Specification-driven development with build-verify cycles",
6
+ "phases": [
7
+ {
8
+ "id": "specify",
9
+ "name": "Specify",
10
+ "description": "Write specification with 3-way review",
11
+ "type": "build_verify",
12
+ "build": {
13
+ "prompt": "specify.md",
14
+ "artifact": "codev/specs/${PROJECT_ID}-*.md"
15
+ },
16
+ "verify": {
17
+ "type": "spec-review",
18
+ "models": ["gemini", "codex", "claude"],
19
+ "parallel": true
20
+ },
21
+ "max_iterations": 3,
22
+ "on_complete": {
23
+ "commit": true,
24
+ "push": true
25
+ },
26
+ "gate": "spec-approval",
27
+ "next": "plan"
28
+ },
29
+ {
30
+ "id": "plan",
31
+ "name": "Plan",
32
+ "description": "Write implementation plan with 3-way review",
33
+ "type": "build_verify",
34
+ "build": {
35
+ "prompt": "plan.md",
36
+ "artifact": "codev/plans/${PROJECT_ID}-*.md"
37
+ },
38
+ "verify": {
39
+ "type": "plan-review",
40
+ "models": ["gemini", "codex", "claude"],
41
+ "parallel": true
42
+ },
43
+ "max_iterations": 3,
44
+ "on_complete": {
45
+ "commit": true,
46
+ "push": true
47
+ },
48
+ "checks": {
49
+ "plan_exists": "test -f codev/plans/${PROJECT_ID}-*.md",
50
+ "has_phases_json": "grep -q '\"phases\":' codev/plans/${PROJECT_ID}-*.md"
51
+ },
52
+ "gate": "plan-approval",
53
+ "next": "implement"
54
+ },
55
+ {
56
+ "id": "implement",
57
+ "name": "Implement",
58
+ "description": "Implement code with 3-way review per plan phase",
59
+ "type": "per_plan_phase",
60
+ "build": {
61
+ "prompt": "implement.md",
62
+ "artifact": "src/**/*.{ts,tsx,js,jsx}"
63
+ },
64
+ "verify": {
65
+ "type": "impl-review",
66
+ "models": ["gemini", "codex", "claude"],
67
+ "parallel": true
68
+ },
69
+ "max_iterations": 3,
70
+ "on_complete": {
71
+ "commit": true,
72
+ "push": true
73
+ },
74
+ "checks": {
75
+ "build": {
76
+ "command": "npm run build",
77
+ "on_fail": "retry",
78
+ "max_retries": 2
79
+ },
80
+ "tests": {
81
+ "command": "npm test",
82
+ "on_fail": "retry",
83
+ "max_retries": 2
84
+ }
85
+ },
86
+ "transition": {
87
+ "on_complete": "implement",
88
+ "on_all_phases_complete": "review"
89
+ }
90
+ },
91
+ {
92
+ "id": "review",
93
+ "name": "Review",
94
+ "description": "Final review and PR with 3-way review",
95
+ "type": "build_verify",
96
+ "build": {
97
+ "prompt": "review.md",
98
+ "artifact": "codev/reviews/${PROJECT_ID}-*.md"
99
+ },
100
+ "verify": {
101
+ "type": "pr-ready",
102
+ "models": ["gemini", "codex", "claude"],
103
+ "parallel": true
104
+ },
105
+ "max_iterations": 3,
106
+ "on_complete": {
107
+ "commit": true,
108
+ "push": true
109
+ },
110
+ "gate": "pr-ready",
111
+ "next": null
112
+ }
113
+ ],
114
+ "signals": {
115
+ "PHASE_COMPLETE": {
116
+ "description": "Signal current build phase is complete",
117
+ "transitions_to": "verify"
118
+ },
119
+ "BLOCKED": {
120
+ "description": "Signal implementation is blocked",
121
+ "requires": "reason"
122
+ }
123
+ },
124
+ "phase_completion": {
125
+ "build_succeeds": "npm run build 2>&1",
126
+ "tests_pass": "npm test 2>&1",
127
+ "commit_has_code": "git log -1 --name-only --pretty=format: | grep -qE '\\.(ts|tsx|js|jsx|py|go|rs)$'"
128
+ },
129
+ "defaults": {
130
+ "max_iterations": 3,
131
+ "verify": {
132
+ "models": ["gemini", "codex", "claude"],
133
+ "parallel": true
134
+ }
135
+ }
136
+ }
@@ -17,6 +17,20 @@
17
17
  - [ ] Zero critical security issues
18
18
  - [ ] Documentation complete
19
19
 
20
+ ## Phases (Machine Readable)
21
+
22
+ <!-- REQUIRED: porch uses this JSON to track phase progress. Update this when adding/removing phases. -->
23
+
24
+ ```json
25
+ {
26
+ "phases": [
27
+ {"id": "phase_1", "title": "Phase 1 Title Here"},
28
+ {"id": "phase_2", "title": "Phase 2 Title Here"},
29
+ {"id": "phase_3", "title": "Phase 3 Title Here"}
30
+ ]
31
+ }
32
+ ```
33
+
20
34
  ## Phase Breakdown
21
35
 
22
36
  ### Phase 1: [Descriptive Name]
@@ -0,0 +1,151 @@
1
+ {
2
+ "$schema": "../../protocol-schema.json",
3
+ "name": "tick",
4
+ "version": "1.0.0",
5
+ "description": "Amendment workflow for existing SPIDER specifications",
6
+ "phases": [
7
+ {
8
+ "id": "identify",
9
+ "name": "Identify Target",
10
+ "description": "Find the existing spec to amend",
11
+ "type": "once",
12
+ "steps": [
13
+ "analyze_requirements",
14
+ "find_target_spec",
15
+ "verify_spec_integrated",
16
+ "determine_tick_number"
17
+ ],
18
+ "transition": {
19
+ "on_complete": "amend_spec"
20
+ }
21
+ },
22
+ {
23
+ "id": "amend_spec",
24
+ "name": "Amend Specification",
25
+ "description": "Update the existing specification",
26
+ "type": "once",
27
+ "steps": [
28
+ "analyze_changes_needed",
29
+ "update_spec_sections",
30
+ "add_amendment_entry",
31
+ "commit_spec_changes"
32
+ ],
33
+ "transition": {
34
+ "on_complete": "amend_plan"
35
+ }
36
+ },
37
+ {
38
+ "id": "amend_plan",
39
+ "name": "Amend Plan",
40
+ "description": "Update the existing plan",
41
+ "type": "once",
42
+ "steps": [
43
+ "update_plan_phases",
44
+ "add_amendment_history",
45
+ "commit_plan_changes"
46
+ ],
47
+ "transition": {
48
+ "on_complete": "implement"
49
+ }
50
+ },
51
+ {
52
+ "id": "implement",
53
+ "name": "Implement",
54
+ "description": "Implement the amendment",
55
+ "type": "once",
56
+ "steps": [
57
+ "implement_changes",
58
+ "self_review",
59
+ "commit"
60
+ ],
61
+ "checks": {
62
+ "build": {
63
+ "command": "npm run build",
64
+ "on_fail": "retry",
65
+ "max_retries": 2
66
+ }
67
+ },
68
+ "transition": {
69
+ "on_complete": "defend"
70
+ }
71
+ },
72
+ {
73
+ "id": "defend",
74
+ "name": "Defend",
75
+ "description": "Test the amendment",
76
+ "type": "once",
77
+ "steps": [
78
+ "write_tests",
79
+ "run_tests",
80
+ "fix_failures"
81
+ ],
82
+ "checks": {
83
+ "tests": {
84
+ "command": "npm test",
85
+ "on_fail": "implement",
86
+ "max_retries": 1
87
+ }
88
+ },
89
+ "transition": {
90
+ "on_complete": "evaluate"
91
+ }
92
+ },
93
+ {
94
+ "id": "evaluate",
95
+ "name": "Evaluate",
96
+ "description": "Verify amendment meets requirements",
97
+ "type": "once",
98
+ "steps": [
99
+ "verify_requirements",
100
+ "check_regressions"
101
+ ],
102
+ "transition": {
103
+ "on_complete": "review"
104
+ }
105
+ },
106
+ {
107
+ "id": "review",
108
+ "name": "Review",
109
+ "description": "Create review document and PR",
110
+ "type": "once",
111
+ "steps": [
112
+ "create_tick_review",
113
+ "create_pr"
114
+ ],
115
+ "consultation": {
116
+ "on": "review",
117
+ "models": ["gemini", "codex"],
118
+ "type": "impl-review",
119
+ "parallel": true,
120
+ "max_rounds": 1
121
+ },
122
+ "gate": {
123
+ "name": "pr-ready",
124
+ "description": "Amendment ready for PR",
125
+ "requires": ["tests_pass", "review_complete"],
126
+ "next": null
127
+ }
128
+ }
129
+ ],
130
+ "signals": {
131
+ "PHASE_COMPLETE": {
132
+ "description": "Signal current phase is complete",
133
+ "transitions_to": "next_phase"
134
+ },
135
+ "BLOCKED": {
136
+ "description": "Signal implementation is blocked",
137
+ "requires": "reason"
138
+ }
139
+ },
140
+ "defaults": {
141
+ "consultation": {
142
+ "enabled": true,
143
+ "models": ["gemini", "codex"],
144
+ "parallel": true
145
+ },
146
+ "checks": {
147
+ "build": "npm run build",
148
+ "test": "npm test"
149
+ }
150
+ }
151
+ }
@@ -214,59 +214,49 @@ planning → active → released → archived
214
214
 
215
215
  ## Development Protocols
216
216
 
217
- The Architect uses SPIDER or TICK protocols. The Architect is responsible for the **Specify** and **Plan** phases. The Builder handles **Implement**, **Defend**, **Evaluate**, and **Review** (IDER).
218
-
219
- ### Phase 1: Specify (Architect)
220
-
221
- 1. Understand the user's request at a system level
222
- 2. **Check `codev/resources/lessons-learned.md`** for relevant past lessons
223
- 3. Identify major components and dependencies
224
- 4. Create a detailed specification (incorporating lessons learned)
225
- 5. **Consult external reviewers** using the consult tool:
226
- ```bash
227
- consult --model gemini --type spec-review spec 0034
228
- consult --model codex --type spec-review spec 0034
229
- ```
230
- 5. Address concerns raised by the reviewers
231
- 6. **Present to human** for final review:
232
- ```bash
233
- af open codev/specs/0034-feature-name.md
234
- ```
235
-
236
- ### Phase 2: Plan (Architect)
237
-
238
- 1. Convert the spec into a sequence of implementation steps for the builder
239
- 2. **Check `codev/resources/lessons-learned.md`** for implementation pitfalls to avoid
240
- 3. Define what tests are needed
241
- 4. Specify acceptance criteria
242
- 5. **Consult external reviewers** using the consult tool:
243
- ```bash
244
- consult --model gemini --type plan-review plan 0034
245
- consult --model codex --type plan-review plan 0034
246
- ```
247
- 5. Address concerns raised by the reviewers
248
- 6. **Present to human** for final review:
249
- ```bash
250
- af open codev/plans/0034-feature-name.md
251
- ```
252
-
253
- ### Phases 3-6: IDER (Builder)
254
-
255
- Once the spec and plan are approved, the Architect spawns a builder:
217
+ The Architect uses SPIDER or TICK protocols. **The Builder executes the full SPIDER protocol** (Specify Plan → Implement → Defend → Evaluate → Review). The Architect's role is to spawn builders, approve gates, and integrate their work.
218
+
219
+ ### Spawning a Builder
220
+
221
+ When a new feature is needed:
256
222
 
257
223
  ```bash
258
224
  af spawn -p 0034
259
225
  ```
260
226
 
261
- **Important:** Update the project status to `implementing` in `codev/projectlist.md` when spawning a builder.
227
+ The builder will:
228
+ 1. **Specify** - Write the spec, run 3-way consultation, then hit `spec-approval` gate
229
+ 2. **Plan** - Write the plan, run 3-way consultation, then hit `plan-approval` gate
230
+ 3. **Implement/Defend/Evaluate** - Complete I→D→E cycles for each plan phase
231
+ 4. **Review** - Create review document and PR
232
+
233
+ ### Approving Gates
234
+
235
+ The builder stops at two gates that require human approval:
236
+
237
+ 1. **spec-approval** - After the builder writes the spec
238
+ - Review the spec at `codev/specs/XXXX-name.md`
239
+ - Verify it captures requirements correctly
240
+ - Approve: `porch approve XXXX spec-approval --a-human-explicitly-approved-this`
241
+
242
+ 2. **plan-approval** - After the builder writes the plan
243
+ - Review the plan at `codev/plans/XXXX-name.md`
244
+ - Verify phases are logical and complete
245
+ - Approve: `porch approve XXXX plan-approval --a-human-explicitly-approved-this`
262
246
 
263
- The Builder then executes the remaining phases:
264
- - **Implement** - Write the code following the plan
265
- - **Defend** - Write tests to validate the implementation
266
- - **Evaluate** - Verify requirements are met
267
- - **Review** - Document lessons learned, create PR
247
+ **Important:** Update the project status in `codev/projectlist.md` as gates are approved.
268
248
 
269
- The Architect monitors progress and provides guidance when the builder is blocked.
249
+ ### Monitoring Progress
250
+
251
+ ```bash
252
+ # Check builder status
253
+ af status
254
+
255
+ # Check porch state for a project
256
+ porch status 0034
257
+ ```
258
+
259
+ The Architect monitors progress and provides guidance when builders are blocked.
270
260
 
271
261
  ## Spikes: De-risking Technical Unknowns
272
262
 
@@ -285,12 +275,14 @@ When facing high-risk technical unknowns, use **spikes** - short, time-boxed exp
285
275
  ### Providing Context
286
276
 
287
277
  When spawning a Builder, provide:
288
- - The spec file path
289
- - The plan file path
278
+ - The project ID and name
279
+ - High-level description of the feature
290
280
  - Any relevant architecture context
291
281
  - Constraints or patterns to follow
292
282
  - Which protocol to use (SPIDER/TICK)
293
283
 
284
+ The builder will create the spec and plan files themselves.
285
+
294
286
  ### Handling Blocked Status
295
287
 
296
288
  When a Builder reports `blocked`: