@cluesmith/codev 1.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 (245) hide show
  1. package/bin/af.js +8 -0
  2. package/bin/codev.js +4 -0
  3. package/bin/consult.js +7 -0
  4. package/dist/agent-farm/cli.d.ts +11 -0
  5. package/dist/agent-farm/cli.d.ts.map +1 -0
  6. package/dist/agent-farm/cli.js +359 -0
  7. package/dist/agent-farm/cli.js.map +1 -0
  8. package/dist/agent-farm/commands/cleanup.d.ts +12 -0
  9. package/dist/agent-farm/commands/cleanup.d.ts.map +1 -0
  10. package/dist/agent-farm/commands/cleanup.js +154 -0
  11. package/dist/agent-farm/commands/cleanup.js.map +1 -0
  12. package/dist/agent-farm/commands/db.d.ts +38 -0
  13. package/dist/agent-farm/commands/db.d.ts.map +1 -0
  14. package/dist/agent-farm/commands/db.js +133 -0
  15. package/dist/agent-farm/commands/db.js.map +1 -0
  16. package/dist/agent-farm/commands/index.d.ts +11 -0
  17. package/dist/agent-farm/commands/index.d.ts.map +1 -0
  18. package/dist/agent-farm/commands/index.js +11 -0
  19. package/dist/agent-farm/commands/index.js.map +1 -0
  20. package/dist/agent-farm/commands/open.d.ts +15 -0
  21. package/dist/agent-farm/commands/open.d.ts.map +1 -0
  22. package/dist/agent-farm/commands/open.js +118 -0
  23. package/dist/agent-farm/commands/open.js.map +1 -0
  24. package/dist/agent-farm/commands/rename.d.ts +13 -0
  25. package/dist/agent-farm/commands/rename.d.ts.map +1 -0
  26. package/dist/agent-farm/commands/rename.js +33 -0
  27. package/dist/agent-farm/commands/rename.js.map +1 -0
  28. package/dist/agent-farm/commands/send.d.ts +9 -0
  29. package/dist/agent-farm/commands/send.d.ts.map +1 -0
  30. package/dist/agent-farm/commands/send.js +282 -0
  31. package/dist/agent-farm/commands/send.js.map +1 -0
  32. package/dist/agent-farm/commands/spawn.d.ts +15 -0
  33. package/dist/agent-farm/commands/spawn.d.ts.map +1 -0
  34. package/dist/agent-farm/commands/spawn.js +575 -0
  35. package/dist/agent-farm/commands/spawn.js.map +1 -0
  36. package/dist/agent-farm/commands/start.d.ts +9 -0
  37. package/dist/agent-farm/commands/start.d.ts.map +1 -0
  38. package/dist/agent-farm/commands/start.js +175 -0
  39. package/dist/agent-farm/commands/start.js.map +1 -0
  40. package/dist/agent-farm/commands/status.d.ts +8 -0
  41. package/dist/agent-farm/commands/status.d.ts.map +1 -0
  42. package/dist/agent-farm/commands/status.js +123 -0
  43. package/dist/agent-farm/commands/status.js.map +1 -0
  44. package/dist/agent-farm/commands/stop.d.ts +8 -0
  45. package/dist/agent-farm/commands/stop.d.ts.map +1 -0
  46. package/dist/agent-farm/commands/stop.js +76 -0
  47. package/dist/agent-farm/commands/stop.js.map +1 -0
  48. package/dist/agent-farm/commands/tower.d.ts +19 -0
  49. package/dist/agent-farm/commands/tower.d.ts.map +1 -0
  50. package/dist/agent-farm/commands/tower.js +125 -0
  51. package/dist/agent-farm/commands/tower.js.map +1 -0
  52. package/dist/agent-farm/commands/tutorial.d.ts +10 -0
  53. package/dist/agent-farm/commands/tutorial.d.ts.map +1 -0
  54. package/dist/agent-farm/commands/tutorial.js +49 -0
  55. package/dist/agent-farm/commands/tutorial.js.map +1 -0
  56. package/dist/agent-farm/commands/util.d.ts +15 -0
  57. package/dist/agent-farm/commands/util.d.ts.map +1 -0
  58. package/dist/agent-farm/commands/util.js +108 -0
  59. package/dist/agent-farm/commands/util.js.map +1 -0
  60. package/dist/agent-farm/db/errors.d.ts +17 -0
  61. package/dist/agent-farm/db/errors.d.ts.map +1 -0
  62. package/dist/agent-farm/db/errors.js +46 -0
  63. package/dist/agent-farm/db/errors.js.map +1 -0
  64. package/dist/agent-farm/db/index.d.ts +41 -0
  65. package/dist/agent-farm/db/index.d.ts.map +1 -0
  66. package/dist/agent-farm/db/index.js +168 -0
  67. package/dist/agent-farm/db/index.js.map +1 -0
  68. package/dist/agent-farm/db/migrate.d.ts +15 -0
  69. package/dist/agent-farm/db/migrate.d.ts.map +1 -0
  70. package/dist/agent-farm/db/migrate.js +137 -0
  71. package/dist/agent-farm/db/migrate.js.map +1 -0
  72. package/dist/agent-farm/db/schema.d.ts +16 -0
  73. package/dist/agent-farm/db/schema.d.ts.map +1 -0
  74. package/dist/agent-farm/db/schema.js +103 -0
  75. package/dist/agent-farm/db/schema.js.map +1 -0
  76. package/dist/agent-farm/db/types.d.ts +87 -0
  77. package/dist/agent-farm/db/types.d.ts.map +1 -0
  78. package/dist/agent-farm/db/types.js +65 -0
  79. package/dist/agent-farm/db/types.js.map +1 -0
  80. package/dist/agent-farm/index.d.ts +7 -0
  81. package/dist/agent-farm/index.d.ts.map +1 -0
  82. package/dist/agent-farm/index.js +373 -0
  83. package/dist/agent-farm/index.js.map +1 -0
  84. package/dist/agent-farm/servers/annotate-server.d.ts +9 -0
  85. package/dist/agent-farm/servers/annotate-server.d.ts.map +1 -0
  86. package/dist/agent-farm/servers/annotate-server.js +136 -0
  87. package/dist/agent-farm/servers/annotate-server.js.map +1 -0
  88. package/dist/agent-farm/servers/dashboard-server.d.ts +9 -0
  89. package/dist/agent-farm/servers/dashboard-server.d.ts.map +1 -0
  90. package/dist/agent-farm/servers/dashboard-server.js +939 -0
  91. package/dist/agent-farm/servers/dashboard-server.js.map +1 -0
  92. package/dist/agent-farm/servers/tower-server.d.ts +9 -0
  93. package/dist/agent-farm/servers/tower-server.d.ts.map +1 -0
  94. package/dist/agent-farm/servers/tower-server.js +463 -0
  95. package/dist/agent-farm/servers/tower-server.js.map +1 -0
  96. package/dist/agent-farm/state.d.ts +93 -0
  97. package/dist/agent-farm/state.d.ts.map +1 -0
  98. package/dist/agent-farm/state.js +253 -0
  99. package/dist/agent-farm/state.js.map +1 -0
  100. package/dist/agent-farm/tutorial/index.d.ts +8 -0
  101. package/dist/agent-farm/tutorial/index.d.ts.map +1 -0
  102. package/dist/agent-farm/tutorial/index.js +8 -0
  103. package/dist/agent-farm/tutorial/index.js.map +1 -0
  104. package/dist/agent-farm/tutorial/prompts.d.ts +57 -0
  105. package/dist/agent-farm/tutorial/prompts.d.ts.map +1 -0
  106. package/dist/agent-farm/tutorial/prompts.js +147 -0
  107. package/dist/agent-farm/tutorial/prompts.js.map +1 -0
  108. package/dist/agent-farm/tutorial/runner.d.ts +52 -0
  109. package/dist/agent-farm/tutorial/runner.d.ts.map +1 -0
  110. package/dist/agent-farm/tutorial/runner.js +204 -0
  111. package/dist/agent-farm/tutorial/runner.js.map +1 -0
  112. package/dist/agent-farm/tutorial/state.d.ts +26 -0
  113. package/dist/agent-farm/tutorial/state.d.ts.map +1 -0
  114. package/dist/agent-farm/tutorial/state.js +89 -0
  115. package/dist/agent-farm/tutorial/state.js.map +1 -0
  116. package/dist/agent-farm/tutorial/steps/first-spec.d.ts +7 -0
  117. package/dist/agent-farm/tutorial/steps/first-spec.d.ts.map +1 -0
  118. package/dist/agent-farm/tutorial/steps/first-spec.js +136 -0
  119. package/dist/agent-farm/tutorial/steps/first-spec.js.map +1 -0
  120. package/dist/agent-farm/tutorial/steps/implementation.d.ts +7 -0
  121. package/dist/agent-farm/tutorial/steps/implementation.d.ts.map +1 -0
  122. package/dist/agent-farm/tutorial/steps/implementation.js +76 -0
  123. package/dist/agent-farm/tutorial/steps/implementation.js.map +1 -0
  124. package/dist/agent-farm/tutorial/steps/index.d.ts +10 -0
  125. package/dist/agent-farm/tutorial/steps/index.d.ts.map +1 -0
  126. package/dist/agent-farm/tutorial/steps/index.js +10 -0
  127. package/dist/agent-farm/tutorial/steps/index.js.map +1 -0
  128. package/dist/agent-farm/tutorial/steps/planning.d.ts +7 -0
  129. package/dist/agent-farm/tutorial/steps/planning.d.ts.map +1 -0
  130. package/dist/agent-farm/tutorial/steps/planning.js +143 -0
  131. package/dist/agent-farm/tutorial/steps/planning.js.map +1 -0
  132. package/dist/agent-farm/tutorial/steps/review.d.ts +7 -0
  133. package/dist/agent-farm/tutorial/steps/review.d.ts.map +1 -0
  134. package/dist/agent-farm/tutorial/steps/review.js +78 -0
  135. package/dist/agent-farm/tutorial/steps/review.js.map +1 -0
  136. package/dist/agent-farm/tutorial/steps/setup.d.ts +7 -0
  137. package/dist/agent-farm/tutorial/steps/setup.d.ts.map +1 -0
  138. package/dist/agent-farm/tutorial/steps/setup.js +126 -0
  139. package/dist/agent-farm/tutorial/steps/setup.js.map +1 -0
  140. package/dist/agent-farm/tutorial/steps/welcome.d.ts +7 -0
  141. package/dist/agent-farm/tutorial/steps/welcome.d.ts.map +1 -0
  142. package/dist/agent-farm/tutorial/steps/welcome.js +50 -0
  143. package/dist/agent-farm/tutorial/steps/welcome.js.map +1 -0
  144. package/dist/agent-farm/types.d.ts +131 -0
  145. package/dist/agent-farm/types.d.ts.map +1 -0
  146. package/dist/agent-farm/types.js +5 -0
  147. package/dist/agent-farm/types.js.map +1 -0
  148. package/dist/agent-farm/utils/config.d.ts +27 -0
  149. package/dist/agent-farm/utils/config.d.ts.map +1 -0
  150. package/dist/agent-farm/utils/config.js +242 -0
  151. package/dist/agent-farm/utils/config.js.map +1 -0
  152. package/dist/agent-farm/utils/deps.d.ts +51 -0
  153. package/dist/agent-farm/utils/deps.d.ts.map +1 -0
  154. package/dist/agent-farm/utils/deps.js +194 -0
  155. package/dist/agent-farm/utils/deps.js.map +1 -0
  156. package/dist/agent-farm/utils/index.d.ts +6 -0
  157. package/dist/agent-farm/utils/index.d.ts.map +1 -0
  158. package/dist/agent-farm/utils/index.js +6 -0
  159. package/dist/agent-farm/utils/index.js.map +1 -0
  160. package/dist/agent-farm/utils/logger.d.ts +31 -0
  161. package/dist/agent-farm/utils/logger.d.ts.map +1 -0
  162. package/dist/agent-farm/utils/logger.js +58 -0
  163. package/dist/agent-farm/utils/logger.js.map +1 -0
  164. package/dist/agent-farm/utils/orphan-handler.d.ts +27 -0
  165. package/dist/agent-farm/utils/orphan-handler.d.ts.map +1 -0
  166. package/dist/agent-farm/utils/orphan-handler.js +127 -0
  167. package/dist/agent-farm/utils/orphan-handler.js.map +1 -0
  168. package/dist/agent-farm/utils/port-registry.d.ts +58 -0
  169. package/dist/agent-farm/utils/port-registry.d.ts.map +1 -0
  170. package/dist/agent-farm/utils/port-registry.js +149 -0
  171. package/dist/agent-farm/utils/port-registry.js.map +1 -0
  172. package/dist/agent-farm/utils/shell.d.ts +45 -0
  173. package/dist/agent-farm/utils/shell.d.ts.map +1 -0
  174. package/dist/agent-farm/utils/shell.js +120 -0
  175. package/dist/agent-farm/utils/shell.js.map +1 -0
  176. package/dist/cli.d.ts +10 -0
  177. package/dist/cli.d.ts.map +1 -0
  178. package/dist/cli.js +160 -0
  179. package/dist/cli.js.map +1 -0
  180. package/dist/commands/adopt.d.ts +12 -0
  181. package/dist/commands/adopt.d.ts.map +1 -0
  182. package/dist/commands/adopt.js +178 -0
  183. package/dist/commands/adopt.js.map +1 -0
  184. package/dist/commands/consult/index.d.ts +17 -0
  185. package/dist/commands/consult/index.d.ts.map +1 -0
  186. package/dist/commands/consult/index.js +405 -0
  187. package/dist/commands/consult/index.js.map +1 -0
  188. package/dist/commands/doctor.d.ts +10 -0
  189. package/dist/commands/doctor.d.ts.map +1 -0
  190. package/dist/commands/doctor.js +346 -0
  191. package/dist/commands/doctor.js.map +1 -0
  192. package/dist/commands/init.d.ts +12 -0
  193. package/dist/commands/init.d.ts.map +1 -0
  194. package/dist/commands/init.js +167 -0
  195. package/dist/commands/init.js.map +1 -0
  196. package/dist/commands/tower.d.ts +16 -0
  197. package/dist/commands/tower.d.ts.map +1 -0
  198. package/dist/commands/tower.js +21 -0
  199. package/dist/commands/tower.js.map +1 -0
  200. package/dist/commands/update.d.ts +13 -0
  201. package/dist/commands/update.d.ts.map +1 -0
  202. package/dist/commands/update.js +137 -0
  203. package/dist/commands/update.js.map +1 -0
  204. package/dist/lib/templates.d.ts +57 -0
  205. package/dist/lib/templates.d.ts.map +1 -0
  206. package/dist/lib/templates.js +205 -0
  207. package/dist/lib/templates.js.map +1 -0
  208. package/package.json +55 -0
  209. package/templates/AGENTS.md +49 -0
  210. package/templates/CLAUDE.md +47 -0
  211. package/templates/DEPENDENCIES.md +344 -0
  212. package/templates/agents/architecture-documenter.md +189 -0
  213. package/templates/agents/codev-updater.md +276 -0
  214. package/templates/agents/spider-protocol-updater.md +118 -0
  215. package/templates/annotate.html +903 -0
  216. package/templates/bin/agent-farm +18 -0
  217. package/templates/bin/annotate-server.js +140 -0
  218. package/templates/bin/codev-doctor +335 -0
  219. package/templates/builders.md +30 -0
  220. package/templates/config.json +7 -0
  221. package/templates/dashboard-split.html +1679 -0
  222. package/templates/dashboard.html +149 -0
  223. package/templates/plans/.gitkeep +0 -0
  224. package/templates/protocols/experiment/protocol.md +229 -0
  225. package/templates/protocols/experiment/templates/notes.md +97 -0
  226. package/templates/protocols/maintain/protocol.md +235 -0
  227. package/templates/protocols/spider/protocol.md +639 -0
  228. package/templates/protocols/spider/templates/plan.md +169 -0
  229. package/templates/protocols/spider/templates/review.md +207 -0
  230. package/templates/protocols/spider/templates/spec.md +140 -0
  231. package/templates/protocols/spider-solo/protocol.md +619 -0
  232. package/templates/protocols/spider-solo/templates/plan.md +169 -0
  233. package/templates/protocols/spider-solo/templates/review.md +207 -0
  234. package/templates/protocols/spider-solo/templates/spec.md +140 -0
  235. package/templates/protocols/tick/protocol.md +250 -0
  236. package/templates/protocols/tick/templates/plan.md +67 -0
  237. package/templates/protocols/tick/templates/review.md +90 -0
  238. package/templates/protocols/tick/templates/spec.md +61 -0
  239. package/templates/reviews/.gitkeep +0 -0
  240. package/templates/roles/architect.md +230 -0
  241. package/templates/roles/builder.md +175 -0
  242. package/templates/roles/consultant.md +27 -0
  243. package/templates/specs/.gitkeep +0 -0
  244. package/templates/templates/projectlist.md +129 -0
  245. package/templates/tower.html +1032 -0
