jettypod 4.4.116 → 4.4.120

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 (162) hide show
  1. package/.env +7 -0
  2. package/apps/dashboard/app/api/claude/[workItemId]/message/route.ts +124 -48
  3. package/apps/dashboard/app/api/claude/[workItemId]/route.ts +171 -58
  4. package/apps/dashboard/app/api/claude/sessions/[sessionId]/message/route.ts +161 -10
  5. package/apps/dashboard/app/api/tests/run/stream/route.ts +13 -1
  6. package/apps/dashboard/app/api/usage/route.ts +17 -0
  7. package/apps/dashboard/app/api/work/[id]/route.ts +35 -0
  8. package/apps/dashboard/app/api/work/[id]/status/route.ts +43 -1
  9. package/apps/dashboard/app/connect-claude/page.tsx +24 -0
  10. package/apps/dashboard/app/decision/[id]/page.tsx +14 -14
  11. package/apps/dashboard/app/demo/gates/page.tsx +42 -42
  12. package/apps/dashboard/app/design-system/page.tsx +868 -0
  13. package/apps/dashboard/app/globals.css +6 -2
  14. package/apps/dashboard/app/install-claude/page.tsx +9 -7
  15. package/apps/dashboard/app/layout.tsx +17 -5
  16. package/apps/dashboard/app/login/page.tsx +250 -0
  17. package/apps/dashboard/app/page.tsx +11 -9
  18. package/apps/dashboard/app/settings/page.tsx +4 -2
  19. package/apps/dashboard/app/signup/page.tsx +245 -0
  20. package/apps/dashboard/app/subscribe/page.tsx +11 -0
  21. package/apps/dashboard/app/welcome/page.tsx +24 -1
  22. package/apps/dashboard/app/work/[id]/page.tsx +34 -50
  23. package/apps/dashboard/components/AppShell.tsx +95 -55
  24. package/apps/dashboard/components/CardMenu.tsx +56 -13
  25. package/apps/dashboard/components/ClaudePanel.tsx +301 -582
  26. package/apps/dashboard/components/ClaudePanelInput.tsx +23 -14
  27. package/apps/dashboard/components/ConnectClaudeScreen.tsx +210 -0
  28. package/apps/dashboard/components/CopyableId.tsx +3 -3
  29. package/apps/dashboard/components/DetailReviewActions.tsx +109 -0
  30. package/apps/dashboard/components/DragContext.tsx +75 -65
  31. package/apps/dashboard/components/DraggableCard.tsx +6 -46
  32. package/apps/dashboard/components/DropZone.tsx +2 -2
  33. package/apps/dashboard/components/EditableDetailDescription.tsx +1 -1
  34. package/apps/dashboard/components/EditableTitle.tsx +26 -6
  35. package/apps/dashboard/components/ElapsedTimer.tsx +54 -0
  36. package/apps/dashboard/components/EpicGroup.tsx +329 -0
  37. package/apps/dashboard/components/GateCard.tsx +100 -16
  38. package/apps/dashboard/components/GateChoiceCard.tsx +15 -17
  39. package/apps/dashboard/components/InstallClaudeScreen.tsx +140 -51
  40. package/apps/dashboard/components/JettyLoader.tsx +38 -0
  41. package/apps/dashboard/components/KanbanBoard.tsx +147 -766
  42. package/apps/dashboard/components/KanbanCard.tsx +506 -0
  43. package/apps/dashboard/components/LazyMarkdown.tsx +12 -0
  44. package/apps/dashboard/components/MainNav.tsx +20 -54
  45. package/apps/dashboard/components/MessageBlock.tsx +391 -0
  46. package/apps/dashboard/components/ModeStartCard.tsx +15 -15
  47. package/apps/dashboard/components/OnboardingWelcome.tsx +214 -0
  48. package/apps/dashboard/components/PlaceholderCard.tsx +11 -21
  49. package/apps/dashboard/components/ProjectSwitcher.tsx +36 -8
  50. package/apps/dashboard/components/PrototypeTimeline.tsx +25 -25
  51. package/apps/dashboard/components/RealTimeKanbanWrapper.tsx +265 -301
  52. package/apps/dashboard/components/RealTimeTestsWrapper.tsx +97 -74
  53. package/apps/dashboard/components/ReviewFooter.tsx +141 -0
  54. package/apps/dashboard/components/SessionList.tsx +19 -18
  55. package/apps/dashboard/components/SubscribeContent.tsx +206 -0
  56. package/apps/dashboard/components/TestTree.tsx +15 -14
  57. package/apps/dashboard/components/TipCard.tsx +177 -0
  58. package/apps/dashboard/components/Toast.tsx +5 -5
  59. package/apps/dashboard/components/TypeIcon.tsx +56 -0
  60. package/apps/dashboard/components/UpgradeBanner.tsx +30 -0
  61. package/apps/dashboard/components/WaveCompletionAnimation.tsx +61 -62
  62. package/apps/dashboard/components/WelcomeScreen.tsx +25 -27
  63. package/apps/dashboard/components/WorkItemHeader.tsx +4 -4
  64. package/apps/dashboard/components/WorkItemTree.tsx +9 -28
  65. package/apps/dashboard/components/settings/AccountSection.tsx +169 -0
  66. package/apps/dashboard/components/settings/EnvVarsSection.tsx +54 -79
  67. package/apps/dashboard/components/settings/GeneralSection.tsx +26 -31
  68. package/apps/dashboard/components/settings/SettingsLayout.tsx +4 -4
  69. package/apps/dashboard/components/ui/Button.tsx +104 -0
  70. package/apps/dashboard/components/ui/Input.tsx +78 -0
  71. package/apps/dashboard/contexts/ClaudeSessionContext.tsx +408 -105
  72. package/apps/dashboard/contexts/ConnectionStatusContext.tsx +25 -4
  73. package/apps/dashboard/contexts/UsageContext.tsx +155 -0
  74. package/apps/dashboard/contexts/usageHelpers.js +9 -0
  75. package/apps/dashboard/electron/ipc-handlers.js +281 -88
  76. package/apps/dashboard/electron/main.js +691 -131
  77. package/apps/dashboard/electron/preload.js +25 -4
  78. package/apps/dashboard/electron/session-manager.js +163 -0
  79. package/apps/dashboard/electron-builder.config.js +3 -5
  80. package/apps/dashboard/hooks/useKanbanAnimation.ts +29 -0
  81. package/apps/dashboard/hooks/useKanbanUndo.ts +83 -0
  82. package/apps/dashboard/lib/backlog-parser.ts +50 -0
  83. package/apps/dashboard/lib/claude-process-manager.ts +50 -11
  84. package/apps/dashboard/lib/constants.ts +43 -0
  85. package/apps/dashboard/lib/db-bridge.ts +33 -0
  86. package/apps/dashboard/lib/db.ts +136 -20
  87. package/apps/dashboard/lib/kanban-utils.ts +70 -0
  88. package/apps/dashboard/lib/run-migrations.js +27 -2
  89. package/apps/dashboard/lib/session-state-machine.ts +3 -0
  90. package/apps/dashboard/lib/session-stream-manager.ts +144 -38
  91. package/apps/dashboard/lib/shadows.ts +7 -0
  92. package/apps/dashboard/lib/tests.ts +3 -1
  93. package/apps/dashboard/lib/utils.ts +6 -0
  94. package/apps/dashboard/next.config.js +35 -14
  95. package/apps/dashboard/package.json +6 -3
  96. package/apps/dashboard/public/bug-icon.svg +9 -0
  97. package/apps/dashboard/public/buoy-icon.svg +9 -0
  98. package/apps/dashboard/public/fonts/Satoshi-Variable.woff2 +0 -0
  99. package/apps/dashboard/public/fonts/Satoshi-VariableItalic.woff2 +0 -0
  100. package/apps/dashboard/public/in-flight-seagull.svg +9 -0
  101. package/apps/dashboard/public/jetty-icon-loading-alt.svg +11 -0
  102. package/apps/dashboard/public/jetty-icon-loading.svg +11 -0
  103. package/apps/dashboard/public/jettypod_logo.png +0 -0
  104. package/apps/dashboard/public/pier-icon.svg +14 -0
  105. package/apps/dashboard/public/star-icon.svg +9 -0
  106. package/apps/dashboard/public/wrench-icon.svg +9 -0
  107. package/apps/dashboard/scripts/upload-to-r2.js +89 -0
  108. package/apps/dashboard/scripts/ws-server.js +191 -0
  109. package/apps/dashboard/tsconfig.tsbuildinfo +1 -0
  110. package/apps/update-server/package.json +16 -0
  111. package/apps/update-server/schema.sql +31 -0
  112. package/apps/update-server/src/index.ts +1085 -0
  113. package/apps/update-server/tsconfig.json +16 -0
  114. package/apps/update-server/wrangler.toml +35 -0
  115. package/cucumber.js +9 -3
  116. package/docs/COMMAND_REFERENCE.md +34 -0
  117. package/hooks/post-checkout +32 -75
  118. package/hooks/post-merge +111 -10
  119. package/jest.setup.js +1 -0
  120. package/jettypod.js +54 -116
  121. package/lib/chore-taxonomy.js +33 -10
  122. package/lib/database.js +36 -16
  123. package/lib/db-watcher.js +1 -1
  124. package/lib/git-hooks/pre-commit +1 -1
  125. package/lib/jettypod-backup.js +27 -4
  126. package/lib/migrations/027-plan-at-creation-column.js +33 -0
  127. package/lib/migrations/028-ready-for-review-column.js +27 -0
  128. package/lib/migrations/029-remove-autoincrement.js +307 -0
  129. package/lib/migrations/029-rename-corrupted-to-cleaned.js +149 -0
  130. package/lib/migrations/index.js +47 -4
  131. package/lib/schema.js +13 -6
  132. package/lib/seed-onboarding.js +101 -69
  133. package/lib/update-command/index.js +9 -175
  134. package/lib/work-commands/index.js +129 -16
  135. package/lib/work-tracking/index.js +86 -46
  136. package/lib/worktree-diagnostics.js +16 -16
  137. package/lib/worktree-facade.js +1 -1
  138. package/lib/worktree-manager.js +8 -8
  139. package/lib/worktree-reconciler.js +5 -5
  140. package/package.json +9 -2
  141. package/scripts/ndjson-to-cucumber-json.js +152 -0
  142. package/scripts/postinstall.js +25 -0
  143. package/skills-templates/bug-mode/SKILL.md +39 -28
  144. package/skills-templates/bug-planning/SKILL.md +25 -29
  145. package/skills-templates/chore-mode/SKILL.md +131 -68
  146. package/skills-templates/chore-mode/verification.js +51 -10
  147. package/skills-templates/chore-planning/SKILL.md +47 -18
  148. package/skills-templates/epic-planning/SKILL.md +68 -48
  149. package/skills-templates/external-transition/SKILL.md +47 -47
  150. package/skills-templates/feature-planning/SKILL.md +83 -73
  151. package/skills-templates/production-mode/SKILL.md +49 -49
  152. package/skills-templates/request-routing/SKILL.md +27 -14
  153. package/skills-templates/simple-improvement/SKILL.md +68 -44
  154. package/skills-templates/speed-mode/SKILL.md +209 -128
  155. package/skills-templates/stable-mode/SKILL.md +105 -94
  156. package/templates/bdd-guidance.md +139 -0
  157. package/templates/bdd-scaffolding/wait.js +18 -0
  158. package/templates/bdd-scaffolding/world.js +19 -0
  159. package/.jettypod-backup/work.db +0 -0
  160. package/apps/dashboard/app/access-code/page.tsx +0 -110
  161. package/lib/discovery-checkpoint.js +0 -123
  162. package/skills-templates/project-discovery/SKILL.md +0 -372
