jettypod 4.4.11 → 4.4.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jettypod",
3
- "version": "4.4.11",
3
+ "version": "4.4.13",
4
4
  "description": "AI-powered development workflow manager with TDD, BDD, and automatic test generation",
5
5
  "main": "jettypod.js",
6
6
  "bin": {
@@ -183,7 +183,48 @@ User picks winner. Note their choice - you'll record it formally in Step 8 when
183
183
 
184
184
  **Proceed to Step 6.**
185
185
 
186
- ### Step 6: Generate BDD Scenarios AND Step Definitions
186
+ ### Step 6: Define Integration Contract AND Generate BDD Scenarios
187
+
188
+ **CRITICAL:** Before writing scenarios, you MUST define how users reach this feature. Features that pass tests but aren't integrated into the product are useless.
189
+
190
+ #### Step 6A: Define Integration Contract
191
+
192
+ **Ask yourself and document:**
193
+
194
+ 1. **Entry Point** - How does a user reach this feature?
195
+ - Web: URL/route (e.g., `/login`, `/dashboard/settings`)
196
+ - CLI: Command (e.g., `jettypod backlog`)
197
+ - UI: Button, link, menu item (e.g., "Login button in header")
198
+ - API: Endpoint that exposes this (e.g., `POST /api/auth/login`)
199
+
200
+ 2. **Caller Code** - What existing code must invoke/import the new feature?
201
+ - Which file imports it (e.g., `src/app/layout.tsx`)
202
+ - Which component/function renders or calls it
203
+ - Where it's registered/mounted (e.g., router config, command registry)
204
+
205
+ 3. **Integration Scenario** - A BDD scenario proving the feature is reachable
206
+ - Must start from an existing entry point users can access
207
+ - Must navigate/invoke to reach the new feature
208
+ - Proves the feature isn't an "island"
209
+
210
+ **Display to user:**
211
+
212
+ ```
213
+ 📍 Integration Contract
214
+
215
+ **Entry Point:** [How users reach this feature]
216
+ **Caller Code:** [What existing code invokes this]
217
+ **Integration Test:** [Scenario proving reachability]
218
+
219
+ Example:
220
+ - Entry Point: `/login` route
221
+ - Caller Code: `src/app/layout.tsx` renders `<LoginButton>` in header, which links to `/login`
222
+ - Integration Test: "Given I'm on the home page, When I click 'Sign In', Then I see the login form"
223
+ ```
224
+
225
+ **WAIT for user to confirm or adjust the integration contract.**
226
+
227
+ #### Step 6B: Generate BDD Scenarios AND Step Definitions
187
228
 
188
229
  **CRITICAL:** BDD scenarios and step definitions must ALWAYS be created together. Never create scenarios without step definitions.
189
230
 
@@ -198,7 +239,8 @@ Based on chosen approach, generate:
198
239
  **A. Scenario file** at `features/[feature-slug].feature` using Write tool:
199
240
 
200
241
  1. **Create file** at `features/[feature-slug].feature` using Write tool
201
- 2. **Include all "make it work" scenarios**:
242
+ 2. **FIRST scenario MUST be the Integration Scenario** from Step 6A (proves reachability)
243
+ 3. **Include all "make it work" scenarios**:
202
244
  - All success paths - required functionality AND optional features
203
245
  - Multiple valid workflows if the feature supports them
204
246
  - Success variations (different outcomes that are all correct)
@@ -239,6 +281,17 @@ Feature: [Feature Name]
239
281
  Epic: [Epic name if applicable]
240
282
  Approach: [Chosen approach name]
241
283
 
284
+ # Integration Contract:
285
+ # Entry Point: [from Step 6A]
286
+ # Caller Code: [from Step 6A]
287
+
288
+ # INTEGRATION SCENARIO (REQUIRED - proves feature is reachable)
289
+ Scenario: User can reach [feature] from [entry point]
290
+ Given I am on [existing entry point users can access]
291
+ When I [navigate/click/invoke to reach the feature]
292
+ Then I [see/access the feature]
293
+
294
+ # FEATURE SCENARIOS (required + optional functionality)
242
295
  Scenario: [Core functionality - required workflow]
243
296
  Given [initial state]
244
297
  When [user takes main action]
@@ -250,7 +303,7 @@ Scenario: [Optional feature 1 - if applicable]
250
303
  When [user uses optional feature]
251
304
  Then [feature works correctly]
252
305
 
253
- # SPEED MODE: All success scenarios above (required + optional functionality)
306
+ # SPEED MODE: All success scenarios above (integration + required + optional)
254
307
  # STABLE MODE: Will add error handling, validation failures, edge cases
255
308
  # These failure scenarios are added by stable-mode skill, NOT during feature discovery
256
309
  ```
@@ -263,6 +316,18 @@ Feature: Email/Password Login
263
316
  Epic: User Authentication
264
317
  Approach: Simple inline form
265
318
 
319
+ # Integration Contract:
320
+ # Entry Point: /login route
321
+ # Caller Code: src/app/layout.tsx renders LoginButton in header
322
+
323
+ # INTEGRATION SCENARIO
324
+ Scenario: User can reach login form from home page
325
+ Given I am on the home page
326
+ When I click the "Sign In" button in the header
327
+ Then I am on the login page
328
+ And I see the email and password fields
329
+
330
+ # FEATURE SCENARIOS
266
331
  Scenario: User successfully logs in with valid credentials
267
332
  Given I am on the login page
268
333
  When I enter valid email and password
@@ -393,13 +458,19 @@ Display: "✅ BDD infrastructure validated - all steps have definitions"
393
458
  **CRITICAL:** After BDD validation passes, analyze the codebase and propose technical implementation chores. **DO NOT CREATE CHORES YET** - the feature must transition to implementation mode first (Step 8).
394
459
 
395
460
  **Your analysis should consider:**
396
- - The BDD scenarios (all success paths - required + optional features)
461
+ - The BDD scenarios (integration + all success paths)
462
+ - The Integration Contract from Step 6A
397
463
  - Existing codebase structure and patterns
398
464
  - Epic's architectural decisions (if any)
399
465
  - Tech stack and framework conventions
400
466
  - Which scenario steps each chore addresses
401
467
  - Similar code patterns to follow
402
468
 
469
+ **REQUIRED: At least one chore MUST be an Integration Chore** that:
470
+ - Wires the feature into the existing app
471
+ - Makes the Integration Scenario pass
472
+ - Modifies the caller code identified in Step 6A
473
+
403
474
  **Say to the user:**
404
475
 
405
476
  ```
@@ -409,7 +480,20 @@ Now let me analyze the codebase and propose implementation chores for speed mode
409
480
 
410
481
  Based on the scenario and my understanding of the codebase, here are the chores I recommend for speed mode:
411
482
 
412
- **Chore 1: [Technical task title]**
483
+ **Chore 1: [Integration chore - wire feature into app]** ⚡ INTEGRATION
484
+ - Why: Makes the feature reachable from [entry point]
485
+ - Integration Contract:
486
+ • Entry point: [from Step 6A]
487
+ • Caller code to modify: [specific file/function]
488
+ - Scenario steps addressed:
489
+ • [Integration scenario Given/When/Then steps]
490
+ - Implementation guidance:
491
+ • Files to modify: [caller code files]
492
+ • What to add: [route, link, import, menu item, etc.]
493
+ - Verification:
494
+ • Integration scenario passes (feature is reachable)
495
+
496
+ **Chore 2: [Core functionality chore]**
413
497
  - Why: [What this accomplishes toward the scenario]
414
498
  - Scenario steps addressed:
415
499
  • [Which Given/When/Then steps this chore makes work]
@@ -420,20 +504,9 @@ Based on the scenario and my understanding of the codebase, here are the chores
420
504
  - Verification:
421
505
  • [Which step definitions should pass]
422
506
 
423
- **Chore 2: [Technical task title]**
424
- - Why: [What this accomplishes]
425
- - Scenario steps addressed:
426
- • [Which steps]
427
- - Implementation guidance:
428
- • Files to create/modify: [paths]
429
- • Patterns to follow: [references]
430
- • Key functions/components needed: [list]
431
- - Verification:
432
- • [Which steps should pass]
433
-
434
507
  [etc.]
435
508
 
436
- These chores will make all success scenarios pass (required + optional features).
509
+ These chores will make all scenarios pass (integration + required + optional features).
437
510
 
438
511
  Sound good? Any adjustments?
439
512
  ```
@@ -633,12 +706,15 @@ Before completing feature planning, ensure:
633
706
  - [ ] Epic's architectural decision is shown (if exists)
634
707
  - [ ] Exactly 3 approaches suggested
635
708
  - [ ] Winner chosen (with prototypes or without)
636
- - [ ] BDD scenarios written (all success paths)
709
+ - [ ] **Integration Contract defined** (entry point, caller code, integration scenario)
710
+ - [ ] **Integration Scenario is FIRST scenario** in feature file
711
+ - [ ] BDD scenarios written (integration + all success paths)
637
712
  - [ ] Step definitions written for ALL scenario steps
638
713
  - [ ] Scenarios file exists at `features/[feature-slug].feature`
639
714
  - [ ] Step definitions file exists at `features/step_definitions/[feature-slug].steps.js`
640
715
  - [ ] BDD infrastructure validated with dry-run (Step 6.5)
641
716
  - [ ] Feature transitioned to implementation with `work implement`
717
+ - [ ] **At least one Integration Chore created** (wires feature into app)
642
718
  - [ ] Speed mode chores created
643
719
  - [ ] First chore started with `work start [chore-id]` (Step 8D)
644
720
  - [ ] **Speed-mode skill invoked using Skill tool** (Step 8D)
@@ -50,9 +50,10 @@ When this skill is activated, you are helping implement a speed mode chore to ma
50
50
 
51
51
  ### Overview
52
52
 
53
- **Speed Mode Goal:** Make it work - implement ALL functionality (required + optional features) to make success scenarios pass, assuming everything works correctly.
53
+ **Speed Mode Goal:** Make it work - implement ALL functionality (integration + required + optional features) to make success scenarios pass, assuming everything works correctly.
54
54
 
55
55
  **Key Principles:**
56
+ - **Integration first** - ensure the feature is wired into the app and reachable (Integration Scenario must pass)
56
57
  - **Implement ALL features/functions** defined in scenarios - both required and optional functionality
57
58
  - **All success paths** - every workflow that should work when inputs are valid
58
59
  - **Assume success** - assume inputs are valid, files upload successfully, types are correct
@@ -67,6 +68,7 @@ When this skill is activated, you are helping implement a speed mode chore to ma
67
68
  <summary><strong>📋 Speed Mode Constraints (click to expand)</strong></summary>
68
69
 
69
70
  **What to implement:**
71
+ - **Integration** - wire feature into the app so it's reachable (Integration Scenario)
70
72
  - ALL scoped functionality - required features AND optional features from all success scenarios
71
73
  - Multiple valid workflows if the feature supports them
72
74
  - Success variations (different outcomes that are all correct)
@@ -556,7 +558,25 @@ If the query returns no remaining chores, proceed to Step 7.
556
558
 
557
559
  This is the transition from speed mode to stable mode. Follow these phases in order.
558
560
 
559
- #### Step 7A: Merge Final Speed Chore
561
+ #### Step 7A: Verify Integration Scenario Passes
562
+
563
+ **CRITICAL: Before transitioning, verify the feature is actually integrated into the app.**
564
+
565
+ ```bash
566
+ # Run ONLY the integration scenario (first scenario in the feature file)
567
+ npx cucumber-js <scenario-file-path> --name "User can reach" --format progress
568
+ ```
569
+
570
+ **If integration scenario FAILS:**
571
+ - The feature exists but isn't wired into the app
572
+ - Stop and fix integration before proceeding
573
+ - Check: Is the route registered? Is the link/button added? Is the import in place?
574
+
575
+ **If integration scenario PASSES:**
576
+ - Feature is reachable by users
577
+ - Proceed to Step 7B
578
+
579
+ #### Step 7B: Merge Final Speed Chore
560
580
 
561
581
  ```bash
562
582
  # Commit changes in the worktree
@@ -568,7 +588,7 @@ jettypod work merge --with-transition
568
588
 
569
589
  After merge, you are on main branch. Ready to generate stable mode scenarios.
570
590
 
571
- #### Step 7B: Generate and Propose Stable Mode Chores
591
+ #### Step 7C: Generate and Propose Stable Mode Chores
572
592
 
573
593
  **⚡ ASYNC BOUNDARY - Must wait for user confirmation**
574
594
 
@@ -628,7 +648,7 @@ Sound good? I'll create these chores once you confirm.
628
648
 
629
649
  **⚡ WAIT for user confirmation or adjustments.**
630
650
 
631
- #### Step 7C: Create Chores and Complete Transition
651
+ #### Step 7D: Create Chores and Complete Transition
632
652
 
633
653
  **After user confirms, execute autonomously:**
634
654
 
@@ -665,7 +685,7 @@ jettypod work merge --release-lock
665
685
  jettypod work set-mode <feature-id> stable
666
686
  ```
667
687
 
668
- #### Step 7D: Invoke Stable Mode Skill
688
+ #### Step 7E: Invoke Stable Mode Skill
669
689
 
670
690
  **🛑 CRITICAL HANDOFF - You MUST invoke stable-mode using the Skill tool.**
671
691
 
@@ -708,6 +728,7 @@ The stable-mode skill will:
708
728
 
709
729
  Before ending speed-mode skill, ensure:
710
730
  - [ ] All speed mode chores complete (GREEN on all success scenarios)
731
+ - [ ] **Integration scenario passes** (feature is reachable, not an "island")
711
732
  - [ ] Stable mode BDD scenarios generated and committed
712
733
  - [ ] Step definitions created for stable scenarios
713
734
  - [ ] Stable mode chores created
@@ -5,14 +5,34 @@ description: Guide implementation of stable mode chores with comprehensive testi
5
5
 
6
6
  # Stable Mode Skill
7
7
 
8
- **Mode Progression:**
9
- Feature Planning → Speed Mode → **[STABLE MODE]** → Done (Internal) OR Production Mode (External)
8
+ ```
9
+ ┌─────────────────────────────────────────────────────────────────────┐
10
+ │ Mode Progression Flow │
11
+ │ │
12
+ │ Feature Planning → Speed Mode → [STABLE MODE] → Production Mode │
13
+ │ ▲▲▲▲▲▲▲▲▲▲▲▲ │
14
+ │ YOU ARE HERE │
15
+ │ │
16
+ │ Next: INTERNAL projects → Feature DONE │
17
+ │ EXTERNAL projects → Invoke production-mode skill │
18
+ └─────────────────────────────────────────────────────────────────────┘
19
+ ```
20
+
21
+ ## 🛑 CRITICAL HANDOFF REQUIREMENT
10
22
 
11
- **You are here:** Adding error handling, validation, and edge cases to speed mode implementation.
23
+ **After completing ALL stable mode chores:**
12
24
 
13
- **Next steps:**
14
- - INTERNAL projects: Feature complete after stable mode (no production mode needed)
15
- - EXTERNAL projects: Continue to production mode for security/scale/monitoring
25
+ **INTERNAL projects (project_state = 'internal'):**
26
+ 1. Mark feature as done
27
+ 2. **End skill** - Feature is complete!
28
+
29
+ **EXTERNAL projects (project_state = 'external'):**
30
+ 1. Set feature mode to production
31
+ 2. **IMMEDIATELY invoke production-mode using the Skill tool**
32
+
33
+ **🛑 STOP GATE:** For external projects, DO NOT end this skill without invoking production-mode. Stable mode makes it robust - production mode makes it ready for real users at scale.
34
+
35
+ ---
16
36
 
17
37
  Guides Claude Code through stable mode implementation with comprehensive testing focus. Users confirm approach but Claude Code writes the code.
18
38
 
@@ -37,7 +57,8 @@ When this skill is activated, you are helping implement a stable mode chore to a
37
57
  **Stable Mode Goal:** Transform speed mode's "make it work" implementation into robust, reliable code with comprehensive error handling and validation.
38
58
 
39
59
  **CRITICAL DISTINCTION:**
40
- - **Speed mode implemented ALL functionality** - every feature/function is already working (all success scenarios)
60
+ - **Speed mode implemented ALL functionality** - every feature/function is already working (integration + all success scenarios)
61
+ - **Speed mode verified integration** - the feature is reachable by users (Integration Scenario passed)
41
62
  - **Stable mode adds COMPLETE robustness** - error handling, validation, and edge cases
42
63
 
43
64
  **Key Principles:**
@@ -45,6 +66,8 @@ When this skill is activated, you are helping implement a stable mode chore to a
45
66
  - **Autonomous execution** - Claude Code writes code, user confirms approach
46
67
  - **Quality focus** - code should be stable, maintainable, and reliable (ready for internal use)
47
68
 
69
+ **User Profile:** May not know how to code - Claude Code does the implementation autonomously.
70
+
48
71
  <details>
49
72
  <summary><strong>📋 What Stable Mode Includes (click to expand)</strong></summary>
50
73
 
@@ -84,8 +107,6 @@ When this skill is activated, you are helping implement a stable mode chore to a
84
107
 
85
108
  </details>
86
109
 
87
- **User Profile:** May not know how to code - Claude Code does the implementation autonomously.
88
-
89
110
  ---
90
111
 
91
112
  ## 🧪 Unit Testing in Stable Mode - True TDD
@@ -107,7 +128,9 @@ When this skill is activated, you are helping implement a stable mode chore to a
107
128
  - Edge case handling (empty arrays, boundary values)
108
129
  - State consistency (transaction rollback, cleanup on failure)
109
130
 
110
- **Unit test scope in stable mode:**
131
+ <details>
132
+ <summary><strong>📋 Unit Test Examples (click to expand)</strong></summary>
133
+
111
134
  ```javascript
112
135
  // ✅ Stable mode unit tests (error paths and edge cases)
113
136
  test('createUser throws ValidationError for null email', () => {
@@ -125,53 +148,24 @@ test('getUserById returns null for non-existent user', () => {
125
148
  });
126
149
  ```
127
150
 
151
+ </details>
152
+
128
153
  ---
129
154
 
130
155
  ## Quick Reference: Async Boundaries
131
156
 
132
157
  **Where Claude Code MUST wait for user confirmation:**
133
158
 
134
- | Phase | Location | Why | Condition |
135
- |-------|----------|-----|-----------|
136
- | Step 3A | Before implementing (conditional) | User confirms implementation approach | Only if approach is ambiguous or multiple valid paths |
159
+ | Step | Location | Why |
160
+ |------|----------|-----|
161
+ | Step 3A | Before implementing (conditional) | User confirms implementation approach - only if ambiguous |
137
162
 
138
163
  **Where Claude Code executes autonomously:**
139
- - Step 0: Initialize context
140
- - Step 1: Scenario analysis
141
- - Step 2: Speed mode implementation review
142
- - Step 3: Decision to skip/ask for confirmation
143
- - Step 4: Establish RED baseline
144
- - Step 5: RED→GREEN→REFACTOR loop (true TDD)
145
- - Step 6: Check progress and route to next chore or completion
146
-
147
- ---
148
-
149
- ## ⚠️ CRITICAL: Stable Mode Workflow Requirements for External Products
150
-
151
- **If the product is EXTERNAL (project_state: 'external'), DO NOT mark features as complete after stable mode.**
152
-
153
- For external products accepting real users, stable mode is NOT the final step. Production mode is REQUIRED for:
154
- - Performance optimization and load testing
155
- - Security hardening (rate limiting, input sanitization, authentication)
156
- - Monitoring and observability
157
- - Operational readiness (logging, metrics, alerting)
158
-
159
- **Required workflow for EXTERNAL products after stable mode implementation:**
160
-
161
- 1. ✅ **Complete ALL stable mode chores** - Add error handling and edge cases
162
- 2. ✅ **Set feature to production mode** - Use `jettypod work set-mode <feature-id> production`
163
- 3. ✅ **Implement production mode chores** - Add performance, security, monitoring
164
- 4. ❌ **NEVER mark feature complete in stable mode for external products** - This bypasses critical production hardening
165
-
166
- **For INTERNAL products (staging/preview only), stable mode IS the final step.**
167
-
168
- **If you attempt to mark an external product feature complete while in stable mode, the system will block you with an error.**
169
-
170
- The validation will require you to either:
171
- - Set feature to production mode: `jettypod work set-mode <feature-id> production`
172
- - Or explicitly force skip (not recommended): `jettypod work set-mode <feature-id> production --force`
173
-
174
- **Remember:** Stable mode makes it robust. Production mode makes it ready for real users at scale.
164
+ - Steps 0-2: Initialize, analyze scenarios, review speed implementation
165
+ - Step 3: Decision to skip/ask confirmation
166
+ - Steps 4-5: RED baseline, RED→GREEN→REFACTOR loop
167
+ - Step 6: Route to next chore OR transition to Step 7
168
+ - Step 7: Complete feature (internal) or invoke production-mode (external)
175
169
 
176
170
  ---
177
171
 
@@ -215,37 +209,29 @@ Analyzing stable mode BDD scenarios to determine what error handling and validat
215
209
  2. Read the full scenario file (should have success scenarios + stable mode error/edge case scenarios)
216
210
  3. Identify which scenario this chore addresses
217
211
  4. Extract requirements from the scenario's Given/When/Then steps
218
- 5. Check chore description for breadcrumbs (implementation guidance from feature-planning)
212
+ 5. Check chore description for breadcrumbs (implementation guidance from speed-mode transition)
219
213
 
220
- **NOTE:** Scenarios and step definitions already exist, created by the speed-mode skill during transition to stable mode. Chore descriptions may contain breadcrumbs with implementation guidance (files to modify, patterns to follow, functions to add validation to).
214
+ **NOTE:** Scenarios and step definitions already exist, created by the speed-mode skill during transition to stable mode. Chore descriptions may contain breadcrumbs with implementation guidance.
221
215
 
222
- **To get scenario information, use these commands:**
216
+ **To get scenario information:**
223
217
 
224
218
  ```bash
225
- # Get current work (chore) and its parent feature with scenario_file
226
219
  sqlite3 .jettypod/work.db "SELECT wi.id, wi.title, wi.description, wi.parent_id, parent.title as parent_title, parent.scenario_file, parent.mode FROM work_items wi LEFT JOIN work_items parent ON wi.parent_id = parent.id WHERE wi.status = 'in_progress'"
227
220
  ```
228
221
 
229
222
  **Then read the scenario file** using the Read tool on the path returned by `scenario_file`.
230
223
 
231
224
  **Identify target scenario:**
232
-
233
- After reading the scenario file content, parse it to find the scenario this chore addresses:
234
-
235
225
  1. Split the file by `Scenario:` to get individual scenarios
236
226
  2. Extract scenario titles from each block
237
- 3. Match the chore description to a scenario by:
238
- - Looking for scenario numbers in the chore description (e.g., "Scenario 2")
239
- - Matching keywords from the chore description to scenario titles
227
+ 3. Match the chore description to a scenario by keywords or scenario numbers
240
228
  4. If no match found, list available scenarios and ask which one to implement
241
229
 
242
230
  **Handle errors gracefully:**
243
231
  - If no current work: "❌ No current work found. Run: jettypod work start <chore-id>"
244
232
  - If no parent feature: "❌ Current work has no parent feature."
245
- - If no scenario_file: "❌ Feature has no scenario_file. Create a scenario file and update the feature."
246
- - If scenario file not found: "❌ Scenario file not found at [path]"
247
- - If no scenarios in file: "❌ No scenarios found in scenario file."
248
- - If can't match chore to scenario: List available scenarios and ask user which one
233
+ - If no scenario_file: "❌ Feature has no scenario_file."
234
+ - If can't match chore to scenario: List available scenarios and ask user
249
235
 
250
236
  **Display to user:**
251
237
 
@@ -260,11 +246,11 @@ What needs to happen:
260
246
  • [When] Action/condition: [requirement]
261
247
  • [Then] Expected behavior: [requirement]
262
248
 
263
- [If breadcrumbs exist in chore description:]
249
+ [If breadcrumbs exist:]
264
250
  Implementation guidance:
265
251
  • Files: [files to modify]
266
252
  • Patterns: [patterns to follow]
267
- • Functions: [specific functions to add validation to]
253
+ • Functions: [functions to add validation to]
268
254
 
269
255
  Now reviewing speed mode implementation...
270
256
  ```
@@ -281,17 +267,14 @@ Now reviewing speed mode implementation...
281
267
  3. Identify what's missing for this scenario
282
268
  4. Understand current code structure
283
269
 
284
- **Find speed mode files using git:**
270
+ **Find speed mode files:**
285
271
 
286
272
  ```bash
287
- # Search git history for commits related to this feature
288
- git log --oneline --all --grep="<feature-name>" -10
289
-
290
- # Get files changed in those commits
291
- git diff-tree --no-commit-id --name-only -r <commit-hash>
292
-
293
- # Or find files by looking at the feature's chores
273
+ # Find files by looking at the feature's speed chores
294
274
  sqlite3 .jettypod/work.db "SELECT id, title FROM work_items WHERE parent_id = <feature-id> AND type = 'chore' AND mode = 'speed'"
275
+
276
+ # Or search git history
277
+ git log --oneline --all --grep="<feature-name>" -10
295
278
  ```
296
279
 
297
280
  Then use the Read tool to examine the implementation files.
@@ -357,6 +340,7 @@ I see multiple ways to approach this error handling. Here's what I'm thinking:
357
340
  **Alternative considered:**
358
341
  • [Brief description] - not choosing because [reason]
359
342
 
343
+ Sound good, or would you prefer a different approach?
360
344
  ```
361
345
 
362
346
  **⚡ WAIT for user confirmation or adjustments.**
@@ -376,7 +360,6 @@ Before writing any implementation code, run tests to establish the RED state:
376
360
  ```bash
377
361
  # Get current work and parent feature's scenario file
378
362
  sqlite3 .jettypod/work.db "SELECT wi.id, wi.parent_id, parent.scenario_file FROM work_items wi LEFT JOIN work_items parent ON wi.parent_id = parent.id WHERE wi.status = 'in_progress'"
379
- # This gives you the chore ID, parent feature ID, and path to the .feature file
380
363
 
381
364
  # Run BDD tests to establish RED baseline
382
365
  npx cucumber-js <scenario-file-path> --format progress
@@ -387,8 +370,6 @@ Parse the output to identify:
387
370
  - Which specific stable mode steps are failing (error/edge case scenarios)
388
371
  - The first error message
389
372
 
390
- This establishes your RED baseline - stable mode scenarios should be failing initially.
391
-
392
373
  **Display RED baseline:**
393
374
  ```
394
375
  🔴 Establishing RED baseline...
@@ -475,19 +456,23 @@ Now implementing...
475
456
 
476
457
  ---
477
458
 
478
- **CRITICAL: Check if ALL stable mode chores are complete. Route to next chore if any remain.**
459
+ ### Step 6: Route After Chore Completion
460
+
461
+ **CRITICAL: After GREEN, check if more stable chores remain.**
479
462
 
480
463
  **Check for incomplete stable chores:**
481
464
 
482
465
  ```bash
483
- # Get current work to find parent feature ID
484
- sqlite3 .jettypod/work.db "SELECT wi.parent_id FROM work_items wi WHERE wi.status = 'in_progress'"
466
+ # Get current work to find parent feature ID and current chore ID
467
+ sqlite3 .jettypod/work.db "SELECT wi.id, wi.parent_id FROM work_items wi WHERE wi.status = 'in_progress'"
485
468
 
486
- # Get list of remaining stable chores (excluding current chore)
469
+ # Count remaining stable chores (excluding current)
487
470
  sqlite3 .jettypod/work.db "SELECT id, title FROM work_items WHERE parent_id = <feature-id> AND type = 'chore' AND mode = 'stable' AND status != 'done' AND id != <current-chore-id> ORDER BY created_at LIMIT 1"
488
471
  ```
489
472
 
490
- **If stable chores remain, display and start next chore:**
473
+ ---
474
+
475
+ **Route A: More stable chores remain → Start next chore**
491
476
 
492
477
  ```
493
478
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
@@ -500,66 +485,64 @@ More stable mode chores remain. Starting next chore:
500
485
  #[next-chore-id]: [next-chore-title]
501
486
  ```
502
487
 
503
- **Then immediately merge current chore and start next:**
488
+ **Merge and start next:**
504
489
 
505
490
  ```bash
506
491
  # Commit changes in the worktree
507
492
  git add . && git commit -m "feat: [brief description of error handling added]"
508
493
 
509
- # Switch to main repo before merging (merge cannot run from inside worktree)
510
- cd $(git rev-parse --git-common-dir)/..
511
-
512
- # Merge current chore - this automatically marks it as done
494
+ # Merge current chore (handles push, merge, cleanup)
513
495
  jettypod work merge
514
496
 
515
497
  # Start next stable chore
516
498
  jettypod work start [next-chore-id]
517
499
  ```
518
500
 
519
- **CRITICAL: Use ONLY `jettypod work merge` to complete chores.**
520
- - ❌ DO NOT use `jettypod work status <id> done`
521
- - ❌ DO NOT use `jettypod work complete <id>`
522
- - ❌ DO NOT use `jettypod work set-mode <id> done`
523
- - ✅ ONLY use `jettypod work merge` (from main repo, not worktree)
501
+ The stable-mode skill will automatically re-invoke for the next chore.
524
502
 
525
- The merge command handles everything: pushes branch, merges to main, marks chore done, cleans up worktree.
503
+ ---
526
504
 
527
- The stable-mode skill will automatically re-invoke for the next chore.
505
+ **Route B: All stable chores complete Transition to Step 7**
528
506
 
529
- **If all stable chores are done (count = 0), continue to Step 6 below.**
507
+ If the query returns no remaining chores, proceed to Step 7.
530
508
 
531
509
  ---
532
510
 
533
- ### Step 6: Route to Completion (After All Stable Chores Complete)
511
+ ### Step 7: Complete Feature or Transition to Production Mode
534
512
 
535
- **CRITICAL: This step ONLY happens when ALL stable chores for the feature are complete.**
513
+ **🛑 CRITICAL: This step ONLY runs after ALL stable chores are complete.**
536
514
 
537
- **Check project state:**
515
+ **First, merge the final stable chore:**
538
516
 
539
517
  ```bash
540
- # Check project_state in database (RECOMMENDED - always up to date)
541
- sqlite3 .jettypod/work.db "SELECT project_state FROM project_config WHERE id = 1"
518
+ git add . && git commit -m "feat: [brief description of error handling added]"
519
+ jettypod work merge
520
+ ```
521
+
522
+ **Then check project state:**
542
523
 
543
- # OR read CLAUDE.md from git root (NOT from CWD - worktrees may have stale copies)
544
- grep -A1 "<project_state>" "$(git rev-parse --show-toplevel)/CLAUDE.md" | tail -1
524
+ ```bash
525
+ sqlite3 .jettypod/work.db "SELECT project_state FROM project_config WHERE id = 1"
545
526
  ```
546
527
 
547
- ⚠️ **CRITICAL:** If reading CLAUDE.md, always read from git root using `$(git rev-parse --show-toplevel)/CLAUDE.md`, NOT from current directory. Worktrees branch from main and may have stale project_state values.
528
+ ---
548
529
 
549
- **Route based on project state:**
530
+ #### Step 7A: INTERNAL Project → Feature Complete
550
531
 
551
532
  **If project_state = 'internal':**
552
533
 
553
- Mark the feature as done:
554
534
  ```bash
555
- jettypod work status [feature-id] done
535
+ jettypod work status <feature-id> done
556
536
  ```
557
537
 
558
- Display:
538
+ **Display:**
539
+
559
540
  ```
560
- ✅ FEATURE #[id] COMPLETE!
541
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
542
+ ✅ FEATURE COMPLETE!
543
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
561
544
 
562
- Feature: [Feature Title]
545
+ Feature: #[id] [Feature Title]
563
546
  Status: ✅ DONE
564
547
 
565
548
  What we accomplished:
@@ -581,112 +564,99 @@ run the external-transition skill to generate production chores.
581
564
 
582
565
  ---
583
566
 
567
+ #### Step 7B: EXTERNAL Project → Invoke Production Mode
568
+
584
569
  **If project_state = 'external':**
585
570
 
586
- Use Skill tool to invoke production-mode:
571
+ **🛑 CRITICAL HANDOFF - You MUST invoke production-mode using the Skill tool.**
572
+
573
+ **Set feature mode to production:**
574
+
575
+ ```bash
576
+ jettypod work set-mode <feature-id> production
577
+ ```
578
+
579
+ **Display:**
587
580
 
588
- Display:
589
581
  ```
590
- ✅ ALL STABLE MODE CHORES COMPLETE!
582
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
583
+ 🎯 Stable Mode Complete! Transitioning to Production Mode
584
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
585
+
586
+ ⚠️ CRITICAL: This is an EXTERNAL project.
587
+ Stable mode makes it robust - production mode makes it ready for real users.
591
588
 
592
589
  What we accomplished:
593
590
  ✅ All BDD scenarios passing (success + error handling + edge cases)
594
591
  ✅ Comprehensive error handling and validation
595
592
  ✅ Feature stable and ready for production hardening
596
593
 
597
- 🚀 AUTO-GENERATING PRODUCTION CHORES
598
-
599
- This project is external - invoking production-mode skill to:
600
- • Detect feature context (authentication/data/general)
601
- • Generate production scenarios from standards
602
- • Create production chores with proper scope
594
+ 🚀 Now invoking production-mode skill...
603
595
  ```
604
596
 
605
- Then invoke production-mode skill. **End skill.**
606
-
607
- ---
608
-
609
- ⚠️ **CRITICAL: Exclude CLAUDE.md from commits in worktrees**
597
+ **Invoke production-mode:**
610
598
 
611
- CLAUDE.md contains work tracking metadata that changes frequently and causes merge conflicts. When committing in a worktree, **always reset CLAUDE.md** before committing:
612
-
613
- ```bash
614
- git checkout HEAD -- CLAUDE.md # Reset CLAUDE.md to avoid merge conflicts
615
- git add . # Stage other changes
616
- git commit -m "feat: [brief description of what was implemented]"
617
- git push
618
599
  ```
619
-
620
- Then switch to main repo and use the merge command (which auto-marks chore as done):
621
- ```bash
622
- cd $(git rev-parse --git-common-dir)/.. # Switch to main repo
623
- jettypod work merge
600
+ Use the Skill tool with skill: "production-mode"
624
601
  ```
625
602
 
626
- <details>
627
- <summary>💡 Multi-instance coordination (click to expand)</summary>
603
+ The production-mode skill will:
604
+ 1. Detect feature context (authentication/data/general)
605
+ 2. Generate production scenarios from standards
606
+ 3. Create production chores with proper scope
628
607
 
629
- The merge command uses a merge lock to prevent conflicts when multiple instances complete work simultaneously:
630
- - First instance acquires lock → merges → releases lock
631
- - Second instance waits → then acquires lock → merges
632
- - No manual coordination needed - happens automatically
633
-
634
- If you see "Acquiring merge lock..." message, another instance is merging. Wait 30-60 seconds.
635
- </details>
636
-
637
- The post-merge hook will automatically mark the chore as done when merged to main.
608
+ **End stable-mode skill.**
638
609
 
639
610
  ---
640
611
 
641
- ⚠️ **CRITICAL: SEQUENTIAL WORKFLOW FOR STABLE MODE CHORES**
612
+ ## Validation Checklist
642
613
 
643
- **Stable mode chores MUST be completed sequentially, not in parallel.**
614
+ Before ending stable-mode skill, ensure:
615
+ - [ ] All stable mode chores complete (GREEN on all error/edge case scenarios)
616
+ - [ ] Integration scenario still passes (feature remains reachable after error handling added)
617
+ - [ ] Final chore merged to main
618
+ - [ ] Project state checked (internal vs external)
619
+ - [ ] **INTERNAL:** Feature marked as done
620
+ - [ ] **EXTERNAL:** Feature mode set to production AND production-mode skill invoked
644
621
 
645
- **Why Sequential?**
646
- - Multiple chores modify the same files (e.g., lib/merge-lock.js, step definitions)
647
- - Later chores build on earlier implementations
648
- - Tests and BDD scenarios depend on cumulative changes
649
- - Parallel worktrees branch from main independently, missing each other's changes
622
+ ---
650
623
 
651
- **MANDATORY PROCESS:**
624
+ ## Command Reference
652
625
 
653
- After completing EACH stable chore:
654
- 1. ✅ Commit changes in worktree (excluding CLAUDE.md)
655
- 2. Push worktree branch
656
- 3. ✅ **Merge to main immediately**
657
- 4. ✅ **Push main**
658
- 5. ✅ ONLY THEN start the next stable chore
626
+ **Complete chores:**
627
+ ```bash
628
+ jettypod work merge # Merge current chore to main
629
+ ```
659
630
 
660
- **DO NOT:**
661
- ❌ Start multiple stable chores without merging previous ones
662
- Leave stable chores unmerged "for later"
663
- ❌ Assume worktrees will have each other's changes
631
+ **Start chores:**
632
+ ```bash
633
+ jettypod work start <chore-id> # Create worktree and start chore
634
+ ```
664
635
 
665
- **Example correct flow:**
636
+ **Set feature status/mode:**
666
637
  ```bash
667
- # Complete chore #1854
668
- git add . && git commit -m "feat: [description]"
669
- cd $(git rev-parse --git-common-dir)/.. # Switch to main repo
670
- jettypod work merge # Automatically pushes, merges, and cleans up
638
+ jettypod work status <feature-id> done # Mark feature complete (internal only)
639
+ jettypod work set-mode <feature-id> production # Set feature to production mode
640
+ ```
671
641
 
672
- # NOW start chore #1855 (main has #1854's changes)
673
- jettypod work start 1855
642
+ **❌ DO NOT use these to complete chores:**
643
+ - `jettypod work status <chore-id> done`
644
+ - `jettypod work complete <id>`
674
645
 
675
- # Complete chore #1855
676
- git add . && git commit -m "feat: [description]"
677
- cd $(git rev-parse --git-common-dir)/.. # Switch to main repo
678
- jettypod work merge # Automatically pushes, merges, and cleans up
646
+ ---
679
647
 
680
- # NOW start chore #1856 (main has #1854 + #1855's changes)
681
- jettypod work start 1856
682
- ```
648
+ ## ⚠️ Important: Sequential Workflow
683
649
 
684
- If you fail to follow this sequential process, later worktrees will be missing earlier implementations, causing:
685
- - Missing functions/exports
686
- - Incomplete test coverage
687
- - Step definition errors
688
- - Duplicate work
650
+ **Stable mode chores MUST be completed sequentially, not in parallel.**
689
651
 
690
- **End skill.**
652
+ **Why?**
653
+ - Multiple chores may modify the same files
654
+ - Later chores build on earlier implementations
655
+ - Parallel worktrees branch from main independently
691
656
 
657
+ **Process:**
658
+ 1. Complete chore → `jettypod work merge`
659
+ 2. Start next chore → `jettypod work start <next-id>`
660
+ 3. Repeat
692
661
 
662
+ The merge command handles everything: pushes branch, merges to main, marks chore done, cleans up worktree.