@cluesmith/codev 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/agent-farm/cli.d.ts.map +1 -1
  2. package/dist/agent-farm/cli.js +19 -0
  3. package/dist/agent-farm/cli.js.map +1 -1
  4. package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
  5. package/dist/agent-farm/commands/cleanup.js +18 -1
  6. package/dist/agent-farm/commands/cleanup.js.map +1 -1
  7. package/dist/agent-farm/commands/consult.d.ts +16 -0
  8. package/dist/agent-farm/commands/consult.d.ts.map +1 -0
  9. package/dist/agent-farm/commands/consult.js +51 -0
  10. package/dist/agent-farm/commands/consult.js.map +1 -0
  11. package/dist/agent-farm/commands/open.js +6 -6
  12. package/dist/agent-farm/commands/open.js.map +1 -1
  13. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  14. package/dist/agent-farm/commands/spawn.js +51 -42
  15. package/dist/agent-farm/commands/spawn.js.map +1 -1
  16. package/dist/agent-farm/commands/start.d.ts.map +1 -1
  17. package/dist/agent-farm/commands/start.js +9 -14
  18. package/dist/agent-farm/commands/start.js.map +1 -1
  19. package/dist/agent-farm/commands/util.js +2 -2
  20. package/dist/agent-farm/commands/util.js.map +1 -1
  21. package/dist/agent-farm/db/errors.d.ts +4 -0
  22. package/dist/agent-farm/db/errors.d.ts.map +1 -1
  23. package/dist/agent-farm/db/errors.js +8 -0
  24. package/dist/agent-farm/db/errors.js.map +1 -1
  25. package/dist/agent-farm/servers/dashboard-server.js +125 -71
  26. package/dist/agent-farm/servers/dashboard-server.js.map +1 -1
  27. package/dist/agent-farm/servers/open-server.d.ts +9 -0
  28. package/dist/agent-farm/servers/open-server.d.ts.map +1 -0
  29. package/dist/agent-farm/servers/{annotate-server.js → open-server.js} +17 -15
  30. package/dist/agent-farm/servers/open-server.js.map +1 -0
  31. package/dist/agent-farm/servers/tower-server.js +4 -7
  32. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  33. package/dist/agent-farm/state.d.ts +5 -0
  34. package/dist/agent-farm/state.d.ts.map +1 -1
  35. package/dist/agent-farm/state.js +17 -0
  36. package/dist/agent-farm/state.js.map +1 -1
  37. package/dist/agent-farm/types.d.ts +1 -1
  38. package/dist/agent-farm/types.d.ts.map +1 -1
  39. package/dist/agent-farm/utils/config.d.ts.map +1 -1
  40. package/dist/agent-farm/utils/config.js +13 -7
  41. package/dist/agent-farm/utils/config.js.map +1 -1
  42. package/dist/agent-farm/utils/port-registry.d.ts +1 -1
  43. package/dist/agent-farm/utils/port-registry.d.ts.map +1 -1
  44. package/dist/agent-farm/utils/port-registry.js +1 -1
  45. package/dist/agent-farm/utils/port-registry.js.map +1 -1
  46. package/dist/agent-farm/utils/shell.d.ts +19 -0
  47. package/dist/agent-farm/utils/shell.d.ts.map +1 -1
  48. package/dist/agent-farm/utils/shell.js +28 -0
  49. package/dist/agent-farm/utils/shell.js.map +1 -1
  50. package/dist/cli.d.ts.map +1 -1
  51. package/dist/cli.js +33 -0
  52. package/dist/cli.js.map +1 -1
  53. package/dist/commands/adopt.d.ts +3 -0
  54. package/dist/commands/adopt.d.ts.map +1 -1
  55. package/dist/commands/adopt.js +31 -25
  56. package/dist/commands/adopt.js.map +1 -1
  57. package/dist/commands/consult/index.d.ts +3 -2
  58. package/dist/commands/consult/index.d.ts.map +1 -1
  59. package/dist/commands/consult/index.js +128 -54
  60. package/dist/commands/consult/index.js.map +1 -1
  61. package/dist/commands/doctor.d.ts.map +1 -1
  62. package/dist/commands/doctor.js +88 -36
  63. package/dist/commands/doctor.js.map +1 -1
  64. package/dist/commands/eject.d.ts +18 -0
  65. package/dist/commands/eject.d.ts.map +1 -0
  66. package/dist/commands/eject.js +149 -0
  67. package/dist/commands/eject.js.map +1 -0
  68. package/dist/commands/import.d.ts +16 -0
  69. package/dist/commands/import.d.ts.map +1 -0
  70. package/dist/commands/import.js +278 -0
  71. package/dist/commands/import.js.map +1 -0
  72. package/dist/commands/init.d.ts +3 -0
  73. package/dist/commands/init.d.ts.map +1 -1
  74. package/dist/commands/init.js +32 -27
  75. package/dist/commands/init.js.map +1 -1
  76. package/dist/lib/projectlist-parser.d.ts +70 -0
  77. package/dist/lib/projectlist-parser.d.ts.map +1 -0
  78. package/dist/lib/projectlist-parser.js +200 -0
  79. package/dist/lib/projectlist-parser.js.map +1 -0
  80. package/dist/lib/skeleton.d.ts +41 -0
  81. package/dist/lib/skeleton.d.ts.map +1 -0
  82. package/dist/lib/skeleton.js +110 -0
  83. package/dist/lib/skeleton.js.map +1 -0
  84. package/dist/lib/templates.d.ts +2 -1
  85. package/dist/lib/templates.d.ts.map +1 -1
  86. package/dist/lib/templates.js +11 -10
  87. package/dist/lib/templates.js.map +1 -1
  88. package/package.json +5 -4
  89. package/{templates → skeleton}/DEPENDENCIES.md +3 -48
  90. package/skeleton/bin/agent-farm +7 -0
  91. package/skeleton/docs/commands/agent-farm.md +469 -0
  92. package/skeleton/docs/commands/codev.md +253 -0
  93. package/skeleton/docs/commands/consult.md +286 -0
  94. package/skeleton/docs/commands/overview.md +108 -0
  95. package/skeleton/maintain/.gitkeep +2 -0
  96. package/{templates → skeleton}/protocols/experiment/protocol.md +2 -2
  97. package/skeleton/protocols/maintain/protocol.md +502 -0
  98. package/skeleton/protocols/maintain/templates/maintenance-run.md +64 -0
  99. package/{templates → skeleton}/protocols/spider/protocol.md +9 -9
  100. package/{templates/protocols/spider-solo → skeleton/protocols/spider}/templates/plan.md +22 -1
  101. package/{templates/protocols/spider-solo → skeleton/protocols/spider}/templates/spec.md +30 -1
  102. package/skeleton/protocols/tick/protocol.md +277 -0
  103. package/skeleton/resources/lessons-learned.md +30 -0
  104. package/skeleton/resources/workflow-reference.md +242 -0
  105. package/skeleton/roles/architect.md +283 -0
  106. package/{templates → skeleton}/roles/builder.md +2 -0
  107. package/skeleton/roles/review-types/impl-review.md +56 -0
  108. package/skeleton/roles/review-types/integration-review.md +68 -0
  109. package/skeleton/roles/review-types/plan-review.md +59 -0
  110. package/skeleton/roles/review-types/pr-ready.md +72 -0
  111. package/skeleton/roles/review-types/spec-review.md +55 -0
  112. package/skeleton/templates/lessons-learned.md +28 -0
  113. package/{templates → skeleton}/templates/projectlist.md +17 -16
  114. package/dist/agent-farm/servers/annotate-server.d.ts +0 -9
  115. package/dist/agent-farm/servers/annotate-server.d.ts.map +0 -1
  116. package/dist/agent-farm/servers/annotate-server.js.map +0 -1
  117. package/templates/agents/architecture-documenter.md +0 -189
  118. package/templates/agents/codev-updater.md +0 -276
  119. package/templates/agents/spider-protocol-updater.md +0 -118
  120. package/templates/annotate.html +0 -903
  121. package/templates/bin/agent-farm +0 -18
  122. package/templates/bin/annotate-server.js +0 -140
  123. package/templates/dashboard-split.html +0 -1679
  124. package/templates/dashboard.html +0 -149
  125. package/templates/protocols/maintain/protocol.md +0 -235
  126. package/templates/protocols/spider/templates/plan.md +0 -169
  127. package/templates/protocols/spider/templates/review.md +0 -207
  128. package/templates/protocols/spider/templates/spec.md +0 -140
  129. package/templates/protocols/spider-solo/protocol.md +0 -619
  130. package/templates/protocols/tick/protocol.md +0 -250
  131. package/templates/roles/architect.md +0 -230
  132. package/templates/tower.html +0 -1032
  133. /package/{templates/AGENTS.md → skeleton/AGENTS.md.template} +0 -0
  134. /package/{templates/CLAUDE.md → skeleton/CLAUDE.md.template} +0 -0
  135. /package/{templates → skeleton}/bin/codev-doctor +0 -0
  136. /package/{templates → skeleton}/builders.md +0 -0
  137. /package/{templates → skeleton}/config.json +0 -0
  138. /package/{templates → skeleton}/plans/.gitkeep +0 -0
  139. /package/{templates → skeleton}/protocols/experiment/templates/notes.md +0 -0
  140. /package/{templates/protocols/spider-solo → skeleton/protocols/spider}/templates/review.md +0 -0
  141. /package/{templates → skeleton}/protocols/tick/templates/plan.md +0 -0
  142. /package/{templates → skeleton}/protocols/tick/templates/review.md +0 -0
  143. /package/{templates → skeleton}/protocols/tick/templates/spec.md +0 -0
  144. /package/{templates → skeleton}/reviews/.gitkeep +0 -0
  145. /package/{templates → skeleton}/roles/consultant.md +0 -0
  146. /package/{templates → skeleton}/specs/.gitkeep +0 -0