@@ -40,13 +40,14 @@ When this skill is activated, you are executing a standalone chore. The chore-pl
40
40
  | Type | Test Handling | Key Constraint |
41
41
  |------|---------------|----------------|
42
42
  | refactor | Affected tests only | Do NOT modify test assertions |
43
- | dependency | Full test suite | Check for deprecation warnings |
43
+ | dependency | Affected + impacted tests | Check for deprecation warnings |
44
44
  | cleanup | Affected tests | Verify code is actually unused |
45
45
  | tooling | CI/manual verification | Focus on verification over unit tests |
46
+ | enhancement | TDD: write tests first | RED → GREEN → REFACTOR cycle |
46
47
 
47
48
  ---
48
49
 
49
- ## 🚨 SHELL CWD RECOVERY
50
+ ## SHELL CWD RECOVERY
50
51
 
51
52
  **If ALL bash commands start failing with "Error: Exit code 1" and no output:**
52
53
 
@@ -68,11 +69,11 @@ Your shell's working directory was likely inside a worktree that was deleted. Th
68
69
 
69
70
  **Your task:** Acknowledge the context passed from chore-planning.
70
71
 
71
- **🚫 FORBIDDEN: Writing Files at This Step**
72
+ **FORBIDDEN: Writing Files at This Step**
72
73
  ```
73
- Write tool to any path
74
- Edit tool to any path
75
- Any file creation or modification
74
+ Write tool to any path
75
+ Edit tool to any path
76
+ Any file creation or modification
76
77
  ```
