@cluesmith/codev 1.5.25 → 1.5.27

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 (38) hide show
  1. package/dist/agent-farm/cli.d.ts.map +1 -1
  2. package/dist/agent-farm/cli.js +19 -2
  3. package/dist/agent-farm/cli.js.map +1 -1
  4. package/dist/agent-farm/commands/cleanup.d.ts +2 -1
  5. package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
  6. package/dist/agent-farm/commands/cleanup.js +112 -22
  7. package/dist/agent-farm/commands/cleanup.js.map +1 -1
  8. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  9. package/dist/agent-farm/commands/spawn.js +157 -2
  10. package/dist/agent-farm/commands/spawn.js.map +1 -1
  11. package/dist/agent-farm/db/schema.d.ts +1 -1
  12. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  13. package/dist/agent-farm/db/schema.js +2 -1
  14. package/dist/agent-farm/db/schema.js.map +1 -1
  15. package/dist/agent-farm/db/types.d.ts +1 -0
  16. package/dist/agent-farm/db/types.d.ts.map +1 -1
  17. package/dist/agent-farm/db/types.js +1 -0
  18. package/dist/agent-farm/db/types.js.map +1 -1
  19. package/dist/agent-farm/state.d.ts.map +1 -1
  20. package/dist/agent-farm/state.js +5 -3
  21. package/dist/agent-farm/state.js.map +1 -1
  22. package/dist/agent-farm/types.d.ts +5 -1
  23. package/dist/agent-farm/types.d.ts.map +1 -1
  24. package/dist/commands/adopt.d.ts.map +1 -1
  25. package/dist/commands/adopt.js +11 -1
  26. package/dist/commands/adopt.js.map +1 -1
  27. package/dist/commands/init.d.ts.map +1 -1
  28. package/dist/commands/init.js +11 -1
  29. package/dist/commands/init.js.map +1 -1
  30. package/dist/lib/scaffold.d.ts +13 -0
  31. package/dist/lib/scaffold.d.ts.map +1 -1
  32. package/dist/lib/scaffold.js +34 -0
  33. package/dist/lib/scaffold.js.map +1 -1
  34. package/package.json +1 -1
  35. package/skeleton/resources/spikes.md +118 -0
  36. package/skeleton/roles/architect.md +35 -103
  37. package/templates/dashboard/css/files.css +18 -0
  38. package/templates/dashboard/js/main.js +16 -6
