@cluesmith/codev 1.5.26 → 1.5.28

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 (35) hide show
  1. package/dist/agent-farm/commands/tower.d.ts.map +1 -1
  2. package/dist/agent-farm/commands/tower.js +93 -7
  3. package/dist/agent-farm/commands/tower.js.map +1 -1
  4. package/dist/agent-farm/db/schema.d.ts +1 -1
  5. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  6. package/dist/agent-farm/db/schema.js +2 -1
  7. package/dist/agent-farm/db/schema.js.map +1 -1
  8. package/dist/agent-farm/db/types.d.ts +1 -0
  9. package/dist/agent-farm/db/types.d.ts.map +1 -1
  10. package/dist/agent-farm/db/types.js +1 -0
  11. package/dist/agent-farm/db/types.js.map +1 -1
  12. package/dist/agent-farm/servers/dashboard-server.js +102 -0
  13. package/dist/agent-farm/servers/dashboard-server.js.map +1 -1
  14. package/dist/agent-farm/servers/tower-server.js +37 -5
  15. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  16. package/dist/agent-farm/state.d.ts.map +1 -1
  17. package/dist/agent-farm/state.js +5 -3
  18. package/dist/agent-farm/state.js.map +1 -1
  19. package/dist/cli.d.ts.map +1 -1
  20. package/dist/cli.js +23 -5
  21. package/dist/cli.js.map +1 -1
  22. package/dist/commands/doctor.d.ts.map +1 -1
  23. package/dist/commands/doctor.js +94 -22
  24. package/dist/commands/doctor.js.map +1 -1
  25. package/dist/lib/scaffold.js +1 -1
  26. package/dist/lib/scaffold.js.map +1 -1
  27. package/package.json +1 -1
  28. package/skeleton/roles/architect.md +39 -22
  29. package/skeleton/roles/builder.md +174 -98
  30. package/skeleton/templates/cheatsheet.md +170 -0
  31. package/skeleton/templates/lifecycle.md +147 -0
  32. package/templates/dashboard/css/layout.css +9 -0
  33. package/templates/dashboard/index.html +17 -0
  34. package/templates/dashboard/js/dialogs.js +86 -2
  35. package/templates/dashboard/js/main.js +5 -0
@@ -4,70 +4,156 @@ A Builder is a focused implementation agent that works on a single spec in an is
4
4
 
5
5
  > **Quick Reference**: See `codev/resources/workflow-reference.md` for stage diagrams and common commands.
6
6
 
7
- ## Performance: Parallel & Background Execution
8
-
9
- **Wherever possible, run tools in the background and in parallel.** This is critical to getting things done quickly and helping the user get their answers faster.
10
-
11
- - **Parallel file reads**: Read multiple source files at once when exploring
12
- - **Concurrent searches**: Launch multiple grep/glob operations simultaneously
13
- - **Background tests**: Run test suites in background while continuing other work
14
- - **Parallel linting**: Run multiple checks at once (type-check, lint, format)
15
-
16
- ```bash
17
- # Good: Parallel operations
18
- npm run typecheck &
19
- npm run lint &
20
- npm run test &
21
- wait
22
-
23
- # Bad: Sequential (3x slower)
24
- npm run typecheck
25
- npm run lint
26
- npm run test
27
- ```
28
-
29
7
  ## Output Formatting
30
8
 
31
- **Dashboard Port: {PORT}**
9
+ When referencing files, use standard file paths or open them directly with `af open`:
32
10
 
33
- When referencing files that the user may want to review, format them as clickable URLs using the dashboard's open-file endpoint:
11
+ ```bash
12
+ # Open a file for review in the dashboard
13
+ af open src/lib/auth.ts
34
14
 
35
- ```
36
- # Instead of:
37
- Updated src/lib/auth.ts with the new handler.
15
+ # Check your status
16
+ af status
38
17
 