77
78
  **This is a CONTEXT step.** File writes happen in Step 5.
78
79
 
@@ -89,7 +90,7 @@ You will receive:
89
90
 
90
91
  ```
91
92
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
92
- 🔧 Chore Mode: [Chore Title]
93
+ Chore Mode: [Chore Title]
93
94
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
94
95
 
95
96
  Type: [TYPE] (confidence: [high/medium/low])
@@ -104,12 +105,12 @@ Implementation Plan:
104
105
 
105
106
  Add this line after Chore ID:
106
107
  ```
107
- Technical Epic Chore - no mode progression
108
+ Technical Epic Chore - no mode progression
108
109
  ```
109
110
 
110
111
  This confirms the chore belongs to a technical epic and will execute directly without any speed→stable→production phases (which is the default for all chores anyway).
111
112
 
112
- **🔄 WORKFLOW INTEGRATION: Start workflow tracking**
113
+ **WORKFLOW INTEGRATION: Start workflow tracking**
113
114
 
114
115
  After receiving context, register this skill execution:
115
116
 
@@ -125,11 +126,11 @@ This validates that `chore_planning_complete` gate is passed (if applicable) and
125
126
 
126
127
  **Your task:** Create an isolated worktree for this chore.
127
128
 
128
- **🚫 FORBIDDEN: Manual Git Worktree Commands**
129
+ **FORBIDDEN: Manual Git Worktree Commands**
129
130
  ```
