get-shit-done-cc 1.9.13 → 1.10.0-experimental.0

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 (60) hide show
  1. package/README.md +8 -0
  2. package/agents/design-specialist.md +222 -0
  3. package/agents/gsd-executor.md +37 -375
  4. package/agents/gsd-planner.md +15 -108
  5. package/bin/install.js +92 -5
  6. package/commands/gsd/autopilot.md +518 -0
  7. package/commands/gsd/checkpoints.md +229 -0
  8. package/commands/gsd/design-system.md +70 -0
  9. package/commands/gsd/discuss-design.md +77 -0
  10. package/commands/gsd/extend.md +80 -0
  11. package/commands/gsd/help.md +43 -0
  12. package/commands/gsd/new-project.md +94 -8
  13. package/commands/gsd/plan-phase.md +35 -5
  14. package/get-shit-done/references/ccr-integration.md +468 -0
  15. package/get-shit-done/references/checkpoint-execution.md +369 -0
  16. package/get-shit-done/references/checkpoint-types.md +728 -0
  17. package/get-shit-done/references/deviation-rules.md +215 -0
  18. package/get-shit-done/references/framework-patterns.md +543 -0
  19. package/get-shit-done/references/ui-principles.md +258 -0
  20. package/get-shit-done/references/verification-patterns.md +1 -1
  21. package/get-shit-done/skills/gsd-extend/SKILL.md +154 -0
  22. package/get-shit-done/skills/gsd-extend/references/agent-structure.md +305 -0
  23. package/get-shit-done/skills/gsd-extend/references/extension-anatomy.md +123 -0
  24. package/get-shit-done/skills/gsd-extend/references/reference-structure.md +408 -0
  25. package/get-shit-done/skills/gsd-extend/references/template-structure.md +370 -0
  26. package/get-shit-done/skills/gsd-extend/references/validation-rules.md +140 -0
  27. package/get-shit-done/skills/gsd-extend/references/workflow-structure.md +253 -0
  28. package/get-shit-done/skills/gsd-extend/templates/agent-template.md +234 -0
  29. package/get-shit-done/skills/gsd-extend/templates/reference-template.md +239 -0
  30. package/get-shit-done/skills/gsd-extend/templates/workflow-template.md +169 -0
  31. package/get-shit-done/skills/gsd-extend/workflows/create-approach.md +332 -0
  32. package/get-shit-done/skills/gsd-extend/workflows/list-extensions.md +133 -0
  33. package/get-shit-done/skills/gsd-extend/workflows/remove-extension.md +93 -0
  34. package/get-shit-done/skills/gsd-extend/workflows/validate-extension.md +184 -0
  35. package/get-shit-done/templates/autopilot-script-simple.sh +181 -0
  36. package/get-shit-done/templates/autopilot-script.sh +1142 -0
  37. package/get-shit-done/templates/autopilot-script.sh.backup +1142 -0
  38. package/get-shit-done/templates/design-system.md +238 -0
  39. package/get-shit-done/templates/phase-design.md +205 -0
  40. package/get-shit-done/templates/phase-models-template.json +71 -0
  41. package/get-shit-done/templates/phase-prompt.md +4 -4
  42. package/get-shit-done/templates/state.md +37 -0
  43. package/get-shit-done/tui/App.tsx +169 -0
  44. package/get-shit-done/tui/README.md +107 -0
  45. package/get-shit-done/tui/build.js +37 -0
  46. package/get-shit-done/tui/components/ActivityFeed.tsx +126 -0
  47. package/get-shit-done/tui/components/PhaseCard.tsx +86 -0
  48. package/get-shit-done/tui/components/StatsBar.tsx +147 -0
  49. package/get-shit-done/tui/dist/index.js +387 -0
  50. package/get-shit-done/tui/index.tsx +12 -0
  51. package/get-shit-done/tui/package-lock.json +1074 -0
  52. package/get-shit-done/tui/package.json +22 -0
  53. package/get-shit-done/tui/utils/pipeReader.ts +129 -0
  54. package/get-shit-done/workflows/design-system.md +245 -0
  55. package/get-shit-done/workflows/discuss-design.md +330 -0
  56. package/get-shit-done/workflows/execute-phase.md +44 -1
  57. package/get-shit-done/workflows/execute-plan-auth.md +122 -0
  58. package/get-shit-done/workflows/execute-plan-checkpoints.md +541 -0
  59. package/get-shit-done/workflows/execute-plan.md +34 -856
  60. package/package.json +8 -3
@@ -9,6 +9,19 @@ Read config.json for planning behavior settings.
9
9
  @~/.claude/get-shit-done/references/git-integration.md
10
10
  </required_reading>
11
11
 
12
+ <conditional_loading>
13
+ ## Load Based on Plan Characteristics
14
+
15
+ **If plan has checkpoints** (detect with: `grep -q 'type="checkpoint' PLAN.md`):
16
+ @~/.claude/get-shit-done/workflows/execute-plan-checkpoints.md
17
+
18
+ **If authentication error encountered during execution:**
19
+ @~/.claude/get-shit-done/workflows/execute-plan-auth.md
20
+
21
+ **Deviation handling rules (reference as needed):**
22
+ @~/.claude/get-shit-done/references/deviation-rules.md
23
+ </conditional_loading>
24
+
12
25
  <process>
13
26
 
14
27
  <step name="resolve_model_profile" priority="first">
@@ -109,6 +122,14 @@ SUMMARY naming follows same pattern:
109
122
 