@@ -0,0 +1,118 @@
1
+ # Spikes: De-risking Technical Unknowns
2
+
3
+ **Spikes are short, focused experiments that validate technical assumptions before full implementation.**
4
+
5
+ ## What is a Spike?
6
+
7
+ The term comes from Extreme Programming (XP), coined in the late 1990s. The metaphor: a spike is like driving a railroad spike through all layers of a problem to see what's underneath. You're not building the whole foundation - you're just poking through to answer a specific question.
8
+
9
+ **Key characteristics:**
10
+ - **Time-boxed** - Typically 1-2 hours; check in if taking longer
11
+ - **Throwaway** - The code is discarded; only the knowledge is kept
12
+ - **Focused** - Answers ONE specific question
13
+ - **Reduces risk** - Done before committing to full implementation
14
+
15
+ | Type | Question |
16
+ |------|----------|
17
+ | Spike | "Can we?" / "Does it work?" |
18
+ | Implementation | "Build it" |
19
+
20
+ ## Time-Boxing
21
+
22
+ **Spikes should typically take 1-2 hours.** If you're spending significantly longer, consider:
23
+
24
+ 1. **Is the question too big?** Break it into smaller spikes
25
+ 2. **Is the answer "not easily"?** That's valuable information - document it
26
+ 3. **Do you need more time?** That's fine, but check in with the user first
27
+
28
+ Time-boxing helps prevent spikes from becoming open-ended research. The goal is a quick answer, not perfection.
29
+
30
+ ## When to Use Spikes
31
+
32
+ Use spikes when a spec has:
33
+ - **Untested external APIs** - Will the API actually behave as documented?
34
+ - **Architectural uncertainty** - Will this pattern work for our use case?
35
+ - **Integration questions** - Can these components work together?
36
+ - **Performance unknowns** - Will this approach be fast enough?
37
+
38
+ **Rule of thumb:** If the spec says "we believe X will work" or "according to docs, Y should happen" - that's a spike candidate.
39
+
40
+ ## Spike Structure
41
+
42
+ Store spikes in `codev/spikes/{spec-number}/`:
43
+
44
+ ```
45
+ codev/spikes/
46
+ └── 0062/
47
+ ├── spike-api-behavior.ts
48
+ ├── spike-event-handoff.ts
49
+ └── spike-storage-roundtrip.ts
50
+ ```
51
+
52
+ Each spike file should:
53
+
54
+ ```typescript
55
+ /**
56
+ * Spike: [Clear Name]
57
+ *
58
+ * Purpose: [What assumption are we validating?]
59
+ * Time Box: 1-2 hours
60
+ *
61
+ * Tests:
62
+ * 1. [Specific test case]
63
+ * 2. [Another test case]
64
+ * 3. [Edge case]
65
+ *
66
+ * Run with: npx tsx codev/spikes/0062/spike-name.ts
67
+ */
68
+
69
+ // Self-contained, runnable code that validates the assumption
70
+ // Mock/simulate infrastructure where needed
71
+ // Print clear PASS/FAIL for each test
72
+ ```
73
+
74
+ ## Spike Workflow
75
+
76
+ 1. **Identify unknowns** during Plan phase - what could break our assumptions?
77
+ 2. **Create spikes** for each high-risk unknown (1-2 hours each)
78
+ 3. **Run spikes** and document results in spec/plan
79
+ 4. **Adjust plan** based on spike findings
80
+ 5. **Include spike results** in spec as "Research Findings"
81
+
82
+ ## Example Spike Questions
83
+
84
+ | Unknown | Spike Purpose |
85
+ |---------|---------------|
86
+ | "Gemini 3 requires thought signatures" | Validate signature storage and replay works |
87
+ | "Two Inngest functions can hand off" | Test event emission and separate invocation |
88
+ | "Frontend handles sequence gaps" | Simulate gap and verify realignment |
89
+ | "Raw payload survives database round-trip" | Store and reconstruct exact API format |
90
+
91
+ ## Spike vs Prototype vs POC
92
+
93
+ | Type | Scope | Output | Kept? | Time |
94
+ |------|-------|--------|-------|------|
95
+ | **Spike** | Single question | PASS/FAIL + learnings | No (throwaway) | 1-2 hours |
96
+ | **Prototype** | Feature shape | Working UI/flow | Sometimes | Days |
97
+ | **POC** | System viability | Minimal working system | Often becomes v1 | Weeks |
98
+
99
+ Spikes are deliberately disposable - they exist to answer a question, not to become production code.
100
+
101
+ ## Build Exclusion
102
+
103
+ **Always exclude spikes from the project's TypeScript build:**
104
+
105
+ ```json
106
+ // tsconfig.json
107
+ {
108
+ "exclude": ["node_modules", "codev/spikes"]
109
+ }
110
+ ```
111
+
112
+ Why:
113
+ - Spikes use experimental/mock code that may not compile cleanly
114
+ - Spikes may import packages not in production dependencies
115
+ - Keeps build fast and focused on production code
116
+ - Prevents spike code from accidentally shipping
117
+
118
+ Run spikes directly: `npx tsx codev/spikes/0062/spike-name.ts`
@@ -110,6 +110,34 @@ These rules are **non-negotiable** and must be followed at all times:
110
110
  7. **Monitor progress** - Track Builder status, unblock when needed
111
111
  8. **Review and integrate** - Review Builder PRs, let builders merge them
112
112
  9. **Maintain quality** - Ensure consistency across Builder outputs
113
+ 10. **Enforce spec compliance** - Verify implementations match specs exactly
114
+
115
+ ## Spec Compliance Enforcement (CRITICAL)
116
+
117
+ **The spec is the source of truth. Code that doesn't match the spec is wrong, even if it "works".**
118
+
119
+ ### The Trust Hierarchy
120
+
121
+ ```
122
+ SPEC (source of truth)
123
+
124
+ PLAN (implementation guide derived from spec)
125
+
126
+ EXISTING CODE (NOT TRUSTED - must be validated against spec)
127
+ ```
128
+
129
+ **Never trust existing code over the spec.** Previous phases may have drifted. The spec is always authoritative.
130
+
131
+ ### Before Each Implementation Phase
132
+
133
+ Ask yourself:
134
+ 1. "Have I read the spec in the last 30 minutes?"
135
+ 2. "Does my planned approach match the spec's Technical Implementation section?"
136
+ 3. "If the spec has code examples, am I following them?"
137
+ 4. "If the spec has 'Traps to Avoid', have I checked each one?"
138
+ 5. "Does the existing code I'm building on match the spec?"
139
+
140
+ If ANY answer is "no" or "I'm not sure" → STOP and verify before proceeding.
113
141
 