130
- git worktree add ...
131
- git checkout -b feature/...
132
- git branch feature/...
131
+ git worktree add ...
132
+ git checkout -b feature/...
133
+ git branch feature/...
133
134
  ```
134
135
  **ALWAYS use `jettypod work start`** - it handles branch naming, path conventions, database tracking, and cleanup. Manual git commands will create orphaned worktrees that break the merge workflow.
135
136
 
@@ -139,7 +140,7 @@ jettypod work start [chore-id]
139
140
 
140
141
  This creates a worktree at `.jettypod-work/[id]-[title-slug]` and switches to a new branch.
141
142
 
142
- **🛑 VALIDATION REQUIRED:** After running `work start`, verify the worktree was created:
143
+ **VALIDATION REQUIRED:** After running `work start`, verify the worktree was created:
143
144
 
144
145
  ```bash
145
146
  sqlite3 .jettypod/work.db "SELECT worktree_path FROM worktrees WHERE work_item_id = [chore-id] AND status = 'active'"
@@ -147,20 +148,20 @@ sqlite3 .jettypod/work.db "SELECT worktree_path FROM worktrees WHERE work_item_i
147
148
 
148
149
  | Result | What it means | Action |
149
150
  |--------|---------------|--------|
150
- | **Has a path** | Worktree created successfully | Continue to Step 3 |
151
- | **Empty/no rows** | Worktree creation failed | **STOP - check the error output from `work start` and resolve before continuing** |
151
+ | **Has a path** | Worktree created successfully | Continue to Step 3 |
152
+ | **Empty/no rows** | Worktree creation failed | **STOP - check the error output from `work start` and resolve before continuing** |
152
153
 
153
154
  **Display (on success):**
154
155
 
155
156
  ```
156
- 📁 Worktree created: .jettypod-work/[id]-[title-slug]
157
+ Worktree created: .jettypod-work/[id]-[title-slug]
157
158
  Branch: chore-[id]-[title-slug]
158
159
  ```
159
160
 
160
161
  **Display (on failure):**
161
162
 
162
163
  ```
163
- Worktree creation failed. Check:
164
+ Worktree creation failed. Check:
164
165
  - Are there uncommitted changes? Run: git status
165
166
  - Does the branch already exist? Run: git branch -a | grep [chore-id]
166
167
  - Is there a worktree conflict? Run: git worktree list
@@ -170,7 +171,7 @@ Resolve the issue before continuing.
170
171
 
171
172
  **Move to Step 3 only if worktree was created successfully.**
172
173
 
173
- **🔒 WORKTREE PATH LOCK**
174
+ **WORKTREE PATH LOCK**
174
175
 
175
176
  After worktree validation passes, capture and lock the path:
176
177
  - `WORKTREE_PATH` - the absolute path from the query result
@@ -178,7 +179,7 @@ After worktree validation passes, capture and lock the path:
178
179
  **Display:**
179
180
 
180
181
  ```
181
- 🔒 WORKTREE LOCK ACTIVE
182
+ WORKTREE LOCK ACTIVE
182
183
  Path: ${WORKTREE_PATH}
183
184
 
184
185
  All file writes will use this path.
@@ -196,11 +197,11 @@ jettypod ui gate worktree-started --data='{"path":"${WORKTREE_PATH}"}'
196
197
 
197
198
  **Your task:** Run tests to establish baseline before making changes.
198
199
 
199
- **🚫 FORBIDDEN: Writing Files at This Step**
200
+ **FORBIDDEN: Writing Files at This Step**
200
201
  ```
201
- Write tool to any path
202
- Edit tool to any path
203
- Any file creation or modification
202
+ Write tool to any path
203
+ Edit tool to any path
204
+ Any file creation or modification
204
205
  ```
205
206
  **This is a TESTING step.** File writes happen in Step 5.
206
207
 
@@ -214,8 +215,8 @@ npm test -- [affected-test-patterns]
214
215
 
215
216
  **For DEPENDENCY:**
216
217
  ```bash
217
- # Run full test suite
218
- npm test
218
+ # Run tests for affected and potentially impacted modules
219
+ npm test -- [affected-test-patterns]
219
220
  ```