@@ -0,0 +1,286 @@
1
+ # consult - AI Consultation CLI
2
+
3
+ The `consult` command provides a unified interface for AI consultation with external models (Gemini, Codex, Claude). Use it for code reviews, spec reviews, and general questions.
4
+
5
+ ## Synopsis
6
+
7
+ ```
8
+ consult -m <model> <subcommand> [args] [options]
9
+ ```
10
+
11
+ ## Required Option
12
+
13
+ ```
14
+ -m, --model <model> Model to use (required)
15
+ ```
16
+
17
+ ## Models
18
+
19
+ | Model | Alias | CLI Used | Notes |
20
+ |-------|-------|----------|-------|
21
+ | `gemini` | `pro` | gemini-cli | Pure text analysis, fast |
22
+ | `codex` | `gpt` | @openai/codex | Shell command exploration, thorough |
23
+ | `claude` | `opus` | @anthropic-ai/claude-code | Balanced analysis |
24
+
25
+ ## Options
26
+
27
+ ```
28
+ -n, --dry-run Show what would execute without running
29
+ -t, --type <type> Review type (see Review Types below)
30
+ ```
31
+
32
+ ## Subcommands
33
+
34
+ ### consult pr
35
+
36
+ Review a pull request.
37
+
38
+ ```bash
39
+ consult -m <model> pr <number>
40
+ ```
41
+
42
+ **Arguments:**
43
+ - `number` - PR number to review
44
+
45
+ **Description:**
46
+
47
+ Reviews a GitHub pull request. The consultant reads:
48
+ - PR info and description
49
+ - Comments and discussions
50
+ - Diff of all changes
51
+ - File metadata
52
+
53
+ Outputs a structured review with verdict: APPROVE, REQUEST_CHANGES, or COMMENT.
54
+
55
+ **Examples:**
56
+
57
+ ```bash
58
+ # Review PR #42 with Gemini
59
+ consult -m gemini pr 42
60
+
61
+ # Review with Codex (more thorough, slower)
62
+ consult -m codex pr 42
63
+
64
+ # Dry run to see command
65
+ consult -m gemini pr 42 --dry-run
66
+ ```
67
+
68
+ ---
69
+
70
+ ### consult spec
71
+
72
+ Review a specification.
73
+
74
+ ```bash
75
+ consult -m <model> spec <number>
76
+ ```
77
+
78
+ **Arguments:**
79
+ - `number` - Spec number to review (e.g., `42` for `codev/specs/0042-*.md`)
80
+
81
+ **Description:**
82
+
83
+ Reviews a specification file for:
84
+ - Clarity and completeness
85
+ - Technical feasibility
86
+ - Edge cases and error scenarios
87
+ - Security considerations
88
+ - Testing strategy
89
+
90
+ If a matching plan exists, it's included for context.
91
+
92
+ **Examples:**
93
+
94
+ ```bash
95
+ # Review spec 42
96
+ consult -m gemini spec 42
97
+
98
+ # With specific review type
99
+ consult -m gemini spec 42 --type spec-review
100
+ ```
101
+
102
+ ---
103
+
104
+ ### consult plan
105
+
106
+ Review an implementation plan.
107
+
108
+ ```bash
109
+ consult -m <model> plan <number>
110
+ ```
111
+
112
+ **Arguments:**
113
+ - `number` - Plan number to review (e.g., `42` for `codev/plans/0042-*.md`)
114
+
115
+ **Description:**
116
+
117
+ Reviews an implementation plan for:
118
+ - Alignment with specification
119
+ - Implementation approach
120
+ - Task breakdown and ordering
121
+ - Risk identification
122
+ - Testing strategy
123
+
124
+ If a matching spec exists, it's included for context.
125
+
126
+ **Example:**
127
+
128
+ ```bash
129
+ consult -m gemini plan 42
130
+ ```
131
+
132
+ ---
133
+
134
+ ### consult general
135
+
136
+ General AI consultation.
137
+
138
+ ```bash
139
+ consult -m <model> general "<query>"
140
+ ```
141
+
142
+ **Arguments:**
143
+ - `query` - Question or request (quoted string)
144
+
145
+ **Description:**
146
+
147
+ Sends a free-form query to the consultant. The consultant role is still loaded, so responses follow the consultant guidelines.
148
+
149
+ **Examples:**
150
+
151
+ ```bash
152
+ # Ask about code design
153
+ consult -m gemini general "What's the best way to structure auth middleware?"
154
+
155
+ # Get architecture advice
156
+ consult -m codex general "Review src/lib/database.ts for potential issues"
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Review Types
162
+
163
+ Use `--type` to load stage-specific review prompts:
164
+
165
+ | Type | Stage | Use Case |
166
+ |------|-------|----------|
167
+ | `spec-review` | conceived | Review specification completeness |
168
+ | `plan-review` | specified | Review implementation plan |
169
+ | `impl-review` | implementing | Review code implementation |
170
+ | `pr-ready` | implemented | Final check before PR |
171
+ | `integration-review` | committed | Architect's integration review |
172
+
173
+ **Example:**
174
+
175
+ ```bash
176
+ consult -m gemini spec 42 --type spec-review
177
+ consult -m codex pr 68 --type integration-review
178
+ ```
179
+
180
+ ---
181
+
182
+ ## Parallel Consultation (3-Way Reviews)
183
+
184
+ For thorough reviews, run multiple models in parallel:
185
+
186
+ ```bash
187
+ # Using background processes
188
+ consult -m gemini spec 42 &
189
+ consult -m codex spec 42 &
190
+ consult -m claude spec 42 &
191
+ wait
192
+ ```
193
+
194
+ Or with separate terminal sessions for better output separation.
195
+
196
+ ---
197
+
198
+ ## Performance
199
+
200
+ | Model | Typical Time | Approach |
201
+ |-------|--------------|----------|
202
+ | Gemini | ~120-150s | Pure text analysis |
203
+ | Codex | ~200-250s | Shell command exploration |
204
+ | Claude | ~60-120s | Balanced tool use |
205
+
206
+ Codex is slower because it executes shell commands (git show, rg, etc.) sequentially. It's more thorough but takes ~2x longer than Gemini.
207
+
208
+ ---
209
+
210
+ ## Prerequisites
211
+
212
+ Install the model CLIs you plan to use:
213
+
214
+ ```bash
215
+ # Claude
216
+ npm install -g @anthropic-ai/claude-code
217
+
218
+ # Codex
219
+ npm install -g @openai/codex
220
+
221
+ # Gemini
222
+ # See: https://github.com/google-gemini/gemini-cli
223
+ ```
224
+
225
+ Configure API keys:
226
+ - Claude: `ANTHROPIC_API_KEY`
227
+ - Codex: `OPENAI_API_KEY`
228
+ - Gemini: `GOOGLE_API_KEY` or `GEMINI_API_KEY`
229
+
230
+ ---
231
+
232
+ ## The Consultant Role
233
+
234
+ The consultant role (`codev/roles/consultant.md`) defines behavior:
235
+ - Provides second perspectives on decisions
236
+ - Offers alternatives and considerations
237
+ - Works constructively (not adversarial, not a rubber stamp)
238
+ - Uses `git show <branch>:<file>` for PR reviews
239
+
240
+ Customize by ejecting and modifying:
241
+
242
+ ```bash
243
+ codev eject roles/consultant.md
244
+ ```
245
+
246
+ ---
247
+
248
+ ## Query Logging
249
+
250
+ All consultations are logged to `.consult/history.log`:
251
+
252
+ ```
253
+ 2024-01-15T10:30:00.000Z model=gemini duration=142.3s query=Review spec 0042...
254
+ ```
255
+
256
+ ---
257
+
258
+ ## Examples
259
+
260
+ ```bash
261
+ # Quick spec review
262
+ consult -m gemini spec 42
263
+
264
+ # Thorough PR review
265
+ consult -m codex pr 68
266
+
267
+ # Architecture question
268
+ consult -m claude general "How should I structure the caching layer?"
269
+
270
+ # Dry run to see command
271
+ consult -m gemini pr 42 --dry-run
272
+
273
+ # 3-way parallel review
274
+ consult -m gemini spec 42 &
275
+ consult -m codex spec 42 &
276
+ consult -m claude spec 42 &
277
+ wait
278
+ ```
279
+
280
+ ---
281
+
282
+ ## See Also
283
+
284
+ - [codev](codev.md) - Project management commands
285
+ - [af](agent-farm.md) - Agent Farm commands
286
+ - [overview](overview.md) - CLI overview
@@ -0,0 +1,108 @@
1
+ # Codev CLI Command Reference
2
+
3
+ Codev provides three CLI tools for AI-assisted software development:
4
+
5
+ | Tool | Description |
6
+ |------|-------------|
7
+ | `codev` | Project setup, maintenance, and framework commands |
8
+ | `af` | Agent Farm - multi-agent orchestration for development |
9
+ | `consult` | AI consultation with external models (Gemini, Codex, Claude) |
10
+
11
+ ## Quick Start
12
+
13
+ ```bash
14
+ # Create a new project
15
+ codev init my-project
16
+
17
+ # Or add codev to an existing project
18
+ codev adopt
19
+
20
+ # Check your environment
21
+ codev doctor
22
+
23
+ # Start the architect dashboard
24
+ af start
25
+
26
+ # Consult an AI model about a spec
27
+ consult -m gemini spec 42
28
+ ```
29
+
30
+ ## Installation
31
+
32
+ ```bash
33
+ npm install -g @cluesmith/codev
34
+ ```
35
+
36
+ This installs all three commands globally: `codev`, `af`, and `consult`.
37
+
38
+ ## Command Summaries
39
+
40
+ ### codev - Project Management
41
+
42
+ | Command | Description |
43
+ |---------|-------------|
44
+ | `codev init [name]` | Create a new codev project |
45
+ | `codev adopt` | Add codev to an existing project |
46
+ | `codev doctor` | Check system dependencies |
47
+ | `codev update` | Update codev templates and protocols |
48
+ | `codev eject [path]` | Copy embedded files for customization |
49
+ | `codev import <source>` | AI-assisted protocol import from other projects |
50
+ | `codev tower` | Cross-project dashboard |
51
+
52
+ See [codev.md](codev.md) for full documentation.
53
+
54
+ ### af - Agent Farm
55
+
56
+ | Command | Description |
57
+ |---------|-------------|
58
+ | `af start` | Start the architect dashboard |
59
+ | `af stop` | Stop all agent farm processes |
60
+ | `af spawn` | Spawn a new builder |
61
+ | `af status` | Show status of all agents |
62
+ | `af cleanup` | Clean up a builder worktree |
63
+ | `af send` | Send instructions to a builder |
64
+ | `af open` | Open file annotation viewer |
65
+ | `af util` | Spawn a utility shell |
66
+
67
+ See [agent-farm.md](agent-farm.md) for full documentation.
68
+
69
+ ### consult - AI Consultation
70
+
71
+ | Subcommand | Description |
72
+ |------------|-------------|
73
+ | `consult pr <num>` | Review a pull request |
74
+ | `consult spec <num>` | Review a specification |
75
+ | `consult plan <num>` | Review an implementation plan |
76
+ | `consult general "<query>"` | General consultation |
77
+
78
+ See [consult.md](consult.md) for full documentation.
79
+
80
+ ## Global Options
81
+
82
+ All codev commands support:
83
+
84
+ ```bash
85
+ --version Show version number
86
+ --help Show help for any command
87
+ ```
88
+
89
+ ## Configuration
90
+
91
+ Customize agent-farm commands via `codev/config.json`:
92
+
93
+ ```json
94
+ {
95
+ "shell": {
96
+ "architect": "claude --model opus",
97
+ "builder": "claude --model sonnet",
98
+ "shell": "bash"
99
+ }
100
+ }
101
+ ```
102
+
103
+ ## Related Documentation
104
+
105
+ - [SPIDER Protocol](../protocols/spider/protocol.md) - Multi-phase development workflow
106
+ - [TICK Protocol](../protocols/tick/protocol.md) - Fast amendment workflow
107
+ - [Architect Role](../roles/architect.md) - Architect responsibilities
108
+ - [Builder Role](../roles/builder.md) - Builder responsibilities
@@ -0,0 +1,2 @@
1
+ # Maintenance run files go here
2
+ # Files are numbered: 0001-maintenance.md, 0002-maintenance.md, etc.
@@ -10,7 +10,7 @@ Disciplined experimentation: Each experiment gets its own directory with `notes.
10
10
 
11
11
  **Use for**: Testing approaches, evaluating models, prototyping, proof-of-concept work, research spikes
12
12
 
13
- **Skip for**: Production code (use SPIDER/SPIDER-SOLO), simple one-off scripts, well-understood implementations (use TICK)
13
+ **Skip for**: Production code (use SPIDER), simple one-off scripts, well-understood implementations (use TICK)
14
14
 
15
15
  ## Structure
16
16
 
@@ -141,7 +141,7 @@ What should be done based on findings?
141
141
 
142
142
  ## Integration with Other Protocols
143
143
 
144
- ### Experiment → SPIDER/SPIDER-SOLO
144
+ ### Experiment → SPIDER
145
145
  When an experiment validates an approach for production use:
146
146
 
147
147
  1. Create a specification referencing the experiment