jettypod 3.0.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.
Files changed (122) hide show
  1. package/.claude/PROTECT_SKILLS.md +28 -0
  2. package/.claude/settings.json +24 -0
  3. package/.claude/settings.local.json +16 -0
  4. package/.claude/skills/epic-discover/SKILL.md +262 -0
  5. package/.claude/skills/feature-discover/SKILL.md +393 -0
  6. package/.claude/skills/speed-mode/SKILL.md +364 -0
  7. package/.claude/skills/stable-mode/SKILL.md +591 -0
  8. package/.github/workflows/test-safety.yml +85 -0
  9. package/README.md +25 -0
  10. package/SPEED-STABLE-AUDIT.md +853 -0
  11. package/SYSTEM-BEHAVIOR.md +1241 -0
  12. package/TEST_SAFETY_AUDIT.md +314 -0
  13. package/TEST_SAFETY_IMPLEMENTATION.md +97 -0
  14. package/cucumber.js +8 -0
  15. package/docs/COMMAND_REFERENCE.md +903 -0
  16. package/docs/DECISIONS.md +68 -0
  17. package/docs/README.md +48 -0
  18. package/docs/STANDARDS-SYSTEM-DOCUMENTATION.md +374 -0
  19. package/docs/TEST-REWRITE-PLAN.md +261 -0
  20. package/docs/ai-test-writing-requirements.md +219 -0
  21. package/docs/claude-code-skills.md +607 -0
  22. package/docs/core-jettypod-methodology/comprehensive-jettypod-methodology.md +582 -0
  23. package/docs/core-jettypod-methodology/deprecated/jettypod-comprehensive-standards.md +1222 -0
  24. package/docs/core-jettypod-methodology/deprecated/jettypod-operating-guide.md +3399 -0
  25. package/docs/core-jettypod-methodology/deprecated/jettypod-technical-checklist.md +1325 -0
  26. package/docs/core-jettypod-methodology/deprecated/jettypod-vibe-coding-framework.md +1544 -0
  27. package/docs/core-jettypod-methodology/deprecated/prompt-engineering-guide.md +320 -0
  28. package/docs/core-jettypod-methodology/deprecated/vibe-coding-cheatsheet (1).md +516 -0
  29. package/docs/core-jettypod-methodology/deprecated/vibe-coding-framework.md +1544 -0
  30. package/docs/features/jettypod-standards-explained.md +543 -0
  31. package/docs/features/standards-inventory.md +257 -0
  32. package/docs/gap-analysis-current-vs-comprehensive-methodology.md +939 -0
  33. package/docs/jettypod-system-overview.md +409 -0
  34. package/features/auto-generate-production-chores.feature +14 -0
  35. package/features/claude-md-protection/steps.js +487 -0
  36. package/features/decisions/index.js +490 -0
  37. package/features/decisions/index.test.js +208 -0
  38. package/features/git-hooks/git-hooks.feature +30 -0
  39. package/features/git-hooks/index.js +93 -0
  40. package/features/git-hooks/index.test.js +137 -0
  41. package/features/git-hooks/post-commit +56 -0
  42. package/features/git-hooks/post-merge +47 -0
  43. package/features/git-hooks/pre-commit +28 -0
  44. package/features/git-hooks/simple-steps.js +53 -0
  45. package/features/git-hooks/simple-test.feature +10 -0
  46. package/features/git-hooks/steps.js +196 -0
  47. package/features/jettypod-update-command.feature +46 -0
  48. package/features/mode-prompts/index.js +95 -0
  49. package/features/mode-prompts/simple-steps.js +44 -0
  50. package/features/mode-prompts/simple-test.feature +9 -0
  51. package/features/mode-prompts/validation.test.js +120 -0
  52. package/features/refactor-mode/steps.js +217 -0
  53. package/features/refactor-mode.feature +49 -0
  54. package/features/skills-update/index.test.js +216 -0
  55. package/features/step_definitions/auto-generate-production-chores.steps.js +162 -0
  56. package/features/step_definitions/terminal-logo.steps.js +145 -0
  57. package/features/step_definitions/update-command.steps.js +183 -0
  58. package/features/terminal-logo/index.js +39 -0
  59. package/features/terminal-logo/terminal-logo.feature +30 -0
  60. package/features/update-command/index.js +181 -0
  61. package/features/update-command/index.test.js +225 -0
  62. package/features/work-commands/bug-workflow-display.feature +22 -0
  63. package/features/work-commands/index.js +311 -0
  64. package/features/work-commands/simple-steps.js +69 -0
  65. package/features/work-commands/stable-tests.feature +57 -0
  66. package/features/work-commands/steps.js +1120 -0
  67. package/features/work-commands/validation.test.js +88 -0
  68. package/features/work-commands/work-commands.feature +13 -0
  69. package/features/work-tracking/discovery-validation.test.js +228 -0
  70. package/features/work-tracking/index.js +1511 -0
  71. package/features/work-tracking/mode-required.feature +112 -0
  72. package/features/work-tracking/phase-tracking.test.js +482 -0
  73. package/features/work-tracking/prototype-tracking.test.js +485 -0
  74. package/features/work-tracking/tree-view.test.js +310 -0
  75. package/features/work-tracking/work-set-mode.feature +71 -0
  76. package/features/work-tracking/work-start-mode.feature +88 -0
  77. package/full-test.txt +0 -0
  78. package/install.sh +89 -0
  79. package/jettypod.js +1640 -0
  80. package/lib/bug-workflow.js +94 -0
  81. package/lib/bug-workflow.test.js +177 -0
  82. package/lib/claudemd.js +130 -0
  83. package/lib/claudemd.test.js +195 -0
  84. package/lib/comprehensive-standards-full.json +1778 -0
  85. package/lib/config.js +181 -0
  86. package/lib/config.test.js +511 -0
  87. package/lib/constants.js +107 -0
  88. package/lib/constants.test.js +164 -0
  89. package/lib/current-work.js +130 -0
  90. package/lib/current-work.test.js +146 -0
  91. package/lib/database-project-config.test.js +107 -0
  92. package/lib/database.js +256 -0
  93. package/lib/database.test.js +106 -0
  94. package/lib/decisions-generator.js +102 -0
  95. package/lib/decisions-generator.test.js +457 -0
  96. package/lib/decisions-helpers.js +119 -0
  97. package/lib/decisions-helpers.test.js +310 -0
  98. package/lib/discovery-checkpoint.js +83 -0
  99. package/lib/docs-generator.js +280 -0
  100. package/lib/external-checklist.js +177 -0
  101. package/lib/git.js +142 -0
  102. package/lib/git.test.js +145 -0
  103. package/lib/logo.js +3 -0
  104. package/lib/migrations/001-epic-to-parent.js +24 -0
  105. package/lib/migrations/002-default-work-item-modes.js +37 -0
  106. package/lib/migrations/002-default-work-item-modes.test.js +351 -0
  107. package/lib/migrations/003-epic-discovery-fields.js +52 -0
  108. package/lib/migrations/004-discovery-decisions-table.js +32 -0
  109. package/lib/migrations/005-migrate-decision-data.js +62 -0
  110. package/lib/migrations/006-feature-phase-field.js +61 -0
  111. package/lib/migrations/007-prototype-tracking.js +38 -0
  112. package/lib/migrations/008-scenario-file-field.js +24 -0
  113. package/lib/migrations/index.js +74 -0
  114. package/lib/production-helpers.js +69 -0
  115. package/lib/project-state.test.js +92 -0
  116. package/lib/test-helpers.js +184 -0
  117. package/lib/test-helpers.test.js +255 -0
  118. package/package.json +36 -0
  119. package/prototypes/test/index.html +1 -0
  120. package/setup-dist-repo.sh +68 -0
  121. package/test-safety-check.sh +80 -0
  122. package/work-item-tracking-plan.md +199 -0