220
221
 
221
222
  **For CLEANUP:**
@@ -230,21 +231,28 @@ npm test -- [affected-test-patterns]
230
231
  # (may not have unit tests)
231
232
  ```
232
233
 
234
+ **For ENHANCEMENT:**
235
+ ```bash
236
+ # Run existing affected tests to establish baseline (these must keep passing)
237
+ npm test -- [affected-test-patterns]
238
+ # Note: No new tests exist yet - they will be written in Step 5 (TDD RED phase)
239
+ ```
240
+
233
241
  **Display:**
234
242
 
235
243
  ```
236
- 🧪 Establishing test baseline...
244
+ Establishing test baseline...
237
245
 
238
246
  Baseline Result:
239
247
  Tests: [X] passing / [Y] total
240
248
  Execution time: [Z]s
241
249
 
242
- Baseline established - all tests passing
250
+ Baseline established - affected tests passing
243
251
  ```
244
252
 
245
253
  **CRITICAL:** If baseline tests fail, STOP. Fix existing failures before proceeding with chore work.
246
254
 
247
- **🔄 WORKFLOW CHECKPOINT: Test baseline established**
255
+ **WORKFLOW CHECKPOINT: Test baseline established**
248
256
 
249
257
  ```bash
250
258
  jettypod workflow checkpoint <chore-id> --step=3
@@ -256,11 +264,11 @@ jettypod workflow checkpoint <chore-id> --step=3
256
264
 
257
265
  **Your task:** Display warnings and constraints based on chore type.
258
266
 
259
- **🚫 FORBIDDEN: Writing Files at This Step**
267
+ **FORBIDDEN: Writing Files at This Step**
260
268
  ```
261
- Write tool to any path
262
- Edit tool to any path
263
- Any file creation or modification
269
+ Write tool to any path
270
+ Edit tool to any path
271
+ Any file creation or modification
264
272
  ```
265
273
  **This is a GUIDANCE step.** File writes happen in Step 5.
266
274
 
@@ -275,9 +283,9 @@ const guidance = getGuidance('[chore-type]');
275
283
 
276
284
  **For REFACTOR:**
277
285
  ```
278
- ⚠️ REFACTOR CONSTRAINTS:
286
+ REFACTOR CONSTRAINTS:
279
287
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
280
- All existing tests MUST pass WITHOUT modification
288
+ Affected tests MUST pass WITHOUT modification
281
289
  • If tests fail, the refactor broke behavior - FIX THE CODE, not the tests
282
290
  • No new functionality - this is restructuring only
283
291
  • Behavior must be preserved exactly
@@ -285,9 +293,9 @@ const guidance = getGuidance('[chore-type]');
285
293
 
286
294
  **For DEPENDENCY:**
287
295
  ```
288
- ⚠️ DEPENDENCY CONSTRAINTS:
296
+ DEPENDENCY CONSTRAINTS:
289
297
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
290
- • Run FULL test suite to catch regressions
298
+ • Run tests for affected and potentially impacted modules to catch regressions
291
299
  • Check for deprecation warnings after update
292
300
  • Review changelog for breaking changes
293
301
  • Update code if API changed
@@ -295,7 +303,7 @@ const guidance = getGuidance('[chore-type]');
295
303
 
296
304
  **For CLEANUP:**
297
305
  ```
298
- ⚠️ CLEANUP CONSTRAINTS:
306
+ CLEANUP CONSTRAINTS:
299
307
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
300
308
  • VERIFY code is actually unused before deleting
301
309
  • Search for all references (grep for function names)
@@ -305,7 +313,7 @@ const guidance = getGuidance('[chore-type]');
305
313
 
306
314
  **For TOOLING:**
307
315
  ```
308
- ⚠️ TOOLING CONSTRAINTS:
316
+ TOOLING CONSTRAINTS:
309
317
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
310
318
  • Verify via CI run or manual testing
311
319
  • Focus on verification over unit testing
@@ -313,13 +321,28 @@ const guidance = getGuidance('[chore-type]');
313
321
  • Plan rollback strategy