@@ -0,0 +1,619 @@
1
+ # SPIDER-SOLO Protocol
2
+
3
+ ## Prerequisites
4
+
5
+ **No External Dependencies Required**:
6
+ - SPIDER-SOLO is a single-agent variant that doesn't require Zen MCP
7
+ - All review and validation is done through self-review
8
+ - Ideal when multi-agent infrastructure is not available
9
+
10
+ ## Protocol Configuration
11
+
12
+ ### Self-Review Only (NO MULTI-AGENT CONSULTATION)
13
+
14
+ **DEFAULT BEHAVIOR:**
15
+ SPIDER-SOLO uses self-review and human approval only.
16
+
17
+ **KEY DIFFERENCE FROM SPIDER:**
18
+ - No multi-agent consultation at any checkpoint
19
+ - All review is done through careful self-examination
20
+ - Emphasis on thorough self-validation before presenting to user
21
+
22
+ **REVIEW APPROACH:**
23
+ - Self-review at each checkpoint where SPIDER would consult agents
24
+ - Use critical thinking to identify gaps and issues
25
+ - Document self-review findings transparently
26
+ - Rely on human feedback for validation
27
+
28
+ ## Overview
29
+ SPIDER-SOLO is a single-agent variant of the SPIDER protocol that emphasizes specification-driven development with iterative implementation and continuous self-review. It maintains the same structured approach but without multi-agent collaboration.
30
+
31
+ **Core Principle**: Each feature is tracked through exactly THREE documents - a specification, a plan, and a review with lessons learned - all sharing the same filename and sequential identifier.
32
+
33
+ ## When to Use SPIDER-SOLO
34
+
35
+ ### Use SPIDER-SOLO for:
36
+ - New feature development (when Zen MCP is not available)
37
+ - Architecture changes (single-agent review)
38
+ - Complex refactoring (self-validated)
39
+ - System design decisions (human-approved)
40
+ - API design and implementation
41
+ - Performance optimization initiatives
42
+
43
+ ### Skip SPIDER-SOLO for:
44
+ - Simple bug fixes (< 10 lines)
45
+ - Documentation updates
46
+ - Configuration changes
47
+ - Dependency updates
48
+ - Emergency hotfixes (but do a lightweight retrospective after)
49
+
50
+ ## Protocol Phases
51
+
52
+ ### S - Specify (Design Exploration with Self-Review)
53
+
54
+ **Purpose**: Thoroughly explore the problem space and solution options before committing to an approach.
55
+
56
+ **Workflow Overview**:
57
+ 1. User provides a prompt describing what they want built
58
+ 2. Agent generates initial specification document
59
+ 3. **COMMIT**: "Initial specification draft"
60
+ 4. Self-review the specification critically
61
+ 5. Agent updates spec based on self-review
62
+ 6. **COMMIT**: "Specification after self-review"
63
+ 7. Human reviews and provides comments for changes
64
+ 8. Agent makes changes and lists what was modified
65
+ 9. **COMMIT**: "Specification with user feedback"
66
+ 10. Final self-review of updated document
67
+ 11. Final updates based on self-review
68
+ 12. **COMMIT**: "Final approved specification"
69
+ 13. Iterate steps 7-12 until user approves and says to proceed to planning
70
+
71
+ **Important**: Keep documentation minimal - use only THREE core files with the same name:
72
+ - `specs/####-descriptive-name.md` - The specification
73
+ - `plans/####-descriptive-name.md` - The implementation plan
74
+ - `reviews/####-descriptive-name.md` - Review and lessons learned (created during Review phase)
75
+
76
+ **Process**:
77
+ 1. **Clarifying Questions** (ALWAYS START HERE)
78
+ - Ask the user/stakeholder questions to understand the problem
79
+ - Probe for hidden requirements and constraints
80
+ - Understand the business context and goals
81
+ - Identify what's in scope and out of scope
82
+ - Continue asking until the problem is crystal clear
83
+
84
+ 2. **Problem Analysis**
85
+ - Clearly articulate the problem being solved
86
+ - Identify stakeholders and their needs
87
+ - Document current state and desired state
88
+ - List assumptions and constraints
89
+
90
+ 3. **Solution Exploration**
91
+ - Generate multiple solution approaches (as many as appropriate)
92
+ - For each approach, document:
93
+ - Technical design
94
+ - Trade-offs (pros/cons)
95
+ - Estimated complexity
96
+ - Risk assessment
97
+
98
+ 4. **Open Questions**
99
+ - List all uncertainties that need resolution
100
+ - Categorize as:
101
+ - Critical (blocks progress)
102
+ - Important (affects design)
103
+ - Nice-to-know (optimization)
104
+
105
+ 5. **Success Criteria**
106
+ - Define measurable acceptance criteria
107
+ - Include performance requirements
108
+ - Specify quality metrics
109
+ - Document test scenarios
110
+
111
+ 6. **Self-Review Process**
112
+ - **First Self-Review** (after initial draft):
113
+ - Critically examine problem clarity and solution completeness
114
+ - Look for missing requirements or edge cases
115
+ - Document self-identified improvements
116
+ - Update specification based on self-review
117
+ - **Second Self-Review** (after human comments):
118
+ - Validate changes align with feedback
119
+ - Ensure specification is comprehensive
120
+ - Final specification refinement
121
+
122
+ **Note**: Self-review only - no multi-agent consultation in SOLO variant
123
+
124
+ **⚠️ IMPORTANT**: Thorough self-review is critical before proceeding
125
+
126
+ **Output**: Single specification document in `codev/specs/####-descriptive-name.md`
127
+ - All self-review findings incorporated directly into this document
128
+ - Include a "Self-Review Notes" section summarizing identified improvements
129
+ - Version control captures evolution through commits
130
+ **Template**: `templates/spec.md`
131
+ **Review Required**: Yes - Human approval AFTER self-review
132
+
133
+ ### P - Plan (Structured Decomposition)
134
+
135
+ **Purpose**: Transform the approved specification into an executable roadmap with clear phases.
136
+
137
+ **⚠️ CRITICAL: No Time Estimates in the AI Age**
138
+ - **NEVER include time estimates** (hours, days, weeks, story points)
139
+ - AI-driven development makes traditional time estimates meaningless
140
+ - Delivery speed depends on iteration cycles, not calendar time
141
+ - Focus on logical dependencies and phase ordering instead
142
+ - Measure progress by completed phases, not elapsed time
143
+ - The only valid metrics are: "done" or "not done"
144
+
145
+ **Workflow Overview**:
146
+ 1. Agent creates initial plan document
147
+ 2. **COMMIT**: "Initial plan draft"
148
+ 3. Self-review the plan thoroughly
149
+ 4. Agent updates plan with self-review findings
150
+ 5. **COMMIT**: "Plan after self-review"
151
+ 6. User reviews and requests modifications
152
+ 7. Agent updates plan based on user feedback
153
+ 8. **COMMIT**: "Plan with user feedback"
154
+ 9. Final self-review of updated plan
155
+ 10. Final updates based on self-review
156
+ 11. **COMMIT**: "Final approved plan"
157
+ 12. Iterate steps 6-11 until agreement is reached
158
+
159
+ **Phase Design Goals**:
160
+ Each phase should be:
161
+ - A separate piece of work that can be checked in as a unit
162
+ - A complete set of functionality
163
+ - Self-contained and independently valuable
164
+
165
+ **Process**:
166
+ 1. **Phase Definition**
167
+ - Break work into logical phases
168
+ - Each phase must:
169
+ - Have a clear, single objective
170
+ - Be independently testable
171
+ - Deliver observable value
172
+ - Be a complete unit that can be committed
173
+ - End with evaluation discussion and single commit
174
+ - Note dependencies inline, for example:
175
+ ```markdown
176
+ Phase 2: API Endpoints
177
+ - Depends on: Phase 1 (Database Schema)
178
+ - Objective: Create /users and /todos endpoints
179
+ - Evaluation: Test coverage, API design review, performance check
180
+ - Commit: Will create single commit after user approval
181
+ ```
182
+
183
+ 2. **Success Metrics**
184
+ - Define "done" for each phase
185
+ - Include test coverage requirements
186
+ - Specify performance benchmarks
187
+ - Document acceptance tests
188
+
189
+ 3. **Self-Review Process**
190
+ - **First Self-Review** (after plan creation):
191
+ - Assess feasibility and phase breakdown
192
+ - Verify completeness of planned approach
193
+ - Update plan based on self-identified gaps
194
+ - **Second Self-Review** (after human review):
195
+ - Validate adjustments align with feedback
196
+ - Confirm approach is sound
197
+ - Final plan refinement
198
+
199
+ **Note**: Self-review only - no multi-agent consultation in SOLO variant
200
+
201
+ **⚠️ IMPORTANT**: Comprehensive self-review required before proceeding
202
+
203
+ **Output**: Single plan document in `codev/plans/####-descriptive-name.md`
204
+ - Same filename as specification, different directory
205
+ - All self-review findings incorporated directly
206
+ - Include phase status tracking within this document
207
+ - **DO NOT include time estimates** - Focus on deliverables and dependencies, not hours/days
208
+ - Version control captures evolution through commits
209
+ **Template**: `templates/plan.md`
210
+ **Review Required**: Yes - Technical lead approval AFTER self-review
211
+
212
+ ### (IDE) - Implementation Loop
213
+
214
+ Execute for each phase in the plan. This is a strict cycle that must be completed in order.
215
+
216
+ **⚠️ MANDATORY**: The I-D-E cycle MUST be completed for EACH PHASE, not just at the end of all phases. Skipping D (Defend) or E (Evaluate) for any phase is a PROTOCOL VIOLATION.
217
+
218
+ **CRITICAL PRECONDITION**: Before starting any phase, verify the previous phase was committed to git. No phase can begin without the prior phase's commit.
219
+
220
+ **Phase Completion Process**:
221
+ 1. **Implement** - Build the code for this phase
222
+ 2. **Defend** - Write comprehensive tests that guard functionality
223
+ 3. **Evaluate** - Assess and discuss with user
224
+ 4. **Commit** - Single atomic commit for the phase (MANDATORY before next phase)
225
+ 5. **Proceed** - Move to next phase only after commit
226
+
227
+ **Handling Failures**:
228
+ - If **Defend** phase reveals gaps → return to **Implement** to fix
229
+ - If **Evaluation** reveals unmet criteria → return to **Implement**
230
+ - If user requests changes → return to **Implement**
231
+ - If fundamental plan flaws found → mark phase as `blocked` and revise plan
232
+
233
+ **Commit Requirements**:
234
+ - Each phase MUST end with a git commit before proceeding
235
+ - Commit message format: `[Spec ####][Phase: name] type: Description`
236
+ - No work on the next phase until current phase is committed
237
+ - If changes are needed after commit, create a new commit with fixes
238
+
239
+ #### I - Implement (Build with Discipline)
240
+
241
+ **Purpose**: Transform the plan into working code with high quality standards.
242
+
243
+ **Precondition**: Previous phase must be committed (verify with `git log`)
244
+
245
+ **Requirements**:
246
+ 1. **Pre-Implementation**
247
+ - Verify previous phase is committed to git
248
+ - Review the phase plan and success criteria
249
+ - Set up the development environment
250
+ - Create feature branch following naming convention
251
+ - Document any plan deviations immediately
252
+
253
+ 2. **During Implementation**
254
+ - Write self-documenting code
255
+ - Follow project style guide strictly
256
+ - Implement incrementally with frequent commits
257
+ - Each commit must:
258
+ - Be atomic (single logical change)
259
+ - Include descriptive message
260
+ - Reference the phase
261
+ - Pass basic syntax checks
262
+
263
+ 3. **Code Quality Standards**
264
+ - No commented-out code
265
+ - No debug prints in final code
266
+ - Handle all error cases explicitly
267
+ - Include necessary logging
268
+ - Follow security best practices
269
+
270
+ 4. **Documentation Requirements**
271
+ - Update API documentation
272
+ - Add inline comments for complex logic
273
+ - Update README if needed
274
+ - Document configuration changes
275
+
276
+ **Evidence Required**:
277
+ - Link to commits
278
+ - Code review approval (if applicable)
279
+ - No linting errors
280
+ - CI pipeline pass link (build/test/lint)
281
+
282
+ **Self-Review Process**:
283
+ - Critically review code quality, patterns, security, best practices
284
+ - Look for potential improvements and issues
285
+ - Update code based on self-identified concerns before proceeding
286
+
287
+ #### D - Defend (Write Comprehensive Tests)
288
+
289
+ **Purpose**: Create comprehensive automated tests that safeguard intended behavior and prevent regressions.
290
+
291
+ **CRITICAL**: Tests must be written IMMEDIATELY after implementation, NOT retroactively at the end of all phases. This is MANDATORY.
292
+
293
+ **Requirements**:
294
+ 1. **Defensive Test Creation**
295
+ - Write unit tests for all new functions
296
+ - Create integration tests for feature flows
297
+ - Develop edge case coverage
298
+ - Build error condition tests
299
+ - Establish performance benchmarks
300
+
301
+ 2. **Test Validation** (ALL MANDATORY)
302
+ - All new tests must pass
303
+ - All existing tests must pass
304
+ - No reduction in overall coverage
305
+ - Performance benchmarks met
306
+ - Security scans pass
307
+ - **Avoid Overmocking**:
308
+ - Test behavior, not implementation details
309
+ - Prefer integration tests over unit tests with heavy mocking
310
+ - Only mock external dependencies (APIs, databases, file systems)
311
+ - Never mock the system under test itself
312
+ - Use real implementations for internal module boundaries
313
+
314
+ 3. **Test Suite Documentation**
315
+ - Document test scenarios
316
+ - Explain complex test setups
317
+ - Note any flaky tests
318
+ - Record performance baselines
319
+
320
+ **Evidence Required**:
321
+ - Test execution logs
322
+ - Coverage report (show no reduction)
323
+ - Performance test results (if applicable per spec)
324
+ - Security scan results (if configured)
325
+ - CI test run link with artifacts
326
+
327
+ **Self-Review Process**:
328
+ - Review test coverage completeness and edge cases
329
+ - Assess defensive patterns and test strategy
330
+ - Write additional tests based on self-identified gaps
331
+ - Document review findings for evaluation discussion
332
+
333
+ #### E - Evaluate (Assess Objectively)
334
+
335
+ **Purpose**: Verify the implementation fully satisfies the phase requirements and maintains system quality. This is where the critical discussion happens before committing the phase.
336
+
337
+ **Requirements**:
338
+ 1. **Functional Evaluation**
339
+ - All acceptance criteria met
340
+ - User scenarios work as expected
341
+ - Edge cases handled properly
342
+ - Error messages are helpful
343
+
344
+ 2. **Non-Functional Evaluation**
345
+ - Performance requirements satisfied
346
+ - Security standards maintained
347
+ - Code maintainability assessed
348
+ - Technical debt documented
349
+
350
+ 3. **Deviation Analysis**
351
+ - Document any changes from plan
352
+ - Explain reasoning for changes
353
+ - Assess impact on other phases
354
+ - Update future phases if needed
355
+ - **Overmocking Check** (MANDATORY):
356
+ - Verify tests focus on behavior, not implementation
357
+ - Ensure at least one integration test per critical path
358
+ - Check that internal module boundaries use real implementations
359
+ - Confirm mocks are only used for external dependencies
360
+ - Tests should survive refactoring that preserves behavior
361
+
362
+ 4. **Final Self-Review Before User Evaluation**
363
+ - Perform thorough self-assessment of the phase
364
+ - Identify and fix any remaining issues
365
+ - **CRITICAL**: Ensure high confidence in the implementation
366
+ - Only proceed to user evaluation after thorough self-validation
367
+ - If any doubts remain, address them FIRST
368
+
369
+ 5. **Evaluation Discussion with User**
370
+ - Present to user: "Phase X complete. Here's what was built: [summary]"
371
+ - Share test results and coverage metrics
372
+ - Share self-review findings and confidence level
373
+ - Ask: "Any changes needed before I commit this phase?"
374
+ - Incorporate user feedback if requested
375
+ - Get explicit approval to proceed
376
+
377
+ 6. **Phase Commit** (MANDATORY - NO EXCEPTIONS)
378
+ - Create single atomic commit for the entire phase
379
+ - Commit message: `[Spec ####][Phase: name] type: Description`
380
+ - Update the plan document marking this phase as complete
381
+ - Push all changes to version control
382
+ - Document any deviations or decisions in the plan
383
+ - **CRITICAL**: Next phase CANNOT begin until this commit is complete
384
+ - Verify commit with `git log` before proceeding
385
+
386
+ 7. **Final Verification**
387
+ - Confirm all self-review findings were addressed
388
+ - Verify all tests pass
389
+ - Check that documentation is updated
390
+ - Ensure no outstanding concerns from user
391
+
392
+ **Evidence Required**:
393
+ - Evaluation checklist completed
394
+ - Test results and coverage report
395
+ - Self-review notes and findings
396
+ - User approval from evaluation discussion
397
+ - Updated plan document with:
398
+ - Phase marked complete
399
+ - Evaluation discussion summary
400
+ - Any deviations noted
401
+ - Git commit for this phase
402
+ - Final CI run link after all fixes
403
+
404
+ ## 📋 PHASE COMPLETION CHECKLIST (MANDATORY BEFORE NEXT PHASE)
405
+
406
+ **⚠️ STOP: DO NOT PROCEED TO NEXT PHASE UNTIL ALL ITEMS ARE ✅**
407
+
408
+ ### Before Starting ANY Phase:
409
+ - [ ] Previous phase is committed to git (verify with `git log`)
410
+ - [ ] Plan document shows previous phase as `completed`
411
+ - [ ] No outstanding issues from previous phase
412
+
413
+ ### After Implement Phase:
414
+ - [ ] All code for this phase is complete
415
+ - [ ] Code follows project style guide
416
+ - [ ] No commented-out code or debug prints
417
+ - [ ] Error handling is implemented
418
+ - [ ] Documentation is updated (if needed)
419
+ - [ ] Self-review completed (critical examination)
420
+ - [ ] Self-identified issues have been fixed
421
+
422
+ ### After Defend Phase:
423
+ - [ ] Unit tests written for all new functions
424
+ - [ ] Integration tests written for critical paths
425
+ - [ ] Edge cases have test coverage
426
+ - [ ] All new tests are passing
427
+ - [ ] All existing tests still pass
428
+ - [ ] No reduction in code coverage
429
+ - [ ] Overmocking check completed (tests focus on behavior)
430
+ - [ ] Self-review of test coverage completed
431
+ - [ ] Test gaps identified and addressed
432
+
433
+ ### After Evaluate Phase:
434
+ - [ ] All acceptance criteria from spec are met
435
+ - [ ] Performance requirements satisfied
436
+ - [ ] Security standards maintained
437
+ - [ ] Thorough self-assessment completed
438
+ - [ ] High confidence in implementation achieved
439
+ - [ ] User evaluation discussion completed
440
+ - [ ] User has given explicit approval to proceed
441
+ - [ ] Plan document updated with phase status
442
+ - [ ] Phase commit created with proper message format
443
+ - [ ] Commit pushed to version control
444
+ - [ ] Commit verified with `git log`
445
+
446
+ ### ❌ PHASE BLOCKERS (Fix Before Proceeding):
447
+ - Any failing tests
448
+ - Unresolved self-review concerns
449
+ - Missing user approval
450
+ - Uncommitted changes
451
+ - Incomplete documentation
452
+ - Coverage reduction
453
+ - Low confidence in implementation
454
+
455
+ **REMINDER**: Each phase is atomic. You cannot start the next phase until the current phase is fully complete, tested, evaluated, and committed.
456
+
457
+ ### R - Review/Refine/Revise (Continuous Improvement)
458
+
459
+ **Purpose**: Ensure overall coherence, capture learnings, and improve the methodology.
460
+
461
+ **Precondition**: All implementation phases must be committed (verify with `git log --oneline | grep "\[Phase"`)
462
+
463
+ **Process**:
464
+ 1. **Comprehensive Review**
465
+ - Verify all phases have been committed to git
466
+ - Compare final implementation to original specification
467
+ - Assess overall architecture impact
468
+ - Review code quality across all changes
469
+ - Validate documentation completeness
470
+
471
+ 2. **Refinement Actions**
472
+ - Refactor code for clarity if needed
473
+ - Optimize performance bottlenecks
474
+ - Improve test coverage gaps
475
+ - Enhance documentation
476
+
477
+ 3. **Revision Requirements** (MANDATORY)
478
+ - Update README.md with any new features or changes
479
+ - Update AGENTS.md and CLAUDE.md with protocol improvements from lessons learned
480
+ - Update specification and plan documents with final status
481
+ - Revise architectural diagrams if needed
482
+ - Update API documentation
483
+ - Modify deployment guides as necessary
484
+ - **CRITICAL**: Update this protocol document based on lessons learned
485
+
486
+ 4. **Systematic Issue Review** (MANDATORY)
487
+ - Review entire project for systematic issues:
488
+ - Repeated problems across phases
489
+ - Process bottlenecks or inefficiencies
490
+ - Missing documentation patterns
491
+ - Technical debt accumulation
492
+ - Testing gaps or quality issues
493
+ - Document systematic findings in lessons learned
494
+ - Create action items for addressing systematic issues
495
+
496
+ 5. **Lessons Learned** (MANDATORY)
497
+ - What went well?
498
+ - What was challenging?
499
+ - What would you do differently?
500
+ - What methodology improvements are needed?
501
+ - What systematic issues were identified?
502
+
503
+ 6. **Methodology Evolution**
504
+ - Propose process improvements based on lessons
505
+ - Update protocol documents with improvements
506
+ - Update templates if needed
507
+ - Share learnings with team
508
+ - Document in `codev/reviews/`
509
+ - **Important**: This protocol should evolve based on each project's learnings
510
+
511
+ **Output**:
512
+ - Single review document in `codev/reviews/####-descriptive-name.md`
513
+ - Same filename as spec/plan, captures review and learnings from this feature
514
+ - Methodology improvement proposals (update protocol if needed)
515
+
516
+ **Review Required**: Yes - Team retrospective recommended
517
+
518
+ ## File Naming Conventions
519
+
520
+ ### Specifications and Plans
521
+ Format: `####-descriptive-name.md`
522
+ - Use sequential numbering (0001, 0002, etc.)
523
+ - Same filename in both `specs/` and `plans/` directories
524
+ - Example: `0001-user-authentication.md`
525
+
526
+ ## Status Tracking
527
+
528
+ Status is tracked at the **phase level** within plan documents, not at the document level.
529
+
530
+ Each phase in a plan should have a status:
531
+ - `pending`: Not started
532
+ - `in-progress`: Currently being worked on
533
+ - `completed`: Phase finished and tested
534
+ - `blocked`: Cannot proceed due to external factors
535
+
536
+ ## Git Integration
537
+
538
+ ### Commit Message Format
539
+
540
+ For specification/plan documents:
541
+ ```
542
+ [Spec ####] <stage>: <description>
543
+ ```
544
+
545
+ Examples:
546
+ ```
547
+ [Spec 0001] Initial specification draft
548
+ [Spec 0001] Specification after self-review
549
+ [Spec 0001] Specification with user feedback
550
+ [Spec 0001] Final approved specification
551
+ ```
552
+
553
+ For implementation:
554
+ ```
555
+ [Spec ####][Phase: <phase-name>] <type>: <description>
556
+
557
+ <optional detailed description>
558
+ ```
559
+
560
+ Example:
561
+ ```
562
+ [Spec 0001][Phase: user-auth] feat: Add password hashing service
563
+
564
+ Implements bcrypt-based password hashing with configurable rounds
565
+ ```
566
+
567
+ ### Branch Naming
568
+ ```
569
+ spider/####-<spec-name>/<phase-name>
570
+ ```
571
+
572
+ Example:
573
+ ```
574
+ spider/0001-user-authentication/database-schema
575
+ ```
576
+
577
+
578
+ ## Best Practices
579
+
580
+ ### During Specification
581
+ - Use clear, unambiguous language
582
+ - Include concrete examples
583
+ - Define measurable success criteria
584
+ - Link to relevant references
585
+
586
+ ### During Planning
587
+ - Keep phases small and focused
588
+ - Ensure each phase delivers value
589
+ - Note phase dependencies inline (no formal dependency mapping needed)
590
+ - Include rollback strategies
591
+
592
+ ### During Implementation
593
+ - Follow the plan but document deviations
594
+ - Maintain test coverage
595
+ - Keep commits atomic and well-described
596
+ - Update documentation as you go
597
+
598
+ ### During Review
599
+ - Check against original specification
600
+ - Document lessons learned
601
+ - Propose methodology improvements
602
+ - Update estimates for future work
603
+
604
+ ## Templates
605
+
606
+ Templates for each phase are available in the `templates/` directory:
607
+ - `spec.md` - Specification template
608
+ - `plan.md` - Planning template (includes phase status tracking)
609
+ - `review.md` - Review and lessons learned template
610
+
611
+ **Remember**: Only create THREE documents per feature - spec, plan, and review with the same filename in different directories.
612
+
613
+ ## Protocol Evolution
614
+
615
+ This protocol can be customized per project:
616
+ 1. Fork the protocol directory
617
+ 2. Modify templates and processes
618
+ 3. Document changes in `protocol-changes.md`
619
+ 4. Share improvements back to the community