39
- # Use:
40
- Updated http://localhost:{PORT}/open-file?path=src/lib/auth.ts with the new handler.
18
+ # Send a message to the architect
19
+ af send architect "Question about the spec..."
41
20
  ```
42
21
 
43
- This opens files in the agent-farm annotation viewer when clicked in the dashboard terminal.
22
+ The `af` commands work from worktrees - they automatically find the main repository's state.
44
23
 
45
24
  ## Responsibilities
46
25
 
47
26
  1. **Implement a single spec** - Focus on one well-defined task
48
27
  2. **Work in isolation** - Use the assigned git worktree
49
- 3. **Follow the assigned protocol** - SPIDER or TICK as specified
28
+ 3. **Follow the assigned protocol** - SPIDER or TICK as specified in the spec
50
29
  4. **Report status** - Keep status updated (implementing/blocked/pr-ready)
51
- 5. **Request help when blocked** - Don't spin; ask the Architect
52
- 6. **Deliver clean PRs** - Tests passing, code reviewed
30
+ 5. **Request help when blocked** - Don't spin; output a clear blocker message
31
+ 6. **Deliver clean PRs** - Tests passing, code reviewed, protocol artifacts complete
32
+
33
+ ## Protocol Adherence
34
+
35
+ **The spec will tell you which protocol to use: SPIDER or TICK.**
36
+
37
+ You are expected to **adhere FULLY to the protocol**. Before starting:
38
+ 1. Read the spec carefully to identify the protocol
39
+ 2. Read the full protocol documentation:
40
+ - SPIDER: `codev/protocols/spider/protocol.md`
41
+ - TICK: `codev/protocols/tick/protocol.md`
42
+ 3. Follow every phase and produce all required artifacts
43
+
44
+ ### SPIDER Protocol Summary
45
+
46
+ SPIDER works in phases. The Builder is responsible for **IDER** (the Architect handles SP):
53
47
 
54
- ## Execution Strategy
48
+ 1. **Implement** - Write the code following the plan
55
49
 
56
- Builders execute the protocol assigned by the Architect:
50
+ 2. **Defend** - Write tests to validate the implementation
57
51
 
58
- ### For Complex Tasks: SPIDER
59
- Full phases with self-review and testing:
60
- - Specify Plan Implement Defend → Evaluate → Review
52
+ 3. **Evaluate** - Verify requirements are met
53
+ - Self-review: Does the implementation satisfy the spec?
54
+ - Self-review: Do the tests adequately cover the requirements?
55
+ - **Consult external reviewers** on the complete implementation + tests:
56
+ ```bash
57
+ consult --model gemini --type impl-review spec XXXX
58
+ consult --model codex --type impl-review spec XXXX
59
+ ```
60
+ - Address concerns raised before proceeding to Review
61
61
 
62
- ### For Simple Tasks: TICK
63
- Fast autonomous implementation:
62
+ 4. **Review** - Document lessons learned, run 3-way review, create PR
63
+ - Write the review document (`codev/reviews/XXXX-spec-name.md`)
64
+ - **Run 3-way parallel review focused on IMPLEMENTATION quality**:
65
+ ```bash
66
+ QUERY="Review Spec XXXX implementation. Branch: builder/XXXX-...
67
+
68
+ Focus on:
69
+ - Implementation quality and correctness
70
+ - Test coverage and quality
71
+ - Adherence to spec requirements
72
+ - Code patterns and best practices
73
+ - Edge cases and error handling
74
+
75
+ Give verdict: APPROVE or REQUEST_CHANGES."
76
+
77
+ consult --model gemini --type pr-ready pr $PR_NUMBER &
78
+ consult --model codex --type pr-ready pr $PR_NUMBER &
79
+ consult --model claude --type pr-ready pr $PR_NUMBER &
80
+ wait
81
+ ```
82
+ - Address any REQUEST_CHANGES feedback before creating the PR
83
+ - Include the 3-way review summary in your PR description
84
+
85
+ **Note**: The Architect will run a separate 3-way review focused on **integration** concerns.
86
+
87
+ **Commit at the end of each phase** with a message indicating the phase:
88
+ ```bash
89
+ git add <files>
90
+ git commit -m "[Spec XXXX][Implement] Add auth routes"
91
+ git commit -m "[Spec XXXX][Defend] Add unit tests for auth"
92
+ git commit -m "[Spec XXXX][Review] Add lessons learned"
93
+ ```
94
+
95
+ ### TICK Protocol Summary
96
+
97
+ TICK is for smaller, well-defined tasks:
64
98
  - Understand → Implement → Verify → Done
65
99
 
100
+ Follow the TICK protocol documentation for details.
101
+
102
+ ## Spec Compliance (CRITICAL)
103
+
104
+ **The spec is the source of truth. Code that doesn't match the spec is wrong, even if it "works".**
105
+
106
+ ### Pre-Implementation Sanity Check (PISC)
107
+
108
+ **Before writing ANY code, run this checklist:**
109
+
110
+ 1. ✅ "Have I read the spec in the last 30 minutes?"
111
+ 2. ✅ "If the spec has a 'Traps to Avoid' section, have I read it?"
112
+ 3. ✅ "Does my planned approach match the spec's Technical Implementation section?"
113
+ 4. ✅ "If the spec has code examples, am I following them?"
114
+ 5. ✅ "Does the existing code I'm building on actually match the spec?"
115
+
116
+ **If ANY answer is "no" or "I'm not sure" → STOP and re-read the spec before proceeding.**
117
+
118
+ ### The Trust Hierarchy
119
+
120
+ ```
121
+ SPEC (source of truth)
122
+
123
+ PLAN (implementation guide derived from spec)
124
+
125
+ EXISTING CODE (NOT TRUSTED - must be validated against spec)
126
+ ```
127
+
128
+ **Never trust existing code over the spec.** Previous implementations may have drifted. The spec is always authoritative.
129
+
130
+ ### Avoiding "Fixing Mode"
131
+
132
+ A dangerous pattern: You start looking at symptoms in code, making incremental fixes, copying existing patterns - without going back to the source of truth (spec). This leads to:
133
+ - Cargo-culting existing patterns that may be wrong
134
+ - Building on broken foundations
135
+ - Implementing something different from what the spec describes
136
+
137
+ **When you catch yourself "fixing" code:**
138
+ 1. STOP
139
+ 2. Ask: "What does the spec say about this?"
140
+ 3. Re-read the spec's Traps to Avoid section
141
+ 4. Verify existing code matches the spec before building on it
142
+
143
+ ### Phrases That Should Trigger Spec Re-reading
144
+
145
+ If you think or receive any of these, immediately re-read the spec:
146
+ - "Does this match the spec?"
147
+ - "What does the spec say about X?"
148
+ - "Check the spec's Traps to Avoid section"
149
+ - "Are you sure?"
150
+ - "You're cargo-culting existing patterns"
151
+
66
152
  ## Status Lifecycle
67
153
 
68
154
  ```