314
322
  ```
315
323
 
324
+ **For ENHANCEMENT:**
325
+ ```
326
+ ENHANCEMENT CONSTRAINTS (TDD):
327
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
328
+ • RED: Write failing tests FIRST that define the new behavior
329
+ • GREEN: Write MINIMUM code to make tests pass
330
+ • REFACTOR: Clean up code while keeping tests green
331
+ • Existing affected tests MUST still pass after implementation
332
+ • Do NOT write implementation before tests
333
+ ```
334
+
316
335
  **Move to Step 5 automatically.**
317
336
 
337
+ ### BDD Step Definition Constraints (ENFORCED)
338
+
339
+ If this chore involves writing step definitions, read `templates/bdd-guidance.md` first. BANNED in step defs: `setTimeout`/`sleep`, module-level `let`/`var`, raw SQL, assertions in Given/When, loops/branching, self-fulfilling mocks (setting state then asserting it). Steps must be 1-5 lines calling one helper via Cucumber World (`this`). Read `features/support/helpers/` and reuse before creating.
340
+
318
341
  ### Step 5: Execute with Iteration
319
342
 
320
- **🔒 WORKTREE PATH REQUIRED:** All file writes MUST use the `WORKTREE_PATH` captured in Step 2.
343
+ **WORKTREE PATH REQUIRED:** All file writes MUST use the `WORKTREE_PATH` captured in Step 2.
321
344
 
322
- **✅ NOW you may write files** - worktree is locked, guidance is displayed.
345
+ **NOW you may write files** - worktree is locked, guidance is displayed.
323
346
 
324
347
  **Emit gate signal:**
325
348
 
@@ -329,13 +352,40 @@ jettypod ui gate implementing --data='{"description":"[chore implementation]","f
329
352
 
330
353
  **Your task:** Make changes and iterate until tests pass. Max 5 iterations.
331
354
 
355
+ **For ENHANCEMENT type, follow TDD cycle instead of the standard iteration:**
356
+
357
+ ```
358
+ ━━━ TDD RED Phase ━━━
359
+ Writing tests that define the new behavior...
360
+ [Write test files that assert expected behavior - these MUST FAIL initially]
361
+
362
+ Running new tests (expecting failures)...
363
+ [Confirm tests fail - this validates the tests are meaningful]
364
+
365
+ ━━━ TDD GREEN Phase ━━━
366
+ Implementing minimum code to pass tests...
367
+ [Write the simplest implementation that makes tests pass]
368
+
369
+ Running tests...
370
+ [Confirm new tests pass + existing affected tests still pass]
371
+
372
+ ━━━ TDD REFACTOR Phase ━━━
373
+ Cleaning up implementation...
374
+ [Refactor for clarity, remove duplication, improve naming]
375
+
376
+ Running tests (confirming still green)...
377
+ [All tests must still pass after refactoring]
378
+ ```
379
+
380
+ **For behavior-preserving types (refactor, dependency, cleanup, tooling), use standard iteration:**
381
+
332
382
  ```
333
383
  ━━━ Iteration [N]/5 ━━━
334
384
 
