@cluesmith/codev 2.0.0-rc.2 → 2.0.0-rc.4

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.
@@ -0,0 +1,241 @@
1
+ # EVALUATE Phase Prompt
2
+
3
+ You are executing the **EVALUATE** phase of the SPIDER protocol.
4
+
5
+ ## Your Goal
6
+
7
+ Verify the implementation fully satisfies the phase requirements, run mandatory multi-agent consultation, and then commit the completed phase.
8
+
9
+ ## CRITICAL: Multi-Agent Consultation is MANDATORY
10
+
11
+ **DO NOT COMMIT without consultation approval.** This is a BLOCKING requirement.
12
+
13
+ The evaluation process is:
14
+ 1. Verify implementation and tests
15
+ 2. Run multi-agent consultation (GPT-5 Codex + Gemini Pro)
16
+ 3. Address any feedback
17
+ 4. Get human approval
18
+ 5. ONLY THEN commit
19
+
20
+ ## Context
21
+
22
+ - **Project ID**: {{project_id}}
23
+ - **Project Title**: {{title}}
24
+ - **Current State**: {{current_state}}
25
+ - **Plan Phase**: {{plan_phase}} (if applicable)
26
+ - **Spec File**: `codev/specs/{{project_id}}-{{title}}.md`
27
+ - **Plan File**: `codev/plans/{{project_id}}-{{title}}.md`
28
+
29
+ ## Prerequisites
30
+
31
+ Before evaluating, verify:
32
+ 1. Implementation is complete
33
+ 2. Tests are written and passing
34
+ 3. Build passes
35
+ 4. Lint passes (if configured)
36
+
37
+ ## Process
38
+
39
+ ### 1. Functional Evaluation
40
+
41
+ Check against the spec's success criteria:
42
+
43
+ - [ ] All acceptance criteria met?
44
+ - [ ] User scenarios work as expected?
45
+ - [ ] Edge cases handled properly?
46
+ - [ ] Error messages are helpful?
47
+
48
+ ### 2. Non-Functional Evaluation
49
+
50
+ Assess quality attributes:
51
+
52
+ - [ ] Performance acceptable?
53
+ - [ ] Security standards maintained?
54
+ - [ ] Code is maintainable?
55
+ - [ ] No unnecessary complexity?
56
+
57
+ ### 3. Spec Compliance Check
58
+
59
+ Compare implementation to specification:
60
+
61
+ - [ ] Does exactly what spec says (no more, no less)?
62
+ - [ ] Handles all scenarios mentioned in spec?
63
+ - [ ] Matches the expected behavior described?
64
+
65
+ ### 4. Test Quality Check
66
+
67
+ Verify test coverage:
68
+
69
+ - [ ] All new code has tests?
70
+ - [ ] Tests cover happy path AND error cases?
71
+ - [ ] No overmocking (tests use real implementations where possible)?
72
+ - [ ] Tests would catch regressions?
73
+
74
+ ### 5. Deviation Analysis
75
+
76
+ If implementation differs from plan:
77
+
78
+ - Document what changed and why
79
+ - Assess impact on other phases
80
+ - Update plan if needed
81
+
82
+ ### 6. MANDATORY: Multi-Agent Consultation
83
+
84
+ **Before committing, run consultation:**
85
+
86
+ ```bash
87
+ # Run consultations in parallel (REQUIRED)
88
+ consult --model gemini --type impl-review spec {{project_id}} &
89
+ consult --model codex --type impl-review spec {{project_id}} &
90
+ wait
91
+ ```
92
+
93
+ - Review ALL feedback from both models
94
+ - Address any issues raised
95
+ - Document feedback in the phase evaluation notes
96
+
97
+ **If consultants identify issues:**
98
+ - Return to Implement or Defend as needed
99
+ - Fix the issues
100
+ - Re-run consultation
101
+ - Do NOT commit until consultation passes
102
+
103
+ ### 7. Human Review
104
+
105
+ After consultation feedback is incorporated:
106
+ - Present evaluation summary for human review
107
+ - Wait for approval to commit
108
+ - If changes requested, address them and re-consult if significant
109
+
110
+ ### 8. Phase Commit (After Approval Only)
111
+
112
+ **CRITICAL**: Only commit after consultation and human approval.
113
+
114
+ ```bash
115
+ # Stage all changes for this phase - NEVER use git add . or git add -A
116
+ git add <specific-files>
117
+
118
+ # Commit with proper format
119
+ git commit -m "[Spec {{project_id}}][Phase: {{plan_phase}}] feat: <description>"
120
+ ```
121
+
122
+ Commit message format:
123
+ - `[Spec XXXX][Phase: name] feat:` for new features
124
+ - `[Spec XXXX][Phase: name] fix:` for bug fixes
125
+ - `[Spec XXXX][Phase: name] refactor:` for refactoring
126
+
127
+ ### 9. Update Plan Status
128
+
129
+ Mark this phase as complete in the plan document.
130
+
131
+ ## Output
132
+
133
+ - Completed evaluation checklist
134
+ - Phase committed to git
135
+ - Plan updated with phase status
136
+
137
+ ## Signals
138
+
139
+ Emit appropriate signals based on your progress:
140
+
141
+ - After initial evaluation passes (before consultation):
142
+ ```
143
+ <signal>EVALUATION_PASSED</signal>
144
+ ```
145
+
146
+ - After consultation feedback is incorporated:
147
+ ```
148
+ <signal>CONSULTATION_INCORPORATED</signal>
149
+ ```
150
+
151
+ - After human approves and commit is complete:
152
+ ```
153
+ <signal>EVALUATION_COMPLETE</signal>
154
+ ```
155
+
156
+ - If evaluation reveals spec non-compliance:
157
+ ```
158
+ <signal>SPEC_VIOLATION:description</signal>
159
+ ```
160
+ (Signals return to Implement)
161
+
162
+ - If tests reveal bugs:
163
+ ```
164
+ <signal>IMPLEMENTATION_BUG:description</signal>
165
+ ```
166
+ (Signals return to Implement)
167
+
168
+ - If consultation identifies issues:
169
+ ```
170
+ <signal>CONSULTATION_ISSUES:description</signal>
171
+ ```
172
+ (Signals return to Implement or Defend)
173
+
174
+ - If all plan phases are complete:
175
+ ```
176
+ <signal>ALL_PHASES_COMPLETE</signal>
177
+ ```
178
+ (Signals transition to Review)
179
+
180
+ ## Evaluation Checklist Template
181
+
182
+ ```markdown
183
+ ## Phase Evaluation: {{plan_phase}}
184
+
185
+ ### Functional
186
+ - [ ] Acceptance criteria 1: [status]
187
+ - [ ] Acceptance criteria 2: [status]
188
+ - [ ] Edge cases handled: [status]
189
+
190
+ ### Non-Functional
191
+ - [ ] Performance: [acceptable/needs work]
192
+ - [ ] Security: [reviewed/concerns]
193
+ - [ ] Maintainability: [good/needs refactor]
194
+
195
+ ### Tests
196
+ - [ ] Coverage: [X%]
197
+ - [ ] All tests passing: [yes/no]
198
+ - [ ] Overmocking check: [passed/failed]
199
+
200
+ ### Spec Compliance
201
+ - [ ] Matches spec requirements: [yes/no]
202
+ - [ ] Deviations: [none/list them]
203
+
204
+ ### Commit
205
+ - [ ] Changes staged
206
+ - [ ] Commit created: [hash]
207
+ - [ ] Plan updated
208
+ ```
209
+
210
+ ## Important Notes
211
+
212
+ 1. **Consultation is MANDATORY** - Cannot skip GPT-5 + Gemini reviews
213
+ 2. **Be honest** - If something isn't right, fix it before committing
214
+ 3. **Don't skip the checklist** - It catches issues before they compound
215
+ 4. **Atomic commits** - One commit per phase, not multiple
216
+ 5. **Update the plan** - Mark phase status after commit
217
+ 6. **Verify the commit** - `git log --oneline -1` should show your commit
218
+
219
+ ## What NOT to Do
220
+
221
+ - Don't commit without consultation approval (BLOCKING)
222
+ - Don't commit if tests are failing
223
+ - Don't commit if build is broken
224
+ - Don't skip the spec compliance check
225
+ - Don't commit multiple phases together
226
+ - Don't proceed to next phase without committing
227
+ - Don't use `git add .` or `git add -A` (security risk)
228
+
229
+ ## Handling Failures
230
+
231
+ **If spec compliance fails**:
232
+ Return to Implement, fix the issue, re-run Defend, then Evaluate again.
233
+
234
+ **If tests fail**:
235
+ Return to Implement to fix bugs, or Defend to fix tests.
236
+
237
+ **If build fails**:
238
+ Return to Implement to fix build errors.
239
+
240
+ **If you discover a spec problem**:
241
+ Signal `BLOCKED` and describe the spec issue. The Architect may need to update the spec.
@@ -0,0 +1,149 @@
1
+ # IMPLEMENT Phase Prompt
2
+
3
+ You are executing the **IMPLEMENT** phase of the SPIDER protocol.
4
+
5
+ ## Your Goal
6
+
7
+ Write clean, well-structured code that implements the current plan phase.
8
+
9
+ ## Context
10
+
11
+ - **Project ID**: {{project_id}}
12
+ - **Project Title**: {{title}}
13
+ - **Current State**: {{current_state}}
14
+ - **Plan Phase**: {{plan_phase}} (if applicable)
15
+ - **Spec File**: `codev/specs/{{project_id}}-{{title}}.md`
16
+ - **Plan File**: `codev/plans/{{project_id}}-{{title}}.md`
17
+
18
+ ## Consultation Context
19
+
20
+ **Implementation does NOT require consultation checkpoints** - that happens after Defend.
21
+
22
+ However, you should be aware:
23
+ - Spec and Plan have already been reviewed by GPT-5 Codex and Gemini Pro
24
+ - After you complete Implement + Defend, your work will be reviewed
25
+ - Implementation must strictly follow the approved spec and plan
26
+
27
+ ## Prerequisites
28
+
29
+ Before implementing, verify:
30
+ 1. Previous phase (if any) is committed to git
31
+ 2. You've read the plan phase you're implementing
32
+ 3. You understand the success criteria for this phase
33
+ 4. Dependencies from earlier phases are available
34
+
35
+ ## Process
36
+
37
+ ### 1. Review the Plan Phase
38
+
39
+ Read the current phase in the plan:
40
+ - What is the objective?
41
+ - What files need to be created/modified?
42
+ - What are the success criteria?
43
+ - What dependencies exist?
44
+
45
+ ### 2. Set Up
46
+
47
+ - Verify you're on the correct branch
48
+ - Check that previous phase is committed: `git log --oneline -5`
49
+ - Ensure build passes before starting: `npm run build` (or equivalent)
50
+
51
+ ### 3. Implement
52
+
53
+ Write the code following these principles:
54
+
55
+ **Code Quality Standards**:
56
+ - Self-documenting code (clear names, obvious structure)
57
+ - No commented-out code
58
+ - No debug prints in final code
59
+ - Explicit error handling
60
+ - Follow project style guide
61
+
62
+ **Implementation Approach**:
63
+ - Work on one file at a time
64
+ - Make small, incremental changes
65
+ - Test as you go (manual verification is fine here)
66
+ - Document complex logic with comments
67
+
68
+ ### 4. Self-Review
69
+
70
+ Before signaling completion:
71
+ - Read through all changes
72
+ - Check for obvious bugs
73
+ - Verify code matches the spec requirements
74
+ - Ensure no accidental debug code
75
+
76
+ ### 5. Build Verification
77
+
78
+ Run build checks using **project-specific commands**:
79
+
80
+ ```bash
81
+ # Check package.json scripts or Makefile for actual commands
82
+ # Common patterns:
83
+ npm run build # Node.js/TypeScript projects
84
+ npm run typecheck # TypeScript type checking
85
+ npm run lint # Linting (ESLint, etc.)
86
+ cargo build # Rust projects
87
+ go build ./... # Go projects
88
+ make build # Projects using Makefiles
89
+ ```
90
+
91
+ **Important**: Don't assume `npm run build` exists. Check `package.json` or equivalent first.
92
+
93
+ Fix any errors before proceeding.
94
+
95
+ ## Output
96
+
97
+ - Modified/created source files as specified in the plan phase
98
+ - All build checks passing
99
+ - Code ready for the Defend (testing) phase
100
+
101
+ ## Signals
102
+
103
+ Emit appropriate signals based on your progress:
104
+
105
+ - After implementation is complete and builds pass:
106
+ ```
107
+ <signal>PHASE_IMPLEMENTED</signal>
108
+ ```
109
+
110
+ - If you encounter a blocker:
111
+ ```
112
+ <signal>BLOCKED:reason goes here</signal>
113
+ ```
114
+
115
+ - If you need spec/plan clarification:
116
+ ```
117
+ <signal>NEEDS_CLARIFICATION:specific question</signal>
118
+ ```
119
+
120
+ ## Important Notes
121
+
122
+ 1. **Follow the plan** - Implement what's specified, not more
123
+ 2. **Don't over-engineer** - Simplest solution that works
124
+ 3. **Don't skip error handling** - But don't go overboard either
125
+ 4. **Keep changes focused** - Only touch files in this phase
126
+ 5. **Build must pass** - Don't proceed if build fails
127
+
128
+ ## What NOT to Do
129
+
130
+ - Don't write tests yet (that's Defend phase)
131
+ - Don't modify files outside this phase's scope
132
+ - Don't add features not in the spec
133
+ - Don't leave TODO comments for later (fix now or note as blocker)
134
+ - Don't commit yet (that happens after Defend + Evaluate)
135
+ - Don't use `git add .` or `git add -A` when you do commit (security risk)
136
+
137
+ ## Handling Problems
138
+
139
+ **If the plan is unclear**:
140
+ Signal `NEEDS_CLARIFICATION` with your specific question.
141
+
142
+ **If you discover the spec is wrong**:
143
+ Signal `BLOCKED` and explain the issue. The Architect may need to update the spec.
144
+
145
+ **If a dependency is missing**:
146
+ Signal `BLOCKED` with details about what's missing.
147
+
148
+ **If build fails and you can't fix it**:
149
+ Signal `BLOCKED` with the error message.
@@ -0,0 +1,214 @@
1
+ # PLAN Phase Prompt
2
+
3
+ You are executing the **PLAN** phase of the SPIDER protocol.
4
+
5
+ ## Your Goal
6
+
7
+ Transform the approved specification into an executable implementation plan with clear phases.
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
+ - **Plan File**: `codev/plans/{{project_id}}-{{title}}.md`
16
+
17
+ ## CRITICAL: Multi-Agent Consultation is MANDATORY
18
+
19
+ The SPIDER protocol **requires** consultation with GPT-5 Codex AND Gemini Pro at specific checkpoints. This is BLOCKING - you cannot proceed without completing consultations.
20
+
21
+ ## Prerequisites
22
+
23
+ Before planning, verify:
24
+ 1. The specification exists and has been approved
25
+ 2. You've read and understood the entire spec
26
+ 3. Success criteria are clear and measurable
27
+
28
+ ## Process
29
+
30
+ ### 1. Analyze the Specification
31
+
32
+ Read the spec thoroughly. Identify:
33
+ - All functional requirements
34
+ - Non-functional requirements
35
+ - Dependencies and constraints
36
+ - Success criteria to validate against
37
+
38
+ ### 2. Identify Implementation Phases
39
+
40
+ Break the work into logical phases. Each phase should be:
41
+ - **Self-contained** - A complete unit of functionality
42
+ - **Independently testable** - Can be verified on its own
43
+ - **Valuable** - Delivers observable progress
44
+ - **Committable** - Can be a single atomic commit
45
+
46
+ Good phase examples:
47
+ - "Database Schema" - Creates all tables/migrations
48
+ - "Core API Endpoints" - Implements main REST routes
49
+ - "Authentication Flow" - Handles login/logout/session
50
+
51
+ Bad phase examples:
52
+ - "Setup" - Too vague
53
+ - "Part 1" - Not descriptive
54
+ - "Everything" - Not broken down
55
+
56
+ ### 3. Define Each Phase
57
+
58
+ For each phase, document:
59
+ - **Objective** - Single clear goal
60
+ - **Files to modify/create** - Specific paths
61
+ - **Dependencies** - Which phases must complete first
62
+ - **Success criteria** - How to know it's done
63
+ - **Test approach** - What tests will verify it
64
+
65
+ ### 4. Order Phases by Dependencies
66
+
67
+ Arrange phases so dependencies are satisfied:
68
+ ```
69
+ Phase 1: Database Schema (no dependencies)
70
+ Phase 2: Data Models (depends on Phase 1)
71
+ Phase 3: API Endpoints (depends on Phase 2)
72
+ Phase 4: Frontend Integration (depends on Phase 3)
73
+ ```
74
+
75
+ ### 5. MANDATORY: First Consultation (After Draft)
76
+
77
+ After completing the initial plan draft:
78
+
79
+ ```bash
80
+ # Run consultations in parallel (REQUIRED)
81
+ consult --model gemini plan {{project_id}} &
82
+ consult --model codex plan {{project_id}} &
83
+ wait
84
+ ```
85
+
86
+ - Review ALL feedback from both models
87
+ - Update the plan with incorporated feedback
88
+ - Add a **Consultation Log** section documenting:
89
+ - Key feedback received
90
+ - Changes made in response
91
+ - Any feedback intentionally not incorporated (with reasoning)
92
+
93
+ ### 6. Human Review
94
+
95
+ After consultation feedback is incorporated:
96
+ - Present the plan for human review
97
+ - Wait for approval or change requests
98
+ - If changes requested, make them and proceed to Step 7
99
+
100
+ ### 7. MANDATORY: Second Consultation (After Human Feedback)
101
+
102
+ After incorporating human feedback:
103
+
104
+ ```bash
105
+ # Run consultations again (REQUIRED)
106
+ consult --model gemini plan {{project_id}} &
107
+ consult --model codex plan {{project_id}} &
108
+ wait
109
+ ```
110
+
111
+ - Update Consultation Log with new feedback
112
+ - Incorporate changes
113
+ - Prepare final plan for approval
114
+
115
+ ## Output
116
+
117
+ Create the plan file at `codev/plans/{{project_id}}-{{title}}.md`.
118
+
119
+ Use the plan template from `codev/protocols/spider/templates/plan.md` if available.
120
+
121
+ ### Plan Structure
122
+
123
+ ```markdown
124
+ # Implementation Plan: {{title}}
125
+
126
+ ## Overview
127
+ Brief summary of what will be implemented.
128
+
129
+ ## Phases
130
+
131
+ ### Phase 1: [Name]
132
+ - **Objective**: [Single clear goal]
133
+ - **Files**: [List of files to create/modify]
134
+ - **Dependencies**: None
135
+ - **Success Criteria**: [How to verify completion]
136
+ - **Tests**: [What tests will be written]
137
+
138
+ ### Phase 2: [Name]
139
+ - **Objective**: [Single clear goal]
140
+ - **Files**: [List of files]
141
+ - **Dependencies**: Phase 1
142
+ - **Success Criteria**: [Verification method]
143
+ - **Tests**: [Test approach]
144
+
145
+ [Continue for all phases...]
146
+
147
+ ## Risk Assessment
148
+ - [Risk 1]: [Mitigation]
149
+ - [Risk 2]: [Mitigation]
150
+
151
+ ## Consultation Log
152
+
153
+ ### First Consultation (After Draft)
154
+ - **Gemini Feedback**: [Summary]
155
+ - **Codex Feedback**: [Summary]
156
+ - **Changes Made**: [List]
157
+ - **Not Incorporated**: [List with reasons]
158
+
159
+ ### Second Consultation (After Human Feedback)
160
+ - **Gemini Feedback**: [Summary]
161
+ - **Codex Feedback**: [Summary]
162
+ - **Changes Made**: [List]
163
+ ```
164
+
165
+ ## Signals
166
+
167
+ Emit appropriate signals based on your progress:
168
+
169
+ - After completing the plan draft:
170
+ ```
171
+ <signal>PLAN_DRAFTED</signal>
172
+ ```
173
+
174
+ - After incorporating consultation feedback:
175
+ ```
176
+ <signal>CONSULTATION_INCORPORATED</signal>
177
+ ```
178
+
179
+ - After final plan is ready for human approval:
180
+ ```
181
+ <signal>PLAN_READY_FOR_APPROVAL</signal>
182
+ ```
183
+
184
+ ## Commit Cadence
185
+
186
+ Make commits at these milestones:
187
+ 1. `[Spec {{project_id}}] Initial implementation plan`
188
+ 2. `[Spec {{project_id}}] Plan with multi-agent review`
189
+ 3. `[Spec {{project_id}}] Plan with user feedback`
190
+ 4. `[Spec {{project_id}}] Final approved plan`
191
+
192
+ **CRITICAL**: Never use `git add .` or `git add -A`. Always stage specific files:
193
+ ```bash
194
+ git add codev/plans/{{project_id}}-{{title}}.md
195
+ ```
196
+
197
+ ## Important Notes
198
+
199
+ 1. **Consultation is MANDATORY** - Cannot skip GPT-5 + Gemini reviews
200
+ 2. **No time estimates** - Don't include hours/days/weeks
201
+ 3. **Be specific about files** - Exact paths, not "the config file"
202
+ 4. **Keep phases small** - 1-3 files per phase is ideal
203
+ 5. **Document dependencies clearly** - Prevents blocked work
204
+ 6. **Document consultations** - Maintain the Consultation Log section
205
+
206
+ ## What NOT to Do
207
+
208
+ - Don't skip consultations (they are BLOCKING)
209
+ - Don't write code (that's for Implement phase)
210
+ - Don't estimate time (meaningless in AI development)
211
+ - Don't create phases that can't be independently tested
212
+ - Don't skip dependency analysis
213
+ - Don't make phases too large (if >5 files, split it)
214
+ - Don't use `git add .` or `git add -A` (security risk)