69
155
  spawning → implementing → blocked → implementing → pr-ready → complete
70
- ↑______________|
156
+ ↑______________|
71
157
  ```
72
158
 
73
159
  ### Status Definitions
@@ -80,16 +166,13 @@ spawning → implementing → blocked → implementing → pr-ready → complete
80
166
  | `pr-ready` | Implementation complete, ready for review |
81
167
  | `complete` | Merged, worktree can be cleaned up |
82
168
 
83
- ### Updating Status
84
-
85
- Status is tracked in `.agent-farm/state.json` and visible on the dashboard.
169
+ ### Checking Status
86
170
 
87
- To check current status:
88
171
  ```bash
89
172
  af status
90
173
  ```
91
174
 
92
- Status updates happen automatically based on your progress. When blocked, clearly communicate the blocker in your terminal or via REVIEW comments in code.
175
+ You can check your own status and see other builders. The Architect also monitors status.
93
176
 
94
177
  ## Working in a Worktree
95
178
 
@@ -105,13 +188,6 @@ Status updates happen automatically based on your progress. When blocked, clearl
105
188
  - Your spec is at `codev/specs/XXXX-spec-name.md`
106
189
  - Your plan is at `codev/plans/XXXX-spec-name.md`
107
190
 
108
- ### Committing
109
- Make atomic commits as you work:
110
- ```bash
111
- git add <files>
112
- git commit -m "[Spec XXXX] <description>"
113
- ```
114
-
115
191
  ## When to Report Blocked
116
192
 
117
193
  Report `blocked` status when:
@@ -121,23 +197,23 @@ Report `blocked` status when:
121
197
  - You need architectural guidance
122
198
  - Tests are failing for reasons outside your scope
123
199
 
124
- **Do NOT stay blocked silently.** The Architect monitors status and will help.
200
+ **Do NOT stay blocked silently.** Communicate your blocker clearly:
125
201
 
126
- ### How to Report Blocked
202
+ 1. Output a clear message in your terminal describing the blocker and options
203
+ 2. Add a `<!-- REVIEW(@architect): question here -->` comment in relevant code if applicable
204
+ 3. The Architect monitors builder status via `af status` and will see you're blocked
205
+
206
+ Example blocker message to output:
207
+ ```
208
+ ## BLOCKED: Spec 0003
209
+ Can't find the auth helper mentioned in spec. Options:
210
+ 1. Create a new auth helper
211
+ 2. Use a third-party library
212
+ 3. Spec needs clarification
213
+ Waiting for Architect guidance.
214
+ ```
127
215
 
128
- 1. Update status to `blocked`
129
- 2. Clearly describe the blocker:
130
- ```markdown
131
- ## Builder 0003
132
- - Status: blocked
133
- - Blocker: The spec says "use the existing auth helper" but I can't find
134
- any auth helper in the codebase. Options:
135
- 1. Create a new auth helper
136
- 2. Use a third-party library
137
- 3. Spec meant something else?
138
- ```
139
- 3. Wait for Architect guidance
140
- 4. Once unblocked, update status back to `implementing`
216
+ The Architect will provide guidance via `af send` or PR comments.
141
217
 
142
218
  ## Deliverables
143
219
 
@@ -146,56 +222,56 @@ When done, a Builder should have:
146
222
  1. **Implementation** - Code that fulfills the spec
147
223
  2. **Tests** - Appropriate test coverage
148
224
  3. **Documentation** - Updated relevant docs (if needed)
149
- 4. **Clean commits** - Atomic, well-messaged commits
150
- 5. **PR-ready branch** - Ready for Architect to merge
225
+ 4. **Clean commits** - Atomic, well-messaged commits per phase
226
+ 5. **Review document** - As specified in the SPIDER protocol (`codev/reviews/XXXX-spec-name.md`)
227
+ 6. **PR-ready branch** - Ready for Architect review
151
228
 
152
229
  ## Communication with Architect
153
230
 
154
231
  ### Receiving Instructions
155
232
  The Architect provides:
156
233
  - Spec file path
234
+ - Plan file path
157
235
  - Protocol to follow (SPIDER/TICK)
158
236
  - Context and constraints
159
- - Builder prompt with project-specific info
160
-
161
- ### Asking Questions
162
- If you need help but aren't fully blocked:
163
- - Add a `<!-- REVIEW(@architect): question here -->` comment
164
- - The Architect will see it during review
165
237
 
166
238
  ### Reporting Completion
167
239
  When implementation is complete:
168
240
  1. Run all tests
169
241
  2. Self-review the code
170
- 3. Update status to `pr-ready`
171
- 4. The Architect will review and merge
242
+ 3. Ensure all protocol artifacts are present (especially the review document for SPIDER)
243
+ 4. Create a PR: `gh pr create --title "[Spec XXXX] Description" --body "..."`
244
+ 5. Update status to `pr-ready`
245
+ 6. Wait for Architect review and approval
246
+ 7. **Merge your own PR** once approved: `gh pr merge --merge --delete-branch`
172
247
 
173
- ## Example Builder Session
248
+ **Important**: The Builder is responsible for merging after Architect approval. This ensures the Builder sees the merge succeed and can handle any final cleanup.
174
249
 
250
+ ### Receiving PR Feedback
251
+
252
+ The Architect reviews PRs and leaves feedback as GitHub PR comments. When notified to check feedback:
253
+
254
+ ```bash
255
+ # View PR comments
256
+ gh pr view <PR_NUMBER> --comments
257
+
258
+ # Or view the full PR with comments in browser
259
+ gh pr view <PR_NUMBER> --web
175
260
  ```
176
- 1. Spawned for spec 0003-user-auth
177
- 2. Read spec at codev/specs/0003-user-auth.md
178
- 3. Status: implementing
179
- 4. Follow SPIDER protocol:
180
- - Create plan
181
- - Implement auth routes
182
- - Write tests
183
- - Self-review
184
- 5. Hit blocker: unclear which JWT library to use
185
- 6. Status: blocked (described options)
186
- 7. Architect responds: "Use jose library"
187
- 8. Status: implementing
188
- 9. Complete implementation
189
- 10. Run tests: all passing
190
- 11. Status: pr-ready
191
- 12. Architect reviews and merges
192
- 13. Status: complete
193
- ```
261
+
262
+ **Workflow:**
263
+ 1. Architect leaves review comments on PR
264
+ 2. You receive a short message: "Check PR comments and address feedback"
265
+ 3. Run `gh pr view <PR_NUMBER> --comments` to see feedback
266
+ 4. Address the issues (High priority first, then Medium, Low is optional)
267
+ 5. Push fixes to the same branch
268
+ 6. Reply to PR comment when done or if clarification needed
194
269
 