335
- ✍️ Making changes...
385
+ Making changes...
336
386
  [Describe what you're changing]
337
387
 
338
- 🧪 Running tests...
388
+ Running tests...
339
389
  ```
340
390
 
341
391
  **On each iteration:**
@@ -346,22 +396,22 @@ jettypod ui gate implementing --data='{"description":"[chore implementation]","f
346
396
  **Display progress:**
347
397
 
348
398
  ```
349
- 📊 Progress: [X]/[Y] tests passing
399
+ Progress: [X]/[Y] tests passing
350
400
 
351
- Newly passing:
401
+ Newly passing:
352
402
  • [test name]
353
403
 
354
- Still failing:
404
+ Still failing:
355
405
  • [test name]: [brief error]
356
406
 
357
- 🔧 Next: [what you'll fix]
407
+ Next: [what you'll fix]
358
408
  ```
359
409
 
360
410
  **Exit conditions:**
361
- - All tests pass → Move to Step 6
362
- - Max iterations reached → Display failure, ask user for guidance
411
+ - Affected tests pass → Move to Step 6
412
+ - Max iterations reached → Display failure, ask user for guidance
363
413
 
364
- **🔄 WORKFLOW CHECKPOINT: Execution complete** (when all tests pass)
414
+ **WORKFLOW CHECKPOINT: Execution complete** (when affected tests pass)
365
415
 
366
416
  ```bash
367
417
  jettypod workflow checkpoint <chore-id> --step=5
@@ -370,7 +420,7 @@ jettypod workflow checkpoint <chore-id> --step=5
370
420
  **On max iterations:**
371
421
 
372
422
  ```
373
- ⚠️ Maximum iterations (5) reached
423
+ Maximum iterations (5) reached
374
424
 
375
425
  Final Progress: [X]/[Y] tests passing
376
426
 
@@ -403,17 +453,17 @@ const guidance = getGuidance('[chore-type]');
403
453
 
404
454
  ```
405
455
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
406
- 🔍 Verification Checklist
456
+ Verification Checklist
407
457
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
408
458
 
409
- [✅/❌] All existing tests pass without modification
410
- [✅/❌] No new functionality added
411
- [✅/❌] Code review confirms behavior preservation
412
- [✅/❌] Performance is not degraded
459
+ [/] Affected tests pass without modification
460
+ [/] No new functionality added
461
+ [/] Code review confirms behavior preservation
462
+ [/] Performance is not degraded
413
463
  ```
414
464
 
415
465
  **Verification methods:**
416
- - **Tests pass**: Run `npm test` and check exit code
466
+ - **Tests pass**: Run `npm test -- [affected-test-patterns]` and check exit code
417
467
  - **No new functionality**: Review diff for new features
418
468
  - **Behavior preservation**: Compare before/after behavior
419
469
  - **Performance**: Run benchmarks if applicable
@@ -421,7 +471,7 @@ const guidance = getGuidance('[chore-type]');
421
471
  **If any verification fails:**
422
472
 
423
473
  ```
424
- Verification failed:
474
+ Verification failed:
425
475
  • [failed item]: [reason]
426
476
 
427
477
  Returning to iteration loop...
@@ -470,7 +520,7 @@ jettypod work cleanup [chore-id]
470
520
 
471
521
  ```
472
522
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
473
- Chore Complete
523
+ Chore Complete
474
524
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
475
525
 
476
526
  Type: [TYPE]
@@ -478,15 +528,15 @@ Iterations: [N]/5
478
528
  Tests: [X]/[Y] passing
479
529
 
480
530
  Verification:
481
- All existing tests pass without modification
482
- No new functionality added
483
- Code review confirms behavior preservation
484
- Performance is not degraded
531
+ Affected tests pass without modification
532
+ No new functionality added
533
+ Code review confirms behavior preservation
534
+ Performance is not degraded
485
535
 
486
536
  Merged to main. Chore #[id] marked done.
487
537
  ```
488
538
 
489
- **🔄 WORKFLOW INTEGRATION: Complete workflow**
539
+ **WORKFLOW INTEGRATION: Complete workflow**
490
540
 
491
541
  ```bash
492
542
  jettypod workflow complete chore-mode <chore-id>
@@ -508,7 +558,7 @@ This marks the `chore_mode_complete` gate as passed. The standalone chore is now
508
558
 
509
559
  ### Baseline Tests Fail
510
560
  ```
511
- Cannot proceed - baseline tests failing
561
+ Cannot proceed - baseline tests failing
512
562
 
513
563
  [X] tests failing before chore work started.
514
564
  Fix existing test failures before proceeding.
@@ -520,7 +570,7 @@ Failing tests:
520
570
  ### Verification Loop
521
571
  If verification fails repeatedly (3+ times on same item):
522
572
  ```
523
- ⚠️ Verification stuck on: [item]
573
+ Verification stuck on: [item]
524
574
 
525
575
  This has failed [N] times. Options:
526
576
  1. Review the implementation approach
@@ -530,7 +580,7 @@ This has failed [N] times. Options:
530
580
 
531
581
  ### Worktree Issues
532
582
  ```
533
- Worktree creation failed
583
+ Worktree creation failed
534
584
 
535
585
  Error: [message]
536
586
 
@@ -539,6 +589,13 @@ Try:
539
589
  jettypod work start [chore-id]
540
590
  ```
541
591
 
592
+ ### Stale/Orphaned Worktree
593
+ If a worktree is stuck active (e.g., fix was superseded, merge conflicts with main, or work was abandoned):
594
+ ```bash
595
+ jettypod work cleanup --force <id> # Bypasses merge requirement, prompts for confirmation
596
+ ```
597
+ This checks for unmerged commits and uncommitted changes, warns you, and marks the work item as cancelled.
598
+
542
599
  ---
543
600
 
544
601
  ## Type Reference
@@ -551,7 +608,7 @@ Try:
551
608
 
552
609
  ### DEPENDENCY
553
610
  - **Goal:** Update packages safely
554
- - **Tests:** Full suite
611
+ - **Tests:** Affected + impacted modules
555
612
  - **Key rule:** Check changelogs for breaking changes
556
613
  - **Verification:** Tests pass, no deprecation warnings
557
614
 
@@ -566,3 +623,9 @@ Try:
566
623
  - **Tests:** CI pipeline or manual
567
624
  - **Key rule:** Plan rollback strategy
568
625
  - **Verification:** CI passes, workflows work
626
+
627
+ ### ENHANCEMENT
628
+ - **Goal:** Add new behavior with TDD
629
+ - **Tests:** Write new tests FIRST (TDD), then implement
630
+ - **Key rule:** RED → GREEN → REFACTOR - never implement before tests
631
+ - **Verification:** New tests written and passing, existing tests unbroken
@@ -57,6 +57,10 @@ function runVerificationChecklist(type, context = {}) {
57
57
  checks.push(...runToolingChecks(guidance, context));
58
58
  break;
59
59
 
60
+ case CHORE_TYPES.ENHANCEMENT:
61
+ checks.push(...runEnhancementChecks(guidance, context));
62
+ break;
63
+
60
64
  default:
61
65
  checks.push(createCheck(
62
66
  'Valid chore type',
@@ -80,9 +84,9 @@ function runVerificationChecklist(type, context = {}) {
80
84
  function runRefactorChecks(guidance, context) {
81
85
  const checks = [];
82
86
 
83
- // "All existing tests pass without modification"
87
+ // "Affected tests pass without modification"
84
88
  checks.push(createCheck(
85
- 'All existing tests pass without modification',
89
+ 'Affected tests pass without modification',
86
90
  context.testResult?.passed === true,
87
91
  context.testResult?.passed ? null : 'Tests failed - refactor may have broken behavior'
88
92
  ));
@@ -117,9 +121,9 @@ function runRefactorChecks(guidance, context) {
117
121
  function runDependencyChecks(guidance, context) {
118
122
  const checks = [];
119
123
 
120
- // "All tests pass after update"
124
+ // "Affected tests pass after update"
121
125
  checks.push(createCheck(
122
- 'All tests pass after update',
126
+ 'Affected tests pass after update',
123
127
  context.testResult?.passed === true,
124
128
  context.testResult?.passed ? null : 'Tests failed after dependency update'
125
129
  ));
@@ -150,9 +154,9 @@ function runDependencyChecks(guidance, context) {
150
154
  function runCleanupChecks(guidance, context) {
151
155
  const checks = [];
152
156
 
153
- // "All tests still pass"
157
+ // "Affected tests still pass"
154
158
  checks.push(createCheck(
155
- 'All tests still pass',
159
+ 'Affected tests still pass',
156
160
  context.testResult?.passed === true,
157
161
  context.testResult?.passed ? null : 'Tests failed after cleanup'
158
162
  ));
@@ -204,6 +208,43 @@ function runToolingChecks(guidance, context) {
204
208
  return checks;
205
209
  }
206
210
 
211
+ /**
212
+ * Run enhancement-specific verification checks (TDD)
213
+ */
214
+ function runEnhancementChecks(guidance, context) {
215
+ const checks = [];
216
+
217
+ // "New tests written BEFORE implementation (TDD red phase)"
218
+ checks.push(createCheck(
219
+ 'New tests written before implementation (TDD red phase)',
220
+ context.newTestsWritten === true,
221
+ context.newTestsWritten ? null : 'No new tests detected - enhancement chores require TDD'
222
+ ));
223
+
224
+ // "All new tests pass (TDD green phase)"
225
+ checks.push(createCheck(
226
+ 'All new tests pass (TDD green phase)',
227
+ context.testResult?.passed === true,
228
+ context.testResult?.passed ? null : 'New tests failing - implementation incomplete'
229
+ ));
230
+
231
+ // "Code is clean and well-structured (TDD refactor phase)"
232
+ checks.push(createCheck(
233
+ 'Code is clean and well-structured (TDD refactor phase)',
234
+ context.refactorComplete !== false,
235
+ context.refactorComplete === false ? 'Refactor phase not completed' : null
236
+ ));
237
+
238
+ // "Existing affected tests still pass"
239
+ checks.push(createCheck(
240
+ 'Existing affected tests still pass',
241
+ context.existingTestsBroken !== true,
242
+ context.existingTestsBroken ? 'Existing tests broken by enhancement' : null
243
+ ));
244
+
245
+ return checks;
246
+ }
247
+
207
248
  /**
208
249
  * Format verification results for display
209
250
  *
@@ -213,12 +254,12 @@ function runToolingChecks(guidance, context) {
213
254
  function formatVerificationResult(result) {
214
255
  const lines = [];
215
256
  lines.push('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
216
- lines.push('🔍 Verification Checklist');
257
+ lines.push('Verification Checklist');
217
258
  lines.push('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
218
259
  lines.push('');
219
260
 
220
261
  for (const check of result.checks) {
221
- const icon = check.passed ? '' : '';
262
+ const icon = check.passed ? '[PASS]' : '[FAIL]';
222
263
  lines.push(`${icon} ${check.description}`);
223
264
  if (check.details) {
224
265
  lines.push(` └─ ${check.details}`);
@@ -227,10 +268,10 @@ function formatVerificationResult(result) {
227
268
 
228
269
  lines.push('');
229
270
  if (result.passed) {
230
- lines.push('All verification checks passed');
271
+ lines.push('All verification checks passed');
231
272
  } else {
232
273
  const failedCount = result.checks.filter(c => !c.passed).length;
233
- lines.push(`❌ ${failedCount} verification check(s) failed`);
274
+ lines.push(`${failedCount} verification check(s) failed`);
234
275
  }
235
276
 
236
277
  return lines.join('\n');