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,1544 @@
1
+ # The Vibe Coding System - Core Framework
2
+
3
+ ## Why This System Exists
4
+
5
+ Everyone should have a side project that could become real.
6
+
7
+ Not hobbyist tinkering. Not premature startup theater. This is disciplined development that keeps doors open. Your side project is your insurance policy. Build like it matters, because it might.
8
+
9
+ This system teaches you to build production-quality software in the time you have. Claude is your technical co-founder for $20/month. The difference between a toy and a real product is smaller than you think with the right approach.
10
+
11
+ ## The Vibe Coding Philosophy
12
+
13
+ ### Core Values
14
+
15
+ **Momentum**
16
+ Building software includes frustrating moments for everyone. Ship simple, complete features regularly - each working piece maintains morale and teaches you something. Momentum isn't about speed or size, it's about consistent forward progress that keeps you engaged as you inevitably face confusion.
17
+
18
+ **Humility**
19
+ You're operating outside your circle of competence - respect that. Even if you've been around software for years, building it is different. You don't have the pattern recognition of an engineer. Success requires actively pursuing understanding - ask why things work, test assumptions, verify outcomes. You can't fake it here. Understanding must be earned.
20
+
21
+ **Simplicity**
22
+ Claude excels at simple, well-defined tasks but struggles with complexity. Success with AI means breaking everything down to its simplest form. This constraint is actually your superpower - it forces you to build what you can understand and maintain. Simple code is debuggable code. Simple code is shippable code. Start simple, stay simple longer than feels comfortable.
23
+
24
+ **Patience**
25
+ Good systems grow, they aren't built. Speed Mode code becoming Production code takes time. Standards emerge from patterns. Understanding comes from iteration. Rushing to Production Mode before you're ready creates disasters - patience prevents rewrites.
26
+
27
+ ### Operating Principles
28
+
29
+ **The Three Pillars:**
30
+ 1. **Momentum over perfection** - Ship broken rather than perfect
31
+ 2. **Tests are the only truth** - Docs lie, tests run
32
+ 3. **Make it work → Make it good → Make it great** - Natural progression through modes
33
+
34
+ **The AI Partnership:**
35
+ - **AI is a partner, not a compiler** - Have conversations, not commands
36
+ - **AI context is hard and it's on YOU** - Claude can't read your mind
37
+ - **Lean into AI's strengths** - Boilerplate, refactoring, explaining
38
+ - **Garbage in, garbage out** - Vague requests get enterprise spaghetti
39
+
40
+ **The Speed Principles:**
41
+ - **Code is cheap** - Throw away code freely, rebuild from scratch often
42
+ - **Perspective is cheap** - Have models wear different hats (security reviewer, user, architect)
43
+ - **Prototypes > technical planning** - Build to learn what you need
44
+ - **Slow is smooth, smooth is fast** - Rushing creates messes that slow you down
45
+
46
+ **The Documentation Truth:**
47
+ - **Actual docs are scratch pads** - They're lies the moment you write them
48
+ - **Tests are docs, docs are tests** - One source of truth
49
+ - **Never skip tests** - Even in Speed Mode, 3 tests minimum
50
+
51
+ ### Core Practices
52
+
53
+ **Building Practices:**
54
+ - **BDD always** - Given/When/Then before any code
55
+ - **Mode-based development** - Altitude determines approach
56
+ - **Progressive standardization** - Standards emerge naturally through modes
57
+ - **Dogfooding** - Use what you build while building it
58
+ - **Aggressive prototyping** - When unclear, build 3 versions
59
+ - **Prototype drilling** - Go deep on unclear aspects quickly
60
+
61
+ **Maintenance Practices:**
62
+ - **Refactor 20% of the time** - Boy Scout rule, constant improvement
63
+ - **Test maintenance > feature development** - Tests are the product
64
+ - **Frequent commits** - Working checkpoints every 30 minutes
65
+ - **Pre-commit test checks** - Never commit red tests
66
+ - **Always understand how everything works** - No magic, no mysteries
67
+
68
+ **Planning Practices:**
69
+ - **Plan epics lightly until active** - Details emerge through building
70
+ - **Surface the right context at the right time** - Mode-appropriate information
71
+ - **Short implementation documents** - Keep Claude on track
72
+ - **Model-to-model feedback** - Have Claude review Claude's code
73
+
74
+ ---
75
+
76
+ ## Core Principle: Test-Driven Everything
77
+
78
+ **The Foundation:** Tests ARE your application. Not documentation about your application - they ARE the application specification.
79
+
80
+ **The Practice:**
81
+ 1. Write Gherkin scenarios BEFORE any code
82
+ 2. Tests fail (red)
83
+ 3. Implement to make tests pass (green)
84
+ 4. Tests become living documentation
85
+
86
+ **No separate artifacts.** No README. No comments. No documentation. Just executable Gherkin scenarios.
87
+
88
+ ---
89
+
90
+ ## The Two-Level Testing Architecture
91
+
92
+ **The Revelation:** Not all tests are created equal. There are exactly two types of tests that matter, and knowing when to use each is the key to moving fast without breaking things.
93
+
94
+ ### Level 1: User-Facing Tests (Gherkin)
95
+ **What they test:** What users can see and do
96
+ **When to write:** ALWAYS - these define your product
97
+ **Examples:**
98
+ ```gherkin
99
+ Scenario: User completes a task
100
+ Given I have a task "Write tests"
101
+ When I mark it complete
102
+ Then the task shows as done
103
+ And my completion count increases
104
+ ```
105
+
106
+ These tests ARE your product specification. If it's not in a Gherkin test, it doesn't exist from the user's perspective.
107
+
108
+ ### Level 2: Code-Facing Tests (Unit Tests)
109
+ **What they test:** Complex internal logic that users don't see
110
+ **When to write:** ONLY for complex calculations, algorithms, or business rules
111
+ **Examples:**
112
+ ```javascript
113
+ test('calculates compound interest correctly', () => {
114
+ expect(calculateInterest(1000, 0.05, 12, 10)).toBe(1647.01)
115
+ })
116
+ ```
117
+
118
+ These tests document HOW your code works internally. They're for developer confidence, not user features.
119
+
120
+ ### The Mode-Based Testing Strategy
121
+
122
+ **Discovery Mode:**
123
+ - User-Facing: 3-5 vague scenarios to explore
124
+ - Code-Facing: NONE - code is throwaway
125
+
126
+ **Speed Mode:**
127
+ - User-Facing: 3-5 clear scenarios that define MVP
128
+ - Code-Facing: ONLY for complex logic (calculations, algorithms)
129
+ - Skip unit tests for: Simple CRUD, UI logic, straightforward data flow
130
+
131
+ **Production Mode:**
132
+ - User-Facing: Comprehensive scenarios for all user paths
133
+ - Code-Facing: Full coverage for business logic, security, data integrity
134
+
135
+ **Recovery Mode:**
136
+ - User-Facing: Test that reproduces the bug
137
+ - Code-Facing: Unit test to isolate the exact problem
138
+
139
+ ### The Critical Insight
140
+
141
+ In Speed Mode, you can ship with ONLY green User-Facing tests and no unit tests because:
142
+ 1. User-Facing tests catch what matters (user experience)
143
+ 2. Simple code doesn't need unit tests (CRUD, basic UI)
144
+ 3. Complex logic gets unit tests even in Speed Mode
145
+ 4. You can add unit tests later when elevating to Production
146
+
147
+ This is why Speed Mode works - you're not skipping quality, you're focusing on user value.
148
+
149
+ ### Examples by Mode
150
+
151
+ **Speed Mode Testing (90% of your work):**
152
+ ```gherkin
153
+ # User-Facing Test (Required)
154
+ Scenario: Calculate monthly budget
155
+ Given I have $5000 income
156
+ And $3000 in expenses
157
+ When I view my budget
158
+ Then I see $2000 surplus
159
+
160
+ # Code-Facing Test (Only because math is complex)
161
+ test('budget calculations', () => {
162
+ const budget = calculateBudget(5000, 3000)
163
+ expect(budget.surplus).toBe(2000)
164
+ expect(budget.savingsRate).toBe(0.4)
165
+ })
166
+ ```
167
+
168
+ **What you DON'T test in Speed Mode:**
169
+ - Form validation (covered by User-Facing tests)
170
+ - Data fetching (covered by User-Facing tests)
171
+ - Component rendering (covered by User-Facing tests)
172
+ - Simple state updates (too simple to break)
173
+
174
+ **Production Mode Testing (When it matters):**
175
+ ```gherkin
176
+ # User-Facing Test (Comprehensive)
177
+ Scenario Outline: Handle various payment amounts
178
+ Given a payment of <amount>
179
+ When processed with <method>
180
+ Then <result>
181
+
182
+ Examples:
183
+ | amount | method | result |
184
+ | $10 | card | success |
185
+ | $0 | card | error: invalid amount |
186
+ | $10000 | card | error: limit exceeded |
187
+
188
+ # Code-Facing Tests (Everything that could break)
189
+ describe('Payment Processing', () => {
190
+ test('validates amount ranges')
191
+ test('handles currency conversion')
192
+ test('applies correct fees')
193
+ test('manages transaction states')
194
+ test('implements retry logic')
195
+ })
196
+ ```
197
+
198
+ ### The Two-Level Truth
199
+
200
+ - **User-Facing Tests** = The truth about what your product does
201
+ - **Code-Facing Tests** = The truth about how your code works
202
+ - **Together** = Complete confidence without over-testing
203
+
204
+ This architecture prevents both the "no tests" disaster AND the "too many tests" paralysis. You test what matters, when it matters, at the level that matters.
205
+
206
+ ---
207
+
208
+ ## The Altitude Framework
209
+
210
+ ### Three Altitudes of Development
211
+
212
+ **Project Altitude (Strategic - months/years)**
213
+ - Discovery Mode: "What should I build?"
214
+ - Speed Mode: "Make it work"
215
+ - Production Mode: "Make it reliable"
216
+
217
+ **Feature Altitude (Tactical - days/weeks)**
218
+ - Inherits ceiling from Project Altitude
219
+ - Can be lower than project, never higher
220
+ - Own mini-progression within project constraints
221
+
222
+ **Task Altitude (Operational - hours)**
223
+ - Single mode per task
224
+ - No progression
225
+ - Determined by Feature and Project context
226
+
227
+ ### Mode Selection Matrix
228
+
229
+ ```
230
+ CLARITY + RISK = MODE
231
+
232
+ Low Clarity + Low Risk = Discovery Mode
233
+ High Clarity + Low Risk = Speed Mode
234
+ High Clarity + High Risk = Production Mode
235
+ Low Clarity + High Risk = STOP (Discovery first, then Production)
236
+ ```
237
+
238
+ ### Altitude Constraints
239
+
240
+ - **Project in Discovery** → Everything is Discovery
241
+ - **Project in Speed** → Features can be Discovery or Speed (never Production)
242
+ - **Project in Production** → Features can be any mode (default to Production)
243
+
244
+ ---
245
+
246
+ ## Mode Specifications
247
+
248
+ ### Discovery Mode
249
+ **Purpose:** Figure out what to build through exploration
250
+
251
+ **Core Approach:**
252
+ - Build multiple prototypes to explore 3 levels of complexity
253
+ - Change everything freely
254
+ - Learn what works
255
+ - No standards needed
256
+
257
+ ### Speed Mode
258
+ **Purpose:** Ship working software quickly
259
+
260
+ **Core Approach:**
261
+ - Simplest implementation that works
262
+ - Cut every corner that doesn't matter
263
+ - Progressive standards emerge naturally
264
+ - Ship in hours, not days
265
+
266
+ ### Production Mode
267
+ **Purpose:** Build reliable systems
268
+
269
+ **Core Approach:**
270
+ - Comprehensive test coverage
271
+ - Handle all edge cases
272
+ - Security and monitoring built-in
273
+ - Full standards enforcement
274
+
275
+ ### Recovery Mode
276
+ **Purpose:** Fix what's broken
277
+
278
+ **Core Approach:**
279
+ - Stop the bleeding first
280
+ - Reproduce the issue with tests
281
+ - Fix systematically
282
+ - Return to previous mode when stable
283
+
284
+ ---
285
+
286
+ ## Use Cases
287
+
288
+ ### Starting a New Project
289
+
290
+ #### Discovery Mode: Starting a New Project
291
+
292
+ **The Situation**
293
+ You have an idea but aren't sure exactly what to build. Multiple approaches seem viable. You need to explore before committing.
294
+
295
+ **The Goal**
296
+ Achieve clarity on your happy path - what's the core workflow that delivers value. You don't need to understand edge cases or full requirements, just the main thing users will do repeatedly. Test assumptions cheaply. Find the simplest version that resonates.
297
+
298
+ **The Approach**
299
+ Build 3 working prototypes at different complexity levels (simple/medium/ambitious). Understand pros and cons of each. Ask AI what it considered but didn't pitch for each level - there might be bad assumptions. Test with real people (not friends). Let usage guide your decision.
300
+
301
+ **Gherkin Scenarios**
302
+ ```gherkin
303
+ # Prototype 1: Task-based approach
304
+ Scenario: User completes a task
305
+ Given I have work to do
306
+ When I use approach 1
307
+ Then I see if this helps
308
+
309
+ # Prototype 2: Timeline-based approach
310
+ Scenario: User views their timeline
311
+ Given I want to see my history
312
+ When I use approach 2
313
+ Then I learn if this is better
314
+
315
+ # Keep scenarios vague - you're learning
316
+ ```
317
+
318
+ **Technical Checklist**
319
+ - [ ] Each prototype in separate file
320
+ - [ ] No shared code between prototypes
321
+ - [ ] Use CDNs, no build process
322
+ - [ ] Deploy each to separate URL
323
+ - [ ] Built in hours, not days
324
+ - [ ] No auth, no database
325
+ - [ ] Different UI paradigms
326
+
327
+ **Claude Prompting Strategy**
328
+ ```
329
+ ## YOUR PRIORITY
330
+ Help the user figure out what they want to build by showing options.
331
+
332
+ ## AUTOMATIC BEHAVIOR
333
+ For ANY feature request, ALWAYS respond with this format:
334
+
335
+ "I'll show you 3 different approaches for [specific feature/task]:
336
+
337
+ **Option 1: Simple**
338
+ [Brief description - quickest to build]
339
+ - **Pros**: ✅ [2-3 specific advantages]
340
+ - **Cons**: ❌ [2-3 specific trade-offs]
341
+ - **Time to build**: [estimate]
342
+
343
+ **Option 2: Balanced**
344
+ [Brief description - good mix of features and effort]
345
+ - **Pros**: ✅ [2-3 specific advantages]
346
+ - **Cons**: ❌ [2-3 specific trade-offs]
347
+ - **Time to build**: [estimate]
348
+
349
+ **Option 3: Advanced**
350
+ [Brief description - most features, most complex]
351
+ - **Pros**: ✅ [2-3 specific advantages]
352
+ - **Cons**: ❌ [2-3 specific trade-offs]
353
+ - **Time to build**: [estimate]
354
+
355
+ **Additional options considered but not recommended:**
356
+ - *Simple alternative*: [Brief description] - Not selected because [1-line reason]
357
+ - *Balanced alternative*: [Brief description] - Not selected because [1-line reason]
358
+ - *Advanced alternative*: [Brief description] - Not selected because [1-line reason]
359
+
360
+ **Would you like me to create working prototypes of these options?**
361
+
362
+ If yes, which ones interest you most? Or should we refine the approach first?"
363
+
364
+ ONLY after user confirms, create the requested prototypes.
365
+
366
+ ## TECHNICAL APPROACH FOR PROTOTYPES
367
+ - Each prototype should be functional
368
+ - Use different techniques to show trade-offs
369
+ - Show different technical approaches when relevant
370
+
371
+ ## DISCOVERY MODE RULES
372
+ 1. Always show 3 options, even if the user seems certain
373
+ 2. Create actual working prototypes, not just descriptions
374
+ 3. Highlight trade-offs clearly (time, complexity, maintenance)
375
+ 4. After showing options, ask: "Which approach resonates with you?"
376
+ 5. Keep prototypes simple enough to understand
377
+ 6. Use comments to explain key differences
378
+
379
+ ## PROTOTYPE FILE NAMING
380
+ When creating prototypes, ALWAYS use this naming convention:
381
+ - Place in `/prototypes/` directory
382
+ - Name format: `[YYYY-MM-DD]-[feature-name]-option[1-3]-[complexity].js`
383
+ - Examples:
384
+ - `2025-09-02-search-option1-simple.js`
385
+ - `2025-09-02-search-option2-balanced.js`
386
+ - `2025-09-02-search-option3-advanced.js`
387
+
388
+ ## EXPLORATION AREAS
389
+ When exploring options, consider variations in:
390
+ - Architecture patterns (MVC, Component-based, Functional)
391
+ - State management (Local, Context, Redux, Zustand)
392
+ - Styling approaches (CSS, CSS-in-JS, Tailwind, Component libraries)
393
+ - Data fetching (fetch, axios, SWR, React Query)
394
+ - Testing strategies (No tests, Unit tests, Integration, E2E)
395
+ - Build complexity (CRA, Vite, Next.js, Custom webpack)
396
+ - Type safety (JavaScript, TypeScript, PropTypes)
397
+ - Performance optimization levels
398
+ ```
399
+
400
+ **Common Pitfalls**
401
+ - Building one "perfect" version instead of multiple rough ones
402
+ - Asking friends instead of strangers for feedback
403
+ - Adding features instead of testing core concept
404
+ - Analysis paralysis - not shipping anything
405
+
406
+ **Graduation Criteria**
407
+ - Clear winner emerges from prototypes → Speed Mode
408
+ - Still confused after 3+ prototypes → More Discovery
409
+ - None resonate → Consider different problem
410
+
411
+ **Real Example**
412
+ "For my workout tracker, I built three prototypes:
413
+ 1. Simple list with checkboxes (30 minutes)
414
+ 2. Calendar view with dots for completed days (45 minutes)
415
+ 3. Graph showing progressive overload (1 hour)
416
+
417
+ The calendar view immediately clicked with testers. Threw away the others, moved to Speed Mode with calendar approach."
418
+
419
+ ---
420
+
421
+ #### Speed Mode: Starting a New Project
422
+
423
+ **The Situation**
424
+ You know exactly what to build. The approach is clear from Discovery Mode or prior experience. You just need to ship it fast and see if it's actually useful. This is about building momentum, not perfection.
425
+
426
+ **The Goal**
427
+ Ship working software in 1-2 hours typically, 4 hours absolute maximum. Get it in users' hands TODAY. Build momentum through visible progress. Remember: momentum over perfection, code is cheap, slow is smooth and smooth is fast.
428
+
429
+ **The Philosophy**
430
+ Speed Mode isn't about being sloppy - it's about being ruthlessly focused. Every line of code either delivers core value or it doesn't exist. You're testing if this thing should exist, not building the perfect version of it. Tests are still truth, but only 3-5 truths matter right now.
431
+
432
+ **The Approach**
433
+ One file to rule them all. Every feature that isn't core value gets cut. localStorage is your database. Tailwind CDN is your design system. Your laptop is your CI/CD. Ship to a static hosting service with one click (Netlify, Vercel, Surge, GitHub Pages, Cloudflare Pages - whatever's fastest for you). If it takes more than 2 hours, you're probably over-building. If it takes more than 4 hours, you're definitely in the wrong mode.
434
+
435
+ **Gherkin Scenarios (Write These FIRST)**
436
+ ```gherkin
437
+ Feature: [One-Line Description of Core Value]
438
+ # These 3-5 scenarios ARE your product spec
439
+ # If it's not in these scenarios, it doesn't exist
440
+
441
+ Scenario: The Happy Path
442
+ Given I'm a user with [specific problem]
443
+ When I [do the main action]
444
+ Then [problem is measurably solved]
445
+ # This is THE scenario that matters most
446
+
447
+ Scenario: Data Persists
448
+ Given I did work in the app
449
+ When I refresh/return later
450
+ Then my work is still there
451
+ # localStorage must work or users will hate you
452
+
453
+ Scenario: Core Interaction Feels Good
454
+ Given I'm using the app
455
+ When I perform [most common action]
456
+ Then it responds in under 100ms
457
+ And I can see what happened
458
+ # Speed of feedback is a feature
459
+
460
+ # MAXIMUM 5 scenarios. Not 6. Not "just this one more."
461
+ # These tests ARE your documentation
462
+ ```
463
+
464
+ **Technical Checklist**
465
+ - [ ] Write 3-5 Gherkin scenarios FIRST (10-15 min)
466
+ - [ ] Single HTML file with <script> tags OR single React component
467
+ - [ ] localStorage for ALL persistence (no databases, no backends)
468
+ - [ ] Tailwind via CDN for styling (no custom CSS files)
469
+ - [ ] No auth unless it's literally the core feature
470
+ - [ ] No build process (if you're running npm build, you're doing it wrong)
471
+ - [ ] Deploy via drag-and-drop or CLI to static hosting (Netlify, Vercel, Surge, GitHub Pages, etc.)
472
+ - [ ] Works on mobile (test on your phone before shipping)
473
+ - [ ] Tests can run by opening the HTML file
474
+ - [ ] Commit working code every 30 minutes
475
+
476
+ **Claude Prompting Strategy**
477
+ ```
478
+ ## SPEED MODE CONTEXT
479
+ You are helping me ship working software in 1-2 hours (4 hours absolute max).
480
+ Momentum over perfection. Tests are truth but keep it minimal.
481
+
482
+ ## THE SCENARIOS (These ARE the spec)
483
+ [Paste your 3-5 Gherkin scenarios]
484
+
485
+ ## YOUR CONSTRAINTS
486
+ 1. Single file application (HTML with scripts OR single React component)
487
+ 2. localStorage for all persistence (no backend, no database)
488
+ 3. Tailwind CDN for all styling (no custom CSS)
489
+ 4. Must pass these exact scenarios - nothing more
490
+ 5. Simplest possible implementation that works
491
+ 6. No features beyond these scenarios
492
+ 7. Comments only where the code is genuinely surprising
493
+
494
+ ## TECHNICAL APPROACH
495
+ - Start with the HTML structure
496
+ - Add the simplest possible state management
497
+ - Use onclick handlers, not complex event systems
498
+ - Use array methods liberally (map, filter, reduce)
499
+ - Use template literals for rendering
500
+ - If using React, useState only (no Context, no Redux)
501
+ - Error handling: console.error is fine
502
+ - Loading states: not needed if fast enough
503
+
504
+ ## WHAT SUCCESS LOOKS LIKE
505
+ The app works, deploys in one click, and users can immediately understand it.
506
+ If you're explaining how to set it up, you've failed.
507
+
508
+ Start with the HTML structure and the simplest possible way to pass the first scenario.
509
+ ```
510
+
511
+ **The Speed Mode Mantras**
512
+ - "If it's not in the test, it doesn't exist"
513
+ - "Every feature that can be cut should be cut"
514
+ - "localhost to user feedback in 1-2 hours"
515
+ - "Code is cheap, throw it all away tomorrow if needed"
516
+ - "Ship broken rather than perfect"
517
+ - "Momentum over perfection"
518
+ - "If it's taking 4 hours, you're building too much"
519
+
520
+ **Common Pitfalls**
521
+ - **The "Just One More Feature" Trap**: After each scenario passes, you think of something else. DON'T. Ship what you have.
522
+ - **The "Proper Setup" Trap**: Installing webpack, setting up ESLint, configuring TypeScript. You've already failed.
523
+ - **The "Future Scale" Trap**: "What if 1000 users..." You don't have 10 users. Stop it.
524
+ - **The "Code Quality" Trap**: Refactoring before shipping. The code works. Ship it.
525
+ - **The "Edge Case" Trap**: "What about users who..." They'll tell you if it matters.
526
+ - **The "Documentation" Trap**: Writing README files. Your 5 scenarios ARE the docs.
527
+
528
+ **The Realistic Timeline**
529
+ ```
530
+ 30 minutes: Scenarios written, HTML structure, first test passing
531
+ 1 hour: Core functionality working, 3+ tests passing
532
+ 1.5 hours: All tests passing, deployed, getting feedback
533
+
534
+ If you're still coding at:
535
+ 2 hours: You're probably adding unnecessary features
536
+ 3 hours: You're definitely over-building
537
+ 4 hours: Wrong mode, abort mission
538
+ ```
539
+
540
+ **Graduation Criteria**
541
+ - **To Production Mode**: 10+ real users actively using AND handling sensitive data
542
+ - **Stay in Speed Mode**: Core value validated, users want more features
543
+ - **Back to Discovery**: Users confused, not solving the problem, engagement drops
544
+ - **To Recovery**: You broke something that was working
545
+
546
+ **Real Example (With Actual Timeline)**
547
+ ```
548
+ "Built a daily standup tool in 90 minutes:
549
+
550
+ Minute 0-10: Wrote 4 scenarios
551
+ 1. Create today's update
552
+ 2. See yesterday's update
553
+ 3. Mark blockers
554
+ 4. Data persists
555
+
556
+ Minute 10-30: HTML structure + first scenario
557
+ - Form with 3 textareas (yesterday/today/blockers)
558
+ - Save button
559
+ - localStorage.setItem on save
560
+
561
+ Minute 30-60: All core features
562
+ - Show previous update on load
563
+ - Clear form after save
564
+ - Add date stamps
565
+
566
+ Minute 60-80: Quick polish
567
+ - Tailwind styling (just enough)
568
+ - Character counts
569
+ - Keyboard shortcut (Cmd+Enter to save)
570
+
571
+ Minute 80-90: Deployed
572
+ - Dragged folder to Netlify
573
+ - Shared link in Slack
574
+ - First feedback: 'Can we have history?'
575
+ - Me: 'Great idea for tomorrow!'
576
+
577
+ Total lines of code: 147
578
+ Total time: 1.5 hours
579
+ Total user value: Replaced $50/mo SaaS tool"
580
+ ```
581
+
582
+ **The Speed Mode Checklist Before Shipping**
583
+ ```
584
+ □ All 3-5 scenarios passing?
585
+ □ Deployable with one click?
586
+ □ Works on your phone?
587
+ □ Could your mom understand what it does?
588
+ □ Did this take less than 2 hours? (Good!)
589
+ □ Did this take less than 4 hours? (Acceptable)
590
+
591
+ If all checked → SHIP IT NOW
592
+ If took more than 4 hours → You're not in Speed Mode
593
+ ```
594
+
595
+ ---
596
+
597
+ #### Production Mode: Starting a New Project
598
+
599
+ **⚠️ WARNING: This is almost never the right choice**
600
+
601
+ **The Situation**
602
+ You're considering starting in Production Mode because you're handling sensitive data or replacing a critical system. STOP. You're probably wrong. Even with sensitive data, start in Speed Mode with fake data. You need to learn what you're actually building first.
603
+
604
+ **The ONLY Valid Reasons to Start Here:**
605
+ 1. You're rebuilding something that already exists with EXACT requirements
606
+ 2. You have complete specifications from an existing system
607
+ 3. You've built this exact thing before multiple times
608
+ 4. There are regulatory requirements from day one AND you can't use fake data
609
+
610
+ **If any doubt exists → Start in Speed Mode with fake data**
611
+
612
+ **Why Starting Here Is Usually Wrong**
613
+ Starting in Production Mode means you're optimizing for problems you don't have yet. You'll build abstractions for requirements that will change. You'll add security for threats that don't exist. You'll create architecture for scale you'll never reach. Meanwhile, you won't ship anything for weeks, losing momentum and learning nothing about what users actually need.
614
+
615
+ **The Reality Check**
616
+ ```
617
+ "I'm handling payment data" → Use Speed Mode with Stripe test mode
618
+ "It's healthcare data" → Use Speed Mode with fake patients
619
+ "It's replacing a critical system" → Use Speed Mode as a prototype first
620
+ "It needs to be secure" → Speed Mode code with fake data IS secure
621
+ "What if we get hacked?" → You have zero users
622
+ "But technical debt!" → Code is cheap, throw it away later
623
+ ```
624
+
625
+ **If You Actually Need to Start in Production Mode**
626
+ This should feel constraining - like coding with heavy gloves on. You're choosing to move 10x slower to avoid risks that probably don't exist yet. Make sure you're certain about the requirements because changes will be expensive.
627
+
628
+ **The Approach**
629
+ Since you've decided to start here: Full test coverage before features. Real auth service from day one. Real database with migrations. Monitoring and logging from the start. Security review before first deploy. This will take weeks, not hours.
630
+
631
+ **Gherkin Scenarios (Need Clear Requirements)**
632
+ ```gherkin
633
+ Feature: Production-Ready Foundation
634
+ # These should be exact requirements that won't change
635
+
636
+ Background:
637
+ Given proper authentication system
638
+ And comprehensive audit logging
639
+ And complete input validation
640
+ # You're paying for this complexity upfront
641
+
642
+ Scenario: User registration with full validation
643
+ Given a new user registration attempt
644
+ When they provide valid data
645
+ Then account created with proper encryption
646
+ And email verified through double opt-in
647
+ And audit trail captures every field
648
+ And GDPR consent recorded
649
+ And rate limiting applied
650
+ # Make sure you actually need all this
651
+
652
+ Scenario: Concurrent operations handling
653
+ Given multiple simultaneous database writes
654
+ When conflicts occur
655
+ Then transactions maintain ACID properties
656
+ And optimistic locking prevents corruption
657
+ And retry logic handles transient failures
658
+ # This complexity should be necessary
659
+ ```
660
+
661
+ **Technical Checklist (Weeks of Work)**
662
+ - [ ] Complete test suite (100+ scenarios)
663
+ - [ ] Auth service (Auth0/Clerk/Supabase)
664
+ - [ ] PostgreSQL with migration strategy
665
+ - [ ] Secrets management system
666
+ - [ ] Input validation on every field
667
+ - [ ] Error tracking (Sentry)
668
+ - [ ] Structured logging (with log aggregation)
669
+ - [ ] API rate limiting by user and IP
670
+ - [ ] Automated backup strategy
671
+ - [ ] CI/CD pipeline with multiple environments
672
+ - [ ] Staging environment matching production
673
+ - [ ] Security scanning in pipeline
674
+ - [ ] Load testing infrastructure
675
+ - [ ] Monitoring and alerting
676
+ - [ ] Incident response playbooks
677
+
678
+ **The Realistic Timeline**
679
+ ```
680
+ Week 1: Setting up infrastructure, still no features
681
+ Week 2: Auth system, still no value delivered
682
+ Week 3: Data model and migrations, users getting impatient
683
+ Week 4: First actual feature, realize requirements were wrong
684
+ Week 5: Refactoring to match actual needs
685
+ Week 6: Wishing you'd started with Speed Mode
686
+ ```
687
+
688
+ **Common Pitfalls (Besides Starting Here)**
689
+ - Building for 1000 users when you don't have 1
690
+ - "Proper" architecture that doesn't match actual needs
691
+ - Security theater for non-existent threats
692
+ - Premature optimization everywhere
693
+ - Analysis paralysis on every decision
694
+ - Never actually shipping anything
695
+
696
+ **Graduation Criteria**
697
+ - Not applicable - you started at the end
698
+ - When requirements change → Consider if Speed Mode would help you learn faster
699
+
700
+ **A More Realistic Example**
701
+ ```
702
+ "Building a healthcare appointment system:
703
+
704
+ What works better:
705
+ Day 1: Speed Mode with fake patients
706
+ Day 2: Learned the workflow was wrong
707
+ Day 3: Rebuilt with correct workflow
708
+ Week 2: 50 beta users with fake data
709
+ Week 3: Validated all assumptions
710
+ Week 4: NOW move to Production Mode with real requirements
711
+
712
+ What happens when you start in Production:
713
+ Week 1-2: Built auth and data model
714
+ Week 3-4: Built features based on assumptions
715
+ Week 5-6: Realized assumptions were wrong
716
+ Week 7-8: Rebuilt in Speed Mode to learn
717
+ Total time lost: 4 weeks"
718
+ ```
719
+
720
+ **The Bottom Line**
721
+ If you're reading this section to start a new project, you're probably in the wrong section. Go back to Speed Mode. Build with fake data. Learn what you actually need. Then come back here to add Production features to your working Speed Mode code.
722
+
723
+ **Remember: Tests are truth, but you don't know what truth is yet.**
724
+
725
+ ---
726
+
727
+ ### Building New Features
728
+
729
+ #### Discovery Mode: Building New Features
730
+
731
+ **The Situation**
732
+ Your project is stable but you're not sure what feature to add next. Multiple user requests but unclear which matters. Need to test feature-market fit.
733
+
734
+ **The Goal**
735
+ Figure out what feature actually adds value. Test different approaches without destabilizing your working app.
736
+
737
+ **The Approach**
738
+ Build feature prototypes separately from main app. Test with subset of users. Use feature flags or separate URLs.
739
+
740
+ **Gherkin Scenarios**
741
+ ```gherkin
742
+ # Exploring feature value
743
+ Scenario: Feature might solve problem
744
+ Given user has [potential problem]
745
+ When they try [feature approach]
746
+ Then we learn if this helps
747
+
748
+ # Multiple variants to test
749
+ Scenario: Variant A
750
+ Given the feature works like X
751
+ When user interacts
752
+ Then measure engagement
753
+
754
+ Scenario: Variant B
755
+ Given the feature works like Y
756
+ When user interacts
757
+ Then compare to variant A
758
+ ```
759
+
760
+ **Technical Checklist**
761
+ - [ ] Separate prototype files
762
+ - [ ] Feature flags for testing
763
+ - [ ] Analytics to measure usage
764
+ - [ ] Quick user feedback loops
765
+ - [ ] No integration with core yet
766
+ - [ ] Time-boxed exploration
767
+
768
+ **Claude Prompting Strategy**
769
+ ```
770
+ "I need to explore adding [feature] to my [app].
771
+ Create 3 different approaches:
772
+ 1. [Simple version]
773
+ 2. [Different paradigm]
774
+ 3. [Ambitious version]
775
+
776
+ Build each as standalone prototype.
777
+ Must be testable independently."
778
+ ```
779
+
780
+ **Common Pitfalls**
781
+ - Building the feature fully before validating
782
+ - Testing with existing users only (bias)
783
+ - Integration before validation
784
+ - Analysis paralysis on approach
785
+
786
+ **Graduation Criteria**
787
+ - Clear approach validated → Speed Mode
788
+ - Feature doesn't resonate → Kill it
789
+ - Need more data → More Discovery
790
+
791
+ **Real Example**
792
+ "Testing 'social features' for workout app:
793
+ - Built 3 prototypes: comments, kudos, challenges
794
+ - Deployed each to different test groups
795
+ - Kudos had 80% engagement, others <20%
796
+ - Moved kudos to Speed Mode, killed others"
797
+
798
+ ---
799
+
800
+ #### Speed Mode: Building New Features
801
+
802
+ **The Situation**
803
+ Your project is in Speed Mode and working well. Users are asking for a specific feature. You know what to build.
804
+
805
+ **The Goal**
806
+ Add value quickly without breaking what works. Maintain momentum. Ship to users within hours.
807
+
808
+ **The Approach**
809
+ Add feature in isolation. Minimal integration with existing code. Ship behind feature flag if risky. 2-hour timebox.
810
+
811
+ **Gherkin Scenarios**
812
+ ```gherkin
813
+ Feature: [New Feature Name]
814
+
815
+ Scenario: Feature delivers value
816
+ Given existing user workflow
817
+ When new feature is used
818
+ Then clear value delivered
819
+
820
+ Scenario: Doesn't break existing
821
+ Given current functionality
822
+ When new feature added
823
+ Then old features still work
824
+
825
+ Scenario: Data consistency
826
+ Given feature creates data
827
+ When app restarts
828
+ Then data persists correctly
829
+
830
+ # 3-5 scenarios max for speed
831
+ ```
832
+
833
+ **Technical Checklist**
834
+ - [ ] 2-hour implementation timebox
835
+ - [ ] Feature flag optional but nice
836
+ - [ ] Minimal refactoring of existing
837
+ - [ ] New code in separate functions
838
+ - [ ] Basic error handling only
839
+ - [ ] Ship same day
840
+ - [ ] Test with real users immediately
841
+
842
+ **Claude Prompting Strategy**
843
+ ```
844
+ "Current app: [brief context or paste main file]
845
+ Current tests: [paste existing scenarios]
846
+
847
+ Add this feature: [description]
848
+ New scenarios to pass: [3-5 new scenarios]
849
+
850
+ Requirements:
851
+ - Don't break existing tests
852
+ - Minimal changes to current code
853
+ - Ship within 2 hours
854
+ - Feature flag: ENABLE_[FEATURE]"
855
+ ```
856
+
857
+ **Common Pitfalls**
858
+ - Scope creep - "while we're at it"
859
+ - Refactoring existing code unnecessarily
860
+ - Over-engineering for future
861
+ - Not shipping same day
862
+ - Too many test scenarios
863
+
864
+ **Graduation Criteria**
865
+ - Feature working + users happy → Stay in Speed
866
+ - Feature critical to business → Elevate to Production
867
+ - Feature unused after week → Remove it
868
+
869
+ **Real Example**
870
+ "Adding search to expense tracker:
871
+ - 90 minutes total
872
+ - Added searchTerm to state
873
+ - Filter function before display
874
+ - Three tests: search by name, amount, category
875
+ - Shipped via feature flag
876
+ - 100% adoption within 3 days"
877
+
878
+ ---
879
+
880
+ #### Production Mode: Building New Features
881
+
882
+ **The Situation**
883
+ Your project is in Production with real users depending on it. Adding a feature that touches critical paths or handles sensitive data.
884
+
885
+ **The Goal**
886
+ Add feature without compromising reliability. Maintain security and performance. Enable confident iteration.
887
+
888
+ **The Approach**
889
+ Full test coverage before implementation. Gradual rollout. Performance testing. Security review. Monitoring from day one.
890
+
891
+ **Gherkin Scenarios**
892
+ ```gherkin
893
+ Feature: Production-Grade [Feature]
894
+
895
+ Scenario: Happy path
896
+ Given perfect conditions
897
+ When feature is used
898
+ Then expected outcome
899
+ And performance maintained
900
+ And audit logged
901
+
902
+ Scenario Outline: Edge cases
903
+ Given <edge_condition>
904
+ When feature is used
905
+ Then <graceful_handling>
906
+
907
+ Examples:
908
+ | edge_condition | graceful_handling |
909
+ | null input | validation error |
910
+ | concurrent use | locks properly |
911
+ | malicious input | sanitized |
912
+
913
+ Scenario: Load testing
914
+ Given 100 concurrent users
915
+ When all use feature
916
+ Then response time < 200ms
917
+ And no data corruption
918
+
919
+ Scenario: Rollback safety
920
+ Given feature is enabled
921
+ When critical error occurs
922
+ Then feature auto-disables
923
+ And system continues working
924
+ ```
925
+
926
+ **Technical Checklist**
927
+ - [ ] Design doc reviewed
928
+ - [ ] Full test suite first
929
+ - [ ] Database migrations safe
930
+ - [ ] API versioning considered
931
+ - [ ] Feature flags required
932
+ - [ ] Performance benchmarked
933
+ - [ ] Security reviewed
934
+ - [ ] Monitoring configured
935
+ - [ ] Rollback plan documented
936
+ - [ ] Gradual rollout planned
937
+
938
+ **Claude Prompting Strategy**
939
+ ```
940
+ "Production feature addition:
941
+ System context: [architecture overview]
942
+ Current tests: [existing test suite]
943
+ Feature requirements: [detailed spec]
944
+ New scenarios: [comprehensive Gherkin]
945
+
946
+ Requirements:
947
+ - Full error handling
948
+ - Transaction safety
949
+ - Performance optimization
950
+ - Security validation
951
+ - Monitoring integration
952
+ - Migration safety
953
+
954
+ Start with implementation plan."
955
+ ```
956
+
957
+ **Common Pitfalls**
958
+ - Rushing due to pressure
959
+ - Skipping load testing
960
+ - No rollback plan
961
+ - Inadequate monitoring
962
+ - Breaking API contracts
963
+
964
+ **Graduation Criteria**
965
+ - Feature stable for 30 days → Success
966
+ - Issues in production → Recovery Mode
967
+ - Feature complete → Back to Speed for next feature
968
+
969
+ **Real Example**
970
+ "Adding payment processing:
971
+ Week 1: Stripe integration design, security review
972
+ Week 2: Test suite (50+ scenarios), implementation
973
+ Week 3: Load testing, security scan
974
+ Week 4: Gradual rollout (1%, 10%, 50%, 100%)
975
+ Zero payment failures in first month"
976
+
977
+ ---
978
+
979
+ ### Refactoring
980
+
981
+ #### Speed Mode: Refactoring
982
+
983
+ **The Situation**
984
+ Your Speed Mode code is getting messy. Files too long. Duplication appearing. Still works but harder to maintain.
985
+
986
+ **The Goal**
987
+ Reduce daily friction without stopping progress. Make code maintainable enough to keep shipping.
988
+
989
+ **The Approach**
990
+ Extract obvious components. Improve naming. Remove duplication. Keep all tests passing. Don't add features.
991
+
992
+ **Gherkin Scenarios**
993
+ ```gherkin
994
+ # Tests don't change during refactoring!
995
+ # These ensure behavior stays the same:
996
+
997
+ Scenario: All existing features still work
998
+ Given each existing test
999
+ When run after refactoring
1000
+ Then all still pass
1001
+
1002
+ Scenario: Performance maintained
1003
+ Given current response times
1004
+ When code is refactored
1005
+ Then same or better performance
1006
+
1007
+ # No new scenarios - refactoring only
1008
+ ```
1009
+
1010
+ **Technical Checklist**
1011
+ - [ ] One refactor type at a time
1012
+ - [ ] Tests passing after each change
1013
+ - [ ] Commit after each successful refactor
1014
+ - [ ] No new features during refactor
1015
+ - [ ] Time-box to 2 hours
1016
+ - [ ] Focus on biggest pain points
1017
+
1018
+ **Claude Prompting Strategy**
1019
+ ```
1020
+ "Refactor this code for better organization:
1021
+ [paste current code]
1022
+ Current tests: [paste tests]
1023
+
1024
+ Refactoring goals:
1025
+ - Extract [component] into separate function
1026
+ - Rename variables for clarity
1027
+ - Remove duplication in [area]
1028
+
1029
+ Keep all tests passing. No behavior changes."
1030
+ ```
1031
+
1032
+ **Common Pitfalls**
1033
+ - Refactoring everything at once
1034
+ - Adding features during refactoring
1035
+ - Breaking tests and "fixing later"
1036
+ - Over-abstracting
1037
+ - Refactoring without clear goal
1038
+
1039
+ **Graduation Criteria**
1040
+ - Code maintainable → Continue building
1041
+ - Still messy → Another refactor session
1042
+ - Tests failing → Recovery Mode
1043
+
1044
+ **Real Example**
1045
+ "Expense tracker refactor:
1046
+ - 500 line component → 5 files
1047
+ - Extracted: ExpenseForm, ExpenseList, calculations
1048
+ - Renamed: 'x', 'temp', 'data' → meaningful names
1049
+ - All tests still passing
1050
+ - 2 hours total, much easier to work with"
1051
+
1052
+ ---
1053
+
1054
+ #### Production Mode: Refactoring
1055
+
1056
+ **The Situation**
1057
+ Production system needs architectural changes. Performance issues. Technical debt affecting reliability. Team struggling with complexity.
1058
+
1059
+ **The Goal**
1060
+ Improve system maintainability without disrupting service. Enable faster future development. Reduce operational burden.
1061
+
1062
+ **The Approach**
1063
+ Add comprehensive tests for current behavior. Refactor with safety net. Measure everything. Deploy carefully with rollback ready.
1064
+
1065
+ **Gherkin Scenarios**
1066
+ ```gherkin
1067
+ Feature: Refactoring Safety
1068
+
1069
+ Scenario: Behavior preservation
1070
+ Given all current functionality
1071
+ When refactoring complete
1072
+ Then identical behavior
1073
+ And all tests still pass
1074
+
1075
+ Scenario: Performance improvement
1076
+ Given current metrics baseline
1077
+ When refactored code runs
1078
+ Then performance same or better
1079
+ And resource usage reduced
1080
+
1081
+ Scenario: Backward compatibility
1082
+ Given existing API contracts
1083
+ When refactoring deployed
1084
+ Then all contracts honored
1085
+ And no breaking changes
1086
+
1087
+ Scenario: Safe rollback
1088
+ Given refactored version live
1089
+ When issues detected
1090
+ Then rollback without data loss
1091
+ And service continues
1092
+ ```
1093
+
1094
+ **Technical Checklist**
1095
+ - [ ] Current behavior fully tested
1096
+ - [ ] Performance baseline measured
1097
+ - [ ] Refactor plan reviewed
1098
+ - [ ] Changes behind feature flags
1099
+ - [ ] Blue-green deployment ready
1100
+ - [ ] Monitoring enhanced
1101
+ - [ ] Load testing completed
1102
+ - [ ] Rollback tested
1103
+ - [ ] Team informed
1104
+ - [ ] Documentation updated
1105
+
1106
+ **Claude Prompting Strategy**
1107
+ ```
1108
+ "Production refactoring needed:
1109
+ Current implementation: [code]
1110
+ Test suite: [comprehensive tests]
1111
+ Performance baseline: [metrics]
1112
+ Pain points: [specific issues]
1113
+
1114
+ Refactoring goals:
1115
+ - [Specific improvements]
1116
+ - Maintain backward compatibility
1117
+ - Improve performance
1118
+ - Increase maintainability
1119
+
1120
+ Provide refactoring plan first, then implementation."
1121
+ ```
1122
+
1123
+ **Common Pitfalls**
1124
+ - Refactoring without complete tests
1125
+ - Big bang deployment
1126
+ - No performance measurement
1127
+ - Breaking API contracts
1128
+ - No rollback plan
1129
+
1130
+ **Graduation Criteria**
1131
+ - Refactoring complete, stable → Normal operation
1132
+ - Issues discovered → Recovery Mode
1133
+ - More refactoring needed → Plan next phase
1134
+
1135
+ **Real Example**
1136
+ "Database query optimization:
1137
+ - Added query performance tests
1138
+ - Measured: 2s average response time
1139
+ - Refactored to use indexes, better joins
1140
+ - Deployed behind flag to 10% traffic
1141
+ - Measured: 200ms response time
1142
+ - Gradual rollout over 1 week
1143
+ - 10x performance improvement, zero downtime"
1144
+
1145
+ ---
1146
+
1147
+ ### Recovery Mode
1148
+
1149
+ #### Recovery Mode: Any Situation
1150
+
1151
+ **The Situation**
1152
+ Something is broken in production. Users affected. Data potentially at risk. You need to fix it NOW.
1153
+
1154
+ **The Goal**
1155
+ Stop the bleeding immediately. Restore service. Fix root cause. Prevent recurrence.
1156
+
1157
+ **The Approach**
1158
+ Follow the protocol: Disable/rollback first, communicate, reproduce with test, fix systematically, add regression tests.
1159
+
1160
+ **Gherkin Scenarios**
1161
+ ```gherkin
1162
+ Feature: Bug Reproduction and Fix
1163
+
1164
+ Scenario: Reproduce the exact bug
1165
+ Given the exact failing conditions
1166
+ When the broken action occurs
1167
+ Then bug manifests (test fails)
1168
+ # This test SHOULD fail initially
1169
+
1170
+ Scenario: Verify the fix
1171
+ Given the same conditions
1172
+ When fix is applied
1173
+ Then bug no longer occurs
1174
+ And no new issues introduced
1175
+
1176
+ Scenario: Regression prevention
1177
+ Given various related inputs
1178
+ When system processes them
1179
+ Then no similar bugs possible
1180
+ ```
1181
+
1182
+ **Technical Checklist**
1183
+ - [ ] Service stabilized first
1184
+ - [ ] Users notified
1185
+ - [ ] Bug reproduced in test
1186
+ - [ ] Root cause identified
1187
+ - [ ] Fix implemented
1188
+ - [ ] All tests passing
1189
+ - [ ] Similar code checked
1190
+ - [ ] Monitoring added
1191
+ - [ ] Postmortem written
1192
+ - [ ] Regression tests added
1193
+
1194
+ **Claude Prompting Strategy**
1195
+ ```
1196
+ "URGENT: Production issue
1197
+ Symptoms: [what's broken]
1198
+ Error messages: [paste any errors]
1199
+ Recent changes: [what changed]
1200
+ Current code: [paste relevant code]
1201
+
1202
+ Need:
1203
+ 1. Immediate mitigation
1204
+ 2. Root cause analysis
1205
+ 3. Fix that won't break other things
1206
+ 4. Tests to prevent recurrence"
1207
+ ```
1208
+
1209
+ **Common Pitfalls**
1210
+ - Fixing without understanding
1211
+ - Making multiple changes at once
1212
+ - Not communicating with users
1213
+ - Forgetting to add regression tests
1214
+ - Not checking for similar bugs
1215
+
1216
+ **Graduation Criteria**
1217
+ - Service restored → Continue postmortem
1218
+ - Fix verified → Return to previous mode
1219
+ - Can't fix → Consider partial rollback
1220
+
1221
+ **Real Example**
1222
+ "Payment processing bug:
1223
+ 1. Disabled payment feature (30 seconds)
1224
+ 2. Notified users with workaround
1225
+ 3. Wrote test reproducing double-charge
1226
+ 4. Found race condition in webhook handler
1227
+ 5. Added mutex lock, fixed issue
1228
+ 6. Re-enabled gradually
1229
+ 7. Added 5 regression tests
1230
+ 8. Total downtime: 15 minutes"
1231
+
1232
+ ---
1233
+
1234
+ ### Elevation Pattern
1235
+
1236
+ **The Situation**
1237
+ Your Speed Mode code is working well. Users depend on it. Time to graduate to Production Mode without rewriting.
1238
+
1239
+ **The Goal**
1240
+ Evolve code to production quality through test addition. No rewrites. Gradual improvement.
1241
+
1242
+ **The Approach**
1243
+ Add tests for edge cases first. Implement code to pass new tests. Standards emerge naturally. Architecture evolves.
1244
+
1245
+ **Week 1-2: Current State (Speed Mode)**
1246
+ ```gherkin
1247
+ # Your starting point - basic tests
1248
+ Scenario: Core function works
1249
+ Given normal input
1250
+ When action performed
1251
+ Then expected output
1252
+ ```
1253
+
1254
+ **Week 3-4: Add Resilience**
1255
+ ```gherkin
1256
+ # Add error handling tests
1257
+ Scenario: Handles missing data
1258
+ Given incomplete input
1259
+ When action attempted
1260
+ Then graceful failure
1261
+
1262
+ Scenario: Validates input
1263
+ Given invalid input
1264
+ When validation runs
1265
+ Then clear error message
1266
+ ```
1267
+
1268
+ **Week 5-6: Add Security**
1269
+ ```gherkin
1270
+ # Add security tests
1271
+ Scenario: Prevents injection
1272
+ Given malicious input
1273
+ When processed
1274
+ Then attack prevented
1275
+
1276
+ Scenario: Rate limiting works
1277
+ Given rapid requests
1278
+ When limit exceeded
1279
+ Then requests blocked
1280
+ ```
1281
+
1282
+ **Week 7-8: Add Scale**
1283
+ ```gherkin
1284
+ # Add performance tests
1285
+ Scenario: Handles concurrent users
1286
+ Given 100 simultaneous users
1287
+ When all act
1288
+ Then system remains stable
1289
+
1290
+ Scenario: Data integrity maintained
1291
+ Given concurrent modifications
1292
+ When conflicts occur
1293
+ Then resolved correctly
1294
+ ```
1295
+
1296
+ **Technical Evolution Checklist**
1297
+ - [ ] Week 1-2: Document current behavior in tests
1298
+ - [ ] Week 3-4: Add error handling to pass new tests
1299
+ - [ ] Week 5-6: Add validation and security
1300
+ - [ ] Week 7-8: Add performance optimizations
1301
+ - [ ] Week 9-10: Add monitoring and logging
1302
+ - [ ] Week 11-12: Production ready!
1303
+
1304
+ **Claude Prompting Strategy**
1305
+ ```
1306
+ "Elevate this Speed Mode code:
1307
+ Current code: [paste]
1308
+ Current tests: [basic scenarios]
1309
+ New tests to add: [resilience scenarios]
1310
+
1311
+ Make code pass new tests WITHOUT breaking existing.
1312
+ Add only what's needed for tests to pass."
1313
+ ```
1314
+
1315
+ **Common Pitfalls**
1316
+ - Trying to elevate everything at once
1317
+ - Rewriting instead of evolving
1318
+ - Adding features during elevation
1319
+ - Skipping test-first approach
1320
+
1321
+ **Graduation Criteria**
1322
+ - All production tests passing → Production Mode achieved
1323
+ - Taking too long → Scope too big, split up
1324
+ - Tests revealing major issues → Consider partial rewrite
1325
+
1326
+ **Real Example**
1327
+ "Elevating expense tracker:
1328
+ - Week 1: Added 20 tests documenting current behavior
1329
+ - Week 2: Added input validation (5 new tests)
1330
+ - Week 3: Error handling (8 new tests)
1331
+ - Week 4: localStorage corruption recovery (3 tests)
1332
+ - Week 5: Performance with 10k expenses (2 tests)
1333
+ - Week 6: Migration to IndexedDB for scale
1334
+ Never rewrote, just evolved. Now handles 50k expenses reliably."
1335
+
1336
+ ---
1337
+
1338
+ ## Standards Progression
1339
+
1340
+ ### Project Maturity Levels
1341
+
1342
+ **Level 0: Discovery (No standards)**
1343
+ - Any file naming
1344
+ - Any structure
1345
+ - Any patterns
1346
+ - Just explore
1347
+
1348
+ **Level 1: Early Speed (Minimal standards)**
1349
+ - Basic file names (MyComponent.js)
1350
+ - Single folder
1351
+ - localStorage for data
1352
+ - One test file
1353
+
1354
+ **Level 2: Late Speed (Patterns emerge)**
1355
+ - Consistent naming (PascalCase components)
1356
+ - Folders by feature
1357
+ - Basic error handling
1358
+ - Tests grouped by feature
1359
+
1360
+ **Level 3: Early Production (Standards enforced)**
1361
+ - Full naming conventions
1362
+ - Clear architecture
1363
+ - Error boundaries
1364
+ - Comprehensive test structure
1365
+
1366
+ **Level 4: Mature Production (Full standardization)**
1367
+ - Documented conventions (in tests)
1368
+ - Enforced via tooling
1369
+ - Design system
1370
+ - Test coverage requirements
1371
+
1372
+ ### Standards by Mode
1373
+
1374
+ **Discovery Mode Standards:**
1375
+ - None required
1376
+ - Change freely
1377
+ - Document nothing
1378
+
1379
+ **Speed Mode Standards:**
1380
+ ```javascript
1381
+ // Minimal viable standards
1382
+ - PascalCase for components
1383
+ - camelCase for functions
1384
+ - Single /src folder
1385
+ - Tests next to code
1386
+ - localStorage for persistence
1387
+ ```
1388
+
1389
+ **Production Mode Standards:**
1390
+ ```javascript
1391
+ // Full standards
1392
+ - /features folder structure
1393
+ - TypeScript required
1394
+ - Error handling required
1395
+ - 80% test coverage
1396
+ - API versioning
1397
+ - Database migrations
1398
+ - CI/CD pipeline
1399
+ ```
1400
+
1401
+ ---
1402
+
1403
+ ## Technical Requirements by Mode
1404
+
1405
+ ### Discovery Mode Tech Stack
1406
+ - HTML + script tags OR
1407
+ - Single React file OR
1408
+ - Whatever you know
1409
+ - No build process
1410
+ - No dependencies
1411
+
1412
+ ### Speed Mode Tech Stack
1413
+ - React (one file)
1414
+ - Tailwind CDN
1415
+ - localStorage
1416
+ - Netlify/Vercel
1417
+ - No auth
1418
+ - No database
1419
+
1420
+ ### Production Mode Tech Stack
1421
+ - Next.js/Remix
1422
+ - PostgreSQL/Supabase
1423
+ - Auth0/Clerk
1424
+ - Sentry
1425
+ - Monitoring
1426
+ - CI/CD
1427
+ - Backups
1428
+
1429
+ ---
1430
+
1431
+ ## Mode Switching Triggers
1432
+
1433
+ ### When to Switch Modes
1434
+
1435
+ **Discovery → Speed**
1436
+ - "I know what to build now"
1437
+ - Can write 3-5 clear scenarios
1438
+ - Ready to ship something
1439
+
1440
+ **Speed → Production**
1441
+ - Real users depending on it
1442
+ - Handling sensitive data
1443
+ - Need reliability
1444
+ - Team growing
1445
+
1446
+ **Any → Recovery**
1447
+ - Something is broken
1448
+ - Users affected
1449
+ - Data at risk
1450
+
1451
+ **Recovery → Previous**
1452
+ - Crisis resolved
1453
+ - Tests added
1454
+ - Confidence restored
1455
+
1456
+ ### Anti-Patterns to Avoid
1457
+
1458
+ **Discovery Mode:**
1459
+ - ❌ Writing documentation
1460
+ - ❌ Setting up CI/CD
1461
+ - ❌ Choosing standards
1462
+
1463
+ **Speed Mode:**
1464
+ - ❌ Custom auth system
1465
+ - ❌ Microservices
1466
+ - ❌ Perfect architecture
1467
+ - ❌ >5 test scenarios
1468
+
1469
+ **Production Mode:**
1470
+ - ❌ Shipping untested code
1471
+ - ❌ No error handling
1472
+ - ❌ Skipping security
1473
+ - ❌ No monitoring
1474
+
1475
+ ---
1476
+
1477
+ ## The Daily Workflow
1478
+
1479
+ ### Starting Each Session
1480
+
1481
+ 1. **Check altitude:** What level am I working at?
1482
+ 2. **Check mode:** What mode should I be in?
1483
+ 3. **Write scenarios:** What behavior am I adding?
1484
+ 4. **Run tests:** What's currently broken?
1485
+ 5. **Implement:** Make tests pass
1486
+ 6. **Ship:** Deploy immediately
1487
+
1488
+ ### Mode-Specific Prompts
1489
+
1490
+ **Discovery Mode:**
1491
+ ```
1492
+ "Show me 3 different ways to implement these scenarios:
1493
+ [Gherkin scenarios]
1494
+ Create working prototypes I can try"
1495
+ ```
1496
+
1497
+ **Speed Mode:**
1498
+ ```
1499
+ "Make these scenarios pass with simplest implementation:
1500
+ [3-5 Gherkin scenarios]
1501
+ Single file, localStorage, ship today"
1502
+ ```
1503
+
1504
+ **Production Mode:**
1505
+ ```
1506
+ "Implement these scenarios with production standards:
1507
+ [Comprehensive Gherkin]
1508
+ Include error handling, validation, monitoring"
1509
+ ```
1510
+
1511
+ **Recovery Mode:**
1512
+ ```
1513
+ "This scenario is failing in production:
1514
+ [Failing Gherkin]
1515
+ Fix immediately with minimal changes"
1516
+ ```
1517
+
1518
+ ---
1519
+
1520
+ ## Success Metrics
1521
+
1522
+ ### By Mode
1523
+
1524
+ **Discovery Success:**
1525
+ - Gained clarity
1526
+ - Eliminated options
1527
+ - Found the right thing to build
1528
+
1529
+ **Speed Success:**
1530
+ - Shipped in hours
1531
+ - Users using it
1532
+ - Momentum maintained
1533
+
1534
+ **Production Success:**
1535
+ - 99.9% uptime
1536
+ - No data loss
1537
+ - Security maintained
1538
+ - Team can contribute
1539
+
1540
+ **Recovery Success:**
1541
+ - Service restored < 1 hour
1542
+ - No data loss
1543
+ - Root cause fixed
1544
+ - Tests prevent recurrence