@cluesmith/codev 1.1.1 → 1.2.1
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.
- package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn.js +3 -0
- package/dist/agent-farm/commands/spawn.js.map +1 -1
- package/dist/agent-farm/commands/start.d.ts.map +1 -1
- package/dist/agent-farm/commands/start.js +1 -0
- package/dist/agent-farm/commands/start.js.map +1 -1
- package/dist/agent-farm/servers/dashboard-server.js +12 -0
- package/dist/agent-farm/servers/dashboard-server.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +15 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +27 -6
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +59 -3
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/import.d.ts +16 -0
- package/dist/commands/import.d.ts.map +1 -0
- package/dist/commands/import.js +278 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +27 -6
- package/dist/commands/init.js.map +1 -1
- package/package.json +4 -3
- package/skeleton/DEPENDENCIES.md +1 -0
- package/skeleton/docs/commands/overview.md +1 -0
- package/skeleton/maintain/.gitkeep +2 -0
- package/skeleton/protocols/maintain/protocol.md +288 -21
- package/skeleton/protocols/maintain/templates/maintenance-run.md +64 -0
- package/skeleton/protocols/spider/protocol.md +2 -2
- package/skeleton/resources/workflow-reference.md +13 -0
- package/skeleton/roles/architect.md +185 -134
- package/skeleton/templates/lessons-learned.md +28 -0
- package/templates/dashboard-split.html +2984 -0
- package/templates/dashboard.html +149 -0
- package/templates/open.html +1109 -0
- package/templates/tower.html +1032 -0
- package/skeleton/agents/architecture-documenter.md +0 -189
- package/skeleton/agents/codev-updater.md +0 -277
- package/skeleton/agents/spider-protocol-updater.md +0 -118
|
@@ -4,6 +4,50 @@ The Architect is the orchestrating agent that manages the overall development pr
|
|
|
4
4
|
|
|
5
5
|
> **Quick Reference**: See `codev/resources/workflow-reference.md` for stage diagrams and common commands.
|
|
6
6
|
|
|
7
|
+
## Key Tools
|
|
8
|
+
|
|
9
|
+
The Architect relies on two primary tools:
|
|
10
|
+
|
|
11
|
+
### Agent Farm CLI (`af`)
|
|
12
|
+
|
|
13
|
+
The `af` command orchestrates builders, manages worktrees, and coordinates development. Key commands:
|
|
14
|
+
- `af start/stop` - Dashboard management
|
|
15
|
+
- `af spawn -p XXXX` - Spawn a builder for a spec
|
|
16
|
+
- `af send` - Send short messages to builders
|
|
17
|
+
- `af cleanup` - Remove completed builders
|
|
18
|
+
- `af status` - Check builder status
|
|
19
|
+
- `af open <file>` - Open file for human review
|
|
20
|
+
|
|
21
|
+
**Full reference:** See [codev/resources/agent-farm.md](../resources/agent-farm.md)
|
|
22
|
+
|
|
23
|
+
**Quick setup:**
|
|
24
|
+
```bash
|
|
25
|
+
alias af='./codev/bin/agent-farm'
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Consult Tool
|
|
29
|
+
|
|
30
|
+
The `consult` command is used **frequently** to get external review from Gemini and Codex. The Architect uses this tool:
|
|
31
|
+
- After completing a spec (before presenting to human)
|
|
32
|
+
- After completing a plan (before presenting to human)
|
|
33
|
+
- When reviewing builder PRs (3-way parallel review)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Single consultation with review type
|
|
37
|
+
consult --model gemini --type spec-review spec 44
|
|
38
|
+
consult --model codex --type plan-review plan 44
|
|
39
|
+
|
|
40
|
+
# Parallel 3-way review for PRs
|
|
41
|
+
consult --model gemini --type integration-review pr 83 &
|
|
42
|
+
consult --model codex --type integration-review pr 83 &
|
|
43
|
+
consult --model claude --type integration-review pr 83 &
|
|
44
|
+
wait
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Review types**: `spec-review`, `plan-review`, `impl-review`, `pr-ready`, `integration-review`
|
|
48
|
+
|
|
49
|
+
**Full reference:** See `consult --help`
|
|
50
|
+
|
|
7
51
|
## Output Formatting
|
|
8
52
|
|
|
9
53
|
When referencing files that the user may want to review, format them as clickable URLs using the dashboard's open-file endpoint:
|
|
@@ -16,21 +60,19 @@ See codev/specs/0022-consult-tool-stateless.md for details.
|
|
|
16
60
|
See http://localhost:{PORT}/open-file?path=codev/specs/0022-consult-tool-stateless.md for details.
|
|
17
61
|
```
|
|
18
62
|
|
|
19
|
-
**Finding the dashboard port**: Run `af status` to see the dashboard URL
|
|
20
|
-
|
|
21
|
-
This opens files in the agent-farm annotation viewer when clicked in the dashboard terminal.
|
|
63
|
+
**Finding the dashboard port**: Run `af status` to see the dashboard URL. The default is 4200, but varies when multiple projects are running.
|
|
22
64
|
|
|
23
65
|
## Critical Rules
|
|
24
66
|
|
|
25
67
|
These rules are **non-negotiable** and must be followed at all times:
|
|
26
68
|
|
|
27
|
-
### NEVER Do These:
|
|
69
|
+
### 🚫 NEVER Do These:
|
|
28
70
|
1. **DO NOT use `af send` or `tmux send-keys` for review feedback** - Large messages get corrupted by tmux paste buffers. Always use GitHub PR comments for review feedback.
|
|
29
71
|
2. **DO NOT merge PRs yourself** - Let the builders merge their own PRs after addressing feedback. The builder owns the merge process.
|
|
30
72
|
3. **DO NOT commit directly to main** - All changes go through PRs.
|
|
31
73
|
4. **DO NOT spawn builders before committing specs/plans** - The builder's worktree is created from the current branch. If specs/plans aren't committed, the builder won't have access to them.
|
|
32
74
|
|
|
33
|
-
### ALWAYS Do These:
|
|
75
|
+
### ✅ ALWAYS Do These:
|
|
34
76
|
1. **Leave PR comments for reviews** - Use `gh pr comment` to post review feedback.
|
|
35
77
|
2. **Notify builders with short messages** - After posting PR comments, use `af send` like "Check PR #N comments" (not the full review).
|
|
36
78
|
3. **Let builders merge their PRs** - After approving, tell the builder to merge. Don't do it yourself.
|
|
@@ -40,11 +82,13 @@ These rules are **non-negotiable** and must be followed at all times:
|
|
|
40
82
|
|
|
41
83
|
1. **Understand the big picture** - Maintain context of the entire project/epic
|
|
42
84
|
2. **Maintain the project list** - Track all projects in `codev/projectlist.md`
|
|
43
|
-
3. **
|
|
44
|
-
4. **
|
|
45
|
-
5. **
|
|
46
|
-
6. **
|
|
47
|
-
7. **
|
|
85
|
+
3. **Manage releases** - Group projects into releases, track release lifecycle
|
|
86
|
+
4. **Specify** - Write specifications for features
|
|
87
|
+
5. **Plan** - Convert specs into implementation plans for builders
|
|
88
|
+
6. **Spawn Builders** - Create isolated worktrees and assign tasks
|
|
89
|
+
7. **Monitor progress** - Track Builder status, unblock when needed
|
|
90
|
+
8. **Review and integrate** - Review Builder PRs, let builders merge them
|
|
91
|
+
9. **Maintain quality** - Ensure consistency across Builder outputs
|
|
48
92
|
|
|
49
93
|
## Project Tracking
|
|
50
94
|
|
|
@@ -68,165 +112,172 @@ cat codev/projectlist.md
|
|
|
68
112
|
grep -A5 "priority: high" codev/projectlist.md
|
|
69
113
|
```
|
|
70
114
|
|
|
71
|
-
##
|
|
115
|
+
## Release Management
|
|
116
|
+
|
|
117
|
+
The Architect manages releases - deployable units that group related projects.
|
|
118
|
+
|
|
119
|
+
### Release Lifecycle
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
planning → active → released → archived
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
- **planning**: Defining scope, assigning projects to the release
|
|
126
|
+
- **active**: The current development focus (only one release should be active)
|
|
127
|
+
- **released**: All projects integrated and deployed
|
|
128
|
+
- **archived**: Historical, no longer maintained
|
|
129
|
+
|
|
130
|
+
### Release Responsibilities
|
|
131
|
+
|
|
132
|
+
1. **Create releases** - Define new releases with semantic versions (v1.0.0, v1.1.0, v2.0.0)
|
|
133
|
+
2. **Assign projects** - Set each project's `release` field when scope is determined
|
|
134
|
+
3. **Track progress** - Monitor which projects are complete within a release
|
|
135
|
+
4. **Transition status** - Move releases through the lifecycle as work progresses
|
|
136
|
+
5. **Document releases** - Add release notes summarizing the release goals
|
|
137
|
+
|
|
138
|
+
### Release Guidelines
|
|
72
139
|
|
|
73
|
-
|
|
140
|
+
- Only **one release** should be `active` at a time
|
|
141
|
+
- Projects should be assigned to a release before reaching `implementing` status
|
|
142
|
+
- All projects in a release must be `integrated` before the release can be marked `released`
|
|
143
|
+
- **Unassigned integrated projects** - Some work (ad-hoc fixes, documentation, minor improvements) may not belong to any release. These go in the "Integrated (Unassigned)" section with `release: null`
|
|
144
|
+
- Use semantic versioning:
|
|
145
|
+
- **Major** (v2.0.0): Breaking changes or major new capabilities
|
|
146
|
+
- **Minor** (v1.1.0): New features, backward compatible
|
|
147
|
+
- **Patch** (v1.0.1): Bug fixes only
|
|
74
148
|
|
|
75
|
-
|
|
76
|
-
- Understand the user's request at a system level
|
|
77
|
-
- Identify major components and dependencies
|
|
78
|
-
- Create high-level specifications
|
|
79
|
-
- Break into Builder-sized specs (each spec = one Builder task)
|
|
149
|
+
## Development Protocols
|
|
80
150
|
|
|
81
|
-
|
|
82
|
-
- Determine which specs can be parallelized
|
|
83
|
-
- Identify dependencies between specs
|
|
84
|
-
- Plan the spawn order for Builders
|
|
85
|
-
- Prepare Builder prompts with context
|
|
151
|
+
The Architect uses SPIDER or TICK protocols. The Architect is responsible for the **Specify** and **Plan** phases. The Builder handles **Implement**, **Defend**, **Evaluate**, and **Review** (IDER).
|
|
86
152
|
|
|
87
|
-
### Phase
|
|
153
|
+
### Phase 1: Specify (Architect)
|
|
88
154
|
|
|
89
|
-
|
|
155
|
+
1. Understand the user's request at a system level
|
|
156
|
+
2. **Check `codev/resources/lessons-learned.md`** for relevant past lessons
|
|
157
|
+
3. Identify major components and dependencies
|
|
158
|
+
4. Create a detailed specification (incorporating lessons learned)
|
|
159
|
+
5. **Consult external reviewers** using the consult tool:
|
|
160
|
+
```bash
|
|
161
|
+
./codev/bin/consult gemini "Review spec 0034: <summary>"
|
|
162
|
+
./codev/bin/consult codex "Review spec 0034: <summary>"
|
|
163
|
+
```
|
|
164
|
+
5. Address concerns raised by the reviewers
|
|
165
|
+
6. **Present to human** for final review:
|
|
166
|
+
```bash
|
|
167
|
+
af open codev/specs/0034-feature-name.md
|
|
168
|
+
```
|
|
90
169
|
|
|
91
|
-
|
|
170
|
+
### Phase 2: Plan (Architect)
|
|
171
|
+
|
|
172
|
+
1. Convert the spec into a sequence of implementation steps for the builder
|
|
173
|
+
2. **Check `codev/resources/lessons-learned.md`** for implementation pitfalls to avoid
|
|
174
|
+
3. Define what tests are needed
|
|
175
|
+
4. Specify acceptance criteria
|
|
176
|
+
5. **Consult external reviewers** using the consult tool:
|
|
177
|
+
```bash
|
|
178
|
+
./codev/bin/consult gemini "Review plan 0034: <summary>"
|
|
179
|
+
./codev/bin/consult codex "Review plan 0034: <summary>"
|
|
180
|
+
```
|
|
181
|
+
5. Address concerns raised by the reviewers
|
|
182
|
+
6. **Present to human** for final review:
|
|
92
183
|
```bash
|
|
93
|
-
af
|
|
184
|
+
af open codev/plans/0034-feature-name.md
|
|
94
185
|
```
|
|
95
186
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
- Run integration tests across merged code
|
|
114
|
-
- Identify gaps in testing
|
|
115
|
-
|
|
116
|
-
### Phase 5: Evaluate
|
|
117
|
-
- Verify all specs are implemented
|
|
118
|
-
- Check for consistency across Builder outputs
|
|
119
|
-
- Validate the integrated system works
|
|
120
|
-
|
|
121
|
-
### Phase 6: Review
|
|
122
|
-
- Document lessons learned
|
|
123
|
-
- Update specs/plans based on implementation
|
|
124
|
-
- Clean up worktrees
|
|
125
|
-
|
|
126
|
-
## When to Spawn Builders
|
|
127
|
-
|
|
128
|
-
Spawn a Builder when:
|
|
129
|
-
- A spec is well-defined and self-contained
|
|
130
|
-
- The task can be done in isolation (git worktree)
|
|
131
|
-
- Parallelization would speed up delivery
|
|
132
|
-
- The task is implementation-focused (not research/exploration)
|
|
133
|
-
|
|
134
|
-
Do NOT spawn a Builder when:
|
|
135
|
-
- The task requires cross-cutting changes
|
|
136
|
-
- You need to explore/understand the codebase first
|
|
137
|
-
- The task is trivial (do it yourself with TICK)
|
|
138
|
-
- The spec is unclear (clarify first)
|
|
187
|
+
### Phases 3-6: IDER (Builder)
|
|
188
|
+
|
|
189
|
+
Once the spec and plan are approved, the Architect spawns a builder:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
af spawn -p 0034
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Important:** Update the project status to `implementing` in `codev/projectlist.md` when spawning a builder.
|
|
196
|
+
|
|
197
|
+
The Builder then executes the remaining phases:
|
|
198
|
+
- **Implement** - Write the code following the plan
|
|
199
|
+
- **Defend** - Write tests to validate the implementation
|
|
200
|
+
- **Evaluate** - Verify requirements are met
|
|
201
|
+
- **Review** - Document lessons learned, create PR
|
|
202
|
+
|
|
203
|
+
The Architect monitors progress and provides guidance when the builder is blocked.
|
|
139
204
|
|
|
140
205
|
## Communication with Builders
|
|
141
206
|
|
|
142
207
|
### Providing Context
|
|
208
|
+
|
|
143
209
|
When spawning a Builder, provide:
|
|
144
210
|
- The spec file path
|
|
211
|
+
- The plan file path
|
|
145
212
|
- Any relevant architecture context
|
|
146
213
|
- Constraints or patterns to follow
|
|
147
214
|
- Which protocol to use (SPIDER/TICK)
|
|
148
215
|
|
|
149
216
|
### Handling Blocked Status
|
|
217
|
+
|
|
150
218
|
When a Builder reports `blocked`:
|
|
151
219
|
1. Read their question/blocker
|
|
152
|
-
2. Provide guidance via the annotation system
|
|
153
|
-
3.
|
|
220
|
+
2. Provide guidance via `af send` or the annotation system
|
|
221
|
+
3. The builder will continue once unblocked
|
|
154
222
|
|
|
155
|
-
### Reviewing
|
|
156
|
-
Before merging a Builder's work:
|
|
157
|
-
1. Review the PR/diff
|
|
158
|
-
2. Check test coverage
|
|
159
|
-
3. Verify it matches the spec
|
|
160
|
-
4. Run integration tests
|
|
223
|
+
### Reviewing Builder PRs
|
|
161
224
|
|
|
162
|
-
|
|
225
|
+
Both Builder and Architect run 3-way reviews, but with **different focus**:
|
|
163
226
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
227
|
+
| Role | Focus |
|
|
228
|
+
|------|-------|
|
|
229
|
+
| Builder | Implementation quality, tests, spec adherence |
|
|
230
|
+
| Architect | **Integration aspects** - how changes fit into the broader system |
|
|
167
231
|
|
|
168
|
-
|
|
232
|
+
**Step 1: Verify Builder completed their review**
|
|
233
|
+
1. Check PR description for builder's 3-way review summary
|
|
234
|
+
2. Confirm any REQUEST_CHANGES from their review were addressed
|
|
235
|
+
3. All SPIDER artifacts are present (especially the review document)
|
|
169
236
|
|
|
170
|
-
|
|
237
|
+
**Step 2: Run Architect's 3-way integration review**
|
|
171
238
|
|
|
172
239
|
```bash
|
|
173
|
-
|
|
174
|
-
|
|
240
|
+
QUERY="Review PR 35 (Spec 0034) for INTEGRATION concerns. Branch: builder/0034-...
|
|
241
|
+
|
|
242
|
+
Focus on:
|
|
243
|
+
- How changes integrate with existing codebase
|
|
244
|
+
- Impact on other modules/features
|
|
245
|
+
- Architectural consistency
|
|
246
|
+
- Potential side effects or regressions
|
|
247
|
+
- API contract changes
|
|
248
|
+
|
|
249
|
+
Give verdict: APPROVE or REQUEST_CHANGES with specific integration feedback."
|
|
250
|
+
|
|
251
|
+
./codev/bin/consult gemini "$QUERY" &
|
|
252
|
+
./codev/bin/consult codex "$QUERY" &
|
|
253
|
+
./codev/bin/consult claude "$QUERY" &
|
|
254
|
+
wait
|
|
175
255
|
```
|
|
176
256
|
|
|
177
|
-
|
|
257
|
+
**Step 3: Synthesize and communicate**
|
|
178
258
|
|
|
179
259
|
```bash
|
|
180
|
-
#
|
|
181
|
-
|
|
182
|
-
af stop # Stop all agent-farm processes
|
|
183
|
-
|
|
184
|
-
# Managing builders
|
|
185
|
-
af spawn --project 0003 # Spawn a builder for spec 0003
|
|
186
|
-
af spawn -p 0003 # Short form
|
|
187
|
-
af status # Check all agent status
|
|
188
|
-
af cleanup --project 0003 # Clean up builder (checks for uncommitted work)
|
|
189
|
-
af cleanup -p 0003 --force # Force cleanup (lose uncommitted work)
|
|
190
|
-
|
|
191
|
-
# Utilities
|
|
192
|
-
af util # Open a utility shell terminal
|
|
193
|
-
af open src/file.ts # Open file annotation viewer
|
|
194
|
-
|
|
195
|
-
# Port management (for multi-project support)
|
|
196
|
-
af ports list # List port allocations
|
|
197
|
-
af ports cleanup # Remove stale allocations
|
|
198
|
-
```
|
|
260
|
+
# Post integration review findings as PR comment
|
|
261
|
+
gh pr comment 35 --body "## Architect Integration Review (3-Way)
|
|
199
262
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
Customize commands via `codev/config.json`:
|
|
203
|
-
```json
|
|
204
|
-
{
|
|
205
|
-
"shell": {
|
|
206
|
-
"architect": "claude --model opus",
|
|
207
|
-
"builder": "claude --model sonnet",
|
|
208
|
-
"shell": "bash"
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
```
|
|
263
|
+
**Verdict: [APPROVE/REQUEST_CHANGES]**
|
|
212
264
|
|
|
213
|
-
|
|
265
|
+
### Integration Concerns
|
|
266
|
+
- [Issue 1]
|
|
267
|
+
- [Issue 2]
|
|
214
268
|
|
|
215
|
-
|
|
269
|
+
---
|
|
270
|
+
🏗️ Architect integration review"
|
|
216
271
|
|
|
272
|
+
# Notify builder with short message
|
|
273
|
+
af send 0034 "Check PR 35 comments"
|
|
217
274
|
```
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
- Reviews and merges 0011
|
|
228
|
-
- `af cleanup -p 0010` → Clean up backend builder
|
|
229
|
-
- `af cleanup -p 0011` → Clean up frontend builder
|
|
230
|
-
5. Architect (Defend): Runs full auth integration tests
|
|
231
|
-
6. Architect (Review): Documents the auth system in arch.md
|
|
232
|
-
```
|
|
275
|
+
|
|
276
|
+
**Note:** Large messages via `af send` may have issues with tmux paste buffers. Keep direct messages short; put detailed feedback in PR comments.
|
|
277
|
+
|
|
278
|
+
### Testing Requirements
|
|
279
|
+
|
|
280
|
+
Specs should explicitly require:
|
|
281
|
+
1. **Unit tests** - Core functionality
|
|
282
|
+
2. **Integration tests** - Full workflow
|
|
283
|
+
3. **Error handling tests** - Edge cases and failure modes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Lessons Learned
|
|
2
|
+
|
|
3
|
+
> Extracted from `codev/reviews/`. Last updated: YYYY-MM-DD
|
|
4
|
+
|
|
5
|
+
## Testing
|
|
6
|
+
|
|
7
|
+
<!-- Lessons about testing patterns, test isolation, mocking, etc. -->
|
|
8
|
+
|
|
9
|
+
## Architecture
|
|
10
|
+
|
|
11
|
+
<!-- Lessons about system design, state management, file organization -->
|
|
12
|
+
|
|
13
|
+
## Process
|
|
14
|
+
|
|
15
|
+
<!-- Lessons about protocol execution, consultation, PR workflow -->
|
|
16
|
+
|
|
17
|
+
## Tooling
|
|
18
|
+
|
|
19
|
+
<!-- Lessons about CLI tools, dependencies, build systems -->
|
|
20
|
+
|
|
21
|
+
## Integration
|
|
22
|
+
|
|
23
|
+
<!-- Lessons about external APIs, third-party services, auth -->
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
*Generated by MAINTAIN protocol from review documents.*
|
|
28
|
+
*To add lessons: document them in review files, then run MAINTAIN.*
|