110
123
  Confirm with user if ambiguous.
111
124
 
125
+ **Check for checkpoints (determines which workflow extensions to load):**
126
+
127
+ ```bash
128
+ HAS_CHECKPOINTS=$(grep -q 'type="checkpoint' .planning/phases/XX-name/{phase}-{plan}-PLAN.md && echo "true" || echo "false")
129
+ ```
130
+
131
+ If `HAS_CHECKPOINTS=true`, load execute-plan-checkpoints.md for checkpoint handling logic.
132
+
112
133
  <config-check>
113
134
  ```bash
114
135
  cat .planning/config.json 2>/dev/null
@@ -123,7 +144,7 @@ cat .planning/config.json 2>/dev/null
123
144
  Starting execution...
124
145
  ```
125
146
 
126
- Proceed directly to parse_segments step.
147
+ Proceed directly to load_prompt step.
127
148
  </if>
128
149
 
129
150
  <if mode="interactive" OR="custom with gates.execute_next_plan true">
@@ -151,384 +172,11 @@ PLAN_START_EPOCH=$(date +%s)
151
172
  Store in shell variables for duration calculation at completion.
152
173
  </step>
153
174
 
154
- <step name="parse_segments">
155
- **Intelligent segmentation: Parse plan into execution segments.**
156
-
157
- Plans are divided into segments by checkpoints. Each segment is routed to optimal execution context (subagent or main).
158
-
159
- **1. Check for checkpoints:**
160
-
161
- ```bash
162
- # Find all checkpoints and their types
163
- grep -n "type=\"checkpoint" .planning/phases/XX-name/{phase}-{plan}-PLAN.md
164
- ```
165
-
166
- **2. Analyze execution strategy:**
167
-
168
- **If NO checkpoints found:**
169
-
170
- - **Fully autonomous plan** - spawn single subagent for entire plan
171
- - Subagent gets fresh 200k context, executes all tasks, creates SUMMARY, commits
172
- - Main context: Just orchestration (~5% usage)
173
-
174
- **If checkpoints found, parse into segments:**
175
-
176
- Segment = tasks between checkpoints (or start→first checkpoint, or last checkpoint→end)
177
-
178
- **For each segment, determine routing:**
179
-
180
- ```
181
- Segment routing rules:
182
-
183
- IF segment has no prior checkpoint:
184
- → SUBAGENT (first segment, nothing to depend on)
185
-
186
- IF segment follows checkpoint:human-verify:
187
- → SUBAGENT (verification is just confirmation, doesn't affect next work)
188
-
189
- IF segment follows checkpoint:decision OR checkpoint:human-action:
190
- → MAIN CONTEXT (next tasks need the decision/result)
191
- ```
192
-
193
- **3. Execution pattern:**
194
-
195
- **Pattern A: Fully autonomous (no checkpoints)**
196
-
197
- ```
198
- Spawn subagent → execute all tasks → SUMMARY → commit → report back
199
- ```
200
-
201
- **Pattern B: Segmented with verify-only checkpoints**
202
-
203
- ```
204
- Segment 1 (tasks 1-3): Spawn subagent → execute → report back
205
- Checkpoint 4 (human-verify): Main context → you verify → continue
206
- Segment 2 (tasks 5-6): Spawn NEW subagent → execute → report back
207
- Checkpoint 7 (human-verify): Main context → you verify → continue
208
- Aggregate results → SUMMARY → commit
209
- ```
210
-
211
- **Pattern C: Decision-dependent (must stay in main)**
212
-
213
- ```
214
- Checkpoint 1 (decision): Main context → you decide → continue in main
215
- Tasks 2-5: Main context (need decision from checkpoint 1)
216
- No segmentation benefit - execute entirely in main
217
- ```
218
-
219
- **4. Why segment:** Fresh context per subagent preserves peak quality. Main context stays lean (~15% usage).
220
-
221
- **5. Implementation:**
222
-
223
- **For fully autonomous plans:**
224
-
225
- ```
226
- 1. Run init_agent_tracking step first (see step below)
227
-
228
- 2. Use Task tool with subagent_type="gsd-executor" and model="{executor_model}":
229
-
230
- Prompt: "Execute plan at .planning/phases/{phase}-{plan}-PLAN.md
231
-
232
- This is an autonomous plan (no checkpoints). Execute all tasks, create SUMMARY.md in phase directory, commit with message following plan's commit guidance.
233
-
234
- Follow all deviation rules and authentication gate protocols from the plan.
235
-
236
- When complete, report: plan name, tasks completed, SUMMARY path, commit hash."
237
-
238
- 3. After Task tool returns with agent_id:
239
-
240
- a. Write agent_id to current-agent-id.txt:
241
- echo "[agent_id]" > .planning/current-agent-id.txt
242
-
243
- b. Append spawn entry to agent-history.json:
244
- {
245
- "agent_id": "[agent_id from Task response]",
246
- "task_description": "Execute full plan {phase}-{plan} (autonomous)",
247
- "phase": "{phase}",
248
- "plan": "{plan}",
249
- "segment": null,
250
- "timestamp": "[ISO timestamp]",
251
- "status": "spawned",
252
- "completion_timestamp": null
253
- }
254
-
255
- 4. Wait for subagent to complete
256
-
257
- 5. After subagent completes successfully:
258
-
259
- a. Update agent-history.json entry:
260
- - Find entry with matching agent_id
261
- - Set status: "completed"
262
- - Set completion_timestamp: "[ISO timestamp]"
263
-
264
- b. Clear current-agent-id.txt:
265
- rm .planning/current-agent-id.txt
266
-
267
- 6. Report completion to user
268
- ```
269
-
270
- **For segmented plans (has verify-only checkpoints):**
271
-
272
- ```
273
- Execute segment-by-segment:
274
-
275
- For each autonomous segment:
276
- Spawn subagent with prompt: "Execute tasks [X-Y] from plan at .planning/phases/{phase}-{plan}-PLAN.md. Read the plan for full context and deviation rules. Do NOT create SUMMARY or commit - just execute these tasks and report results."
277
-
278
- Wait for subagent completion
279
-
280
- For each checkpoint:
281
- Execute in main context
282
- Wait for user interaction
283
- Continue to next segment
284
-
285
- After all segments complete:
286
- Aggregate all results
287
- Create SUMMARY.md
288
- Commit with all changes
289
- ```
290
-
291
- **For decision-dependent plans:**
292
-
293
- ```
294
- Execute in main context (standard flow below)
295
- No subagent routing
296
- Quality maintained through small scope (2-3 tasks per plan)
297
- ```
298
-
299
- See step name="segment_execution" for detailed segment execution loop.
300
- </step>
301
-
302
- <step name="init_agent_tracking">
303
- **Initialize agent tracking for subagent resume capability.**
304
-
305
- Before spawning any subagents, set up tracking infrastructure:
306
-
307
- **1. Create/verify tracking files:**
308
-
309
- ```bash
310
- # Create agent history file if doesn't exist
311
- if [ ! -f .planning/agent-history.json ]; then
312
- echo '{"version":"1.0","max_entries":50,"entries":[]}' > .planning/agent-history.json
313
- fi
314
-
315
- # Clear any stale current-agent-id (from interrupted sessions)
316
- # Will be populated when subagent spawns
317
- rm -f .planning/current-agent-id.txt
318
- ```
319
-
320
- **2. Check for interrupted agents (resume detection):**
321
-
322
- ```bash
323
- # Check if current-agent-id.txt exists from previous interrupted session
324
- if [ -f .planning/current-agent-id.txt ]; then
325
- INTERRUPTED_ID=$(cat .planning/current-agent-id.txt)
326
- echo "Found interrupted agent: $INTERRUPTED_ID"
327
- fi
328
- ```
329
-
330
- **If interrupted agent found:**
331
- - The agent ID file exists from a previous session that didn't complete
332
- - This agent can potentially be resumed using Task tool's `resume` parameter
333
- - Present to user: "Previous session was interrupted. Resume agent [ID] or start fresh?"
334
- - If resume: Use Task tool with `resume` parameter set to the interrupted ID
335
- - If fresh: Clear the file and proceed normally
336
-
337
- **3. Prune old entries (housekeeping):**
338
-
339
- If agent-history.json has more than `max_entries`:
340
- - Remove oldest entries with status "completed"
341
- - Never remove entries with status "spawned" (may need resume)
342
- - Keep file under size limit for fast reads
343
-
344
- **When to run this step:**
345
- - Pattern A (fully autonomous): Before spawning the single subagent
346
- - Pattern B (segmented): Before the segment execution loop
347
- - Pattern C (main context): Skip - no subagents spawned
348
- </step>
349
-
350
- <step name="segment_execution">
351
- **Detailed segment execution loop for segmented plans.**
352
-
353
- **This step applies ONLY to segmented plans (Pattern B: has checkpoints, but they're verify-only).**
354
-
355
- For Pattern A (fully autonomous) and Pattern C (decision-dependent), skip this step.
356
-
357
- **Execution flow:**
358
-
359
- ````
360
- 1. Parse plan to identify segments:
361
- - Read plan file
362
- - Find checkpoint locations: grep -n "type=\"checkpoint" PLAN.md
363
- - Identify checkpoint types: grep "type=\"checkpoint" PLAN.md | grep -o 'checkpoint:[^"]*'
364
- - Build segment map:
365
- * Segment 1: Start → first checkpoint (tasks 1-X)
366
- * Checkpoint 1: Type and location
367
- * Segment 2: After checkpoint 1 → next checkpoint (tasks X+1 to Y)
368
- * Checkpoint 2: Type and location
369
- * ... continue for all segments
370
-
371
- 2. For each segment in order:
372
-
373
- A. Determine routing (apply rules from parse_segments):
374
- - No prior checkpoint? → Subagent
375
- - Prior checkpoint was human-verify? → Subagent
376
- - Prior checkpoint was decision/human-action? → Main context
377
-
378
- B. If routing = Subagent:
379
- ```
380
- Spawn Task tool with subagent_type="gsd-executor" and model="{executor_model}":
381
-
382
- Prompt: "Execute tasks [task numbers/names] from plan at [plan path].
383
-
384
- **Context:**
385
- - Read the full plan for objective, context files, and deviation rules
386
- - You are executing a SEGMENT of this plan (not the full plan)
387
- - Other segments will be executed separately
388
-
389
- **Your responsibilities:**
390
- - Execute only the tasks assigned to you
391
- - Follow all deviation rules and authentication gate protocols
392
- - Track deviations for later Summary
393
- - DO NOT create SUMMARY.md (will be created after all segments complete)
394
- - DO NOT commit (will be done after all segments complete)
395
-
396
- **Report back:**
397
- - Tasks completed
398
- - Files created/modified
399
- - Deviations encountered
400
- - Any issues or blockers"
401
-
402
- **After Task tool returns with agent_id:**
403
-
404
- 1. Write agent_id to current-agent-id.txt:
405
- echo "[agent_id]" > .planning/current-agent-id.txt
406
-
407
- 2. Append spawn entry to agent-history.json:
408
- {
409
- "agent_id": "[agent_id from Task response]",
410
- "task_description": "Execute tasks [X-Y] from plan {phase}-{plan}",
411
- "phase": "{phase}",
412
- "plan": "{plan}",
413
- "segment": [segment_number],
414
- "timestamp": "[ISO timestamp]",
415
- "status": "spawned",
416
- "completion_timestamp": null
417
- }
418
-
419
- Wait for subagent to complete
420
- Capture results (files changed, deviations, etc.)
421
-
422
- **After subagent completes successfully:**
423
-
424
- 1. Update agent-history.json entry:
425
- - Find entry with matching agent_id
426
- - Set status: "completed"
427
- - Set completion_timestamp: "[ISO timestamp]"
428
-
429
- 2. Clear current-agent-id.txt:
430
- rm .planning/current-agent-id.txt
431
-
432
- ```
433
-
434
- C. If routing = Main context:
435
- Execute tasks in main using standard execution flow (step name="execute")
436
- Track results locally
437
-
438
- D. After segment completes (whether subagent or main):
439
- Continue to next checkpoint/segment
440
-
441
- 3. After ALL segments complete:
442
-
443
- A. Aggregate results from all segments:
444
- - Collect files created/modified from all segments
445
- - Collect deviations from all segments
446
- - Collect decisions from all checkpoints
447
- - Merge into complete picture
448
-
449
- B. Create SUMMARY.md:
450
- - Use aggregated results
451
- - Document all work from all segments
452
- - Include deviations from all segments
453
- - Note which segments were subagented
454
-
455
- C. Commit:
456
- - Stage all files from all segments
457
- - Stage SUMMARY.md
458
- - Commit with message following plan guidance
459
- - Include note about segmented execution if relevant
460
-
461
- D. Report completion
462
-
463
- **Example execution trace:**
464
-
465
- ````
466
-
467
- Plan: 01-02-PLAN.md (8 tasks, 2 verify checkpoints)
468
-
469
- Parsing segments...
470
-
471
- - Segment 1: Tasks 1-3 (autonomous)
472
- - Checkpoint 4: human-verify
473
- - Segment 2: Tasks 5-6 (autonomous)
474
- - Checkpoint 7: human-verify
475
- - Segment 3: Task 8 (autonomous)
476
-
477
- Routing analysis:
478
-
479
- - Segment 1: No prior checkpoint → SUBAGENT ✓
480
- - Checkpoint 4: Verify only → MAIN (required)
481
- - Segment 2: After verify → SUBAGENT ✓
482
- - Checkpoint 7: Verify only → MAIN (required)
483
- - Segment 3: After verify → SUBAGENT ✓
484
-
485
- Execution:
486
- [1] Spawning subagent for tasks 1-3...
487
- → Subagent completes: 3 files modified, 0 deviations
488
- [2] Executing checkpoint 4 (human-verify)...
489
- ╔═══════════════════════════════════════════════════════╗
490
- ║ CHECKPOINT: Verification Required ║
491
- ╚═══════════════════════════════════════════════════════╝
492
-
493
- Progress: 3/8 tasks complete
494
- Task: Verify database schema
495
-
496
- Built: User and Session tables with relations
497
-
498
- How to verify:
499
- 1. Check src/db/schema.ts for correct types
500
-
501
- ────────────────────────────────────────────────────────
502
- → YOUR ACTION: Type "approved" or describe issues
503
- ────────────────────────────────────────────────────────
504
- User: "approved"
505
- [3] Spawning subagent for tasks 5-6...
506
- → Subagent completes: 2 files modified, 1 deviation (added error handling)
507
- [4] Executing checkpoint 7 (human-verify)...
508
- User: "approved"
509
- [5] Spawning subagent for task 8...
510
- → Subagent completes: 1 file modified, 0 deviations
511
-
512
- Aggregating results...
513
-
514
- - Total files: 6 modified
515
- - Total deviations: 1
516
- - Segmented execution: 3 subagents, 2 checkpoints
517
-
518
- Creating SUMMARY.md...
519
- Committing...
520
- ✓ Complete
521
-
522
- ````
523
-
524
- **Benefit:** Each subagent starts fresh (~20-30% context), enabling larger plans without quality degradation.
525
- </step>
526
-
527
175
  <step name="load_prompt">
528
176
  Read the plan prompt:
529
177
  ```bash
530
178
  cat .planning/phases/XX-name/{phase}-{plan}-PLAN.md
531
- ````
179
+ ```
532
180
 
533
181
  This IS the execution instructions. Follow it exactly.
534
182
 
@@ -554,10 +202,10 @@ Use AskUserQuestion:
554
202
  - "Proceed anyway" - Issues won't block this phase
555
203
  - "Address first" - Let's resolve before continuing
556
204
  - "Review previous" - Show me the full summary
557
- </step>
205
+ </step>
558
206
 
559
207
  <step name="execute">
560
- Execute each task in the prompt. **Deviations are normal** - handle them automatically using embedded rules below.
208
+ Execute each task in the prompt. **Deviations are normal** - handle them using deviation rules (see references/deviation-rules.md).
561
209
 
562
210
  1. Read the @context files listed in the prompt
563
211
 
@@ -570,8 +218,8 @@ Execute each task in the prompt. **Deviations are normal** - handle them automat
570
218
  - If no: Standard implementation
571
219
 
572
220
  - Work toward task completion
573
- - **If CLI/API returns authentication error:** Handle as authentication gate (see below)
574
- - **When you discover additional work not in plan:** Apply deviation rules (see below) automatically
221
+ - **If CLI/API returns authentication error:** Load execute-plan-auth.md and follow authentication gate protocol
222
+ - **When you discover additional work not in plan:** Apply deviation rules (see references/deviation-rules.md) automatically
575
223
  - Continue implementing, applying rules as needed
576
224
  - Run the verification
577
225
  - Confirm done criteria met
@@ -582,327 +230,15 @@ Execute each task in the prompt. **Deviations are normal** - handle them automat
582
230
  **If `type="checkpoint:*"`:**
583
231
 
584
232
  - STOP immediately (do not continue to next task)
585
- - Execute checkpoint_protocol (see below)
233
+ - Execute checkpoint_protocol (see execute-plan-checkpoints.md)
586
234
  - Wait for user response
587
235
  - Verify if possible (check files, env vars, etc.)
588
236
  - Only after user confirmation: continue to next task
589
237
 
590
238
  3. Run overall verification checks from `<verification>` section
591
239
  4. Confirm all success criteria from `<success_criteria>` section met
592
- 5. Document all deviations in Summary (automatic - see deviation_documentation below)
593
- </step>
594
-
595
- <authentication_gates>
596
-
597
- ## Handling Authentication Errors During Execution
598
-
599
- **When you encounter authentication errors during `type="auto"` task execution:**
600
-
601
- This is NOT a failure. Authentication gates are expected and normal. Handle them dynamically:
602
-
603
- **Authentication error indicators:**
604
-
605
- - CLI returns: "Error: Not authenticated", "Not logged in", "Unauthorized", "401", "403"
606
- - API returns: "Authentication required", "Invalid API key", "Missing credentials"
607
- - Command fails with: "Please run {tool} login" or "Set {ENV_VAR} environment variable"
608
-
609
- **Authentication gate protocol:**
610
-
611
- 1. **Recognize it's an auth gate** - Not a bug, just needs credentials
612
- 2. **STOP current task execution** - Don't retry repeatedly
613
- 3. **Create dynamic checkpoint:human-action** - Present it to user immediately
614
- 4. **Provide exact authentication steps** - CLI commands, where to get keys
615
- 5. **Wait for user to authenticate** - Let them complete auth flow
616
- 6. **Verify authentication works** - Test that credentials are valid
617
- 7. **Retry the original task** - Resume automation where you left off
618
- 8. **Continue normally** - Don't treat this as an error in Summary
619
-
620
- **Example: Vercel deployment hits auth error**
621
-
622
- ```
623
- Task 3: Deploy to Vercel
624
- Running: vercel --yes
625
-
626
- Error: Not authenticated. Please run 'vercel login'
627
-
628
- [Create checkpoint dynamically]
629
-
630
- ╔═══════════════════════════════════════════════════════╗
631
- ║ CHECKPOINT: Action Required ║
632
- ╚═══════════════════════════════════════════════════════╝
633
-
634
- Progress: 2/8 tasks complete
635
- Task: Authenticate Vercel CLI
636
-
637
- Attempted: vercel --yes
638
- Error: Not authenticated
639
-
640
- What you need to do:
641
- 1. Run: vercel login
642
- 2. Complete browser authentication
643
-
644
- I'll verify: vercel whoami returns your account
645
-
646
- ────────────────────────────────────────────────────────
647
- → YOUR ACTION: Type "done" when authenticated
648
- ────────────────────────────────────────────────────────
649
-
650
- [Wait for user response]
651
-
652
- [User types "done"]
653
-
654
- Verifying authentication...
655
- Running: vercel whoami
656
- ✓ Authenticated as: user@example.com
657
-
658
- Retrying deployment...
659
- Running: vercel --yes
660
- ✓ Deployed to: https://myapp-abc123.vercel.app
661
-
662
- Task 3 complete. Continuing to task 4...
663
- ```
664
-
665
- **In Summary documentation:**
666
-
667
- Document authentication gates as normal flow, not deviations:
668
-
669
- ```markdown
670
- ## Authentication Gates
671
-
672
- During execution, I encountered authentication requirements:
673
-
674
- 1. Task 3: Vercel CLI required authentication
675
- - Paused for `vercel login`
676
- - Resumed after authentication
677
- - Deployed successfully
678
-
679
- These are normal gates, not errors.
680
- ```
681
-
682
- **Key principles:**
683
-
684
- - Authentication gates are NOT failures or bugs
685
- - They're expected interaction points during first-time setup
686
- - Handle them gracefully and continue automation after unblocked
687
- - Don't mark tasks as "failed" or "incomplete" due to auth gates
688
- - Document them as normal flow, separate from deviations
689
- </authentication_gates>
690
-
691
- <deviation_rules>
692
-
693
- ## Automatic Deviation Handling
694
-
695
- **While executing tasks, you WILL discover work not in the plan.** This is normal.
696
-
697
- Apply these rules automatically. Track all deviations for Summary documentation.
698
-
699
- ---
700
-
701
- **RULE 1: Auto-fix bugs**
702
-
703
- **Trigger:** Code doesn't work as intended (broken behavior, incorrect output, errors)
704
-
705
- **Action:** Fix immediately, track for Summary
706
-
707
- **Examples:**
708
-
709
- - Wrong SQL query returning incorrect data
710
- - Logic errors (inverted condition, off-by-one, infinite loop)
711
- - Type errors, null pointer exceptions, undefined references
712
- - Broken validation (accepts invalid input, rejects valid input)
713
- - Security vulnerabilities (SQL injection, XSS, CSRF, insecure auth)
714
- - Race conditions, deadlocks
715
- - Memory leaks, resource leaks
716
-
717
- **Process:**
718
-
719
- 1. Fix the bug inline
720
- 2. Add/update tests to prevent regression
721
- 3. Verify fix works
722
- 4. Continue task
723
- 5. Track in deviations list: `[Rule 1 - Bug] [description]`
724
-
725
- **No user permission needed.** Bugs must be fixed for correct operation.
726
-
727
- ---
728
-
729
- **RULE 2: Auto-add missing critical functionality**
730
-
731
- **Trigger:** Code is missing essential features for correctness, security, or basic operation
732
-
733
- **Action:** Add immediately, track for Summary
734
-
735
- **Examples:**
736
-
737
- - Missing error handling (no try/catch, unhandled promise rejections)
738
- - No input validation (accepts malicious data, type coercion issues)
739
- - Missing null/undefined checks (crashes on edge cases)
740
- - No authentication on protected routes
741
- - Missing authorization checks (users can access others' data)
742
- - No CSRF protection, missing CORS configuration
743
- - No rate limiting on public APIs
744
- - Missing required database indexes (causes timeouts)
745
- - No logging for errors (can't debug production)
746
-
747
- **Process:**
748
-
749
- 1. Add the missing functionality inline
750
- 2. Add tests for the new functionality
751
- 3. Verify it works
752
- 4. Continue task
753
- 5. Track in deviations list: `[Rule 2 - Missing Critical] [description]`
754
-
755
- **Critical = required for correct/secure/performant operation**
756
- **No user permission needed.** These are not "features" - they're requirements for basic correctness.
757
-
758
- ---
759
-
760
- **RULE 3: Auto-fix blocking issues**
761
-
762
- **Trigger:** Something prevents you from completing current task
763
-
764
- **Action:** Fix immediately to unblock, track for Summary
765
-
766
- **Examples:**
767
-
768
- - Missing dependency (package not installed, import fails)
769
- - Wrong types blocking compilation
770
- - Broken import paths (file moved, wrong relative path)
771
- - Missing environment variable (app won't start)
772
- - Database connection config error
773
- - Build configuration error (webpack, tsconfig, etc.)
774
- - Missing file referenced in code
775
- - Circular dependency blocking module resolution
776
-
777
- **Process:**
778
-
779
- 1. Fix the blocking issue
780
- 2. Verify task can now proceed
781
- 3. Continue task
782
- 4. Track in deviations list: `[Rule 3 - Blocking] [description]`
783
-
784
- **No user permission needed.** Can't complete task without fixing blocker.
785
-
786
- ---
787
-
788
- **RULE 4: Ask about architectural changes**
789
-
790
- **Trigger:** Fix/addition requires significant structural modification
791
-
792
- **Action:** STOP, present to user, wait for decision
793
-
794
- **Examples:**
795
-
796
- - Adding new database table (not just column)
797
- - Major schema changes (changing primary key, splitting tables)
798
- - Introducing new service layer or architectural pattern
799
- - Switching libraries/frameworks (React → Vue, REST → GraphQL)
800
- - Changing authentication approach (sessions → JWT)
801
- - Adding new infrastructure (message queue, cache layer, CDN)
802
- - Changing API contracts (breaking changes to endpoints)
803
- - Adding new deployment environment
804
-
805
- **Process:**
806
-
807
- 1. STOP current task
808
- 2. Present clearly:
809
-
810
- ```
811
- ⚠️ Architectural Decision Needed
812
-
813
- Current task: [task name]
814
- Discovery: [what you found that prompted this]
815
- Proposed change: [architectural modification]
816
- Why needed: [rationale]
817
- Impact: [what this affects - APIs, deployment, dependencies, etc.]
818
- Alternatives: [other approaches, or "none apparent"]
819
-
820
- Proceed with proposed change? (yes / different approach / defer)
821
- ```
822
-
823
- 3. WAIT for user response
824
- 4. If approved: implement, track as `[Rule 4 - Architectural] [description]`
825
- 5. If different approach: discuss and implement
826
- 6. If deferred: note in Summary and continue without change
827
-
828
- **User decision required.** These changes affect system design.
829
-
830
- ---
831
-
832
- **RULE PRIORITY (when multiple could apply):**
833
-
834
- 1. **If Rule 4 applies** → STOP and ask (architectural decision)
835
- 2. **If Rules 1-3 apply** → Fix automatically, track for Summary
836
- 3. **If genuinely unsure which rule** → Apply Rule 4 (ask user)
837
-
838
- **Edge case guidance:**
839
-
840
- - "This validation is missing" → Rule 2 (critical for security)
841
- - "This crashes on null" → Rule 1 (bug)
842
- - "Need to add table" → Rule 4 (architectural)
843
- - "Need to add column" → Rule 1 or 2 (depends: fixing bug or adding critical field)
844
-
845
- **When in doubt:** Ask yourself "Does this affect correctness, security, or ability to complete task?"
846
-
847
- - YES → Rules 1-3 (fix automatically)
848
- - MAYBE → Rule 4 (ask user)
849
-
850
- </deviation_rules>
851
-
852
- <deviation_documentation>
853
-
854
- ## Documenting Deviations in Summary
855
-
856
- After all tasks complete, Summary MUST include deviations section.
857
-
858
- **If no deviations:**
859
-
860
- ```markdown
861
- ## Deviations from Plan
862
-
863
- None - plan executed exactly as written.
864
- ```
865
-
866
- **If deviations occurred:**
867
-
868
- ```markdown
869
- ## Deviations from Plan
870
-
871
- ### Auto-fixed Issues
872
-
873
- **1. [Rule 1 - Bug] Fixed case-sensitive email uniqueness constraint**
874
-
875
- - **Found during:** Task 4 (Follow/unfollow API implementation)
876
- - **Issue:** User.email unique constraint was case-sensitive - Test@example.com and test@example.com were both allowed, causing duplicate accounts
877
- - **Fix:** Changed to `CREATE UNIQUE INDEX users_email_unique ON users (LOWER(email))`
878
- - **Files modified:** src/models/User.ts, migrations/003_fix_email_unique.sql
879
- - **Verification:** Unique constraint test passes - duplicate emails properly rejected
880
- - **Commit:** abc123f
881
-
882
- **2. [Rule 2 - Missing Critical] Added JWT expiry validation to auth middleware**
883
-
884
- - **Found during:** Task 3 (Protected route implementation)
885
- - **Issue:** Auth middleware wasn't checking token expiry - expired tokens were being accepted
886
- - **Fix:** Added exp claim validation in middleware, reject with 401 if expired
887
- - **Files modified:** src/middleware/auth.ts, src/middleware/auth.test.ts
888
- - **Verification:** Expired token test passes - properly rejects with 401
889
- - **Commit:** def456g
890
-
891
- ---
892
-
893
- **Total deviations:** 4 auto-fixed (1 bug, 1 missing critical, 1 blocking, 1 architectural with approval)
894
- **Impact on plan:** All auto-fixes necessary for correctness/security/performance. No scope creep.
895
- ```
896
-
897
- **This provides complete transparency:**
898
-
899
- - Every deviation documented
900
- - Why it was needed
901
- - What rule applied
902
- - What was done
903
- - User can see exactly what happened beyond the plan
904
-
905
- </deviation_documentation>
240
+ 5. Document all deviations in Summary (see references/deviation-rules.md for documentation format)
241
+ </step>
906
242
 
907
243
  <tdd_plan_execution>
908
244
  ## TDD Plan Execution
@@ -1047,164 +383,6 @@ TASK_COMMITS+=("Task ${TASK_NUM}: ${TASK_COMMIT}")
1047
383
 
1048
384
  </task_commit>
1049
385
 
1050
- <step name="checkpoint_protocol">
1051
- When encountering `type="checkpoint:*"`:
1052
-
1053
- **Critical: Claude automates everything with CLI/API before checkpoints.** Checkpoints are for verification and decisions, not manual work.
1054
-
1055
- **Display checkpoint clearly:**
1056
-
1057
- ```
1058
- ╔═══════════════════════════════════════════════════════╗
1059
- ║ CHECKPOINT: [Type] ║
1060
- ╚═══════════════════════════════════════════════════════╝
1061
-
1062
- Progress: {X}/{Y} tasks complete
1063
- Task: [task name]
1064
-
1065
- [Display task-specific content based on type]
1066
-
1067
- ────────────────────────────────────────────────────────
1068
- → YOUR ACTION: [Resume signal instruction]
1069
- ────────────────────────────────────────────────────────
1070
- ```
1071
-
1072
- **For checkpoint:human-verify (90% of checkpoints):**
1073
-
1074
- ```
1075
- Built: [what was automated - deployed, built, configured]
1076
-
1077
- How to verify:
1078
- 1. [Step 1 - exact command/URL]
1079
- 2. [Step 2 - what to check]
1080
- 3. [Step 3 - expected behavior]
1081
-
1082
- ────────────────────────────────────────────────────────
1083
- → YOUR ACTION: Type "approved" or describe issues
1084
- ────────────────────────────────────────────────────────
1085
- ```
1086
-
1087
- **For checkpoint:decision (9% of checkpoints):**
1088
-
1089
- ```
1090
- Decision needed: [decision]
1091
-
1092
- Context: [why this matters]
1093
-
1094
- Options:
1095
- 1. [option-id]: [name]
1096
- Pros: [pros]
1097
- Cons: [cons]
1098
-
1099
- 2. [option-id]: [name]
1100
- Pros: [pros]
1101
- Cons: [cons]
1102
-
1103
- [Resume signal - e.g., "Select: option-id"]
1104
- ```
1105
-
1106
- **For checkpoint:human-action (1% - rare, only for truly unavoidable manual steps):**
1107
-
1108
- ```
1109
- I automated: [what Claude already did via CLI/API]
1110
-
1111
- Need your help with: [the ONE thing with no CLI/API - email link, 2FA code]
1112
-
1113
- Instructions:
1114
- [Single unavoidable step]
1115
-
1116
- I'll verify after: [verification]
1117
-
1118
- [Resume signal - e.g., "Type 'done' when complete"]
1119
- ```
1120
-
1121
- **After displaying:** WAIT for user response. Do NOT hallucinate completion. Do NOT continue to next task.
1122
-
1123
- **After user responds:**
1124
-
1125
- - Run verification if specified (file exists, env var set, tests pass, etc.)
1126
- - If verification passes or N/A: continue to next task
1127
- - If verification fails: inform user, wait for resolution
1128
-
1129
- See ~/.claude/get-shit-done/references/checkpoints.md for complete checkpoint guidance.
1130
- </step>
1131
-
1132
- <step name="checkpoint_return_for_orchestrator">
1133
- **When spawned by an orchestrator (execute-phase or execute-plan command):**
1134
-
1135
- If you were spawned via Task tool and hit a checkpoint, you cannot directly interact with the user. Instead, RETURN to the orchestrator with structured checkpoint state so it can present to the user and spawn a fresh continuation agent.
1136
-
1137
- **Return format for checkpoints:**
1138
-
1139
- **Required in your return:**
1140
-
1141
- 1. **Completed Tasks table** - Tasks done so far with commit hashes and files created
1142
- 2. **Current Task** - Which task you're on and what's blocking it
1143
- 3. **Checkpoint Details** - User-facing content (verification steps, decision options, or action instructions)
1144
- 4. **Awaiting** - What you need from the user
1145
-
1146
- **Example return:**
1147
-
1148
- ```
1149
- ## CHECKPOINT REACHED
1150
-
1151
- **Type:** human-action
1152
- **Plan:** 01-01
1153
- **Progress:** 1/3 tasks complete
1154
-
1155
- ### Completed Tasks
1156
-
1157
- | Task | Name | Commit | Files |
1158
- |------|------|--------|-------|
1159
- | 1 | Initialize Next.js 15 project | d6fe73f | package.json, tsconfig.json, app/ |
1160
-
1161
- ### Current Task
1162
-
1163
- **Task 2:** Initialize Convex backend
1164
- **Status:** blocked
1165
- **Blocked by:** Convex CLI authentication required
1166
-
1167
- ### Checkpoint Details
1168
-
1169
- **Automation attempted:**
1170
- Ran `npx convex dev` to initialize Convex backend
1171
-
1172
- **Error encountered:**
1173
- "Error: Not authenticated. Run `npx convex login` first."
1174
-
1175
- **What you need to do:**
1176
- 1. Run: `npx convex login`
1177
- 2. Complete browser authentication
1178
- 3. Run: `npx convex dev`
1179
- 4. Create project when prompted
1180
-
1181
- **I'll verify after:**
1182
- `cat .env.local | grep CONVEX` returns the Convex URL
1183
-
1184
- ### Awaiting
1185
-
1186
- Type "done" when Convex is authenticated and project created.
1187
- ```
1188
-
1189
- **After you return:**
1190
-
1191
- The orchestrator will:
1192
- 1. Parse your structured return
1193
- 2. Present checkpoint details to the user
1194
- 3. Collect user's response
1195
- 4. Spawn a FRESH continuation agent with your completed tasks state
1196
-
1197
- You will NOT be resumed. A new agent continues from where you stopped, using your Completed Tasks table to know what's done.
1198
-
1199
- **How to know if you were spawned:**
1200
-
1201
- If you're reading this workflow because an orchestrator spawned you (vs running directly), the orchestrator's prompt will include checkpoint return instructions. Follow those instructions when you hit a checkpoint.
1202
-
1203
- **If running in main context (not spawned):**
1204
-
1205
- Use the standard checkpoint_protocol - display checkpoint and wait for direct user response.
1206
- </step>
1207
-
1208
386
  <step name="verification_failure_gate">
1209
387
  If any task verification fails:
1210
388
 
@@ -1376,7 +554,7 @@ The one-liner must be SUBSTANTIVE:
1376
554
 
1377
555
  - If more plans exist in this phase: "Ready for {phase}-{next-plan}-PLAN.md"
1378
556
  - If this is the last plan: "Phase complete, ready for transition"
1379
- </step>
557
+ </step>
1380
558
 
1381
559
  <step name="update_current_position">
1382
560
  Update Current Position section in STATE.md to reflect plan completion.
@@ -1434,7 +612,7 @@ Progress: ███████░░░ 50%
1434
612
  - [ ] Status reflects current state (In progress / Phase complete)
1435
613
  - [ ] Last activity shows today's date and the plan just completed
1436
614
  - [ ] Progress bar calculated correctly from total completed plans
1437
- </step>
615
+ </step>
1438
616
 
1439
617
  <step name="extract_decisions_and_issues">
1440
618
  Extract decisions, issues, and concerns from SUMMARY.md into STATE.md accumulated context.
@@ -1451,7 +629,7 @@ Extract decisions, issues, and concerns from SUMMARY.md into STATE.md accumulate
1451
629
  - Read SUMMARY.md "## Next Phase Readiness" section
1452
630
  - If contains blockers or concerns:
1453
631
  - Add to STATE.md "Blockers/Concerns Carried Forward"
1454
- </step>
632
+ </step>
1455
633
 
1456
634
  <step name="update_session_continuity">
1457
635
  Update Session Continuity section in STATE.md to enable resumption in future sessions.
@@ -1841,4 +1019,4 @@ All {Y} plans finished.
1841
1019
  - ROADMAP.md updated
1842
1020
  - If codebase map exists: map updated with execution changes (or skipped if no significant changes)
1843
1021
  - If USER-SETUP.md created: prominently surfaced in completion output
1844
- </success_criteria>
1022
+ </success_criteria>