114
142
  ## Project Tracking
115
143
 
@@ -225,111 +253,15 @@ The Architect monitors progress and provides guidance when the builder is blocke
225
253
 
226
254
  ## Spikes: De-risking Technical Unknowns
227
255
 
228
- **Spikes are short, focused experiments that validate technical assumptions before full implementation.**
229
-
230
- ### What is a Spike?
231
-
232
- The term comes from Extreme Programming (XP), coined in the late 1990s. The metaphor: a spike is like driving a railroad spike through all layers of a problem to see what's underneath. You're not building the whole foundation - you're just poking through to answer a specific question.
233
-
234
- **Key characteristics:**
235
- - **Time-boxed** - Has a hard stop, not open-ended research
236
- - **Throwaway** - The code is discarded; only the knowledge is kept
237
- - **Focused** - Answers ONE specific question
238
- - **Reduces risk** - Done before committing to full implementation
239
-
240
- | Type | Question |
241
- |------|----------|
242
- | Spike | "Can we?" / "Does it work?" |
243
- | Implementation | "Build it" |
244
-
245
- ### When to Use Spikes
246
-
247
- Use spikes when a spec has:
248
- - **Untested external APIs** - Will the API actually behave as documented?
249
- - **Architectural uncertainty** - Will this pattern work for our use case?
250
- - **Integration questions** - Can these components work together?
251
- - **Performance unknowns** - Will this approach be fast enough?
252
-
253
- **Rule of thumb:** If the spec says "we believe X will work" or "according to docs, Y should happen" - that's a spike candidate.
254
-
255
- ### Spike Structure
256
-
257
- Store spikes in `codev/spikes/{spec-number}/`:
258
-
259
- ```
260
- codev/spikes/
261
- └── 0062/
262
- ├── spike-api-behavior.ts
263
- ├── spike-event-handoff.ts
264
- └── spike-storage-roundtrip.ts
265
- ```
266
-
267
- Each spike file should:
268
-
269
- ```typescript
270
- /**
271
- * Spike: [Clear Name]
272
- *
273
- * Purpose: [What assumption are we validating?]
274
- *
275
- * Tests:
276
- * 1. [Specific test case]
277
- * 2. [Another test case]
278
- * 3. [Edge case]
279
- *
280
- * Run with: npx tsx codev/spikes/0062/spike-name.ts
281
- */
282
-
283
- // Self-contained, runnable code that validates the assumption
284
- // Mock/simulate infrastructure where needed
285
- // Print clear PASS/FAIL for each test
286
- ```
287
-
288
- ### Spike Workflow
289
-
290
- 1. **Identify unknowns** during Plan phase - what could break our assumptions?
291
- 2. **Create spikes** for each high-risk unknown
292
- 3. **Run spikes** and document results in spec/plan
293
- 4. **Adjust plan** based on spike findings
294
- 5. **Include spike results** in spec as "Research Findings"
295
-
296
- ### Example Spike Questions
297
-
298
- | Unknown | Spike Purpose |
299
- |---------|---------------|
300
- | "Gemini 3 requires thought signatures" | Validate signature storage and replay works |
301
- | "Two Inngest functions can hand off" | Test event emission and separate invocation |
302
- | "Frontend handles sequence gaps" | Simulate gap and verify realignment |
303
- | "Raw payload survives database round-trip" | Store and reconstruct exact API format |
304
-
305
- ### Spike vs Prototype vs POC
306
-
307
- | Type | Scope | Output | Kept? |
308
- |------|-------|--------|-------|
309
- | **Spike** | Single question | PASS/FAIL + learnings | No (throwaway) |
310
- | **Prototype** | Feature shape | Working UI/flow | Sometimes |
311
- | **POC** | System viability | Minimal working system | Often becomes v1 |
312
-
313
- Spikes are deliberately disposable - they exist to answer a question, not to become production code.
314
-
315
- ### Build Exclusion
316
-
317
- **Always exclude spikes from the project's TypeScript build:**
318
-
319
- ```json
320
- // tsconfig.json
321
- {
322
- "exclude": ["node_modules", "codev/spikes"]
323
- }
324
- ```
256
+ When facing high-risk technical unknowns, use **spikes** - short, time-boxed experiments (1-2 hours max) that validate assumptions before full implementation.
325
257
 
