jettypod 4.3.0 β 4.4.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/SECURITY-AUDIT-CATASTROPHIC-DELETE.md +196 -0
- package/TEST_HOOK.md +1 -0
- package/docs/DECISIONS.md +4 -52
- package/jettypod.js +210 -24
- package/lib/chore-classifier.js +232 -0
- package/lib/chore-taxonomy.js +172 -0
- package/lib/jettypod-backup.js +124 -8
- package/lib/safe-delete.js +794 -0
- package/lib/worktree-manager.js +54 -41
- package/package.json +1 -1
- package/skills-templates/chore-mode/SKILL.md +396 -0
- package/skills-templates/chore-mode/verification.js +255 -0
- package/skills-templates/chore-planning/SKILL.md +229 -0
- package/skills-templates/epic-planning/SKILL.md +13 -5
- package/skills-templates/feature-planning/SKILL.md +113 -158
- package/skills-templates/production-mode/SKILL.md +7 -4
- package/skills-templates/speed-mode/SKILL.md +463 -471
- package/skills-templates/stable-mode/SKILL.md +371 -319
|
@@ -22,28 +22,15 @@ Guides Claude Code through speed mode implementation with autonomous analysis an
|
|
|
22
22
|
|
|
23
23
|
## Instructions
|
|
24
24
|
|
|
25
|
-
When this skill is activated, you are helping implement a speed mode chore to make
|
|
26
|
-
|
|
27
|
-
## π Critical Context
|
|
28
|
-
|
|
29
|
-
**You are working in an isolated git worktree:**
|
|
30
|
-
- `work start [chore-id]` created a dedicated worktree for this chore
|
|
31
|
-
- All file operations must use **absolute paths** from the worktree (not relative paths)
|
|
32
|
-
- The worktree has its own branch - changes are isolated from main
|
|
33
|
-
- BDD tests and unit tests run in the worktree context
|
|
34
|
-
|
|
35
|
-
**Worktree path is available in Step 0 output** - use it for all file operations.
|
|
36
|
-
|
|
37
|
-
---
|
|
25
|
+
When this skill is activated, you are helping implement a speed mode chore to make the happy path scenario pass. Follow this structured approach:
|
|
38
26
|
|
|
39
27
|
### Overview
|
|
40
28
|
|
|
41
|
-
**Speed Mode Goal:**
|
|
29
|
+
**Speed Mode Goal:** Implement ALL scoped functionality to make the happy path BDD scenario pass, assuming everything works correctly.
|
|
42
30
|
|
|
43
31
|
**Key Principles:**
|
|
44
|
-
- **Implement ALL features/functions** defined in
|
|
45
|
-
- **
|
|
46
|
-
- **Assume success** - assume inputs are valid, files upload successfully, types are correct
|
|
32
|
+
- **Implement ALL features/functions** defined in the scenario - do not skip functionality
|
|
33
|
+
- **Assume happy path** - assume inputs are valid, files upload successfully, types are correct
|
|
47
34
|
- **No error handling** - no validation, no edge case handling, no error messages (that's for stable mode)
|
|
48
35
|
- **Fast iteration** - single file when possible, inline code over abstraction
|
|
49
36
|
- **Use real infrastructure** - use the actual database/storage from your tech stack, not mocks
|
|
@@ -53,136 +40,20 @@ When this skill is activated, you are helping implement a speed mode chore to ma
|
|
|
53
40
|
|
|
54
41
|
---
|
|
55
42
|
|
|
56
|
-
## π§ͺ Unit Testing in Speed Mode - True TDD
|
|
57
|
-
|
|
58
|
-
**Unit tests are written DURING the REDβGREEN loop, not after.**
|
|
59
|
-
|
|
60
|
-
**The TDD workflow (each iteration):**
|
|
61
|
-
1. **Identify next failing BDD step** - Which scenario step needs to pass next?
|
|
62
|
-
2. **Write unit test for the function** - Test the specific function/logic needed
|
|
63
|
-
3. **Watch unit test fail (RED)** - Confirm test catches the missing implementation
|
|
64
|
-
4. **Write minimal code** - Just enough to make the unit test pass
|
|
65
|
-
5. **Run unit test (GREEN)** - Verify the function works in isolation
|
|
66
|
-
6. **Run BDD scenarios** - Check if this makes any BDD steps pass
|
|
67
|
-
7. **Next iteration** - Repeat for next failing step
|
|
68
|
-
|
|
69
|
-
**What to unit test:**
|
|
70
|
-
- New functions you're creating (not framework/library code)
|
|
71
|
-
- Core logic and business rules
|
|
72
|
-
- Success scenarios only (no error cases - that's stable mode)
|
|
73
|
-
|
|
74
|
-
**Where to put unit tests:**
|
|
75
|
-
- Follow project conventions: `test/`, `__tests__/`, or `*.test.js` alongside code
|
|
76
|
-
- Check existing test files for patterns
|
|
77
|
-
|
|
78
|
-
**Example of TDD iteration:**
|
|
79
|
-
```javascript
|
|
80
|
-
// Iteration 1: BDD step "Given a user exists" is failing
|
|
81
|
-
|
|
82
|
-
// 1. Write unit test first (RED)
|
|
83
|
-
test('createUser creates user with valid data', () => {
|
|
84
|
-
const user = createUser('John', 'john@example.com');
|
|
85
|
-
expect(user.name).toBe('John');
|
|
86
|
-
expect(user.email).toBe('john@example.com');
|
|
87
|
-
});
|
|
88
|
-
// Run: FAILS - createUser doesn't exist
|
|
89
|
-
|
|
90
|
-
// 2. Write minimal implementation (GREEN)
|
|
91
|
-
function createUser(name, email) {
|
|
92
|
-
return { name, email };
|
|
93
|
-
}
|
|
94
|
-
// Run unit test: PASSES
|
|
95
|
-
// Run BDD: "Given a user exists" now passes
|
|
96
|
-
|
|
97
|
-
// Iteration 2: Next failing BDD step...
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
**Unit test scope in speed mode:**
|
|
101
|
-
```javascript
|
|
102
|
-
// β
Speed mode unit tests (success paths)
|
|
103
|
-
test('createUser creates user with valid data', () => {
|
|
104
|
-
const user = createUser('John', 'john@example.com');
|
|
105
|
-
expect(user.name).toBe('John');
|
|
106
|
-
expect(user.email).toBe('john@example.com');
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
// β NOT in speed mode (stable mode adds these)
|
|
110
|
-
test('createUser throws error for invalid email', () => {
|
|
111
|
-
expect(() => createUser('John', 'invalid')).toThrow();
|
|
112
|
-
});
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
<details>
|
|
116
|
-
<summary><strong>π Speed Mode Constraints (click to expand)</strong></summary>
|
|
117
|
-
|
|
118
|
-
**What to implement:**
|
|
119
|
-
- ALL scoped functionality - required features AND optional features from all success scenarios
|
|
120
|
-
- Multiple valid workflows if the feature supports them
|
|
121
|
-
- Success variations (different outcomes that are all correct)
|
|
122
|
-
|
|
123
|
-
**What NOT to implement:**
|
|
124
|
-
- β Error handling (try/catch, validation, edge cases)
|
|
125
|
-
- β Input validation (null checks, type checks, range validation)
|
|
126
|
-
- β Error messages for failures
|
|
127
|
-
- β Edge case handling (empty arrays, boundary values, race conditions)
|
|
128
|
-
|
|
129
|
-
**Code organization:**
|
|
130
|
-
- Single file when possible - keep it simple
|
|
131
|
-
- Inline code over separate modules initially
|
|
132
|
-
- Use real infrastructure (actual database/storage from your tech stack, not mocks)
|
|
133
|
-
- Focus: Make. All. Features. Work. (all success paths)
|
|
134
|
-
|
|
135
|
-
</details>
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
### Step 0: Initialize Speed Mode Context
|
|
140
|
-
|
|
141
|
-
**You are now in speed mode,** implementing a chore to make success scenarios pass.
|
|
142
|
-
|
|
143
|
-
**Get the current work context:**
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
sqlite3 .jettypod/work.db "SELECT wi.id, wi.title, wi.parent_id, parent.title as parent_title, parent.scenario_file, wt.worktree_path, wt.branch_name FROM work_items wi LEFT JOIN work_items parent ON wi.parent_id = parent.id LEFT JOIN worktrees wt ON wi.id = wt.work_item_id WHERE wi.status = 'in_progress' AND wi.type = 'chore'"
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
**Display to user:**
|
|
150
|
-
|
|
151
|
-
```
|
|
152
|
-
ββββββββββββββββββββββββββββββββββββββββββ
|
|
153
|
-
π SPEED MODE: Implementing Chore #[id]
|
|
154
|
-
ββββββββββββββββββββββββββββββββββββββββββ
|
|
155
|
-
|
|
156
|
-
Chore: [title]
|
|
157
|
-
Feature: #[parent-id] [parent-title]
|
|
158
|
-
Worktree: [worktree_path]
|
|
159
|
-
Branch: [branch_name]
|
|
160
|
-
|
|
161
|
-
Analyzing BDD scenarios to determine implementation approach...
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
**Then proceed to Step 1.**
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
43
|
## Quick Reference: Async Boundaries
|
|
169
44
|
|
|
170
45
|
**Where Claude Code MUST wait for user confirmation:**
|
|
171
46
|
|
|
172
|
-
| Phase | Location | Why |
|
|
173
|
-
|
|
174
|
-
| Step
|
|
175
|
-
| Step
|
|
47
|
+
| Phase | Location | Why |
|
|
48
|
+
|-------|----------|-----|
|
|
49
|
+
| Step 3 Phase 1 | Before implementing | User confirms implementation approach |
|
|
50
|
+
| Step 4 Phase 2 | Before creating chores | User confirms proposed stable mode chores |
|
|
176
51
|
|
|
177
52
|
**Where Claude Code executes autonomously:**
|
|
178
|
-
- Step
|
|
179
|
-
- Step 1: Scenario analysis and breadcrumb check
|
|
53
|
+
- Step 1: Scenario analysis
|
|
180
54
|
- Step 2: Codebase analysis
|
|
181
|
-
- Step 3
|
|
182
|
-
- Step 4:
|
|
183
|
-
- Step 5: REDβGREENβREFACTOR loop (true TDD)
|
|
184
|
-
- Step 6 Phase 1: Generate stable mode scenarios/steps
|
|
185
|
-
- Step 6 Phases 3-5: Create chores and invoke stable-mode skill
|
|
55
|
+
- Step 3 Phase 2: REDβGREENβREFACTOR loop
|
|
56
|
+
- Step 4 Phases 3-4: Create chores and elevate
|
|
186
57
|
|
|
187
58
|
---
|
|
188
59
|
|
|
@@ -190,7 +61,7 @@ Analyzing BDD scenarios to determine implementation approach...
|
|
|
190
61
|
|
|
191
62
|
**DO NOT mark features as complete after speed mode implementation.**
|
|
192
63
|
|
|
193
|
-
Speed mode is ONLY a checkpoint to prove
|
|
64
|
+
Speed mode is ONLY a checkpoint to prove the happy path works. Features are INCOMPLETE without stable mode chores that add:
|
|
194
65
|
- Error handling and validation
|
|
195
66
|
- Edge case coverage
|
|
196
67
|
- Comprehensive testing
|
|
@@ -198,7 +69,7 @@ Speed mode is ONLY a checkpoint to prove functionality works. Features are INCOM
|
|
|
198
69
|
|
|
199
70
|
**Required workflow after speed mode implementation:**
|
|
200
71
|
|
|
201
|
-
1. β
**Complete ALL speed mode chores** - Implement
|
|
72
|
+
1. β
**Complete ALL speed mode chores** - Implement happy path functionality
|
|
202
73
|
2. β
**Elevate to stable mode** - Use `node jettypod.js work set-mode <feature-id> stable` to auto-generate stable mode chores
|
|
203
74
|
3. β
**Implement stable mode chores** - Add error handling and edge cases
|
|
204
75
|
4. β **NEVER mark feature complete in speed mode** - This bypasses critical quality gates
|
|
@@ -210,12 +81,17 @@ The validation will require you to:
|
|
|
210
81
|
- This will automatically analyze the implementation and generate appropriate stable mode chores
|
|
211
82
|
- Or explicitly skip (not recommended): `node jettypod.js work set-mode <feature-id> stable --force`
|
|
212
83
|
|
|
213
|
-
**Remember:** Speed mode
|
|
84
|
+
**Remember:** Speed mode proves it works on the happy path. Stable mode makes it production-ready.
|
|
214
85
|
|
|
215
86
|
---
|
|
216
87
|
|
|
217
88
|
## Implementation Steps
|
|
218
89
|
|
|
90
|
+
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
91
|
+
PHASE 1: AUTONOMOUS ANALYSIS
|
|
92
|
+
No user input required - Claude Code executes independently
|
|
93
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -->
|
|
94
|
+
|
|
219
95
|
### Step 1: Check for Breadcrumbs and Analyze Scenario
|
|
220
96
|
|
|
221
97
|
**CRITICAL:** Claude Code executes this autonomously - no user permission needed.
|
|
@@ -230,8 +106,15 @@ The validation will require you to:
|
|
|
230
106
|
**To get current work and check for breadcrumbs:**
|
|
231
107
|
|
|
232
108
|
```bash
|
|
233
|
-
# Get current work item with description
|
|
234
|
-
|
|
109
|
+
# Get current work item with description
|
|
110
|
+
jettypod work current
|
|
111
|
+
|
|
112
|
+
# Get parent feature details including scenario_file
|
|
113
|
+
jettypod work show <parent-feature-id>
|
|
114
|
+
|
|
115
|
+
# Or query database directly
|
|
116
|
+
sqlite3 .jettypod/work.db "SELECT id, title, description, parent_id FROM work_items WHERE status = 'in_progress' AND type = 'chore'"
|
|
117
|
+
sqlite3 .jettypod/work.db "SELECT id, title, scenario_file FROM work_items WHERE id = <parent-feature-id>"
|
|
235
118
|
```
|
|
236
119
|
|
|
237
120
|
**Check for breadcrumbs** by examining the chore's description for:
|
|
@@ -244,8 +127,8 @@ If all three sections exist, use them. Otherwise, fall back to autonomous analys
|
|
|
244
127
|
**Then read the scenario file** using the Read tool on the path returned by `scenario_file`.
|
|
245
128
|
|
|
246
129
|
**Parse Gherkin:**
|
|
247
|
-
- Extract
|
|
248
|
-
- Parse Given/When/Then/And steps
|
|
130
|
+
- Extract first `Scenario:` block (happy path)
|
|
131
|
+
- Parse Given/When/Then/And steps
|
|
249
132
|
- Identify:
|
|
250
133
|
- Initial state setup (Given)
|
|
251
134
|
- User actions (When)
|
|
@@ -358,62 +241,65 @@ Integration Points:
|
|
|
358
241
|
Now proposing implementation approach...
|
|
359
242
|
```
|
|
360
243
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
**Evaluate if you need user confirmation before implementing:**
|
|
244
|
+
**Move to Step 3 automatically.**
|
|
364
245
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
-
|
|
368
|
-
|
|
369
|
-
- Epic architectural decisions are clear and constraining
|
|
246
|
+
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
247
|
+
PHASE 2: USER CONFIRMATION REQUIRED
|
|
248
|
+
β‘ ASYNC BOUNDARY - Must wait for user response before proceeding
|
|
249
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -->
|
|
370
250
|
|
|
371
|
-
|
|
372
|
-
- Multiple valid implementation approaches exist
|
|
373
|
-
- Breadcrumbs are vague or missing key details
|
|
374
|
-
- Architectural choice impacts other features
|
|
375
|
-
- You're uncertain about the right approach
|
|
251
|
+
### Step 3: Propose and Execute Implementation
|
|
376
252
|
|
|
377
|
-
|
|
253
|
+
**Two phases: Propose (get user confirmation) β Execute (autonomous)**
|
|
378
254
|
|
|
379
|
-
|
|
255
|
+
#### Phase 1: Propose Implementation Approach
|
|
380
256
|
|
|
381
|
-
**Present your analysis and proposal
|
|
257
|
+
**Present your analysis and proposal:**
|
|
382
258
|
|
|
383
259
|
```
|
|
384
260
|
π‘ Implementation Proposal
|
|
385
261
|
|
|
386
|
-
|
|
262
|
+
Based on scenario analysis and codebase patterns, here's how I'll make the scenario pass:
|
|
387
263
|
|
|
388
|
-
**
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
β’ Why: [rationale - why this over alternatives]
|
|
264
|
+
**Files to create/modify:**
|
|
265
|
+
1. [file path] - [what it will do]
|
|
266
|
+
2. [file path] - [what it will do]
|
|
392
267
|
|
|
393
|
-
**
|
|
394
|
-
β’ [
|
|
268
|
+
**Key implementation points:**
|
|
269
|
+
β’ [Point 1]: [specific approach]
|
|
270
|
+
β’ [Point 2]: [specific approach]
|
|
271
|
+
β’ [Point 3]: [specific approach]
|
|
395
272
|
|
|
396
|
-
|
|
273
|
+
**Why this approach:**
|
|
274
|
+
[Brief explanation of how this satisfies the scenario while following codebase patterns]
|
|
275
|
+
|
|
276
|
+
Sound good? I'll implement this autonomously once you confirm.
|
|
397
277
|
```
|
|
398
278
|
|
|
399
|
-
|
|
279
|
+
**WAIT for user confirmation or adjustments.**
|
|
400
280
|
|
|
401
|
-
If user adjusts: revise proposal and confirm again
|
|
281
|
+
If user adjusts: revise proposal and confirm again.
|
|
402
282
|
|
|
403
|
-
|
|
283
|
+
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
284
|
+
PHASE 3: AUTONOMOUS EXECUTION
|
|
285
|
+
User has confirmed - Claude Code executes REDβGREEN loop independently
|
|
286
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -->
|
|
404
287
|
|
|
405
|
-
|
|
288
|
+
#### Phase 2: Autonomous Execution
|
|
406
289
|
|
|
407
|
-
|
|
290
|
+
**CRITICAL:** After user confirms, Claude Code executes autonomously - no permission needed for individual code changes.
|
|
408
291
|
|
|
409
|
-
**
|
|
292
|
+
**Step 1: Establish RED Baseline**
|
|
410
293
|
|
|
411
294
|
Before writing any implementation code, run tests to establish the RED state:
|
|
412
295
|
|
|
413
296
|
```bash
|
|
414
297
|
# Get current work and parent feature's scenario file
|
|
415
|
-
|
|
416
|
-
#
|
|
298
|
+
jettypod work current
|
|
299
|
+
# Note the parent_id from output
|
|
300
|
+
|
|
301
|
+
sqlite3 .jettypod/work.db "SELECT scenario_file FROM work_items WHERE id = <parent-feature-id>"
|
|
302
|
+
# This gives you the path to the .feature file
|
|
417
303
|
|
|
418
304
|
# Run BDD tests to establish RED baseline
|
|
419
305
|
npx cucumber-js <scenario-file-path> --format progress
|
|
@@ -448,360 +334,441 @@ First error:
|
|
|
448
334
|
Now implementing...
|
|
449
335
|
```
|
|
450
336
|
|
|
451
|
-
|
|
337
|
+
**Step 2: REDβGREEN Iteration Loop**
|
|
452
338
|
|
|
453
|
-
|
|
339
|
+
Iterate until all tests pass or MAX_ITERATIONS reached:
|
|
454
340
|
|
|
455
|
-
|
|
341
|
+
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
342
|
+
β π ITERATION LOOP: REDβGREEN β
|
|
343
|
+
β β
|
|
344
|
+
β Progress Tracking: β
|
|
345
|
+
β β’ Display: "Iteration X/10" at start of each cycle β
|
|
346
|
+
β β’ Track: steps passing vs total, newly passing steps β
|
|
347
|
+
β β’ Goal: All steps pass (exit code 0) β
|
|
348
|
+
β β
|
|
349
|
+
β Return Points: β
|
|
350
|
+
β β’ CHECKPOINT_ITERATION: Resume at specific iteration number β
|
|
351
|
+
β β’ CHECKPOINT_PROGRESS: Resume with known passing step count β
|
|
352
|
+
β β’ If session interrupted, can resume from last known iteration β
|
|
353
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -->
|
|
456
354
|
|
|
457
|
-
|
|
355
|
+
```javascript
|
|
356
|
+
// --- Imports and setup ---
|
|
357
|
+
const { runBddScenarioWithTimeout, parseTestProgress, findNewlyPassingSteps, extractErrors, MAX_ITERATIONS } = require('./.claude/skills/speed-mode/test-runner');
|
|
358
|
+
|
|
359
|
+
let previousResult = global.redBaseline; // From Step 1
|
|
360
|
+
let iteration = 0;
|
|
361
|
+
|
|
362
|
+
// --- Main iteration loop ---
|
|
363
|
+
// π PROGRESS: Iteration {iteration}/{MAX_ITERATIONS} | Steps: {passed}/{total}
|
|
364
|
+
while (iteration < MAX_ITERATIONS) {
|
|
365
|
+
iteration++;
|
|
366
|
+
console.log(`\nβββ Iteration ${iteration}/${MAX_ITERATIONS} βββ`);
|
|
367
|
+
|
|
368
|
+
// --- Make code changes ---
|
|
369
|
+
console.log(`\nβοΈ Making code changes...`);
|
|
370
|
+
// [Claude Code writes implementation code here using Write/Edit tools]
|
|
371
|
+
|
|
372
|
+
// --- Run tests ---
|
|
373
|
+
console.log(`\nπ§ͺ Running tests...`);
|
|
374
|
+
const result = await runBddScenarioWithTimeout(feature.scenario_file, happyPathLine);
|
|
375
|
+
|
|
376
|
+
// --- Handle timeout ---
|
|
377
|
+
if (result.timedOut) {
|
|
378
|
+
console.log(`β οΈ Test execution timed out - tests may be hanging`);
|
|
379
|
+
console.log(`Stopping iteration loop`);
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
458
382
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
5. **Run BDD scenarios** - Check if BDD step now passes
|
|
464
|
-
6. **Display progress** - Show what's passing, what's next
|
|
465
|
-
7. **Continue or exit** - If all BDD scenarios pass β REFACTOR. Otherwise, repeat.
|
|
383
|
+
// --- Parse results and track progress ---
|
|
384
|
+
const currentResult = parseTestProgress(result.stdout + result.stderr);
|
|
385
|
+
const errors = extractErrors(result.stdout + result.stderr);
|
|
386
|
+
const newlyPassing = findNewlyPassingSteps(previousResult, currentResult);
|
|
466
387
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
βββ Iteration 3/10 βββ
|
|
470
|
-
π Unit test: test/dashboard.test.js - sortActivityByDate()
|
|
471
|
-
RED: Test fails - function doesn't exist yet
|
|
472
|
-
βοΈ Implementation: src/dashboard.js - added sortActivityByDate()
|
|
473
|
-
GREEN: Unit test passes
|
|
474
|
-
π§ͺ Running BDD scenarios...
|
|
475
|
-
π Progress: 7/8 BDD steps passing
|
|
476
|
-
β
Newly passing: And activity should be sorted by date
|
|
477
|
-
π§ Next failure: And activity should be filterable
|
|
478
|
-
BDD step: When I filter by category "work"
|
|
479
|
-
```
|
|
388
|
+
// --- Display progress ---
|
|
389
|
+
console.log(`\nπ Progress: ${currentResult.passed}/${currentResult.total} steps passing`);
|
|
480
390
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
391
|
+
if (newlyPassing.length > 0) {
|
|
392
|
+
console.log(`\nβ
Newly passing:`);
|
|
393
|
+
newlyPassing.forEach(step => console.log(` β’ ${step}`));
|
|
394
|
+
}
|
|
485
395
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
396
|
+
// --- Check for GREEN state ---
|
|
397
|
+
if (currentResult.exitCode === 0 || currentResult.passed === currentResult.total) {
|
|
398
|
+
console.log(`\nπ GREEN: All tests passing!`);
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
491
401
|
|
|
492
|
-
|
|
402
|
+
// --- Display next failure ---
|
|
403
|
+
if (errors.errors.length > 0) {
|
|
404
|
+
const nextError = errors.errors[0];
|
|
405
|
+
console.log(`\nπ§ Next failure to address:`);
|
|
406
|
+
console.log(` Step: ${nextError.step}`);
|
|
407
|
+
console.log(` Error: ${nextError.message}`);
|
|
408
|
+
if (nextError.stack) {
|
|
409
|
+
console.log(` Stack: ${nextError.stack.split('\n')[0]}`);
|
|
410
|
+
}
|
|
411
|
+
} else if (currentResult.failedSteps.length > 0) {
|
|
412
|
+
console.log(`\nπ§ Still failing:`);
|
|
413
|
+
currentResult.failedSteps.slice(0, 3).forEach(step => console.log(` β’ ${step}`));
|
|
414
|
+
if (currentResult.failedSteps.length > 3) {
|
|
415
|
+
console.log(` ... and ${currentResult.failedSteps.length - 3} more`);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
493
418
|
|
|
494
|
-
|
|
495
|
-
|
|
419
|
+
previousResult = currentResult;
|
|
420
|
+
}
|
|
496
421
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
422
|
+
// --- Handle max iterations reached ---
|
|
423
|
+
if (iteration >= MAX_ITERATIONS) {
|
|
424
|
+
console.log(`\nβ οΈ Maximum iterations (${MAX_ITERATIONS}) reached without achieving GREEN`);
|
|
425
|
+
console.log(`Final progress: ${previousResult.passed}/${previousResult.total} steps passing`);
|
|
426
|
+
console.log(`\nConsider:`);
|
|
427
|
+
console.log(` β’ Breaking down the chore into smaller pieces`);
|
|
428
|
+
console.log(` β’ Reviewing the implementation approach`);
|
|
429
|
+
console.log(` β’ Checking for incorrect assumptions`);
|
|
430
|
+
}
|
|
431
|
+
```
|
|
502
432
|
|
|
503
|
-
**
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
- Break down the change - can you make smaller steps?
|
|
433
|
+
**Display example:**
|
|
434
|
+
```
|
|
435
|
+
βββ Iteration 1/10 βββ
|
|
507
436
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
- Consider breaking chore into smaller pieces
|
|
437
|
+
βοΈ Making code changes...
|
|
438
|
+
Created src/login.js
|
|
439
|
+
Modified src/app.js
|
|
512
440
|
|
|
513
|
-
|
|
441
|
+
π§ͺ Running tests...
|
|
514
442
|
|
|
515
|
-
|
|
443
|
+
π Progress: 2/8 steps passing
|
|
516
444
|
|
|
517
|
-
|
|
445
|
+
β
Newly passing:
|
|
446
|
+
β’ Given a user is logged in
|
|
447
|
+
β’ When they click the dashboard button
|
|
518
448
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
β β’ Query: Count incomplete speed chores for feature β
|
|
524
|
-
β β’ Display: "X speed mode chores remaining" or "All complete" β
|
|
525
|
-
β β’ Action: Generate stable scenarios/steps/chores if all complete β
|
|
526
|
-
β β
|
|
527
|
-
β Return Point: β
|
|
528
|
-
β β’ CHECKPOINT_CHORE_COUNT: Known incomplete count from last check β
|
|
529
|
-
β β’ If session interrupted, re-query to get current count β
|
|
530
|
-
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -->
|
|
449
|
+
π§ Next failure to address:
|
|
450
|
+
Step: Then they should see their dashboard
|
|
451
|
+
Error: Cannot read property 'innerText' of null
|
|
452
|
+
Stack: at Dashboard.render (src/dashboard.js:12:15)
|
|
531
453
|
|
|
532
|
-
|
|
454
|
+
βββ Iteration 2/10 βββ
|
|
533
455
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
456
|
+
βοΈ Making code changes...
|
|
457
|
+
Created src/dashboard.js
|
|
458
|
+
Modified src/app.js
|
|
537
459
|
|
|
538
|
-
|
|
539
|
-
sqlite3 .jettypod/work.db "SELECT id, title FROM work_items WHERE parent_id = <feature-id> AND type = 'chore' AND mode = 'speed' AND status != 'done' AND id != <current-chore-id> ORDER BY created_at LIMIT 1"
|
|
540
|
-
```
|
|
460
|
+
π§ͺ Running tests...
|
|
541
461
|
|
|
542
|
-
|
|
462
|
+
π Progress: 5/8 steps passing
|
|
543
463
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
464
|
+
β
Newly passing:
|
|
465
|
+
β’ Then they should see their dashboard
|
|
466
|
+
β’ And the dashboard should show their username
|
|
467
|
+
β’ And the dashboard should show their recent activity
|
|
548
468
|
|
|
549
|
-
|
|
469
|
+
π§ Next failure to address:
|
|
470
|
+
Step: And the activity should be sorted by date
|
|
471
|
+
Error: Expected ['Post 2', 'Post 1'] but got ['Post 1', 'Post 2']
|
|
550
472
|
|
|
551
|
-
|
|
552
|
-
#[next-chore-id]: [next-chore-title]
|
|
553
|
-
```
|
|
473
|
+
βββ Iteration 3/10 βββ
|
|
554
474
|
|
|
555
|
-
|
|
475
|
+
βοΈ Making code changes...
|
|
476
|
+
Modified src/dashboard.js
|
|
556
477
|
|
|
557
|
-
|
|
558
|
-
# Commit changes in the worktree
|
|
559
|
-
git add . && git commit -m "feat: [brief description of what was implemented]"
|
|
478
|
+
π§ͺ Running tests...
|
|
560
479
|
|
|
561
|
-
|
|
562
|
-
jettypod work merge
|
|
480
|
+
π Progress: 8/8 steps passing
|
|
563
481
|
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
```
|
|
482
|
+
β
Newly passing:
|
|
483
|
+
β’ And the activity should be sorted by date
|
|
567
484
|
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
- β DO NOT use `jettypod work complete <id>`
|
|
571
|
-
- β DO NOT use `jettypod work set-mode <id> done`
|
|
572
|
-
- β
ONLY use `jettypod work merge`
|
|
485
|
+
π GREEN: All tests passing!
|
|
486
|
+
```
|
|
573
487
|
|
|
574
|
-
|
|
488
|
+
**Speed mode constraints:**
|
|
489
|
+
- **Implement ALL scoped functionality** - if the scenario requires file upload, implement it (just assume it works)
|
|
490
|
+
- **Single file when possible** - keep it simple
|
|
491
|
+
- **NO error handling** - no try/catch, no validation, no edge cases
|
|
492
|
+
- **Assume everything works** - valid inputs, successful operations, correct types
|
|
493
|
+
- **Use real infrastructure** - actual database/storage from your tech stack
|
|
494
|
+
- **Inline code over separate modules** - keep it simple
|
|
495
|
+
- **Focus: Make. All. Features. Work.** (on the happy path)
|
|
575
496
|
|
|
576
|
-
|
|
497
|
+
**Step 3: REFACTOR**
|
|
577
498
|
|
|
578
|
-
|
|
499
|
+
After GREEN is achieved, do a quick refactor pass:
|
|
579
500
|
|
|
580
|
-
|
|
501
|
+
1. **Extract duplicated code** - DRY up any copy-pasted logic
|
|
502
|
+
2. **Rename unclear variables** - make intent obvious
|
|
503
|
+
3. **Simplify complex expressions** - break into readable steps
|
|
504
|
+
4. **Remove dead code** - delete unused variables/functions
|
|
581
505
|
|
|
582
|
-
|
|
506
|
+
**Keep it fast** - 5 minutes max. Major refactoring happens in stable mode.
|
|
583
507
|
|
|
584
|
-
|
|
508
|
+
**Re-run tests after refactoring** to ensure nothing broke:
|
|
585
509
|
|
|
586
|
-
|
|
510
|
+
```javascript
|
|
511
|
+
const result = await runBddScenarioWithTimeout(feature.scenario_file, scenarioLine);
|
|
512
|
+
if (result.exitCode !== 0) {
|
|
513
|
+
console.log('β οΈ Refactoring broke tests - revert and try again');
|
|
514
|
+
}
|
|
515
|
+
```
|
|
587
516
|
|
|
588
|
-
**
|
|
517
|
+
**Step 4: Final Verification and Completion**
|
|
589
518
|
|
|
590
|
-
|
|
519
|
+
After GREEN + REFACTOR, run full feature file once to verify no regressions:
|
|
591
520
|
|
|
592
|
-
|
|
521
|
+
```javascript
|
|
522
|
+
// After iteration loop succeeds (GREEN achieved)
|
|
523
|
+
if (currentResult.exitCode === 0 || currentResult.passed === currentResult.total) {
|
|
524
|
+
console.log(`\nπ GREEN: Happy path scenario passing!`);
|
|
525
|
+
console.log(`\nπ Running full verification (all scenarios)...`);
|
|
526
|
+
|
|
527
|
+
// Run entire feature file once for regression detection
|
|
528
|
+
// Uses the already imported runBddScenarioWithTimeout with no line number to run all scenarios
|
|
529
|
+
const fullResult = await runBddScenarioWithTimeout(feature.scenario_file);
|
|
530
|
+
|
|
531
|
+
if (fullResult.timedOut) {
|
|
532
|
+
console.log(`β οΈ Full verification timed out`);
|
|
533
|
+
} else if (fullResult.exitCode !== 0) {
|
|
534
|
+
const fullProgress = parseTestProgress(fullResult.stdout + fullResult.stderr);
|
|
535
|
+
console.log(`β οΈ Full verification found regressions: ${fullProgress.total - fullProgress.passed} scenarios failing`);
|
|
536
|
+
console.log(`This is expected in speed mode - stable mode will address additional scenarios.`);
|
|
537
|
+
} else {
|
|
538
|
+
console.log(`β
Full verification passed - all scenarios passing!`);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
```
|
|
593
542
|
|
|
594
|
-
|
|
595
|
-
# Commit changes in the worktree
|
|
596
|
-
git add . && git commit -m "feat: [brief description of what was implemented]"
|
|
543
|
+
Display comprehensive results:
|
|
597
544
|
|
|
598
|
-
|
|
599
|
-
# This prevents race conditions when multiple instances generate BDD files simultaneously
|
|
600
|
-
jettypod work merge --with-transition
|
|
601
|
-
```
|
|
545
|
+
**On SUCCESS (GREEN achieved):**
|
|
602
546
|
|
|
603
|
-
|
|
604
|
-
|
|
547
|
+
```javascript
|
|
548
|
+
// Track what files were created/modified during implementation
|
|
549
|
+
const filesCreated = [/* list of created files */];
|
|
550
|
+
const filesModified = [/* list of modified files */];
|
|
605
551
|
|
|
606
|
-
|
|
552
|
+
console.log(`\nββββββββββββββββββββββββββββββββββββββββββ`);
|
|
553
|
+
console.log(`β
SPEED MODE COMPLETE - GREEN STATE ACHIEVED`);
|
|
554
|
+
console.log(`ββββββββββββββββββββββββββββββββββββββββββ\n`);
|
|
607
555
|
|
|
608
|
-
|
|
609
|
-
- Instance A merges β generates BDD β appends to step_definitions/auth.steps.js
|
|
610
|
-
- Instance B merges β generates BDD β appends to step_definitions/auth.steps.js (CONFLICT!)
|
|
611
|
-
- Second write can overwrite first write, losing step definitions
|
|
556
|
+
console.log(`π Happy path scenario: ALL TESTS PASSING\n`);
|
|
612
557
|
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
- No conflicts, all step definitions preserved
|
|
558
|
+
console.log(`Implementation Summary:`);
|
|
559
|
+
console.log(` Iterations: ${iteration}/${MAX_ITERATIONS}`);
|
|
560
|
+
console.log(` Test steps: ${currentResult.passed}/${currentResult.total} passing\n`);
|
|
617
561
|
|
|
618
|
-
|
|
619
|
-
|
|
562
|
+
if (filesCreated.length > 0) {
|
|
563
|
+
console.log(`Files created:`);
|
|
564
|
+
filesCreated.forEach(file => console.log(` β
${file}`));
|
|
565
|
+
console.log();
|
|
566
|
+
}
|
|
620
567
|
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
568
|
+
if (filesModified.length > 0) {
|
|
569
|
+
console.log(`Files modified:`);
|
|
570
|
+
filesModified.forEach(file => console.log(` βοΈ ${file}`));
|
|
571
|
+
console.log();
|
|
572
|
+
}
|
|
626
573
|
|
|
627
|
-
|
|
574
|
+
// --- Create unit tests for new functions ---
|
|
575
|
+
// For each new function implemented, create a unit test file with happy path coverage
|
|
628
576
|
|
|
629
|
-
|
|
577
|
+
// Unit test template for new functions:
|
|
578
|
+
// test/[filename].test.js or __tests__/[filename].test.js
|
|
579
|
+
/*
|
|
580
|
+
const { functionName } = require('../src/path/to/module');
|
|
630
581
|
|
|
631
|
-
|
|
582
|
+
describe('functionName', () => {
|
|
583
|
+
it('should handle valid input successfully', () => {
|
|
584
|
+
// Arrange
|
|
585
|
+
const input = validTestData;
|
|
632
586
|
|
|
633
|
-
|
|
587
|
+
// Act
|
|
588
|
+
const result = functionName(input);
|
|
634
589
|
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
590
|
+
// Assert
|
|
591
|
+
expect(result).toEqual(expectedOutput);
|
|
592
|
+
});
|
|
593
|
+
});
|
|
594
|
+
*/
|
|
640
595
|
|
|
641
|
-
|
|
596
|
+
// Speed mode unit tests focus on:
|
|
597
|
+
// - Happy path with valid input
|
|
598
|
+
// - One successful operation per function
|
|
599
|
+
// - Basic return value verification
|
|
642
600
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
- Missing required parameters
|
|
646
|
-
- System errors (file not found, network errors, database errors)
|
|
647
|
-
- Permission/authorization failures
|
|
601
|
+
console.log(`Next step: Elevate to stable mode using 'jettypod work set-mode <feature-id> stable'\n`);
|
|
602
|
+
```
|
|
648
603
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
604
|
+
**Display:**
|
|
605
|
+
```
|
|
606
|
+
ββββββββββββββββββββββββββββββββββββββββββ
|
|
607
|
+
β
GREEN STATE ACHIEVED - Now Creating Stable Chores
|
|
608
|
+
ββββββββββββββββββββββββββββββββββββββββββ
|
|
654
609
|
|
|
655
|
-
|
|
656
|
-
- Concurrent operations (race conditions)
|
|
657
|
-
- Partial failures (transaction rollbacks)
|
|
658
|
-
- State transitions (invalid state changes)
|
|
610
|
+
π Happy path scenario: ALL TESTS PASSING
|
|
659
611
|
|
|
660
|
-
|
|
612
|
+
Implementation Summary:
|
|
613
|
+
Iterations: 3/10
|
|
614
|
+
Test steps: 8/8 passing
|
|
661
615
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
When I call the function with missing "name" parameter
|
|
666
|
-
Then it should throw a validation error
|
|
667
|
-
And the error message should be "Parameter 'name' is required"
|
|
616
|
+
Files created:
|
|
617
|
+
β
src/login.js
|
|
618
|
+
β
src/dashboard.js
|
|
668
619
|
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
Then it should return an appropriate error
|
|
673
|
-
And the error code should be "INVALID_INPUT"
|
|
620
|
+
Files modified:
|
|
621
|
+
βοΈ src/app.js
|
|
622
|
+
βοΈ src/index.html
|
|
674
623
|
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
When I provide the maximum allowed value
|
|
678
|
-
Then it should process successfully
|
|
679
|
-
And return the expected result
|
|
624
|
+
β οΈ Speed mode is NOT complete until stable chores exist.
|
|
625
|
+
Proceeding to Step 4 to create stable mode chores...
|
|
680
626
|
```
|
|
681
627
|
|
|
682
|
-
**
|
|
628
|
+
**On FAILURE (max iterations or timeout):**
|
|
683
629
|
|
|
684
|
-
```
|
|
685
|
-
|
|
686
|
-
|
|
630
|
+
```javascript
|
|
631
|
+
// --- Display failure header ---
|
|
632
|
+
console.log(`\nββββββββββββββββββββββββββββββββββββββββββ`);
|
|
633
|
+
console.log(`β οΈ SPEED MODE INCOMPLETE - STILL IN RED STATE`);
|
|
634
|
+
console.log(`ββββββββββββββββββββββββββββββββββββββββββ\n`);
|
|
635
|
+
|
|
636
|
+
// --- Handle timeout case ---
|
|
637
|
+
if (result.timedOut) {
|
|
638
|
+
console.log(`β Test execution timed out`);
|
|
639
|
+
console.log(`\nPossible causes:`);
|
|
640
|
+
console.log(` β’ Infinite loop in implementation code`);
|
|
641
|
+
console.log(` β’ Test is waiting for async operation that never completes`);
|
|
642
|
+
console.log(` β’ Step definition has blocking code`);
|
|
643
|
+
} else {
|
|
644
|
+
// --- Handle max iterations case ---
|
|
645
|
+
console.log(`β Maximum iterations (${MAX_ITERATIONS}) reached\n`);
|
|
646
|
+
console.log(`Final Progress: ${previousResult.passed}/${previousResult.total} steps passing\n`);
|
|
647
|
+
|
|
648
|
+
// --- Display failing steps ---
|
|
649
|
+
if (previousResult.failedSteps.length > 0) {
|
|
650
|
+
console.log(`Still failing:`);
|
|
651
|
+
previousResult.failedSteps.forEach(step => console.log(` β ${step}`));
|
|
652
|
+
console.log();
|
|
653
|
+
}
|
|
687
654
|
|
|
688
|
-
|
|
655
|
+
// --- Display remaining errors ---
|
|
656
|
+
const errors = extractErrors(result.stdout + result.stderr);
|
|
657
|
+
if (errors.errors.length > 0) {
|
|
658
|
+
console.log(`Remaining errors:`);
|
|
659
|
+
errors.errors.slice(0, 3).forEach(err => {
|
|
660
|
+
console.log(` Step: ${err.step}`);
|
|
661
|
+
console.log(` Error: ${err.message}\n`);
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
}
|
|
689
665
|
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
666
|
+
// --- Display next steps ---
|
|
667
|
+
console.log(`\nWhat to do:`);
|
|
668
|
+
console.log(` β’ Review implementation approach - is it the right strategy?`);
|
|
669
|
+
console.log(` β’ Check for incorrect assumptions about existing code`);
|
|
670
|
+
console.log(` β’ Consider breaking this chore into smaller pieces`);
|
|
671
|
+
console.log(` β’ Verify step definitions match what implementation provides`);
|
|
672
|
+
console.log(`\nDO NOT proceed to generate stable mode chores until GREEN is achieved.`);
|
|
673
|
+
```
|
|
694
674
|
|
|
695
|
-
|
|
696
|
-
Given [context]
|
|
697
|
-
When [action]
|
|
698
|
-
Then [expected behavior]
|
|
699
|
-
EOF
|
|
675
|
+
**Display (on failure):**
|
|
700
676
|
```
|
|
677
|
+
ββββββββββββββββββββββββββββββββββββββββββ
|
|
678
|
+
β οΈ SPEED MODE INCOMPLETE - STILL IN RED STATE
|
|
679
|
+
ββββββββββββββββββββββββββββββββββββββββββ
|
|
701
680
|
|
|
702
|
-
|
|
681
|
+
β Maximum iterations (10) reached
|
|
703
682
|
|
|
704
|
-
|
|
683
|
+
Final Progress: 5/8 steps passing
|
|
705
684
|
|
|
706
|
-
|
|
685
|
+
Still failing:
|
|
686
|
+
β Then they should see their dashboard
|
|
687
|
+
β And the dashboard should show their username
|
|
688
|
+
β And the dashboard should show their recent activity
|
|
707
689
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
4. Create new step definition files for missing steps
|
|
690
|
+
Remaining errors:
|
|
691
|
+
Step: Then they should see their dashboard
|
|
692
|
+
Error: Cannot read property 'innerText' of null
|
|
712
693
|
|
|
713
|
-
|
|
694
|
+
Step: And the dashboard should show their username
|
|
695
|
+
Error: Expected 'John Doe' but got undefined
|
|
714
696
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
// Error handling steps
|
|
722
|
-
When('I call the function with missing {string} parameter', async function(paramName) {
|
|
723
|
-
try {
|
|
724
|
-
// Implementation that calls function without parameter
|
|
725
|
-
this.error = null;
|
|
726
|
-
} catch (err) {
|
|
727
|
-
this.error = err;
|
|
728
|
-
}
|
|
729
|
-
});
|
|
697
|
+
What to do:
|
|
698
|
+
β’ Review implementation approach - is it the right strategy?
|
|
699
|
+
β’ Check for incorrect assumptions about existing code
|
|
700
|
+
β’ Consider breaking this chore into smaller pieces
|
|
701
|
+
β’ Verify step definitions match what implementation provides
|
|
730
702
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
expect(this.error.name).to.equal('ValidationError');
|
|
734
|
-
});
|
|
703
|
+
DO NOT proceed to generate stable mode chores until GREEN is achieved.
|
|
704
|
+
```
|
|
735
705
|
|
|
736
|
-
|
|
737
|
-
expect(this.error.message).to.equal(expectedMessage);
|
|
738
|
-
});
|
|
706
|
+
**Move to Step 4 IMMEDIATELY if GREEN achieved.**
|
|
739
707
|
|
|
740
|
-
|
|
741
|
-
When('I provide an empty string as input', async function() {
|
|
742
|
-
this.result = await this.functionUnderTest('');
|
|
743
|
-
});
|
|
708
|
+
**CRITICAL: GREEN is NOT completion - it's just a checkpoint. Speed mode is INCOMPLETE until stable mode chores are created. You MUST continue to Step 4.**
|
|
744
709
|
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
710
|
+
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
711
|
+
PHASE 4: STABLE CHORE GENERATION
|
|
712
|
+
β‘ ASYNC BOUNDARY - Must wait for user to confirm proposed chores
|
|
713
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -->
|
|
749
714
|
|
|
750
|
-
|
|
715
|
+
### Step 4: Generate Stable Mode Chores (REQUIRED - Do Not Skip)
|
|
751
716
|
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
# Write the step definitions to the file
|
|
756
|
-
```
|
|
717
|
+
**CRITICAL:** This step is MANDATORY. Speed mode is NOT complete until stable mode chores exist. Without them, users cannot resume work on this feature.
|
|
718
|
+
|
|
719
|
+
**Two phases: Analyze and propose β Get confirmation β Create autonomously**
|
|
757
720
|
|
|
758
|
-
#### Phase
|
|
721
|
+
#### Phase 1: Analyze Implementation
|
|
759
722
|
|
|
760
|
-
**Your task:**
|
|
723
|
+
**Your task:** Review what was built and identify what's needed for stable mode.
|
|
761
724
|
|
|
762
725
|
**Analysis checklist:**
|
|
763
726
|
|
|
764
727
|
1. **Error handling gaps**
|
|
765
|
-
- What
|
|
766
|
-
- What
|
|
767
|
-
- What
|
|
768
|
-
|
|
769
|
-
2. **Edge
|
|
770
|
-
-
|
|
771
|
-
-
|
|
772
|
-
-
|
|
773
|
-
|
|
774
|
-
3. **
|
|
775
|
-
-
|
|
728
|
+
- What user errors are possible?
|
|
729
|
+
- What system errors could occur?
|
|
730
|
+
- What validation is missing?
|
|
731
|
+
|
|
732
|
+
2. **Edge cases**
|
|
733
|
+
- Boundary conditions (empty inputs, max values, etc.)
|
|
734
|
+
- Race conditions
|
|
735
|
+
- State consistency issues
|
|
736
|
+
|
|
737
|
+
3. **Non-happy-path scenarios**
|
|
738
|
+
- Read the full scenario file (not just happy path)
|
|
739
|
+
- Identify scenarios 2+ (error handling, edge cases)
|
|
740
|
+
- Check what additional behavior is needed
|
|
741
|
+
|
|
742
|
+
4. **Code quality needs**
|
|
743
|
+
- What needs better structure/organization?
|
|
744
|
+
- What needs proper error messages?
|
|
776
745
|
- What needs logging/debugging support?
|
|
777
|
-
|
|
746
|
+
|
|
747
|
+
#### Phase 2: Propose Stable Mode Chores
|
|
778
748
|
|
|
779
749
|
**Present your analysis:**
|
|
780
750
|
|
|
781
751
|
```
|
|
782
752
|
π Stable Mode Chores Proposal
|
|
783
753
|
|
|
784
|
-
I've
|
|
785
|
-
I've created step definitions for these scenarios.
|
|
786
|
-
|
|
787
|
-
Here are the chores needed to make these scenarios pass:
|
|
754
|
+
I've analyzed the implementation. Here are the chores needed for stable mode:
|
|
788
755
|
|
|
789
756
|
**Chore 1: [Title]**
|
|
790
757
|
- Why: [What gap this fills]
|
|
791
758
|
- Scope: [What specifically needs to be done]
|
|
792
|
-
-
|
|
759
|
+
- Scenario: [Which BDD scenario this addresses, if applicable]
|
|
793
760
|
|
|
794
761
|
**Chore 2: [Title]**
|
|
795
762
|
- Why: [What gap this fills]
|
|
796
763
|
- Scope: [What specifically needs to be done]
|
|
797
|
-
-
|
|
764
|
+
- Scenario: [Which BDD scenario this addresses, if applicable]
|
|
798
765
|
|
|
799
766
|
**Chore 3: [Title]**
|
|
800
767
|
- Why: [What gap this fills]
|
|
801
768
|
- Scope: [What specifically needs to be done]
|
|
802
|
-
-
|
|
769
|
+
- Scenario: [Which BDD scenario this addresses, if applicable]
|
|
803
770
|
|
|
804
|
-
These chores will make all
|
|
771
|
+
These chores will make all BDD scenarios pass with proper error handling and edge case coverage.
|
|
805
772
|
|
|
806
773
|
Sound good? I'll create these chores once you confirm.
|
|
807
774
|
```
|
|
@@ -810,7 +777,12 @@ Sound good? I'll create these chores once you confirm.
|
|
|
810
777
|
|
|
811
778
|
If user adjusts: revise chores and confirm again.
|
|
812
779
|
|
|
813
|
-
|
|
780
|
+
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
781
|
+
PHASE 5: AUTONOMOUS COMPLETION
|
|
782
|
+
User has confirmed chores - create them and finalize
|
|
783
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -->
|
|
784
|
+
|
|
785
|
+
#### Phase 3: Create Chores Autonomously
|
|
814
786
|
|
|
815
787
|
**CRITICAL:** After user confirms, create chores programmatically - no additional permission needed.
|
|
816
788
|
|
|
@@ -818,7 +790,7 @@ If user adjusts: revise chores and confirm again.
|
|
|
818
790
|
|
|
819
791
|
```javascript
|
|
820
792
|
const { create } = require('./features/work-tracking');
|
|
821
|
-
const { getCurrentWork } = require('
|
|
793
|
+
const { getCurrentWork } = require('../../lib/current-work');
|
|
822
794
|
|
|
823
795
|
(async () => {
|
|
824
796
|
const currentWork = await getCurrentWork();
|
|
@@ -840,47 +812,46 @@ Chores created:
|
|
|
840
812
|
β’ #[ID]: [Title]
|
|
841
813
|
```
|
|
842
814
|
|
|
843
|
-
#### Phase
|
|
815
|
+
#### Phase 4: Auto-Elevate to Stable Mode (If All Speed Chores Done)
|
|
844
816
|
|
|
845
|
-
**CRITICAL:
|
|
817
|
+
**CRITICAL: Check if ALL speed mode chores are complete. If yes, auto-elevate to stable mode.**
|
|
846
818
|
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
819
|
+
<!-- βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
820
|
+
β π COMPLETION CHECK: Speed Chores β
|
|
821
|
+
β β
|
|
822
|
+
β Progress Tracking: β
|
|
823
|
+
β β’ Query: Count incomplete speed chores for feature β
|
|
824
|
+
β β’ Display: "X speed mode chores remaining" or "All complete" β
|
|
825
|
+
β β’ Action: Auto-elevate if all complete β
|
|
826
|
+
β β
|
|
827
|
+
β Return Point: β
|
|
828
|
+
β β’ CHECKPOINT_CHORE_COUNT: Known incomplete count from last check β
|
|
829
|
+
β β’ If session interrupted, re-query to get current count β
|
|
830
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ -->
|
|
854
831
|
|
|
855
|
-
|
|
856
|
-
- Step definitions for validation, error handling, and edge cases"
|
|
832
|
+
**Check for incomplete speed chores:**
|
|
857
833
|
|
|
858
|
-
|
|
859
|
-
|
|
834
|
+
```bash
|
|
835
|
+
# Get current work to find parent feature ID
|
|
836
|
+
jettypod work current
|
|
860
837
|
|
|
861
|
-
#
|
|
862
|
-
jettypod
|
|
838
|
+
# Count incomplete speed chores for the feature
|
|
839
|
+
sqlite3 .jettypod/work.db "SELECT COUNT(*) FROM work_items WHERE parent_id = <feature-id> AND type = 'chore' AND mode = 'speed' AND status != 'done'"
|
|
863
840
|
```
|
|
864
841
|
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
The merge lock is now released - other instances can proceed with their transitions.
|
|
868
|
-
|
|
869
|
-
#### Phase 7: Set Feature Mode to Stable
|
|
870
|
-
|
|
871
|
-
**Set the feature mode:**
|
|
842
|
+
**If all speed chores are done (count = 0), EXECUTE elevation:**
|
|
872
843
|
|
|
873
844
|
```bash
|
|
874
845
|
jettypod work set-mode <feature-id> stable
|
|
875
846
|
```
|
|
876
847
|
|
|
877
|
-
|
|
848
|
+
**DO NOT display this as example text. EXECUTE IT using the Bash tool.**
|
|
878
849
|
|
|
879
|
-
|
|
850
|
+
After execution, display:
|
|
880
851
|
|
|
881
852
|
```
|
|
882
853
|
ββββββββββββββββββββββββββββββββββββββββββ
|
|
883
|
-
π― Speed Mode Complete!
|
|
854
|
+
π― Speed Mode Complete! Feature Elevated to Stable Mode
|
|
884
855
|
ββββββββββββββββββββββββββββββββββββββββββ
|
|
885
856
|
|
|
886
857
|
β οΈ CRITICAL: Speed mode is ONLY a checkpoint to prove functionality works.
|
|
@@ -888,35 +859,56 @@ The feature is INCOMPLETE without stable mode - error handling, validation,
|
|
|
888
859
|
edge cases, and comprehensive testing are ALL required.
|
|
889
860
|
|
|
890
861
|
What we accomplished:
|
|
862
|
+
β
Happy path scenario passes
|
|
891
863
|
β
All speed mode chores complete
|
|
892
|
-
β
|
|
893
|
-
β
|
|
894
|
-
β
Created [N] stable mode chores
|
|
895
|
-
β
Feature mode set to stable
|
|
864
|
+
β
Feature elevated to stable mode
|
|
865
|
+
β
Stable mode chores created and ready
|
|
896
866
|
|
|
897
|
-
π NEVER leave a feature in speed mode.
|
|
867
|
+
π NEVER leave a feature in speed mode - it's not production-ready.
|
|
898
868
|
Stable mode adds:
|
|
899
869
|
β’ Comprehensive error handling and user-friendly error messages
|
|
900
870
|
β’ Input validation (null checks, type checks, range validation)
|
|
901
871
|
β’ Edge case handling (empty arrays, boundary values, race conditions)
|
|
902
872
|
β’ State consistency and data integrity
|
|
903
|
-
β’ All BDD scenarios passing (
|
|
873
|
+
β’ All BDD scenarios passing (happy path + error/edge cases)
|
|
874
|
+
|
|
875
|
+
**Next step:** IMMEDIATELY start the first stable mode chore
|
|
876
|
+
jettypod work start [first-stable-chore-id]
|
|
877
|
+
```
|
|
878
|
+
|
|
879
|
+
**If speed chores remain, display:**
|
|
904
880
|
|
|
905
|
-
**Next step:** I'm now invoking the stable-mode skill to start implementing the first stable chore.
|
|
906
881
|
```
|
|
882
|
+
ββββββββββββββββββββββββββββββββββββββββββ
|
|
883
|
+
π― Speed Mode Chore Done - Stable Chores Created
|
|
884
|
+
ββββββββββββββββββββββββββββββββββββββββββ
|
|
885
|
+
|
|
886
|
+
What we accomplished:
|
|
887
|
+
β
Happy path scenario passes for this chore
|
|
888
|
+
β
Stable mode chores created for when speed mode finishes
|
|
907
889
|
|
|
908
|
-
|
|
890
|
+
Remaining speed mode chores: [count]
|
|
909
891
|
|
|
910
|
-
|
|
892
|
+
β οΈ Speed mode is NOT complete yet - [count] chores remain.
|
|
893
|
+
You can take a break here - stable mode chores exist and work can resume.
|
|
911
894
|
|
|
895
|
+
**Next step:** Continue with next speed mode chore
|
|
896
|
+
jettypod work start [next-speed-chore-id]
|
|
912
897
|
```
|
|
913
|
-
|
|
898
|
+
|
|
899
|
+
**Mark current chore as done:**
|
|
900
|
+
|
|
901
|
+
Use Bash tool to commit and push:
|
|
902
|
+
```bash
|
|
903
|
+
git add . && git commit -m "feat: [brief description of what was implemented]" && git push
|
|
904
|
+
```
|
|
905
|
+
|
|
906
|
+
Then use the merge command to merge to main (which auto-marks chore as done via post-merge hook):
|
|
907
|
+
```bash
|
|
908
|
+
jettypod work merge
|
|
914
909
|
```
|
|
915
910
|
|
|
916
|
-
The
|
|
917
|
-
1. Start the first stable chore automatically
|
|
918
|
-
2. Guide implementation to make stable scenarios pass
|
|
919
|
-
3. Continue with remaining stable chores
|
|
911
|
+
The post-merge hook will automatically mark the chore as done when merged to main.
|
|
920
912
|
|
|
921
|
-
**End
|
|
913
|
+
**End skill.**
|
|
922
914
|
|