@cluesmith/codev 1.1.0 → 1.2.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 (146) hide show
  1. package/dist/agent-farm/cli.d.ts.map +1 -1
  2. package/dist/agent-farm/cli.js +19 -0
  3. package/dist/agent-farm/cli.js.map +1 -1
  4. package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
  5. package/dist/agent-farm/commands/cleanup.js +18 -1
  6. package/dist/agent-farm/commands/cleanup.js.map +1 -1
  7. package/dist/agent-farm/commands/consult.d.ts +16 -0
  8. package/dist/agent-farm/commands/consult.d.ts.map +1 -0
  9. package/dist/agent-farm/commands/consult.js +51 -0
  10. package/dist/agent-farm/commands/consult.js.map +1 -0
  11. package/dist/agent-farm/commands/open.js +6 -6
  12. package/dist/agent-farm/commands/open.js.map +1 -1
  13. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  14. package/dist/agent-farm/commands/spawn.js +51 -42
  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 +9 -14
  18. package/dist/agent-farm/commands/start.js.map +1 -1
  19. package/dist/agent-farm/commands/util.js +2 -2
  20. package/dist/agent-farm/commands/util.js.map +1 -1
  21. package/dist/agent-farm/db/errors.d.ts +4 -0
  22. package/dist/agent-farm/db/errors.d.ts.map +1 -1
  23. package/dist/agent-farm/db/errors.js +8 -0
  24. package/dist/agent-farm/db/errors.js.map +1 -1
  25. package/dist/agent-farm/servers/dashboard-server.js +125 -71
  26. package/dist/agent-farm/servers/dashboard-server.js.map +1 -1
  27. package/dist/agent-farm/servers/open-server.d.ts +9 -0
  28. package/dist/agent-farm/servers/open-server.d.ts.map +1 -0
  29. package/dist/agent-farm/servers/{annotate-server.js → open-server.js} +17 -15
  30. package/dist/agent-farm/servers/open-server.js.map +1 -0
  31. package/dist/agent-farm/servers/tower-server.js +4 -7
  32. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  33. package/dist/agent-farm/state.d.ts +5 -0
  34. package/dist/agent-farm/state.d.ts.map +1 -1
  35. package/dist/agent-farm/state.js +17 -0
  36. package/dist/agent-farm/state.js.map +1 -1
  37. package/dist/agent-farm/types.d.ts +1 -1
  38. package/dist/agent-farm/types.d.ts.map +1 -1
  39. package/dist/agent-farm/utils/config.d.ts.map +1 -1
  40. package/dist/agent-farm/utils/config.js +13 -7
  41. package/dist/agent-farm/utils/config.js.map +1 -1
  42. package/dist/agent-farm/utils/port-registry.d.ts +1 -1
  43. package/dist/agent-farm/utils/port-registry.d.ts.map +1 -1
  44. package/dist/agent-farm/utils/port-registry.js +1 -1
  45. package/dist/agent-farm/utils/port-registry.js.map +1 -1
  46. package/dist/agent-farm/utils/shell.d.ts +19 -0
  47. package/dist/agent-farm/utils/shell.d.ts.map +1 -1
  48. package/dist/agent-farm/utils/shell.js +28 -0
  49. package/dist/agent-farm/utils/shell.js.map +1 -1
  50. package/dist/cli.d.ts.map +1 -1
  51. package/dist/cli.js +33 -0
  52. package/dist/cli.js.map +1 -1
  53. package/dist/commands/adopt.d.ts +3 -0
  54. package/dist/commands/adopt.d.ts.map +1 -1
  55. package/dist/commands/adopt.js +31 -25
  56. package/dist/commands/adopt.js.map +1 -1
  57. package/dist/commands/consult/index.d.ts +3 -2
  58. package/dist/commands/consult/index.d.ts.map +1 -1
  59. package/dist/commands/consult/index.js +128 -54
  60. package/dist/commands/consult/index.js.map +1 -1
  61. package/dist/commands/doctor.d.ts.map +1 -1
  62. package/dist/commands/doctor.js +88 -36
  63. package/dist/commands/doctor.js.map +1 -1
  64. package/dist/commands/eject.d.ts +18 -0
  65. package/dist/commands/eject.d.ts.map +1 -0
  66. package/dist/commands/eject.js +149 -0
  67. package/dist/commands/eject.js.map +1 -0
  68. package/dist/commands/import.d.ts +16 -0
  69. package/dist/commands/import.d.ts.map +1 -0
  70. package/dist/commands/import.js +278 -0
  71. package/dist/commands/import.js.map +1 -0
  72. package/dist/commands/init.d.ts +3 -0
  73. package/dist/commands/init.d.ts.map +1 -1
  74. package/dist/commands/init.js +32 -27
  75. package/dist/commands/init.js.map +1 -1
  76. package/dist/lib/projectlist-parser.d.ts +70 -0
  77. package/dist/lib/projectlist-parser.d.ts.map +1 -0
  78. package/dist/lib/projectlist-parser.js +200 -0
  79. package/dist/lib/projectlist-parser.js.map +1 -0
  80. package/dist/lib/skeleton.d.ts +41 -0
  81. package/dist/lib/skeleton.d.ts.map +1 -0
  82. package/dist/lib/skeleton.js +110 -0
  83. package/dist/lib/skeleton.js.map +1 -0
  84. package/dist/lib/templates.d.ts +2 -1
  85. package/dist/lib/templates.d.ts.map +1 -1
  86. package/dist/lib/templates.js +11 -10
  87. package/dist/lib/templates.js.map +1 -1
  88. package/package.json +5 -4
  89. package/{templates → skeleton}/DEPENDENCIES.md +3 -48
  90. package/skeleton/bin/agent-farm +7 -0
  91. package/skeleton/docs/commands/agent-farm.md +469 -0
  92. package/skeleton/docs/commands/codev.md +253 -0
  93. package/skeleton/docs/commands/consult.md +286 -0
  94. package/skeleton/docs/commands/overview.md +108 -0
  95. package/skeleton/maintain/.gitkeep +2 -0
  96. package/{templates → skeleton}/protocols/experiment/protocol.md +2 -2
  97. package/skeleton/protocols/maintain/protocol.md +502 -0
  98. package/skeleton/protocols/maintain/templates/maintenance-run.md +64 -0
  99. package/{templates → skeleton}/protocols/spider/protocol.md +9 -9
  100. package/{templates/protocols/spider-solo → skeleton/protocols/spider}/templates/plan.md +22 -1
  101. package/{templates/protocols/spider-solo → skeleton/protocols/spider}/templates/spec.md +30 -1
  102. package/skeleton/protocols/tick/protocol.md +277 -0
  103. package/skeleton/resources/lessons-learned.md +30 -0
  104. package/skeleton/resources/workflow-reference.md +242 -0
  105. package/skeleton/roles/architect.md +283 -0
  106. package/{templates → skeleton}/roles/builder.md +2 -0
  107. package/skeleton/roles/review-types/impl-review.md +56 -0
  108. package/skeleton/roles/review-types/integration-review.md +68 -0
  109. package/skeleton/roles/review-types/plan-review.md +59 -0
  110. package/skeleton/roles/review-types/pr-ready.md +72 -0
  111. package/skeleton/roles/review-types/spec-review.md +55 -0
  112. package/skeleton/templates/lessons-learned.md +28 -0
  113. package/{templates → skeleton}/templates/projectlist.md +17 -16
  114. package/dist/agent-farm/servers/annotate-server.d.ts +0 -9
  115. package/dist/agent-farm/servers/annotate-server.d.ts.map +0 -1
  116. package/dist/agent-farm/servers/annotate-server.js.map +0 -1
  117. package/templates/agents/architecture-documenter.md +0 -189
  118. package/templates/agents/codev-updater.md +0 -276
  119. package/templates/agents/spider-protocol-updater.md +0 -118
  120. package/templates/annotate.html +0 -903
  121. package/templates/bin/agent-farm +0 -18
  122. package/templates/bin/annotate-server.js +0 -140
  123. package/templates/dashboard-split.html +0 -1679
  124. package/templates/dashboard.html +0 -149
  125. package/templates/protocols/maintain/protocol.md +0 -235
  126. package/templates/protocols/spider/templates/plan.md +0 -169
  127. package/templates/protocols/spider/templates/review.md +0 -207
  128. package/templates/protocols/spider/templates/spec.md +0 -140
  129. package/templates/protocols/spider-solo/protocol.md +0 -619
  130. package/templates/protocols/tick/protocol.md +0 -250
  131. package/templates/roles/architect.md +0 -230
  132. package/templates/tower.html +0 -1032
  133. /package/{templates/AGENTS.md → skeleton/AGENTS.md.template} +0 -0
  134. /package/{templates/CLAUDE.md → skeleton/CLAUDE.md.template} +0 -0
  135. /package/{templates → skeleton}/bin/codev-doctor +0 -0
  136. /package/{templates → skeleton}/builders.md +0 -0
  137. /package/{templates → skeleton}/config.json +0 -0
  138. /package/{templates → skeleton}/plans/.gitkeep +0 -0
  139. /package/{templates → skeleton}/protocols/experiment/templates/notes.md +0 -0
  140. /package/{templates/protocols/spider-solo → skeleton/protocols/spider}/templates/review.md +0 -0
  141. /package/{templates → skeleton}/protocols/tick/templates/plan.md +0 -0
  142. /package/{templates → skeleton}/protocols/tick/templates/review.md +0 -0
  143. /package/{templates → skeleton}/protocols/tick/templates/spec.md +0 -0
  144. /package/{templates → skeleton}/reviews/.gitkeep +0 -0
  145. /package/{templates → skeleton}/roles/consultant.md +0 -0
  146. /package/{templates → skeleton}/specs/.gitkeep +0 -0