195
270
  ## Constraints
196
271
 
197
272
  - **Stay in scope** - Only implement what's in your spec
198
273
  - **Don't modify shared config** - Without Architect approval
199
- - **Don't merge yourself** - The Architect handles integration
274
+ - **Merge your own PRs** - After Architect approves, you are responsible for merging
200
275
  - **Don't spawn other Builders** - Only Architects spawn Builders
201
276
  - **Keep worktree clean** - No untracked files, no debug code
277
+ - **Follow the protocol** - All phases, all artifacts
@@ -0,0 +1,170 @@
1
+ # Codev Cheatsheet
2
+
3
+ A quick reference for Codev's philosophies, concepts, and tools.
4
+
5
+ ---
6
+
7
+ ## Core Philosophies
8
+
9
+ ### 1. Natural Language is the Programming Language
10
+
11
+ Specifications and plans are as important as code—they ARE the requirements and design.
12
+
13
+ | Traditional | Codev |
14
+ |-------------|-------|
15
+ | Code first, document later | Spec first, code implements spec |
16
+ | Documentation gets stale | Specs ARE the source of truth |
17
+ | Humans read code to understand | AI agents translate spec → code |
18
+
19
+ **Corollaries:**
20
+ - The spec IS the requirements; the plan IS the design
21
+ - Code is the implementation of well-defined natural language artifacts
22
+ - If the spec is wrong, the code will be wrong—fix the spec first
23
+
24
+ ### 2. Multiple Models Outperform a Single Model
25
+
26
+ No single AI model catches everything. Diverse perspectives find more issues.
27
+
28
+ | Role | Models |
29
+ |------|--------|
30
+ | Architect & Builder | Claude (primary agent) |
31
+ | Consultants | Gemini, Codex, Claude (for reviews) |
32
+
33
+ **Corollaries:**
34
+ - 3-way reviews catch issues single models miss
35
+ - Different models have different strengths and blind spots
36
+ - Consultation happens at key checkpoints, not continuously
37
+
38
+ ### 3. Human-Agent Work Requires Thoughtful Structure
39
+
40
+ Just like structuring a human team—clear roles, defined processes, explicit handoffs.
41
+
42
+ | Component | Purpose |
43
+ |-----------|---------|
44
+ | Protocols | Define HOW work happens (SPIDER, TICK, etc.) |
45
+ | Roles | Define WHO does what (Architect, Builder, Consultant) |
46
+ | Parallelism | Scale by running multiple builders simultaneously |
47
+
48
+ **Corollaries:**
49
+ - Well-defined protocols reduce ambiguity and rework
50
+ - Clear roles enable autonomous operation
51
+ - Parallel execution multiplies throughput
52
+
53
+ ---
54
+
55
+ ## Core Concepts
56
+
57
+ ### Protocols
58
+
59
+ A **protocol** is a structured workflow that defines how work progresses from idea to completion.
60
+
61
+ | Protocol | Use For | Phases |
62
+ |----------|---------|--------|
63
+ | **SPIDER** | New features | Specify → Plan → Implement → Defend → Evaluate → Review |
64
+ | **TICK** | Amendments to existing specs | Task Identification → Coding → Kickout |
65
+ | **MAINTAIN** | Codebase hygiene | Dead code removal, documentation sync |
66
+ | **EXPERIMENT** | Research & prototyping | Hypothesis → Experiment → Conclude |
67
+
68
+ ### Roles
69
+
70
+ A **role** defines who does what work and what tools/permissions they have.
71
+
72
+ | Role | Responsibilities |
73
+ |------|------------------|
74
+ | **Architect** | Orchestrates development, writes specs/plans, reviews PRs, maintains big picture |
75
+ | **Builder** | Implements specs in isolated worktrees, writes tests, creates PRs |
76
+ | **Consultant** | External reviewers providing second opinions on specs, plans, implementations |
77
+
78
+ **Consultant Flavors** (via `--type`):
79
+ - `spec-review` - Review specification completeness
80
+ - `plan-review` - Review implementation plan feasibility
81
+ - `impl-review` - Review code for spec adherence
82
+ - `integration-review` - Review for architectural fit
83
+
84
+ ### Context Hierarchy
85
+
86
+ In much the same way an operating system has a memory hierarchy, Codev repos have a context hierarchy. The codev/ directory holds the top 3 layers. This allows both humans and agents to think about problems at different levels of detail.
87
+
88
+ **Key insight**: We build from the top down, and we propagate information from the bottom up. We start with an entry in the project list, then spec and plan out the feature, generate the code, and then propagate what we learned through the reviews.
89
+
90
+ ---
91
+
92
+ ## Tools Reference
93
+
94
+ ### codev
95
+
96
+ Project management commands. Typically used by **humans** to set up and maintain projects.
97
+
98
+ | Command | Description |
99
+ |---------|-------------|
100
+ | `codev init <dirname>` | Create a new Codev project |
101
+ | `codev adopt` | Add Codev to an existing project |
102
+ | `codev doctor` | Check dependencies and configuration |
103
+ | `codev update` | Update Codev framework |
104
+ | `codev import` | Import specs from another project |
105
+ | `codev tower` | Cross-project dashboard |
106
+
107
+ ### agent-farm (af)
108
+
109
+ Architect-Builder orchestration. Used by both **humans and agents**—agents use it more frequently.
110
+
111
+ | Command | Description |
112
+ |---------|-------------|
113
+ | `af start` | Start dashboard (port 4200, 4300, etc.) |
114
+ | `af stop` | Stop all processes |
115
+ | `af spawn -p <id>` | Spawn a builder for project |
116
+ | `af status` | Check status of all builders |
117
+ | `af send <target> <msg>` | Send message (builder↔architect) |
118
+ | `af cleanup -p <id>` | Clean up a builder worktree |
119
+ | `af open <file>` | Open file in dashboard viewer |
120
+
121
+ ### consult
122
+
123
+ Multi-agent consultation. Used by both humans and agents—**mostly agents** during reviews.
124
+
125
+ | Command | Description |
126
+ |---------|-------------|
127
+ | `consult --model <model> spec <id>` | Review a specification |
128
+ | `consult --model <model> plan <id>` | Review an implementation plan |
129
+ | `consult --model <model> pr <id>` | Review a pull request |
130
+ | `consult --model <model> general "<query>"` | General consultation |
131
+
132
+ **Models**: `gemini` (alias: `pro`), `codex` (alias: `gpt`), `claude` (alias: `opus`)
133
+
134
+ **Review Types** (via `--type`):
135
+ | Type | Use Case |
136
+ |------|----------|
137
+ | `spec-review` | Review spec completeness and clarity |
138
+ | `plan-review` | Review plan coverage and feasibility |
139
+ | `impl-review` | Review implementation quality (Builder use) |
140
+ | `integration-review` | Review architectural fit (Architect use) |
141
+
142
+ ---
143
+
144
+ ## Quick Reference
145
+
146
+ ### SPIDER Checklist
147
+
148
+ ```
149
+ [ ] Specify - Write spec in codev/specs/XXXX-name.md
150
+ [ ] Plan - Write plan in codev/plans/XXXX-name.md
151
+ For each phase of the plan:
152
+ [ ] Implement - Write code following the plan
153
+ [ ] Defend - Write tests for the implementation
154
+ [ ] Evaluate - Consult external reviewers, address feedback
155
+ [ ] Review - Write review in codev/reviews/XXXX-name.md, create PR
156
+ ```
157
+
158
+ ### Consultation Pattern
159
+
160
+ ```bash
161
+ # Run 3-way review in parallel
162
+ consult --model gemini pr <id> &
163
+ consult --model codex pr <id> &
164
+ consult --model claude pr <id> &
165
+ wait
166
+ ```
167
+
168
+ ---
169
+
170
+ *For detailed documentation, see the full protocol files in `codev/protocols/`.*
@@ -0,0 +1,147 @@
1
+ # Codev Project Lifecycle
2
+
3
+ Every project in Codev flows through a series of stages from idea to production. This document explains each stage and how projects progress through the lifecycle.
4
+
5
+ ## Lifecycle Overview
6
+
7
+ ```
8
+ conceived → specified → planned → implementing → implemented → committed → integrated
9
+ ```
10
+
11
+ ## Stages
12
+
13
+ ### 1. Conceived
14
+
15
+ **What it means:** An idea has been captured. A spec file may exist but hasn't been approved yet.
16
+
17
+ **Who does it:** Anyone can conceive a project by describing what they want to build.
18
+
19
+ **What happens next:** The Architect (AI) writes a specification. The human reviews and approves it.
20
+
21
+ **Artifact:** Draft specification in `codev/specs/NNNN-name.md`
22
+
23
+ ---
24
+
25
+ ### 2. Specified
26
+
27
+ **What it means:** The specification has been approved by a human.
28
+
29
+ **Who does it:** Only a human can approve a specification and mark it as specified.
30
+
31
+ **What happens next:** The Architect creates an implementation plan.
32
+
33
+ **Artifact:** Approved specification in `codev/specs/NNNN-name.md`
34
+
35
+ ---
36
+
37
+ ### 3. Planned
38
+
39
+ **What it means:** An implementation plan exists that describes how to build the feature.
40
+
41
+ **Who does it:** The Architect (AI) creates the plan, human reviews it.
42
+
43
+ **What happens next:** A Builder is spawned to implement the plan.
44
+
45
+ **Artifact:** Implementation plan in `codev/plans/NNNN-name.md`
46
+
47
+ ---
48
+
49
+ ### 4. Implementing
50
+
51
+ **What it means:** Active development is in progress. A Builder is working on the code.
52
+
53
+ **Who does it:** A Builder (AI agent) in an isolated git worktree.
54
+
55
+ **What happens next:** Builder completes implementation and creates a PR.
56
+
57
+ **Artifact:** Code changes in a builder worktree, work in progress
58
+
59
+ ---
60
+
61
+ ### 5. Implemented
62
+
63
+ **What it means:** Code is complete, tests pass, and a Pull Request has been created.
64
+
65
+ **Who does it:** The Builder creates the PR after completing implementation.
66
+
67
+ **What happens next:** The Architect reviews the PR, Builder addresses feedback, then merges.
68
+
69
+ **Artifact:** Open Pull Request ready for review
70
+
71
+ ---
72
+
73
+ ### 6. Committed
74
+
75
+ **What it means:** The PR has been merged to the main branch.
76
+
77
+ **Who does it:** The Builder merges after approval from the Architect's review.
78
+
79
+ **What happens next:** Human validates in production and marks as integrated.
80
+
81
+ **Artifact:** Merged PR, code on main branch
82
+
83
+ ---
84
+
85
+ ### 7. Integrated
86
+
87
+ **What it means:** The feature has been validated in production and the project is complete.
88
+
89
+ **Who does it:** Only a human can mark a project as integrated after validating it works.
90
+
91
+ **What happens next:** Nothing - the project is complete! A review document captures lessons learned.
92
+
93
+ **Artifact:** Review document in `codev/reviews/NNNN-name.md`
94
+
95
+ ---
96
+
97
+ ## Terminal States
98
+
99
+ Projects can also end up in terminal states if they won't be completed:
100
+
101
+ ### Abandoned
102
+
103
+ The project was canceled or rejected. It will not be implemented. The notes field in `projectlist.md` should explain why.
104
+
105
+ ### On-Hold
106
+
107
+ The project is temporarily paused but may resume later. The notes field should explain the reason and any conditions for resuming.
108
+
109
+ ---
110
+
111
+ ## Human Approval Gates
112
+
113
+ Two stages require explicit human approval - AI agents cannot bypass these:
114
+
115
+ | Gate | Transition | Why |
116
+ |------|------------|-----|
117
+ | **Spec Approval** | conceived → specified | Humans must approve what gets built |
118
+ | **Production Validation** | committed → integrated | Humans must verify it works in production |
119
+
120
+ ```
121
+ conceived → [HUMAN APPROVES] → specified → planned → implementing → implemented → committed → [HUMAN VALIDATES] → integrated
122
+ ```
123
+
124
+ ---
125
+
126
+ ## Managing Projects
127
+
128
+ All project tracking happens in `codev/projectlist.md`. To manage projects:
129
+
130
+ - **Add a project:** Tell the Architect what you want to build
131
+ - **Update status:** Ask the Architect to update the project status
132
+ - **Approve stages:** Review the spec/plan and tell the Architect to mark it approved
133
+ - **View progress:** Check the Projects tab in the dashboard or read `projectlist.md`
134
+
135
+ ---
136
+
137
+ ## Quick Reference
138
+
139
+ | Stage | Artifact | Who Advances |
140
+ |-------|----------|--------------|
141
+ | Conceived | Draft spec | AI writes, human approves |
142
+ | Specified | Approved spec | AI creates plan |
143
+ | Planned | Implementation plan | AI spawns builder |
144
+ | Implementing | WIP code | Builder completes |
145
+ | Implemented | Open PR | Architect reviews, Builder merges |
146
+ | Committed | Merged PR | Human validates |
147
+ | Integrated | Review doc | Complete |
@@ -43,6 +43,15 @@
43
43
  background: rgba(239, 68, 68, 0.1);
44
44
  }
45
45
 
46
+ .btn-primary {
47
+ border-color: var(--accent);
48
+ color: var(--accent);
49
+ }
50
+
51
+ .btn-primary:hover {
52
+ background: rgba(59, 130, 246, 0.1);
53
+ }
54
+
46
55
  /* Main content area */
47
56
  .main {
48
57
  display: flex;