@@ -0,0 +1,1241 @@
1
+ # JettyPod System Behaviors
2
+
3
+ *Auto-generated from test scenarios on 2025-11-06*
4
+
5
+ ## Summary
6
+
7
+ - **13** features
8
+ - **65** test scenarios
9
+ - **312** test steps
10
+
11
+ ## Table of Contents
12
+
13
+ - [Auto-generate production chores on external transition](#auto-generate-production-chores-on-external-transition) (1 scenarios)
14
+ - [Git Hook Integration](#git-hook-integration) (4 scenarios)
15
+ - [Git Hooks Integration](#git-hooks-integration) (1 scenarios)
16
+ - [JettyPod update command](#jettypod-update-command) (5 scenarios)
17
+ - [Mode Change Prompts](#mode-change-prompts) (1 scenarios)
18
+ - [Refactor Mode](#refactor-mode) (5 scenarios)
19
+ - [Terminal Logo Display](#terminal-logo-display) (4 scenarios)
20
+ - [Bug Workflow Display](#bug-workflow-display) (2 scenarios)
21
+ - [Work Commands - Stable Mode](#work-commands-stable-mode) (10 scenarios)
22
+ - [Work Item Commands](#work-item-commands) (1 scenarios)
23
+ - [Mode defaults to discovery on work item creation](#mode-defaults-to-discovery-on-work-item-creation) (14 scenarios)
24
+ - [Work set-mode updates CLAUDE.md if item is current](#work-set-mode-updates-claude-md-if-item-is-current) (6 scenarios)
25
+ - [Work start sets CLAUDE.md mode from work item](#work-start-sets-claude-md-mode-from-work-item) (11 scenarios)
26
+
27
+ ---
28
+
29
+ ## What JettyPod Does
30
+
31
+ This documentation is derived from actual passing tests. It describes the verified behaviors of the system.
32
+
33
+ ### Auto-generate production chores on external transition
34
+
35
+ *Related features: Auto-generate production chores on external transition*
36
+
37
+ **Verified behaviors:**
38
+
39
+ - **User transitions project to external with stable features**
40
+ When I have a project with 3 features in stable mode, the project state is "internal", I transition the project to external → the project state is set to "external" and a "Feature Production Readiness" epic is created and 3 production chores are created for each stable feature and the chores are grouped under the epic and I see a summary of created chores
41
+
42
+ ---
43
+
44
+ ### Git Hook Integration
45
+
46
+ *Related features: Git Hook Integration*
47
+
48
+ **Verified behaviors:**
49
+
50
+ - **First commit updates status to in_progress**
51
+ When I have a work item with status "todo", the work item is set as current work, I make my first commit → the work item status should be "in_progress"
52
+
53
+ - **Merge to main updates status to done**
54
+ When I have a work item with status "in_progress", the work item is set as current work, I am on a feature branch, I merge to main → the work item status should be "done"
55
+
56
+ - **No current work item - hooks do nothing**
57
+ When no work item is set as current, I make a commit → no errors occur
58
+
59
+ - **Integration - hooks work with existing work commands**
60
+ When I have initialized jettypod with git, I create a work item via work commands, I start work on the item, I commit changes → the work item status updates automatically and the current work file still exists
61
+
62
+ ---
63
+
64
+ ### Git Hooks Integration
65
+
66
+ *Related features: Git Hooks Integration*
67
+
68
+ **Verified behaviors:**
69
+
70
+ - **Integration - post-commit hook updates status**
71
+ When I initialize a git repo with devpod, I create and start work on a todo item, I make a commit → the hook updates status to in_progress
72
+
73
+ ---
74
+
75
+ ### JettyPod update command
76
+
77
+ *Related features: JettyPod update command*
78
+
79
+ **Verified behaviors:**
80
+
81
+ - **User runs jettypod update when new version is available**
82
+ When jettypod version 3.0.0 is installed, npm registry has version 3.1.0 available, I run update command "jettypod update" → jettypod checks npm registry for latest version and jettypod shows "New version available: 3.1.0 (current: 3.0.0)" and jettypod downloads and installs version 3.1.0 and skills are refreshed in current project and jettypod shows "✅ JettyPod updated to 3.1.0"
83
+
84
+ - **User runs jettypod update when already on latest version**
85
+ When jettypod version 3.1.0 is installed, npm registry has version 3.1.0 available, I run update command "jettypod update" → jettypod checks npm registry for latest version and jettypod shows "Already on latest version: 3.1.0" and skills are refreshed in current project
86
+
87
+ - **User runs jettypod update without internet connection**
88
+ When jettypod is installed, there is no internet connection, I run update command "jettypod update" → jettypod shows "Cannot check for updates: network error" and skills are still refreshed in current project using existing jettypod
89
+
90
+ - **Command rename - jettypod without init creates new project**
91
+ When I am in a directory without .claude/, I run update command "jettypod" → jettypod initializes the project and .claude/ directory is created and CLAUDE.md is created and skills are installed
92
+
93
+ - **Backwards compatibility - jettypod init still works**
94
+ When I am in a directory without .claude/, I run update command "jettypod init" → jettypod initializes the project and .claude/ directory is created and CLAUDE.md is created and skills are installed
95
+
96
+ ---
97
+
98
+ ### Mode Change Prompts
99
+
100
+ *Related features: Mode Change Prompts*
101
+
102
+ **Verified behaviors:**
103
+
104
+ - **Integration - mode change with work item present**
105
+ When I have jettypod with a work item in progress, I check current work exists → the work item has a status
106
+
107
+ ---
108
+
109
+ ### Refactor Mode
110
+
111
+ *Related features: Refactor Mode*
112
+
113
+ **Verified behaviors:**
114
+
115
+ - **Refactor mode integrates with work tracking**
116
+ When I have existing work items in the system, I enter refactor mode and audit the codebase and I select "Architectural" category and I approve creating chores for storage pattern → refactor chores are created under an epic and the epic is linked to the refactor mode work item
117
+
118
+ - **User enters refactor mode and sees audit menu**
119
+ When I'm in a project with technical debt, I enter refactor mode → Claude audits the codebase and I see categorized menu with counts:
120
+
121
+ - **User picks category and sees detailed breakdown**
122
+ When I see the audit menu, I pick "Architectural" category → I see detailed items with:
123
+
124
+ - **Claude recommends quick wins**
125
+ When I see the detailed breakdown for "Architectural", Claude analyzes impact vs time → I see recommendation: "Start with Storage Pattern (quick win, high impact)" and I see warning: "Skip State Management (needs Discovery Mode first)"
126
+
127
+ - **User approves and chores are created**
128
+ When I see recommendations for Storage Pattern, I say "create chores" → epic "Refactor: Architectural patterns" is created and chore "Create shared storage util" is created and chore "Migrate auth to storage util" is created and all chores are linked to the epic
129
+
130
+ ---
131
+
132
+ ### Terminal Logo Display
133
+
134
+ *Related features: Terminal Logo Display*
135
+
136
+ **Verified behaviors:**
137
+
138
+ - **jettypod init displays unicode gradient logo**
139
+ When a new empty directory, I run jettypod init → the output contains the unicode gradient logo and the logo includes "DEV" and "POD" text and the logo uses ANSI color codes
140
+
141
+ - **Logo module exports showLogo function**
142
+ When the logo module exists, I import it → it exports a "showLogo" function
143
+
144
+ - **Logo output is properly formatted**
145
+ I call the showLogo function → it outputs 6 lines of logo art and it includes the version subtitle
146
+
147
+ - **jettypod init integrates with existing features**
148
+ When a new empty directory, I run jettypod init → I see the unicode logo and the .jettypod directory is created and CLAUDE.md is created and git hooks are installed
149
+
150
+ ---
151
+
152
+ ### Bug Workflow Display
153
+
154
+ *Related features: Bug Workflow Display*
155
+
156
+ **Verified behaviors:**
157
+
158
+ - **Starting work on a bug displays workflow guidance**
159
+ When jettypod is initialized, I create a bug "Install script fails", I start work on the bug → the output contains "BUG FIXING WORKFLOW" and the output contains "1. REPRODUCE" and the output contains "2. INVESTIGATE" and the output contains "3. ISOLATE" and the output contains "4. FIX" and the output contains "5. VERIFY" and the output contains "6. COMMIT"
160
+
161
+ - **Starting work on a feature does not display bug workflow**
162
+ When jettypod is initialized, I create a feature "Add new feature", I start work on the feature → the output does not contain "BUG FIXING WORKFLOW"
163
+
164
+ ---
165
+
166
+ ### Work
167
+
168
+ *Related features: Work Commands - Stable Mode*
169
+
170
+ **Verified behaviors:**
171
+
172
+ - **Start work with invalid ID**
173
+ When jettypod is initialized, I try to start work with ID "invalid" → I get an error "Invalid work item ID"
174
+
175
+ - **Start work with negative ID**
176
+ When jettypod is initialized, I try to start work with ID "-1" → I get an error "Invalid work item ID"
177
+
178
+ - **Start work when not initialized**
179
+ When jettypod is not initialized, I try to start work with ID "1" → I get an error "JettyPod not initialized"
180
+
181
+ - **Start work on non-existent item**
182
+ When jettypod is initialized, I try to start work with ID "999" → I get an error "Work item #999 not found"
183
+
184
+ - **Stop work with invalid status**
185
+ When I have current work, I try to stop work with status "invalid" → I get an error "Invalid status"
186
+
187
+ - **Stop work when no current work**
188
+ When jettypod is initialized, no work is active, I try to stop work → operation succeeds with no changes
189
+
190
+ - **Get current work with corrupted file**
191
+ When jettypod is initialized, current work file is corrupted, I get current work → it returns null
192
+
193
+ - **Start work without git repo**
194
+ When jettypod is initialized without git, I have a work item, I start work on the item → it succeeds without creating branch
195
+
196
+ - **Multiple start work calls**
197
+ When I have a work item, I start work on it, I start work on a different item → the first item stops being current and the second item becomes current
198
+
199
+ - **Start work preserves existing status**
200
+ When I have a work item with status "in_progress", I start work on it → the status remains "in_progress"
201
+
202
+ ---
203
+
204
+ ### Work Item
205
+
206
+ *Related features: Work Item Commands*
207
+
208
+ **Verified behaviors:**
209
+
210
+ - **Integration - work commands with existing work tracking**
211
+ When I have initialized jettypod, I create an epic with id 1, I create a feature with id 2 under epic 1, I start work on item 2 → the current work file exists and the current work contains item 2 and item 2 status is in_progress or backlog
212
+
213
+ ---
214
+
215
+ ### Mode defaults to discovery on work item creation
216
+
217
+ *Related features: Mode defaults to discovery on work item creation*
218
+
219
+ **Verified behaviors:**
220
+
221
+ - **Create epic without mode**
222
+ When jettypod is initialized, I create an epic "Test Epic" without mode → the work item is created successfully and the work item has NULL mode
223
+
224
+ - **Create epic with mode (optional)**
225
+ When jettypod is initialized, I create an epic "Test Epic" with mode "stable" → the work item is created successfully and the work item has mode "stable"
226
+
227
+ - **Create feature with explicit mode**
228
+ When jettypod is initialized, I create a feature "Test Feature" with mode "speed" → the work item is created successfully and the work item has mode "speed"
229
+
230
+ - **Create feature without mode defaults to discovery**
231
+ When jettypod is initialized, I create a feature "Test Feature" without mode → the work item is created successfully and the work item has mode "discovery"
232
+
233
+ - **Create feature with invalid mode**
234
+ When jettypod is initialized, I try to create a feature "Test Feature" with mode "invalid" → I get an error "Invalid mode" and no work item is created
235
+
236
+ - **Create bug with explicit mode**
237
+ When jettypod is initialized, I create a bug "Test Bug" with mode "stable" → the work item is created successfully and the work item has mode "stable"
238
+
239
+ - **Create bug without mode defaults to discovery**
240
+ When jettypod is initialized, I create a bug "Test Bug" without mode → the work item is created successfully and the work item has mode "discovery"
241
+
242
+ - **Create chore with mode fails**
243
+ When jettypod is initialized, I try to create a chore "Test Chore" with mode "production" → I get an error "Chores do not have modes" and no work item is created
244
+
245
+ - **Create chore without mode succeeds with NULL**
246
+ When jettypod is initialized, jettypod is initialized, I create a chore "Test Chore" without mode and I create a feature "Test Feature" with mode "<mode>" → the work item is created successfully and the work item has NULL mode and the work item is created successfully and the work item has mode "<mode>"
247
+
248
+ - **Epic with children in different modes**
249
+ When jettypod is initialized, I create an epic "Test Epic" without mode, I create a feature "Speed Feature" with mode "speed" and parent epic, I create a bug "Stable Bug" with mode "stable" and parent epic, I create a chore "Test Chore" without mode and parent epic, I view the work tree → I see the epic without mode indicator and I see the feature with mode "speed" and I see the bug with mode "stable" and I see the chore without mode indicator
250
+
251
+ - **Create multiple items with same title but different modes**
252
+ When jettypod is initialized, I create a feature "Duplicate" with mode "speed" and I create a feature "Duplicate" with mode "stable" → both work items are created successfully and they have different modes
253
+
254
+ - **Mode is case-sensitive**
255
+ When jettypod is initialized, I try to create a feature "Test" with mode "Speed" → I get an error "Invalid mode"
256
+
257
+ - **Mode with whitespace is invalid**
258
+ When jettypod is initialized, I try to create a feature "Test" with mode " speed " → I get an error "Invalid mode"
259
+
260
+ - **Empty string mode is treated as NULL**
261
+ When jettypod is initialized, I try to create a feature "Test" with mode "" → I get an error "Invalid mode"
262
+
263
+ ---
264
+
265
+ ### Work set-mode updates CLAUDE.md if item is current
266
+
267
+ *Related features: Work set-mode updates CLAUDE.md if item is current*
268
+
269
+ **Verified behaviors:**
270
+
271
+ - **Set mode on current work item updates CLAUDE.md**
272
+ When I create a feature "Test Feature" with mode "speed", I start work on the feature, CLAUDE.md mode is set to "speed", I set mode for current item to "stable" → the work item has mode "stable" and CLAUDE.md mode is set to "stable"
273
+
274
+ - **Set mode on non-current item does not update CLAUDE.md**
275
+ When I create a feature "Item 1" with mode "speed", I create a feature "Item 2" with mode "discovery", I start work on the feature "Item 1", CLAUDE.md mode is set to "speed", I set mode for item "Item 2" to "stable" → item "Item 2" has mode "stable"
276
+
277
+ - **Set invalid mode shows error**
278
+ When I create a feature "Test Feature" with mode "speed", I try to set mode to "invalid" → I get error "Invalid mode" and the work item still has mode "speed"
279
+
280
+ - **Set mode is case-sensitive**
281
+ When I create a feature "Test Feature" with mode "speed", I create a feature "Test Feature" with mode "speed", I try to set mode to "Speed" and I set mode for current item to "<new_mode>" → I get error "Invalid mode" and I start work on the feature and the work item has mode "<new_mode>" and CLAUDE.md mode is set to "<new_mode>"
282
+
283
+ - **Mode change persists across work start/stop**
284
+ When I create a feature "Test Feature" with mode "speed", I start work on the feature, I set mode for current item to "production" and I stop work and I start work on the feature → CLAUDE.md mode is set to "production"
285
+
286
+ - **Change mode multiple times**
287
+ When I create a feature "Test Feature" with mode "speed", I start work on the feature, I set mode for current item to "discovery" and I set mode for current item to "stable" and I set mode for current item to "production" → the work item has mode "production" and CLAUDE.md mode is set to "production"
288
+
289
+ ---
290
+
291
+ ### Work start sets CLAUDE.md mode from work item
292
+
293
+ *Related features: Work start sets CLAUDE.md mode from work item*
294
+
295
+ **Verified behaviors:**
296
+
297
+ - **Start work on feature in speed mode**
298
+ When I create a feature "Speed Feature" with mode "speed", I start work on the feature → CLAUDE.md mode is set to "speed"
299
+
300
+ - **Start work on bug in stable mode**
301
+ When I create a bug "Stable Bug" with mode "stable", I start work on the bug → CLAUDE.md mode is set to "stable"
302
+
303
+ - **Start work on chore inherits parent feature mode**
304
+ When I create a feature "Discovery Feature" with mode "discovery", I create a chore "Child Chore" without mode and parent feature, I start work on the chore → CLAUDE.md mode is set to "discovery"
305
+
306
+ - **Start work on feature in production mode**
307
+ When I create a feature "Production Feature" with mode "production", I start work on the feature → CLAUDE.md mode is set to "production"
308
+
309
+ - **Switch from speed mode item to stable mode item**
310
+ When I create a feature "Speed Feature" with mode "speed", I create a bug "Stable Bug" with mode "stable", I start work on the feature, CLAUDE.md mode is set to "speed", I stop work and I start work on the bug → CLAUDE.md mode is set to "stable"
311
+
312
+ - **Start work updates mode even if item already in progress**
313
+ When I create a feature "Test Feature" with mode "discovery", the feature status is "in_progress", CLAUDE.md has mode "speed", I start work on the feature → CLAUDE.md mode is set to "discovery"
314
+
315
+ - **Start work on epic (NULL mode)**
316
+ When I create an epic "Test Epic" without mode, I start work on the epic → CLAUDE.md has no mode line and the current work section exists
317
+
318
+ - **Start work on feature with default discovery mode**
319
+ When I create a feature "Default Feature" without mode, the work item has mode "discovery", I start work on the feature → CLAUDE.md mode is set to "discovery"
320
+
321
+ - **Start work on child item inherits its own mode, not parent's**
322
+ When I create an epic "Test Epic" without mode, I create a feature "Speed Feature" with mode "speed" and parent epic, I create a bug "Stable Bug" with mode "stable" and parent epic, I start work on the speed feature and I stop work → CLAUDE.md mode is set to "speed" and I start work on the stable bug and CLAUDE.md mode is set to "stable"
323
+
324
+ - **Work item mode persists in database after start**
325
+ When I create a feature "Test Feature" with mode "stable", I start work on the feature and I stop work → the work item still has mode "stable"
326
+
327
+ - **Starting work multiple times preserves mode**
328
+ When I create a feature "Test Feature" with mode "production", I start work on the feature and I stop work and I start work on the feature → CLAUDE.md mode is set to "production" and the work item still has mode "production"
329
+
330
+ ---
331
+
332
+ ## Detailed Feature Specifications
333
+
334
+ ### Auto-generate production chores on external transition
335
+
336
+ When transitioning to external, automatically create production chores for all stable features Approach: Silent Auto-Generation
337
+
338
+ #### User transitions project to external with stable features
339
+
340
+ **Context:**
341
+ - I have a project with 3 features in stable mode
342
+ - the project state is "internal"
343
+
344
+ **Action:**
345
+ - I transition the project to external
346
+
347
+ **Expected outcome:**
348
+ - the project state is set to "external"
349
+ - a "Feature Production Readiness" epic is created
350
+ - 3 production chores are created for each stable feature
351
+ - the chores are grouped under the epic
352
+ - I see a summary of created chores
353
+
354
+ ---
355
+
356
+ ### Git Hook Integration
357
+
358
+ As a developer I want work item status to update automatically on git operations So that I don't have to manually track progress
359
+
360
+ #### First commit updates status to in_progress
361
+
362
+ **Context:**
363
+ - I have a work item with status "todo"
364
+ - the work item is set as current work
365
+
366
+ **Action:**
367
+ - I make my first commit
368
+
369
+ **Expected outcome:**
370
+ - the work item status should be "in_progress"
371
+
372
+ #### Merge to main updates status to done
373
+
374
+ **Context:**
375
+ - I have a work item with status "in_progress"
376
+ - the work item is set as current work
377
+ - I am on a feature branch
378
+
379
+ **Action:**
380
+ - I merge to main
381
+
382
+ **Expected outcome:**
383
+ - the work item status should be "done"
384
+
385
+ #### No current work item - hooks do nothing
386
+
387
+ **Context:**
388
+ - no work item is set as current
389
+
390
+ **Action:**
391
+ - I make a commit
392
+
393
+ **Expected outcome:**
394
+ - no errors occur
395
+
396
+ #### Integration - hooks work with existing work commands
397
+
398
+ **Context:**
399
+ - I have initialized jettypod with git
400
+ - I create a work item via work commands
401
+ - I start work on the item
402
+
403
+ **Action:**
404
+ - I commit changes
405
+
406
+ **Expected outcome:**
407
+ - the work item status updates automatically
408
+ - the current work file still exists
409
+
410
+ ---
411
+
412
+ ### Git Hooks Integration
413
+
414
+ As a developer I want work item status to auto-update on commits So I don't manually track progress
415
+
416
+ #### Integration - post-commit hook updates status
417
+
418
+ **Context:**
419
+ - I initialize a git repo with devpod
420
+ - I create and start work on a todo item
421
+
422
+ **Action:**
423
+ - I make a commit
424
+
425
+ **Expected outcome:**
426
+ - the hook updates status to in_progress
427
+
428
+ ---
429
+
430
+ ### JettyPod update command
431
+
432
+ Self-updating jettypod and skills refresh with a single command Epic: JettyPod and Skills Auto-Update Approach: Full self-update - Check npm, update jettypod, refresh skills
433
+
434
+ #### User runs jettypod update when new version is available
435
+
436
+ **Context:**
437
+ - jettypod version 3.0.0 is installed
438
+ - npm registry has version 3.1.0 available
439
+
440
+ **Action:**
441
+ - I run update command "jettypod update"
442
+
443
+ **Expected outcome:**
444
+ - jettypod checks npm registry for latest version
445
+ - jettypod shows "New version available: 3.1.0 (current: 3.0.0)"
446
+ - jettypod downloads and installs version 3.1.0
447
+ - skills are refreshed in current project
448
+ - jettypod shows "✅ JettyPod updated to 3.1.0"
449
+
450
+ #### User runs jettypod update when already on latest version
451
+
452
+ **Context:**
453
+ - jettypod version 3.1.0 is installed
454
+ - npm registry has version 3.1.0 available
455
+
456
+ **Action:**
457
+ - I run update command "jettypod update"
458
+
459
+ **Expected outcome:**
460
+ - jettypod checks npm registry for latest version
461
+ - jettypod shows "Already on latest version: 3.1.0"
462
+ - skills are refreshed in current project
463
+
464
+ #### User runs jettypod update without internet connection
465
+
466
+ **Context:**
467
+ - jettypod is installed
468
+ - there is no internet connection
469
+
470
+ **Action:**
471
+ - I run update command "jettypod update"
472
+
473
+ **Expected outcome:**
474
+ - jettypod shows "Cannot check for updates: network error"
475
+ - skills are still refreshed in current project using existing jettypod
476
+
477
+ #### Command rename - jettypod without init creates new project
478
+
479
+ **Context:**
480
+ - I am in a directory without .claude/
481
+
482
+ **Action:**
483
+ - I run update command "jettypod"
484
+
485
+ **Expected outcome:**
486
+ - jettypod initializes the project
487
+ - .claude/ directory is created
488
+ - CLAUDE.md is created
489
+ - skills are installed
490
+
491
+ #### Backwards compatibility - jettypod init still works
492
+
493
+ **Context:**
494
+ - I am in a directory without .claude/
495
+
496
+ **Action:**
497
+ - I run update command "jettypod init"
498
+
499
+ **Expected outcome:**
500
+ - jettypod initializes the project
501
+ - .claude/ directory is created
502
+ - CLAUDE.md is created
503
+ - skills are installed
504
+
505
+ ---
506
+
507
+ ### Mode Change Prompts
508
+
509
+ As a developer I want to update work status when switching modes So my work state stays current
510
+
511
+ #### Integration - mode change with work item present
512
+
513
+ **Context:**
514
+ - I have jettypod with a work item in progress
515
+
516
+ **Action:**
517
+ - I check current work exists
518
+
519
+ **Expected outcome:**
520
+ - the work item has a status
521
+
522
+ ---
523
+
524
+ ### Refactor Mode
525
+
526
+ As a developer I want an interactive audit menu for refactoring So that I can systematically clean up technical debt
527
+
528
+ #### Refactor mode integrates with work tracking
529
+
530
+ **Context:**
531
+ - I have existing work items in the system
532
+
533
+ **Action:**
534
+ - I enter refactor mode and audit the codebase
535
+ - I select "Architectural" category
536
+ - I approve creating chores for storage pattern
537
+
538
+ **Expected outcome:**
539
+ - refactor chores are created under an epic
540
+ - the epic is linked to the refactor mode work item
541
+
542
+ #### User enters refactor mode and sees audit menu
543
+
544
+ **Context:**
545
+ - I'm in a project with technical debt
546
+
547
+ **Action:**
548
+ - I enter refactor mode
549
+
550
+ **Expected outcome:**
551
+ - Claude audits the codebase
552
+ - I see categorized menu with counts:
553
+
554
+ #### User picks category and sees detailed breakdown
555
+
556
+ **Context:**
557
+ - I see the audit menu
558
+
559
+ **Action:**
560
+ - I pick "Architectural" category
561
+
562
+ **Expected outcome:**
563
+ - I see detailed items with:
564
+
565
+ #### Claude recommends quick wins
566
+
567
+ **Context:**
568
+ - I see the detailed breakdown for "Architectural"
569
+
570
+ **Action:**
571
+ - Claude analyzes impact vs time
572
+
573
+ **Expected outcome:**
574
+ - I see recommendation: "Start with Storage Pattern (quick win, high impact)"
575
+ - I see warning: "Skip State Management (needs Discovery Mode first)"
576
+
577
+ #### User approves and chores are created
578
+
579
+ **Context:**
580
+ - I see recommendations for Storage Pattern
581
+
582
+ **Action:**
583
+ - I say "create chores"
584
+
585
+ **Expected outcome:**
586
+ - epic "Refactor: Architectural patterns" is created
587
+ - chore "Create shared storage util" is created
588
+ - chore "Migrate auth to storage util" is created
589
+ - all chores are linked to the epic
590
+
591
+ ---
592
+
593
+ ### Terminal Logo Display
594
+
595
+ As a JettyPod user I want to see a welcoming logo when I run jettypod init So that the tool feels approachable and modern
596
+
597
+ #### jettypod init displays unicode gradient logo
598
+
599
+ **Context:**
600
+ - a new empty directory
601
+
602
+ **Action:**
603
+ - I run jettypod init
604
+
605
+ **Expected outcome:**
606
+ - the output contains the unicode gradient logo
607
+ - the logo includes "DEV" and "POD" text
608
+ - the logo uses ANSI color codes
609
+
610
+ #### Logo module exports showLogo function
611
+
612
+ **Context:**
613
+ - the logo module exists
614
+
615
+ **Action:**
616
+ - I import it
617
+
618
+ **Expected outcome:**
619
+ - it exports a "showLogo" function
620
+
621
+ #### Logo output is properly formatted
622
+
623
+ **Action:**
624
+ - I call the showLogo function
625
+
626
+ **Expected outcome:**
627
+ - it outputs 6 lines of logo art
628
+ - it includes the version subtitle
629
+
630
+ #### jettypod init integrates with existing features
631
+
632
+ **Context:**
633
+ - a new empty directory
634
+
635
+ **Action:**
636
+ - I run jettypod init
637
+
638
+ **Expected outcome:**
639
+ - I see the unicode logo
640
+ - the .jettypod directory is created
641
+ - CLAUDE.md is created
642
+ - git hooks are installed
643
+
644
+ ---
645
+
646
+ ### Bug Workflow Display
647
+
648
+ As a developer I want to see bug-specific workflow guidance when starting a bug So that I have systematic steps to follow for fixing bugs
649
+
650
+ #### Starting work on a bug displays workflow guidance
651
+
652
+ **Context:**
653
+ - jettypod is initialized
654
+ - I create a bug "Install script fails"
655
+
656
+ **Action:**
657
+ - I start work on the bug
658
+
659
+ **Expected outcome:**
660
+ - the output contains "BUG FIXING WORKFLOW"
661
+ - the output contains "1. REPRODUCE"
662
+ - the output contains "2. INVESTIGATE"
663
+ - the output contains "3. ISOLATE"
664
+ - the output contains "4. FIX"
665
+ - the output contains "5. VERIFY"
666
+ - the output contains "6. COMMIT"
667
+
668
+ #### Starting work on a feature does not display bug workflow
669
+
670
+ **Context:**
671
+ - jettypod is initialized
672
+ - I create a feature "Add new feature"
673
+
674
+ **Action:**
675
+ - I start work on the feature
676
+
677
+ **Expected outcome:**
678
+ - the output does not contain "BUG FIXING WORKFLOW"
679
+
680
+ ---
681
+
682
+ ### Work Commands - Stable Mode
683
+
684
+ Edge cases and error handling for work commands
685
+
686
+ #### Start work with invalid ID
687
+
688
+ **Context:**
689
+ - jettypod is initialized
690
+
691
+ **Action:**
692
+ - I try to start work with ID "invalid"
693
+
694
+ **Expected outcome:**
695
+ - I get an error "Invalid work item ID"
696
+
697
+ #### Start work with negative ID
698
+
699
+ **Context:**
700
+ - jettypod is initialized
701
+
702
+ **Action:**
703
+ - I try to start work with ID "-1"
704
+
705
+ **Expected outcome:**
706
+ - I get an error "Invalid work item ID"
707
+
708
+ #### Start work when not initialized
709
+
710
+ **Context:**
711
+ - jettypod is not initialized
712
+
713
+ **Action:**
714
+ - I try to start work with ID "1"
715
+
716
+ **Expected outcome:**
717
+ - I get an error "JettyPod not initialized"
718
+
719
+ #### Start work on non-existent item
720
+
721
+ **Context:**
722
+ - jettypod is initialized
723
+
724
+ **Action:**
725
+ - I try to start work with ID "999"
726
+
727
+ **Expected outcome:**
728
+ - I get an error "Work item #999 not found"
729
+
730
+ #### Stop work with invalid status
731
+
732
+ **Context:**
733
+ - I have current work
734
+
735
+ **Action:**
736
+ - I try to stop work with status "invalid"
737
+
738
+ **Expected outcome:**
739
+ - I get an error "Invalid status"
740
+
741
+ #### Stop work when no current work
742
+
743
+ **Context:**
744
+ - jettypod is initialized
745
+ - no work is active
746
+
747
+ **Action:**
748
+ - I try to stop work
749
+
750
+ **Expected outcome:**
751
+ - operation succeeds with no changes
752
+
753
+ #### Get current work with corrupted file
754
+
755
+ **Context:**
756
+ - jettypod is initialized
757
+ - current work file is corrupted
758
+
759
+ **Action:**
760
+ - I get current work
761
+
762
+ **Expected outcome:**
763
+ - it returns null
764
+
765
+ #### Start work without git repo
766
+
767
+ **Context:**
768
+ - jettypod is initialized without git
769
+ - I have a work item
770
+
771
+ **Action:**
772
+ - I start work on the item
773
+
774
+ **Expected outcome:**
775
+ - it succeeds without creating branch
776
+
777
+ #### Multiple start work calls
778
+
779
+ **Context:**
780
+ - I have a work item
781
+ - I start work on it
782
+
783
+ **Action:**
784
+ - I start work on a different item
785
+
786
+ **Expected outcome:**
787
+ - the first item stops being current
788
+ - the second item becomes current
789
+
790
+ #### Start work preserves existing status
791
+
792
+ **Context:**
793
+ - I have a work item with status "in_progress"
794
+
795
+ **Action:**
796
+ - I start work on it
797
+
798
+ **Expected outcome:**
799
+ - the status remains "in_progress"
800
+
801
+ ---
802
+
803
+ ### Work Item Commands
804
+
805
+ As a developer I want to start and stop work on items So that my current work is tracked automatically
806
+
807
+ #### Integration - work commands with existing work tracking
808
+
809
+ **Context:**
810
+ - I have initialized jettypod
811
+ - I create an epic with id 1
812
+ - I create a feature with id 2 under epic 1
813
+
814
+ **Action:**
815
+ - I start work on item 2
816
+
817
+ **Expected outcome:**
818
+ - the current work file exists
819
+ - the current work contains item 2
820
+ - item 2 status is in_progress or backlog
821
+
822
+ ---
823
+
824
+ ### Mode defaults to discovery on work item creation
825
+
826
+ As a developer I want new work items to default to discovery mode So I can start exploring without specifying mode every time
827
+
828
+ #### Create epic without mode
829
+
830
+ **Context:**
831
+ - jettypod is initialized
832
+
833
+ **Action:**
834
+ - I create an epic "Test Epic" without mode
835
+
836
+ **Expected outcome:**
837
+ - the work item is created successfully
838
+ - the work item has NULL mode
839
+
840
+ #### Create epic with mode (optional)
841
+
842
+ **Context:**
843
+ - jettypod is initialized
844
+
845
+ **Action:**
846
+ - I create an epic "Test Epic" with mode "stable"
847
+
848
+ **Expected outcome:**
849
+ - the work item is created successfully
850
+ - the work item has mode "stable"
851
+
852
+ #### Create feature with explicit mode
853
+
854
+ **Context:**
855
+ - jettypod is initialized
856
+
857
+ **Action:**
858
+ - I create a feature "Test Feature" with mode "speed"
859
+
860
+ **Expected outcome:**
861
+ - the work item is created successfully
862
+ - the work item has mode "speed"
863
+
864
+ #### Create feature without mode defaults to discovery
865
+
866
+ **Context:**
867
+ - jettypod is initialized
868
+
869
+ **Action:**
870
+ - I create a feature "Test Feature" without mode
871
+
872
+ **Expected outcome:**
873
+ - the work item is created successfully
874
+ - the work item has mode "discovery"
875
+
876
+ #### Create feature with invalid mode
877
+
878
+ **Context:**
879
+ - jettypod is initialized
880
+
881
+ **Action:**
882
+ - I try to create a feature "Test Feature" with mode "invalid"
883
+
884
+ **Expected outcome:**
885
+ - I get an error "Invalid mode"
886
+ - no work item is created
887
+
888
+ #### Create bug with explicit mode
889
+
890
+ **Context:**
891
+ - jettypod is initialized
892
+
893
+ **Action:**
894
+ - I create a bug "Test Bug" with mode "stable"
895
+
896
+ **Expected outcome:**
897
+ - the work item is created successfully
898
+ - the work item has mode "stable"
899
+
900
+ #### Create bug without mode defaults to discovery
901
+
902
+ **Context:**
903
+ - jettypod is initialized
904
+
905
+ **Action:**
906
+ - I create a bug "Test Bug" without mode
907
+
908
+ **Expected outcome:**
909
+ - the work item is created successfully
910
+ - the work item has mode "discovery"
911
+
912
+ #### Create chore with mode fails
913
+
914
+ **Context:**
915
+ - jettypod is initialized
916
+
917
+ **Action:**
918
+ - I try to create a chore "Test Chore" with mode "production"
919
+
920
+ **Expected outcome:**
921
+ - I get an error "Chores do not have modes"
922
+ - no work item is created
923
+
924
+ #### Create chore without mode succeeds with NULL
925
+
926
+ **Context:**
927
+ - jettypod is initialized
928
+ - jettypod is initialized
929
+
930
+ **Action:**
931
+ - I create a chore "Test Chore" without mode
932
+ - I create a feature "Test Feature" with mode "<mode>"
933
+
934
+ **Expected outcome:**
935
+ - the work item is created successfully
936
+ - the work item has NULL mode
937
+ - the work item is created successfully
938
+ - the work item has mode "<mode>"
939
+
940
+ #### Epic with children in different modes
941
+
942
+ **Context:**
943
+ - jettypod is initialized
944
+ - I create an epic "Test Epic" without mode
945
+ - I create a feature "Speed Feature" with mode "speed" and parent epic
946
+ - I create a bug "Stable Bug" with mode "stable" and parent epic
947
+ - I create a chore "Test Chore" without mode and parent epic
948
+
949
+ **Action:**
950
+ - I view the work tree
951
+
952
+ **Expected outcome:**
953
+ - I see the epic without mode indicator
954
+ - I see the feature with mode "speed"
955
+ - I see the bug with mode "stable"
956
+ - I see the chore without mode indicator
957
+
958
+ #### Create multiple items with same title but different modes
959
+
960
+ **Context:**
961
+ - jettypod is initialized
962
+
963
+ **Action:**
964
+ - I create a feature "Duplicate" with mode "speed"
965
+ - I create a feature "Duplicate" with mode "stable"
966
+
967
+ **Expected outcome:**
968
+ - both work items are created successfully
969
+ - they have different modes
970
+
971
+ #### Mode is case-sensitive
972
+
973
+ **Context:**
974
+ - jettypod is initialized
975
+
976
+ **Action:**
977
+ - I try to create a feature "Test" with mode "Speed"
978
+
979
+ **Expected outcome:**
980
+ - I get an error "Invalid mode"
981
+
982
+ #### Mode with whitespace is invalid
983
+
984
+ **Context:**
985
+ - jettypod is initialized
986
+
987
+ **Action:**
988
+ - I try to create a feature "Test" with mode " speed "
989
+
990
+ **Expected outcome:**
991
+ - I get an error "Invalid mode"
992
+
993
+ #### Empty string mode is treated as NULL
994
+
995
+ **Context:**
996
+ - jettypod is initialized
997
+
998
+ **Action:**
999
+ - I try to create a feature "Test" with mode ""
1000
+
1001
+ **Expected outcome:**
1002
+ - I get an error "Invalid mode"
1003
+
1004
+ ---
1005
+
1006
+ ### Work set-mode updates CLAUDE.md if item is current
1007
+
1008
+ As a developer I want to change a work item's mode with jettypod work set-mode So I can adjust my approach without recreating the work item Given jettypod is initialized And CLAUDE.md exists
1009
+
1010
+ #### Set mode on current work item updates CLAUDE.md
1011
+
1012
+ **Context:**
1013
+ - I create a feature "Test Feature" with mode "speed"
1014
+ - I start work on the feature
1015
+ - CLAUDE.md mode is set to "speed"
1016
+
1017
+ **Action:**
1018
+ - I set mode for current item to "stable"
1019
+
1020
+ **Expected outcome:**
1021
+ - the work item has mode "stable"
1022
+ - CLAUDE.md mode is set to "stable"
1023
+
1024
+ #### Set mode on non-current item does not update CLAUDE.md
1025
+
1026
+ **Context:**
1027
+ - I create a feature "Item 1" with mode "speed"
1028
+ - I create a feature "Item 2" with mode "discovery"
1029
+ - I start work on the feature "Item 1"
1030
+ - CLAUDE.md mode is set to "speed"
1031
+
1032
+ **Action:**
1033
+ - I set mode for item "Item 2" to "stable"
1034
+
1035
+ **Expected outcome:**
1036
+ - item "Item 2" has mode "stable"
1037
+
1038
+ #### Set invalid mode shows error
1039
+
1040
+ **Context:**
1041
+ - I create a feature "Test Feature" with mode "speed"
1042
+
1043
+ **Action:**
1044
+ - I try to set mode to "invalid"
1045
+
1046
+ **Expected outcome:**
1047
+ - I get error "Invalid mode"
1048
+ - the work item still has mode "speed"
1049
+
1050
+ #### Set mode is case-sensitive
1051
+
1052
+ **Context:**
1053
+ - I create a feature "Test Feature" with mode "speed"
1054
+ - I create a feature "Test Feature" with mode "speed"
1055
+
1056
+ **Action:**
1057
+ - I try to set mode to "Speed"
1058
+ - I set mode for current item to "<new_mode>"
1059
+
1060
+ **Expected outcome:**
1061
+ - I get error "Invalid mode"
1062
+ - I start work on the feature
1063
+ - the work item has mode "<new_mode>"
1064
+ - CLAUDE.md mode is set to "<new_mode>"
1065
+
1066
+ #### Mode change persists across work start/stop
1067
+
1068
+ **Context:**
1069
+ - I create a feature "Test Feature" with mode "speed"
1070
+ - I start work on the feature
1071
+
1072
+ **Action:**
1073
+ - I set mode for current item to "production"
1074
+ - I stop work
1075
+ - I start work on the feature
1076
+
1077
+ **Expected outcome:**
1078
+ - CLAUDE.md mode is set to "production"
1079
+
1080
+ #### Change mode multiple times
1081
+
1082
+ **Context:**
1083
+ - I create a feature "Test Feature" with mode "speed"
1084
+ - I start work on the feature
1085
+
1086
+ **Action:**
1087
+ - I set mode for current item to "discovery"
1088
+ - I set mode for current item to "stable"
1089
+ - I set mode for current item to "production"
1090
+
1091
+ **Expected outcome:**
1092
+ - the work item has mode "production"
1093
+ - CLAUDE.md mode is set to "production"
1094
+
1095
+ ---
1096
+
1097
+ ### Work start sets CLAUDE.md mode from work item
1098
+
1099
+ As a developer I want jettypod work start to set the CLAUDE.md mode from the work item's mode So I automatically work in the correct mode for each work item Given jettypod is initialized And CLAUDE.md exists
1100
+
1101
+ #### Start work on feature in speed mode
1102
+
1103
+ **Context:**
1104
+ - I create a feature "Speed Feature" with mode "speed"
1105
+
1106
+ **Action:**
1107
+ - I start work on the feature
1108
+
1109
+ **Expected outcome:**
1110
+ - CLAUDE.md mode is set to "speed"
1111
+
1112
+ #### Start work on bug in stable mode
1113
+
1114
+ **Context:**
1115
+ - I create a bug "Stable Bug" with mode "stable"
1116
+
1117
+ **Action:**
1118
+ - I start work on the bug
1119
+
1120
+ **Expected outcome:**
1121
+ - CLAUDE.md mode is set to "stable"
1122
+
1123
+ #### Start work on chore inherits parent feature mode
1124
+
1125
+ **Context:**
1126
+ - I create a feature "Discovery Feature" with mode "discovery"
1127
+ - I create a chore "Child Chore" without mode and parent feature
1128
+
1129
+ **Action:**
1130
+ - I start work on the chore
1131
+
1132
+ **Expected outcome:**
1133
+ - CLAUDE.md mode is set to "discovery"
1134
+
1135
+ #### Start work on feature in production mode
1136
+
1137
+ **Context:**
1138
+ - I create a feature "Production Feature" with mode "production"
1139
+
1140
+ **Action:**
1141
+ - I start work on the feature
1142
+
1143
+ **Expected outcome:**
1144
+ - CLAUDE.md mode is set to "production"
1145
+
1146
+ #### Switch from speed mode item to stable mode item
1147
+
1148
+ **Context:**
1149
+ - I create a feature "Speed Feature" with mode "speed"
1150
+ - I create a bug "Stable Bug" with mode "stable"
1151
+ - I start work on the feature
1152
+ - CLAUDE.md mode is set to "speed"
1153
+
1154
+ **Action:**
1155
+ - I stop work
1156
+ - I start work on the bug
1157
+
1158
+ **Expected outcome:**
1159
+ - CLAUDE.md mode is set to "stable"
1160
+
1161
+ #### Start work updates mode even if item already in progress
1162
+
1163
+ **Context:**
1164
+ - I create a feature "Test Feature" with mode "discovery"
1165
+ - the feature status is "in_progress"
1166
+ - CLAUDE.md has mode "speed"
1167
+
1168
+ **Action:**
1169
+ - I start work on the feature
1170
+
1171
+ **Expected outcome:**
1172
+ - CLAUDE.md mode is set to "discovery"
1173
+
1174
+ #### Start work on epic (NULL mode)
1175
+
1176
+ **Context:**
1177
+ - I create an epic "Test Epic" without mode
1178
+
1179
+ **Action:**
1180
+ - I start work on the epic
1181
+
1182
+ **Expected outcome:**
1183
+ - CLAUDE.md has no mode line
1184
+ - the current work section exists
1185
+
1186
+ #### Start work on feature with default discovery mode
1187
+
1188
+ **Context:**
1189
+ - I create a feature "Default Feature" without mode
1190
+ - the work item has mode "discovery"
1191
+
1192
+ **Action:**
1193
+ - I start work on the feature
1194
+
1195
+ **Expected outcome:**
1196
+ - CLAUDE.md mode is set to "discovery"
1197
+
1198
+ #### Start work on child item inherits its own mode, not parent's
1199
+
1200
+ **Context:**
1201
+ - I create an epic "Test Epic" without mode
1202
+ - I create a feature "Speed Feature" with mode "speed" and parent epic
1203
+ - I create a bug "Stable Bug" with mode "stable" and parent epic
1204
+
1205
+ **Action:**
1206
+ - I start work on the speed feature
1207
+ - I stop work
1208
+
1209
+ **Expected outcome:**
1210
+ - CLAUDE.md mode is set to "speed"
1211
+ - I start work on the stable bug
1212
+ - CLAUDE.md mode is set to "stable"
1213
+
1214
+ #### Work item mode persists in database after start
1215
+
1216
+ **Context:**
1217
+ - I create a feature "Test Feature" with mode "stable"
1218
+
1219
+ **Action:**
1220
+ - I start work on the feature
1221
+ - I stop work
1222
+
1223
+ **Expected outcome:**
1224
+ - the work item still has mode "stable"
1225
+
1226
+ #### Starting work multiple times preserves mode
1227
+
1228
+ **Context:**
1229
+ - I create a feature "Test Feature" with mode "production"
1230
+
1231
+ **Action:**
1232
+ - I start work on the feature
1233
+ - I stop work
1234
+ - I start work on the feature
1235
+
1236
+ **Expected outcome:**
1237
+ - CLAUDE.md mode is set to "production"
1238
+ - the work item still has mode "production"
1239
+
1240
+ ---
1241
+