326
- Why:
327
- - Spikes use experimental/mock code that may not compile cleanly
328
- - Spikes may import packages not in production dependencies
329
- - Keeps build fast and focused on production code
330
- - Prevents spike code from accidentally shipping
258
+ **Full guide:** See [codev/resources/spikes.md](../resources/spikes.md)
331
259
 
332
- Run spikes directly: `npx tsx codev/spikes/0062/spike-name.ts`
260
+ **Quick reference:**
261
+ - Store in `codev/spikes/{spec-number}/`
262
+ - Typically 1-2 hours; check in if taking longer
263
+ - Output: PASS/FAIL + learnings (code is throwaway)
264
+ - Use when: Untested APIs, architectural uncertainty, integration questions
333
265
 
334
266
  ## Communication with Builders
335
267
 
@@ -498,6 +498,24 @@
498
498
  text-align: center;
499
499
  }
500
500
 
501
+ /* Action items for creating new shells/worktrees */
502
+ .dashboard-tab-action {
503
+ border: 1px dashed var(--border);
504
+ margin-bottom: 4px;
505
+ color: var(--text-muted);
506
+ }
507
+
508
+ .dashboard-tab-action:hover {
509
+ border-style: solid;
510
+ border-color: var(--accent);
511
+ color: var(--text-secondary);
512
+ }
513
+
514
+ .dashboard-tab-action .tab-icon {
515
+ color: var(--accent);
516
+ font-weight: 500;
517
+ }
518
+
501
519
  /* Status indicators in dashboard tab list */
502
520
  .dashboard-status-indicator {
503
521
  width: 8px;
@@ -116,10 +116,6 @@ function renderDashboardTabContent() {
116
116
  <div class="dashboard-section section-tabs ${sectionState.tabs ? '' : 'collapsed'}">
117
117
  <div class="dashboard-section-header" onclick="toggleSection('tabs')">
118
118
  <h3><span class="collapse-icon">▼</span> Tabs</h3>
119
- <div class="header-actions" onclick="event.stopPropagation()">
120
- <button onclick="spawnBuilder()" title="New Worktree">+ Worktree</button>
121
- <button onclick="spawnShell()" title="New Shell">+ Shell</button>
122
- </div>
123
119
  </div>
124
120
  <div class="dashboard-section-content">
125
121
  <div class="dashboard-tabs-list" id="dashboard-tabs-list">
@@ -173,11 +169,23 @@ function renderDashboardTabContent() {
173
169
  function renderDashboardTabsList() {
174
170
  const terminalTabs = tabs.filter(t => t.type !== 'dashboard' && t.type !== 'files');
175
171
 
172
+ // Action items at the top of the list
173
+ const actionItems = `
174
+ <div class="dashboard-tab-item dashboard-tab-action" onclick="spawnShell()">
175
+ <span class="tab-icon">+</span>
176
+ <span class="tab-name">Create new shell</span>
177
+ </div>
178
+ <div class="dashboard-tab-item dashboard-tab-action" onclick="spawnBuilder()">
179
+ <span class="tab-icon">+</span>
180
+ <span class="tab-name">Create new worktree + shell</span>
181
+ </div>
182
+ `;
183
+
176
184
  if (terminalTabs.length === 0) {
177
- return '<div class="dashboard-empty-state">No tabs open</div>';
185
+ return actionItems;
178
186
  }
179
187
 
180
- return terminalTabs.map(tab => {
188
+ const tabItems = terminalTabs.map(tab => {
181
189
  const isActive = tab.id === activeTabId;
182
190
  const icon = getTabIcon(tab.type);
183
191
  const statusIndicator = getDashboardStatusIndicator(tab);
@@ -190,6 +198,8 @@ function renderDashboardTabsList() {
190
198
  </div>
191
199
  `;
192
200
  }).join('');
201
+
202
+ return actionItems + tabItems;
193
203
  }
194
204
 
195
205
  // Get status indicator for dashboard tab list