@@ -0,0 +1,277 @@
1
+ # TICK Protocol
2
+ **T**ask **I**dentification, **C**oding, **K**ickout
3
+
4
+ ## Overview
5
+
6
+ TICK is an **amendment workflow** for existing SPIDER specifications. Rather than creating new standalone specs, TICK modifies existing spec and plan documents in-place, tracking changes in an "Amendments" section.
7
+
8
+ **Core Principle**: TICK is for *refining* existing specs. SPIDER is for *creating* new specs.
9
+
10
+ **Key Insight**: TICKs are not small SPIDERs - they're amendments to existing SPIDERs. This eliminates the "TICK vs SPIDER" decision problem and keeps related work together.
11
+
12
+ ## When to Use TICK
13
+
14
+ ### Use TICK when:
15
+ - Making **amendments to an existing SPIDER spec** that is already `integrated`
16
+ - Small scope (< 300 lines of new/changed code)
17
+ - Requirements are clear and well-defined
18
+ - No fundamental architecture changes
19
+ - Examples:
20
+ - Adding a feature to an existing system (e.g., "add password reset to user auth")
21
+ - Bug fixes that extend existing functionality
22
+ - Configuration changes with logic
23
+ - Utility function additions to existing modules
24
+ - Refactoring within an existing feature
25
+
26
+ ### Use SPIDER instead when:
27
+ - Creating a **new feature from scratch** (no existing spec to amend)
28
+ - Major architecture changes (scope too large for amendment)
29
+ - Unclear requirements needing exploration
30
+ - > 300 lines of code
31
+ - Multiple stakeholders need alignment
32
+
33
+ ### Cannot Use TICK when:
34
+ - No relevant SPIDER spec exists (create a new SPIDER spec instead)
35
+ - Target spec is not yet `integrated` (complete the SPIDER cycle first)
36
+
37
+ ## Amendment Workflow
38
+
39
+ ### Phase 1: Identify Target Spec
40
+
41
+ **Input**: User describes the amendment needed
42
+
43
+ **Agent Actions**:
44
+ 1. Analyze the amendment requirements
45
+ 2. Search for the relevant existing spec to amend
46
+ 3. Verify the spec exists and is `integrated`
47
+ 4. Load current spec and plan documents
48
+ 5. Determine next TICK number (count existing TICK entries + 1)
49
+
50
+ **Example**:
51
+ ```
52
+ User: "Use TICK to add password reset to the auth system"
53
+ Agent finds: specs/0002-user-authentication.md (status: integrated)
54
+ Agent determines: Next TICK is TICK-001 (first amendment)
55
+ ```
56
+
57
+ ### Phase 2: Specification Amendment (Autonomous)
58
+
59
+ **Agent Actions**:
60
+ 1. Analyze what needs to change in the spec
61
+ 2. Update relevant sections of `specs/####-name.md`:
62
+ - Problem Statement (if scope expands)
63
+ - Success Criteria (if new criteria added)
64
+ - Solution Approaches (if design changes)
65
+ - Any other section that needs updating
66
+ 3. Add entry to "Amendments" section at bottom:
67
+ ```markdown
68
+ ### TICK-001: [Title] (YYYY-MM-DD)
69
+
70
+ **Summary**: [One-line description]
71
+
72
+ **Problem Addressed**:
73
+ [Why this amendment was needed]
74
+
75
+ **Spec Changes**:
76
+ - [Section]: [What changed]
77
+
78
+ **Plan Changes**:
79
+ - [Phase/steps]: [What was added/modified]
80
+
81
+ **Review**: See `reviews/####-name-tick-001.md`
82
+ ```
83
+ 4. **COMMIT**: `[TICK ####-NNN] Spec: [description]`
84
+
85
+ ### Phase 3: Planning Amendment (Autonomous)
86
+
87
+ **Agent Actions**:
88
+ 1. Update `plans/####-name.md` with new implementation steps
89
+ 2. Add/modify phases as needed
90
+ 3. Add entry to "Amendment History" section at bottom:
91
+ ```markdown
92
+ ### TICK-001: [Title] (YYYY-MM-DD)
93
+
94
+ **Changes**:
95
+ - [Phase added]: [Description]
96
+ - [Implementation steps]: [What was updated]
97
+
98
+ **Review**: See `reviews/####-name-tick-001.md`
99
+ ```
100
+ 4. **COMMIT**: `[TICK ####-NNN] Plan: [description]`
101
+
102
+ ### Phase 4: Implementation (Autonomous)
103
+
104
+ **Agent Actions**:
105
+ 1. Execute implementation steps from the plan
106
+ 2. Write code following fail-fast principles
107
+ 3. Test functionality
108
+ 4. **COMMIT**: `[TICK ####-NNN] Impl: [description]`
109
+
110
+ ### Phase 5: Review (User Checkpoint)
111
+
112
+ **Agent Actions**:
113
+ 1. Create review document: `reviews/####-name-tick-NNN.md`
114
+ - What was amended and why
115
+ - Changes made to spec and plan
116
+ - Implementation challenges
117
+ - Lessons learned
118
+ 2. **Multi-Agent Consultation** (MANDATORY):
119
+ - Consult GPT-5 AND Gemini Pro
120
+ - Focus: Code quality, missed issues, improvements
121
+ - Update review with consultation feedback
122
+ 3. **Update Architecture Documentation** (if applicable)
123
+ 4. **COMMIT**: `[TICK ####-NNN] Review: [description]`
124
+ 5. **PRESENT TO USER**: Show summary with consultation insights
125
+
126
+ **User Actions**:
127
+ - Review completed work
128
+ - Provide feedback
129
+ - Request changes OR approve
130
+
131
+ **If Changes Requested**:
132
+ - Agent makes changes
133
+ - Commits: `[TICK ####-NNN] Fixes: [description]`
134
+ - Updates review document
135
+ - Repeats until user approval
136
+
137
+ ## File Naming Convention
138
+
139
+ TICK amendments modify existing files and create new review files:
140
+
141
+ | File Type | Pattern | Example |
142
+ |-----------|---------|---------|
143
+ | Spec (modified) | `specs/####-name.md` | `specs/0002-user-authentication.md` |
144
+ | Plan (modified) | `plans/####-name.md` | `plans/0002-user-authentication.md` |
145
+ | Review (new) | `reviews/####-name-tick-NNN.md` | `reviews/0002-user-authentication-tick-001.md` |
146
+
147
+ **Note**: Spec and plan files are modified in-place. Only the review file is new.
148
+
149
+ ## Git Commit Strategy
150
+
151
+ **TICK commits reference the parent spec and TICK number**:
152
+
153
+ ```
154
+ [TICK 0002-001] Spec: Add password reset feature
155
+ [TICK 0002-001] Plan: Add password reset implementation
156
+ [TICK 0002-001] Impl: Add password reset feature
157
+ [TICK 0002-001] Review: Password reset implementation
158
+ [TICK 0002-001] Fixes: Address review feedback
159
+ ```
160
+
161
+ The format `[TICK ####-NNN]` identifies:
162
+ - `####`: Parent spec number (e.g., 0002)
163
+ - `NNN`: TICK amendment number (e.g., 001, 002, 003)
164
+
165
+ ## Key Differences from SPIDER
166
+
167
+ | Aspect | SPIDER | TICK |
168
+ |--------|--------|------|
169
+ | Purpose | Create new features | Amend existing features |
170
+ | File creation | Creates new spec/plan/review | Modifies spec/plan, creates review |
171
+ | Sequential numbering | Gets new number (0001, 0002) | Uses parent's number (0002-001) |
172
+ | Scope | Any size | < 300 lines typically |
173
+ | Prerequisites | None | Existing integrated spec required |
174
+ | User checkpoints | Multiple (spec, plan, phases) | Two (start, end) |
175
+ | Multi-agent consultation | Throughout | End only (review) |
176
+
177
+ ## Protocol Selection Guide
178
+
179
+ ```
180
+ Is there an existing spec to amend?
181
+ ├── NO → Use SPIDER (create new spec)
182
+ └── YES → Is it integrated?
183
+ ├── NO → Complete SPIDER cycle first
184
+ └── YES → Is the change small (<300 LOC)?
185
+ ├── YES → Use TICK (amend existing spec)
186
+ └── NO → Use SPIDER (scope too large)
187
+ ```
188
+
189
+ **Mental Model**:
190
+ - SPIDER = Create new feature from scratch
191
+ - TICK = Refine/extend existing feature
192
+
193
+ ## Example TICK Workflow
194
+
195
+ **User**: "Add password reset to the user authentication system"
196
+
197
+ **Agent**:
198
+ 1. **Identify**: Finds `specs/0002-user-authentication.md` (integrated)
199
+ 2. **Amend Spec** (30 seconds):
200
+ - Updates Success Criteria with password reset requirements
201
+ - Adds TICK-001 entry to Amendments section
202
+ - Commit: `[TICK 0002-001] Spec: Add password reset feature`
203
+ 3. **Amend Plan** (30 seconds):
204
+ - Adds Phase 4: Password Reset Email Service
205
+ - Adds TICK-001 entry to Amendment History
206
+ - Commit: `[TICK 0002-001] Plan: Add password reset implementation`
207
+ 4. **Implement** (2 minutes):
208
+ - Creates password reset endpoint
209
+ - Implements email service
210
+ - Tests functionality
211
+ - Commit: `[TICK 0002-001] Impl: Add password reset feature`
212
+ 5. **Review** (1 minute):
213
+ - Creates `reviews/0002-user-authentication-tick-001.md`
214
+ - Runs 3-way consultation (Gemini, Codex, Claude)
215
+ - Commit: `[TICK 0002-001] Review: Password reset implementation`
216
+ - Shows user the completed work
217
+
218
+ **Total Time**: ~4 minutes for simple amendment
219
+
220
+ ## Multiple TICKs per Spec
221
+
222
+ A single spec can have multiple TICK amendments over its lifetime:
223
+
224
+ ```markdown
225
+ ## Amendments
226
+
227
+ ### TICK-003: Add MFA support (2025-03-15)
228
+ ...
229
+
230
+ ### TICK-002: Add session timeout (2025-02-01)
231
+ ...
232
+
233
+ ### TICK-001: Add password reset (2025-01-15)
234
+ ...
235
+ ```
236
+
237
+ TICKs are listed in reverse chronological order (newest first). Each TICK builds on the previous state of the spec.
238
+
239
+ ## Migration from Standalone TICK
240
+
241
+ Existing standalone TICK projects (created before this protocol change) are grandfathered in. No migration required.
242
+
243
+ **Optional Migration** (if desired):
244
+ 1. Identify the "parent spec" the TICK logically extends
245
+ 2. Move TICK content into an amendment entry in the parent spec
246
+ 3. Archive the standalone files with a note: "Migrated to spec #### as TICK-NNN"
247
+ 4. Update projectlist.md to reflect the change
248
+
249
+ ## Benefits
250
+
251
+ 1. **Single source of truth**: Spec file shows complete feature evolution
252
+ 2. **Clear history**: Amendments section documents all changes chronologically
253
+ 3. **Reduced fragmentation**: Related work stays together
254
+ 4. **Simpler mental model**: "New vs amendment" is clearer than "SPIDER vs TICK"
255
+ 5. **Preserved context**: Looking at a spec shows all refinements
256
+
257
+ ## Limitations
258
+
259
+ 1. **Requires existing spec**: Cannot use TICK for greenfield work
260
+ 2. **Spec can grow large**: Many TICKs add content (consider: >5 TICKs suggests need for new spec)
261
+ 3. **Merge conflicts**: Multiple TICKs on same spec may conflict
262
+ 4. **No course correction**: Can't adjust mid-implementation
263
+
264
+ ## Best Practices
265
+
266
+ 1. **Verify spec is integrated**: Never TICK a spec that isn't complete
267
+ 2. **Keep TICKs small**: If scope grows, consider new SPIDER spec
268
+ 3. **Clear summaries**: Amendment entries should be self-explanatory
269
+ 4. **Test before review**: Always test functionality before presenting
270
+ 5. **Honest documentation**: Document all deviations in review
271
+
272
+ ## Templates
273
+
274
+ TICK uses the standard SPIDER templates with amendments sections:
275
+ - Spec template: `codev/protocols/spider/templates/spec.md` (includes Amendments section)
276
+ - Plan template: `codev/protocols/spider/templates/plan.md` (includes Amendment History section)
277
+ - Review template: `codev/protocols/tick/templates/review.md` (TICK-specific)
@@ -0,0 +1,30 @@
1
+ # Lessons Learned
2
+
3
+ Consolidated wisdom extracted from review documents. Updated during MAINTAIN protocol runs.
4
+
5
+ ---
6
+
7
+ ## Testing
8
+
9
+ <!-- Add lessons about testing practices -->
10
+
11
+ ## Architecture
12
+
13
+ <!-- Add lessons about architectural decisions -->
14
+
15
+ ## Process
16
+
17
+ <!-- Add lessons about development process -->
18
+
19
+ ## Documentation
20
+
21
+ <!-- Add lessons about documentation practices -->
22
+
23
+ ## Tools
24
+
25
+ <!-- Add lessons about tooling -->
26
+
27
+ ---
28
+
29
+ *Last updated: YYYY-MM-DD*
30
+ *Source: codev/reviews/*
@@ -0,0 +1,242 @@
1
+ # Architect-Builder Workflow Reference
2
+
3
+ Quick reference for the 7-stage project workflow. For protocol details, see `codev/protocols/spider/protocol.md`.
4
+
5
+ ## Workflow Overview
6
+
7
+ ```
8
+ CONCEPTION PLANNING EXECUTION
9
+ ┌─────────────────────────────────────────────────────────────────────────────────────┐
10
+ │ │
11
+ │ → 1. CONCEIVED │
12
+ │ User describes project concept │
13
+ │ Architect adds to projectlist, writes spec │
14
+ │ Architect does 3-way spec review │
15
+ │ ⏸️ HUMAN GATE: Approve spec │
16
+ │ │
17
+ │ → 2. SPECIFIED │
18
+ │ Human approves spec │
19
+ │ Architect writes plan │
20
+ │ Architect does 3-way plan review │
21
+ │ Human reviews and approves plan │
22
+ │ │
23
+ │ → 3. PLANNED │
24
+ │ Architect commits spec + plan to main │
25
+ ├─────────────────────────────────────────────────────────────────────────────────────┤
26
+ │ IMPLEMENTATION │
27
+ ├─────────────────────────────────────────────────────────────────────────────────────┤
28
+ │ → 4. IMPLEMENTING │
29
+ │ Architect spawns builder: af spawn -p XXXX │
30
+ │ Builder reads spec and plan │
31
+ │ For each phase: Implement → Defend → Evaluate │
32
+ │ Builder commits after each phase │
33
+ │ │
34
+ │ → 5. IMPLEMENTED │
35
+ │ Builder writes review doc │
36
+ │ Builder creates PR, notifies architect │
37
+ ├─────────────────────────────────────────────────────────────────────────────────────┤
38
+ │ HANDOFF / INTEGRATION │
39
+ ├─────────────────────────────────────────────────────────────────────────────────────┤
40
+ │ → 6. COMMITTED │
41
+ │ Architect does 3-way integration review │
42
+ │ Architect iterates with builder via PR comments │
43
+ │ Architect tells builder to merge │
44
+ │ Builder merges PR (NO --delete-branch flag) │
45
+ │ Architect cleans up builder │
46
+ │ │
47
+ │ ⏸️ HUMAN GATE: Validate in production │
48
+ │ → 7. INTEGRATED │
49
+ │ Human validates and marks as integrated │
50
+ └─────────────────────────────────────────────────────────────────────────────────────┘
51
+ ```
52
+
53
+ ## Stage Quick Reference
54
+
55
+ | Stage | Status | Actor | Key Action | Exit Condition |
56
+ |-------|--------|-------|------------|----------------|
57
+ | 1 | conceived | Architect | Write spec, 3-way review | Human approves spec |
58
+ | 2 | specified | Human + Architect | Write plan, 3-way review | Human approves plan |
59
+ | 3 | planned | Architect | Commit spec + plan | Committed to main |
60
+ | 4 | implementing | Builder | IDE loop per phase | All phases complete |
61
+ | 5 | implemented | Builder | Write review, create PR | PR created |
62
+ | 6 | committed | Architect + Builder | Integration review, merge | PR merged |
63
+ | 7 | integrated | Human | Validate production | Human confirms |
64
+
65
+ ## Human Gates
66
+
67
+ There are **two points where only a human can advance the workflow**:
68
+
69
+ 1. **conceived → specified**: Human must approve the specification
70
+ 2. **committed → integrated**: Human must validate production deployment
71
+
72
+ AI agents must stop and wait for human action at these gates.
73
+
74
+ ## Common Commands
75
+
76
+ ### Architect Commands
77
+
78
+ ```bash
79
+ # Start the dashboard
80
+ af start
81
+
82
+ # Spawn a builder for a project
83
+ af spawn -p 0044
84
+
85
+ # Check all builder statuses
86
+ af status
87
+
88
+ # Send message to builder
89
+ af send 0044 "Check PR comments and address feedback"
90
+
91
+ # Open a file for review
92
+ af open codev/specs/0044-name.md
93
+
94
+ # Clean up after merge
95
+ af cleanup -p 0044
96
+
97
+ # Stop everything
98
+ af stop
99
+ ```
100
+
101
+ ### Builder Commands
102
+
103
+ ```bash
104
+ # Check your own status
105
+ af status
106
+
107
+ # Send message to architect
108
+ af send architect "Question about the spec..."
109
+
110
+ # Open a file in the annotation viewer
111
+ af open src/path/to/file.ts
112
+ ```
113
+
114
+ ### Protocol Import
115
+
116
+ ```bash
117
+ # Import protocol improvements from another project
118
+ codev import /path/to/other-project
119
+
120
+ # Import from GitHub
121
+ codev import github:cluesmith/ansari-project
122
+
123
+ # Preview without running Claude
124
+ codev import github:owner/repo --dry-run
125
+ ```
126
+
127
+ ### Consultation Commands
128
+
129
+ ```bash
130
+ # Spec review (during Stage 1)
131
+ consult --model gemini --type spec-review spec 0044
132
+ consult --model codex --type spec-review spec 0044
133
+
134
+ # Plan review (during Stage 2)
135
+ consult --model gemini --type plan-review plan 0044
136
+ consult --model codex --type plan-review plan 0044
137
+
138
+ # Implementation review (during Stage 4, after each phase)
139
+ consult --model gemini --type impl-review spec 0044
140
+ consult --model codex --type impl-review spec 0044
141
+
142
+ # PR ready review (during Stage 5)
143
+ consult --model gemini --type pr-ready pr 88
144
+ consult --model codex --type pr-ready pr 88
145
+
146
+ # Integration review (during Stage 6)
147
+ consult --model gemini --type integration-review pr 88
148
+ consult --model codex --type integration-review pr 88
149
+
150
+ # Parallel 3-way reviews (run all three concurrently)
151
+ consult --model gemini --type spec-review spec 0044 &
152
+ consult --model codex --type spec-review spec 0044 &
153
+ consult --model claude --type spec-review spec 0044 &
154
+ wait
155
+ ```
156
+
157
+ ## Review Types
158
+
159
+ | Type | When Used | Focus |
160
+ |------|-----------|-------|
161
+ | `spec-review` | Stage 1 | Requirements clarity, completeness, feasibility |
162
+ | `plan-review` | Stage 2 | Implementation approach, phase breakdown, risk assessment |
163
+ | `impl-review` | Stage 4 | Code quality, test coverage, spec adherence |
164
+ | `pr-ready` | Stage 5 | Final self-check before PR creation |
165
+ | `integration-review` | Stage 6 | System fit, architectural consistency, side effects |
166
+
167
+ ## Builder Lifecycle
168
+
169
+ ```
170
+ spawning → implementing → blocked → implementing → pr-ready → complete
171
+ ↑______________|
172
+ ```
173
+
174
+ | Status | Meaning |
175
+ |--------|---------|
176
+ | `spawning` | Worktree created, builder starting up |
177
+ | `implementing` | Actively working on the spec |
178
+ | `blocked` | Stuck, needs architect help |
179
+ | `pr-ready` | Implementation complete, ready for review |
180
+ | `complete` | Merged, worktree can be cleaned up |
181
+
182
+ ## Git Workflow
183
+
184
+ ### Branch Naming
185
+ ```
186
+ builder/XXXX-spec-name
187
+ ```
188
+
189
+ ### Commit Messages
190
+ ```
191
+ [Spec XXXX][Implement] Phase description
192
+ [Spec XXXX][Defend] Add tests for phase
193
+ [Spec XXXX][Review] Add lessons learned
194
+ ```
195
+
196
+ ### PR Merge (Builder)
197
+ ```bash
198
+ # CORRECT - preserves branch for worktree
199
+ gh pr merge N --merge
200
+
201
+ # WRONG - breaks worktree
202
+ gh pr merge N --merge --delete-branch
203
+ ```
204
+
205
+ ### Post-Merge Cleanup (Architect)
206
+ ```bash
207
+ git pull # Get merged changes
208
+ af cleanup -p XXXX # Clean up builder worktree
209
+ ```
210
+
211
+ ## Troubleshooting
212
+
213
+ ### Builder Reports Blocked
214
+
215
+ 1. Check builder terminal for blocker message
216
+ 2. Review any `// REVIEW(@architect):` comments in code
217
+ 3. Provide guidance via `af send XXXX "guidance here"`
218
+ 4. Builder will resume work after receiving help
219
+
220
+ ### PR Has Conflicts
221
+
222
+ 1. Architect: `git pull` on main
223
+ 2. Architect: Resolve conflicts or instruct builder
224
+ 3. Builder: Rebase or merge main into branch
225
+ 4. Builder: Force push if needed
226
+
227
+ ### Builder Worktree Broken
228
+
229
+ ```bash
230
+ # Check worktree status
231
+ git worktree list
232
+
233
+ # Force cleanup (only if work is committed/pushed)
234
+ af cleanup -p XXXX --force
235
+ ```
236
+
237
+ ## Related Documentation
238
+
239
+ - Full SPIDER protocol: `codev/protocols/spider/protocol.md`
240
+ - Builder role: `codev/roles/builder.md`
241
+ - Architect role: `codev/roles/architect.md`
242
+ - Consultant role: `codev/roles/consultant.md`