get-shit-done-ios 0.7.0 → 0.9.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 (61) hide show
  1. package/agents/gsd-codebase-mapper.md +3 -0
  2. package/agents/gsd-debugger.md +3 -0
  3. package/agents/gsd-executor.md +18 -0
  4. package/agents/gsd-integration-checker.md +3 -0
  5. package/agents/gsd-phase-researcher.md +81 -4
  6. package/agents/gsd-plan-checker.md +119 -0
  7. package/agents/gsd-planner.md +33 -3
  8. package/agents/gsd-project-researcher.md +3 -0
  9. package/agents/gsd-research-synthesizer.md +3 -0
  10. package/agents/gsd-roadmapper.md +3 -0
  11. package/agents/gsd-verifier.md +3 -0
  12. package/bin/install.js +61 -22
  13. package/commands/gsd/add-phase.md +6 -2
  14. package/commands/gsd/add-todo.md +6 -1
  15. package/commands/gsd/audit-milestone.md +1 -7
  16. package/commands/gsd/check-todos.md +6 -2
  17. package/commands/gsd/debug.md +3 -1
  18. package/commands/gsd/discuss-phase.md +1 -5
  19. package/commands/gsd/execute-phase.md +1 -2
  20. package/commands/gsd/insert-phase.md +1 -2
  21. package/commands/gsd/list-phase-assumptions.md +1 -5
  22. package/commands/gsd/new-milestone.md +1 -8
  23. package/commands/gsd/pause-work.md +4 -1
  24. package/commands/gsd/plan-milestone-gaps.md +1 -7
  25. package/commands/gsd/quick.md +2 -1
  26. package/commands/gsd/remove-phase.md +1 -2
  27. package/commands/gsd/verify-work.md +1 -2
  28. package/get-shit-done/bin/gsd-tools.cjs +87 -4860
  29. package/get-shit-done/bin/lib/commands.cjs +556 -0
  30. package/get-shit-done/bin/lib/config.cjs +162 -0
  31. package/get-shit-done/bin/lib/core.cjs +398 -0
  32. package/get-shit-done/bin/lib/frontmatter.cjs +299 -0
  33. package/get-shit-done/bin/lib/init.cjs +694 -0
  34. package/get-shit-done/bin/lib/milestone.cjs +215 -0
  35. package/get-shit-done/bin/lib/phase.cjs +873 -0
  36. package/get-shit-done/bin/lib/roadmap.cjs +298 -0
  37. package/get-shit-done/bin/lib/state.cjs +490 -0
  38. package/get-shit-done/bin/lib/template.cjs +222 -0
  39. package/get-shit-done/bin/lib/verify.cjs +772 -0
  40. package/get-shit-done/templates/VALIDATION.md +104 -0
  41. package/get-shit-done/templates/config.json +2 -1
  42. package/get-shit-done/workflows/diagnose-issues.md +1 -1
  43. package/get-shit-done/workflows/discuss-phase.md +63 -13
  44. package/get-shit-done/workflows/execute-phase.md +29 -4
  45. package/get-shit-done/workflows/execute-plan.md +6 -20
  46. package/get-shit-done/workflows/help.md +2 -2
  47. package/get-shit-done/workflows/map-codebase.md +32 -44
  48. package/get-shit-done/workflows/new-milestone.md +16 -7
  49. package/get-shit-done/workflows/new-project.md +26 -30
  50. package/get-shit-done/workflows/plan-phase.md +105 -79
  51. package/get-shit-done/workflows/progress.md +14 -26
  52. package/get-shit-done/workflows/quick.md +24 -15
  53. package/get-shit-done/workflows/research-phase.md +10 -11
  54. package/get-shit-done/workflows/settings.md +16 -3
  55. package/get-shit-done/workflows/verify-work.md +11 -12
  56. package/hooks/dist/gsd-check-update.js +1 -1
  57. package/hooks/dist/gsd-context-monitor.js +122 -0
  58. package/hooks/dist/gsd-statusline.js +17 -0
  59. package/package.json +2 -2
  60. package/scripts/build-hooks.js +1 -0
  61. package/get-shit-done/bin/gsd-tools.test.cjs +0 -2346
@@ -15,6 +15,9 @@ You are spawned by `/gsd:map-codebase` with one of four focus areas:
15
15
  - **concerns**: Identify technical debt and issues → write CONCERNS.md
16
16
 
17
17
  Your job: Explore thoroughly, then write document(s) directly. Return confirmation only.
18
+
19
+ **CRITICAL: Mandatory Initial Read**
20
+ If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context.
18
21
  </role>
19
22
 
20
23
  <why_this_matters>
@@ -15,6 +15,9 @@ You are spawned by:
15
15
 
16
16
  Your job: Find the root cause through hypothesis testing, maintain debug file state, optionally fix and verify (depending on mode).
17
17
 
18
+ **CRITICAL: Mandatory Initial Read**
19
+ If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context.
20
+
18
21
  **Core responsibilities:**
19
22
  - Investigate autonomously (user reports symptoms, you find cause)
20
23
  - Maintain persistent debug file state (survives context resets)
@@ -18,8 +18,26 @@ Spawned by `/gsd:execute-phase` orchestrator.
18
18
  Your job: Execute the plan completely, commit each task, create SUMMARY.md, update STATE.md.
19
19
 
20
20
  **iOS context:** All implementation work targets iOS 17+ using Swift, SwiftUI, and native Apple frameworks. Prefer Swift concurrency (async/await, actors) over Combine where appropriate. Follow Apple Human Interface Guidelines and App Store Review Guidelines throughout execution.
21
+
22
+ **CRITICAL: Mandatory Initial Read**
23
+ If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context.
21
24
  </role>
22
25
 
26
+ <project_context>
27
+ Before executing, discover project context:
28
+
29
+ **Project instructions:** Read `./CLAUDE.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions.
30
+
31
+ **Project skills:** Check `.agents/skills/` directory if it exists:
32
+ 1. List available skills (subdirectories)
33
+ 2. Read `SKILL.md` for each skill (lightweight index ~130 lines)
34
+ 3. Load specific `rules/*.md` files as needed during implementation
35
+ 4. Do NOT load full `AGENTS.md` files (100KB+ context cost)
36
+ 5. Follow skill rules relevant to your current task
37
+
38
+ This ensures project-specific patterns, conventions, and best practices are applied during execution.
39
+ </project_context>
40
+
23
41
  <execution_flow>
24
42
 
25
43
  <step name="load_project_state" priority="first">
@@ -10,6 +10,9 @@ You are an integration checker. You verify that phases work together as a system
10
10
 
11
11
  Your job: Check cross-phase wiring (exports used, APIs called, data flows) and verify E2E user flows complete without breaks.
12
12
 
13
+ **CRITICAL: Mandatory Initial Read**
14
+ If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context.
15
+
13
16
  **Critical mindset:** Individual phases can pass while the system fails. A component can exist without being imported. An API can exist without being called. Focus on connections, not existence.
14
17
  </role>
15
18
 
@@ -10,6 +10,9 @@ You are a GSD phase researcher. You answer "What do I need to know to PLAN this
10
10
 
11
11
  Spawned by `/gsd:plan-phase` (integrated) or `/gsd:research-phase` (standalone).
12
12
 
13
+ **CRITICAL: Mandatory Initial Read**
14
+ If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context.
15
+
13
16
  **Core responsibilities:**
14
17
  - Investigate the phase's technical domain
15
18
  - Identify standard stack, patterns, and pitfalls
@@ -18,6 +21,21 @@ Spawned by `/gsd:plan-phase` (integrated) or `/gsd:research-phase` (standalone).
18
21
  - Return structured result to orchestrator
19
22
  </role>
20
23
 
24
+ <project_context>
25
+ Before researching, discover project context:
26
+
27
+ **Project instructions:** Read `./CLAUDE.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions.
28
+
29
+ **Project skills:** Check `.agents/skills/` directory if it exists:
30
+ 1. List available skills (subdirectories)
31
+ 2. Read `SKILL.md` for each skill (lightweight index ~130 lines)
32
+ 3. Load specific `rules/*.md` files as needed during implementation
33
+ 4. Do NOT load full `AGENTS.md` files (100KB+ context cost)
34
+ 5. Follow skill rules relevant to your current task
35
+
36
+ This ensures project-specific patterns, conventions, and best practices are applied during research.
37
+ </project_context>
38
+
21
39
  <upstream_input>
22
40
  **CONTEXT.md** (if exists) — User decisions from `/gsd:discuss-phase`
23
41
 
@@ -330,6 +348,37 @@ Verified patterns from official sources:
330
348
  - What's unclear: [the gap]
331
349
  - Recommendation: [how to handle]
332
350
 
351
+ ## Validation Architecture
352
+
353
+ > Skip this section entirely if workflow.nyquist_validation is false in .planning/config.json
354
+
355
+ ### Test Framework
356
+ | Property | Value |
357
+ |----------|-------|
358
+ | Framework | {framework name + version} |
359
+ | Config file | {path or "none — see Wave 0"} |
360
+ | Quick run command | `{command}` |
361
+ | Full suite command | `{command}` |
362
+ | Estimated runtime | ~{N} seconds |
363
+
364
+ ### Phase Requirements → Test Map
365
+ | Req ID | Behavior | Test Type | Automated Command | File Exists? |
366
+ |--------|----------|-----------|-------------------|-------------|
367
+ | REQ-XX | {behavior description} | unit | `swift test --filter {TestModule}.{testName}` | ✅ yes / ❌ Wave 0 gap |
368
+
369
+ ### Nyquist Sampling Rate
370
+ - **Minimum sample interval:** After every committed task → run: `{quick run command}`
371
+ - **Full suite trigger:** Before merging final task of any plan wave
372
+ - **Phase-complete gate:** Full suite green before `/gsd:verify-work` runs
373
+ - **Estimated feedback latency per task:** ~{N} seconds
374
+
375
+ ### Wave 0 Gaps (must be created before implementation)
376
+ - [ ] `{Tests/TestFile.swift}` — covers REQ-{XX}
377
+ - [ ] `{Tests/Helpers/SharedFixtures.swift}` — shared fixtures for phase {N}
378
+ - [ ] Framework config: Xcode test plan or Package.swift test targets — if no framework detected
379
+
380
+ *(If no gaps: "None — existing test infrastructure covers all phase requirements")*
381
+
333
382
  ## Sources
334
383
 
335
384
  ### Primary (HIGH confidence)
@@ -370,6 +419,8 @@ INIT=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs init phase-op "${PHASE}")
370
419
 
371
420
  Extract from init JSON: `phase_dir`, `padded_phase`, `phase_number`, `commit_docs`.
372
421
 
422
+ Also check Nyquist validation config — read `.planning/config.json` and check if `workflow.nyquist_validation` is `true`. If `true`, include the Validation Architecture section in RESEARCH.md output (scan for test frameworks, map requirements to test types, identify Wave 0 gaps). If `false`, skip the Validation Architecture section entirely and omit it from output.
423
+
373
424
  Then read CONTEXT.md if exists:
374
425
  ```bash
375
426
  cat "$phase_dir"/*-CONTEXT.md 2>/dev/null
@@ -415,7 +466,33 @@ For each domain: Context7 first → Official docs → WebSearch → Cross-verify
415
466
 
416
467
  **Step 3b: Check for emerging APIs.** Before finalizing the Standard Stack section, actively search for new Apple frameworks and APIs released in the past 12 months relevant to this phase's domain. SwiftUI, SwiftData, and system frameworks evolve every WWDC — do not assume training data reflects the current state of any Apple API. Use Context7 and Apple Developer Documentation to verify current API availability. Flag iOS 18+ / iOS 26+ APIs that could simplify the phase implementation as conditional recommendations.
417
468
 
418
- ## Step 4: Quality Check
469
+ ## Step 4: Validation Architecture Research (if nyquist_validation enabled)
470
+
471
+ **Skip this step if** workflow.nyquist_validation is false in config.
472
+
473
+ This step answers: "How will Claude's executor know, within seconds of committing each task, whether the output is correct?"
474
+
475
+ ### Detect Test Infrastructure
476
+ Scan the codebase for test configuration:
477
+ - Look for test config files: Xcode test plan (.xctestplan), Package.swift test targets
478
+ - Look for test directories: Tests/, *Tests/
479
+ - Look for test files: *Tests.swift, *Test.swift
480
+ - Check for Swift Testing (`import Testing`) vs XCTest (`import XCTest`) usage
481
+
482
+ ### Map Requirements to Tests
483
+ For each requirement in <phase_requirements>:
484
+ - Identify the behavior to verify
485
+ - Determine test type: unit / integration / contract / smoke / e2e / manual-only
486
+ - Specify the automated command to run that test in < 30 seconds
487
+ - Flag if only verifiable manually (justify why)
488
+
489
+ ### Identify Wave 0 Gaps
490
+ List test files, fixtures, or utilities that must be created BEFORE implementation:
491
+ - Missing test files for phase requirements
492
+ - Missing test framework configuration
493
+ - Missing shared fixtures or test utilities
494
+
495
+ ## Step 5: Quality Check
419
496
 
420
497
  - [ ] All domains investigated
421
498
  - [ ] Negative claims verified
@@ -423,7 +500,7 @@ For each domain: Context7 first → Official docs → WebSearch → Cross-verify
423
500
  - [ ] Confidence levels assigned honestly
424
501
  - [ ] "What might I have missed?" review
425
502
 
426
- ## Step 5: Write RESEARCH.md
503
+ ## Step 6: Write RESEARCH.md
427
504
 
428
505
  **ALWAYS use Write tool to persist to disk** — mandatory regardless of `commit_docs` setting.
429
506
 
@@ -462,13 +539,13 @@ Write to: `$PHASE_DIR/$PADDED_PHASE-RESEARCH.md`
462
539
 
463
540
  ⚠️ `commit_docs` controls git only, NOT file writing. Always write first.
464
541
 
465
- ## Step 6: Commit Research (optional)
542
+ ## Step 7: Commit Research (optional)
466
543
 
467
544
  ```bash
468
545
  node ~/.claude/get-shit-done/bin/gsd-tools.cjs commit "docs($PHASE): research phase domain" --files "$PHASE_DIR/$PADDED_PHASE-RESEARCH.md"
469
546
  ```
470
547
 
471
- ## Step 7: Return Structured Result
548
+ ## Step 8: Return Structured Result
472
549
 
473
550
  </execution_flow>
474
551
 
@@ -12,6 +12,9 @@ Spawned by `/gsd:plan-phase` orchestrator (after planner creates PLAN.md) or re-
12
12
 
13
13
  Goal-backward verification of PLANS before execution. Start from what the phase SHOULD deliver, verify plans address it.
14
14
 
15
+ **CRITICAL: Mandatory Initial Read**
16
+ If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context.
17
+
15
18
  **Critical mindset:** Plans describe intent. You verify they deliver. A plan can have all tasks filled in but still miss the goal if:
16
19
  - Key requirements have no tasks
17
20
  - Tasks exist but don't actually achieve the requirement
@@ -23,6 +26,21 @@ Goal-backward verification of PLANS before execution. Start from what the phase
23
26
  You are NOT the executor or verifier — you verify plans WILL work before execution burns context.
24
27
  </role>
25
28
 
29
+ <project_context>
30
+ Before verifying, discover project context:
31
+
32
+ **Project instructions:** Read `./CLAUDE.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions.
33
+
34
+ **Project skills:** Check `.agents/skills/` directory if it exists:
35
+ 1. List available skills (subdirectories)
36
+ 2. Read `SKILL.md` for each skill (lightweight index ~130 lines)
37
+ 3. Load specific `rules/*.md` files as needed during implementation
38
+ 4. Do NOT load full `AGENTS.md` files (100KB+ context cost)
39
+ 5. Follow skill rules relevant to your current task
40
+
41
+ This ensures project-specific patterns, conventions, and best practices are applied during verification.
42
+ </project_context>
43
+
26
44
  <upstream_input>
27
45
  **CONTEXT.md** (if exists) — User decisions from `/gsd:discuss-phase`
28
46
 
@@ -294,6 +312,105 @@ issue:
294
312
  fix_hint: "Remove search task - belongs in future phase per user decision"
295
313
  ```
296
314
 
315
+ ## Dimension 8: Nyquist Compliance
316
+
317
+ <dimension_8_skip_condition>
318
+ Skip this entire dimension if:
319
+ - workflow.nyquist_validation is false in .planning/config.json
320
+ - The phase being checked has no RESEARCH.md (researcher was skipped)
321
+ - The RESEARCH.md has no "Validation Architecture" section (researcher ran without Nyquist)
322
+
323
+ If skipped, output: "Dimension 8: SKIPPED (nyquist_validation disabled or not applicable)"
324
+ </dimension_8_skip_condition>
325
+
326
+ <dimension_8_context>
327
+ This dimension enforces the Nyquist-Shannon Sampling Theorem for AI code generation:
328
+ if Claude's executor produces output at high frequency (one task per commit), feedback
329
+ must run at equally high frequency. A plan that produces code without pre-defined
330
+ automated verification is under-sampled — errors will be statistically missed.
331
+
332
+ The gsd-phase-researcher already determined WHAT to test. This dimension verifies
333
+ that the planner correctly incorporated that information into the actual task plans.
334
+ </dimension_8_context>
335
+
336
+ ### Check 8a — Automated Verify Presence
337
+
338
+ For EACH `<task>` element in EACH plan file for this phase:
339
+
340
+ 1. Does `<verify>` contain an `<automated>` command (or structured equivalent)?
341
+ 2. If `<automated>` is absent or empty:
342
+ - Is there a Wave 0 dependency that creates the test before this task runs?
343
+ - If no Wave 0 dependency exists → **BLOCKING FAIL**
344
+ 3. If `<automated>` says "MISSING":
345
+ - A Wave 0 task must reference the same test file path → verify this link is present
346
+ - If the link is broken → **BLOCKING FAIL**
347
+
348
+ **PASS criteria:** Every task either has an `<automated>` verify command, OR explicitly
349
+ references a Wave 0 task that creates the test scaffold it depends on.
350
+
351
+ ### Check 8b — Feedback Latency Assessment
352
+
353
+ Review each `<automated>` command in the plans:
354
+
355
+ 1. Does the command appear to be a full E2E suite (XCUITest full suite, UI test all)?
356
+ - If yes: **WARNING** (non-blocking) — suggest adding a faster unit/smoke test as primary verify
357
+ 2. Does the command include watch mode flags?
358
+ - If yes: **BLOCKING FAIL** — watch mode is not suitable for CI/post-commit sampling
359
+ 3. Does the command include `sleep`, `wait`, or arbitrary delays > 30 seconds?
360
+ - If yes: **WARNING** — flag as latency risk
361
+
362
+ ### Check 8c — Sampling Continuity
363
+
364
+ Review ALL tasks across ALL plans for this phase in wave order:
365
+
366
+ 1. Map each task to its wave number
367
+ 2. For each consecutive window of 3 tasks in the same wave: at least 2 must have
368
+ an `<automated>` verify command (not just Wave 0 scaffolding)
369
+ 3. If any 3 consecutive implementation tasks all lack automated verify: **BLOCKING FAIL**
370
+
371
+ ### Check 8d — Wave 0 Completeness
372
+
373
+ If any plan contains `<automated>MISSING</automated>` or references Wave 0:
374
+
375
+ 1. Does a Wave 0 task exist for every MISSING reference?
376
+ 2. Does the Wave 0 task's `<files>` match the path referenced in the MISSING automated command?
377
+ 3. Is the Wave 0 task in a plan that executes BEFORE the dependent task?
378
+
379
+ **FAIL condition:** Any MISSING automated verify without a matching Wave 0 task.
380
+
381
+ ### Dimension 8 Output Block
382
+
383
+ Include this block in the plan-checker report:
384
+
385
+ ```
386
+ ## Dimension 8: Nyquist Compliance
387
+
388
+ ### Automated Verify Coverage
389
+ | Task | Plan | Wave | Automated Command | Latency | Status |
390
+ |------|------|------|-------------------|---------|--------|
391
+ | {task name} | {plan} | {wave} | `{command}` | ~{N}s | ✅ PASS / ❌ FAIL |
392
+
393
+ ### Sampling Continuity Check
394
+ Wave {N}: {X}/{Y} tasks verified → ✅ PASS / ❌ FAIL
395
+
396
+ ### Wave 0 Completeness
397
+ - {test file} → Wave 0 task present ✅ / MISSING ❌
398
+
399
+ ### Overall Nyquist Status: ✅ PASS / ❌ FAIL
400
+
401
+ ### Revision Instructions (if FAIL)
402
+ Return to planner with the following required changes:
403
+ {list of specific fixes needed}
404
+ ```
405
+
406
+ ### Revision Loop Behavior
407
+
408
+ If Dimension 8 FAILS:
409
+ - Return to `gsd-planner` with the specific revision instructions above
410
+ - The planner must address ALL failing checks before returning
411
+ - This follows the same loop behavior as existing dimensions
412
+ - Maximum 3 revision loops for Dimension 8 before escalating to user
413
+
297
414
  </verification_dimensions>
298
415
 
299
416
  <verification_process>
@@ -311,6 +428,8 @@ Orchestrator provides CONTEXT.md content in the verification prompt. If provided
311
428
 
312
429
  ```bash
313
430
  ls "$phase_dir"/*-PLAN.md 2>/dev/null
431
+ # Read research for Nyquist validation data
432
+ cat "$phase_dir"/*-RESEARCH.md 2>/dev/null
314
433
  node ~/.claude/get-shit-done/bin/gsd-tools.cjs roadmap get-phase "$phase_number"
315
434
  ls "$phase_dir"/*-BRIEF.md 2>/dev/null
316
435
  ```
@@ -15,6 +15,9 @@ Spawned by:
15
15
 
16
16
  Your job: Produce PLAN.md files that Claude executors can implement without interpretation. Plans are prompts, not documents that become prompts.
17
17
 
18
+ **CRITICAL: Mandatory Initial Read**
19
+ If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context.
20
+
18
21
  **Core responsibilities:**
19
22
  - **FIRST: Parse and honor user decisions from CONTEXT.md** (locked decisions are NON-NEGOTIABLE)
20
23
  - Decompose phases into parallel-optimized plans with 2-3 tasks each
@@ -25,6 +28,21 @@ Your job: Produce PLAN.md files that Claude executors can implement without inte
25
28
  - Return structured results to orchestrator
26
29
  </role>
27
30
 
31
+ <project_context>
32
+ Before planning, discover project context:
33
+
34
+ **Project instructions:** Read `./CLAUDE.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions.
35
+
36
+ **Project skills:** Check `.agents/skills/` directory if it exists:
37
+ 1. List available skills (subdirectories)
38
+ 2. Read `SKILL.md` for each skill (lightweight index ~130 lines)
39
+ 3. Load specific `rules/*.md` files as needed during implementation
40
+ 4. Do NOT load full `AGENTS.md` files (100KB+ context cost)
41
+ 5. Follow skill rules relevant to your current task
42
+
43
+ This ensures project-specific patterns, conventions, and best practices are applied during planning.
44
+ </project_context>
45
+
28
46
  <context_fidelity>
29
47
  ## CRITICAL: User Decision Fidelity
30
48
 
@@ -139,9 +157,21 @@ Every task has four required fields:
139
157
  - Good: "Create SignInWithAppleViewModel conforming to ObservableObject. Use ASAuthorizationAppleIDProvider for authentication flow, store credential in Keychain via KeychainService. Persist user profile to SwiftData User model. Use async/await (not Combine - simpler error propagation for one-shot operations)."
140
158
  - Bad: "Add authentication", "Make login work"
141
159
 
142
- **<verify>:** How to prove the task is complete.
143
- - Good: `swift test` passes, `xcodebuild build -scheme App -destination 'platform=iOS Simulator,name=iPhone 16'` succeeds with zero warnings
144
- - Bad: "It works", "Looks good"
160
+ **<verify>:** How to prove the task is complete. Supports structured format:
161
+
162
+ ```xml
163
+ <verify>
164
+ <automated>swift test --filter TestModule.testBehavior</automated>
165
+ <manual>Optional: human-readable description of what to check</manual>
166
+ <sampling_rate>run after this task commits, before next task begins</sampling_rate>
167
+ </verify>
168
+ ```
169
+
170
+ - Good: Specific automated command that runs in < 60 seconds
171
+ - Bad: "It works", "Looks good", manual-only verification
172
+ - Simple format also accepted: `swift test` passes, `xcodebuild build -scheme App -destination 'platform=iOS Simulator,name=iPhone 16'` succeeds with zero warnings
173
+
174
+ **Nyquist Rule:** Every `<verify>` must include an `<automated>` command. If no test exists yet for this behavior, set `<automated>MISSING — Wave 0 must create {test_file} first</automated>` and create a Wave 0 task that generates the test scaffold.
145
175
 
146
176
  **<done>:** Acceptance criteria - measurable state of completion.
147
177
  - Good: "Sign in with Apple flow completes, user profile is persisted to SwiftData, subsequent app launch shows authenticated state"
@@ -10,6 +10,9 @@ You are a GSD project researcher spawned by `/gsd:new-project` or `/gsd:new-mile
10
10
 
11
11
  Answer "What does this domain ecosystem look like for iOS?" Write research files in `.planning/research/` that inform roadmap creation. Always prioritize Apple-native frameworks and patterns. Consult `get-shit-done/references/ios-swift-guidelines.md` and `get-shit-done/references/ios-frameworks.md` as authoritative references.
12
12
 
13
+ **CRITICAL: Mandatory Initial Read**
14
+ If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context.
15
+
13
16
  Your files feed the roadmap:
14
17
 
15
18
  | File | How Roadmap Uses It |
@@ -14,6 +14,9 @@ You are spawned by:
14
14
 
15
15
  Your job: Create a unified research summary that informs roadmap creation. Extract key findings, identify patterns across research files, and produce roadmap implications.
16
16
 
17
+ **CRITICAL: Mandatory Initial Read**
18
+ If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context.
19
+
17
20
  **Core responsibilities:**
18
21
  - Read all 4 research files (STACK.md, FEATURES.md, ARCHITECTURE.md, PITFALLS.md)
19
22
  - Synthesize findings into executive summary
@@ -14,6 +14,9 @@ You are spawned by:
14
14
 
15
15
  Your job: Transform requirements into a phase structure that delivers the iOS app. Every v1 requirement maps to exactly one phase. Every phase has observable success criteria that can be verified on a real device or simulator.
16
16
 
17
+ **CRITICAL: Mandatory Initial Read**
18
+ If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context.
19
+
17
20
  **Core responsibilities:**
18
21
  - Derive phases from requirements (not impose arbitrary structure)
19
22
  - Validate 100% requirement coverage (no orphans)
@@ -12,6 +12,9 @@ You are a GSD phase verifier. You verify that a phase achieved its GOAL, not jus
12
12
 
13
13
  Your job: Goal-backward verification. Start from what the phase SHOULD deliver, verify it actually exists and works in the codebase.
14
14
 
15
+ **CRITICAL: Mandatory Initial Read**
16
+ If the prompt contains a `<files_to_read>` block, you MUST use the `Read` tool to load every file listed there before performing any other actions. This is your primary context.
17
+
15
18
  **Critical mindset:** Do NOT trust SUMMARY.md claims. SUMMARYs document what Claude SAID it did. You verify what ACTUALLY exists in the code. These often differ.
16
19
  </role>
17
20
 
package/bin/install.js CHANGED
@@ -127,15 +127,16 @@ function getGlobalDir(runtime, explicitDir = null) {
127
127
  return path.join(os.homedir(), '.claude');
128
128
  }
129
129
 
130
+ const orange = '\x1b[38;2;255;158;100m';
130
131
  const banner = '\n' +
131
- cyan + ' ██████╗ ███████╗██████╗\n' +
132
- ' ██╔════╝ ██╔════╝██╔══██╗\n' +
133
- ' ██║ ███╗███████╗██║ ██║\n' +
134
- ' ██║ ██║╚════██║██║ ██║\n' +
135
- ' ╚██████╔╝███████║██████╔╝\n' +
136
- ' ╚═════╝ ╚══════╝╚═════╝' + reset + '\n' +
132
+ ' ' + cyan + ' ██████╗ ███████╗██████╗ ' + orange + ' ██╗ ██████╗ ███████╗' + reset + '\n' +
133
+ ' ' + cyan + '██╔════╝ ██╔════╝██╔══██╗' + orange + '██╗██║██╔═══██╗██╔════╝' + reset + '\n' +
134
+ ' ' + cyan + '██║ ███╗███████╗██║ ██║' + orange + '╚═╝██║██║ ██║███████╗' + reset + '\n' +
135
+ ' ' + cyan + '██║ ██║╚════██║██║ ██║' + orange + '██╗██║██║ ██║╚════██║' + reset + '\n' +
136
+ ' ' + cyan + '╚██████╔╝███████║██████╔╝' + orange + '╚═╝██║╚██████╔╝███████║' + reset + '\n' +
137
+ ' ' + cyan + ' ╚═════╝ ╚══════╝╚═════╝ ' + orange + ' ╚═╝ ╚═════╝ ╚══════╝' + reset + '\n' +
137
138
  '\n' +
138
- ' GSD' + '\x1b[38;2;255;158;100m' + ':iOS' + reset + ' ' + dim + 'v' + pkg.version + reset + '\n' +
139
+ ' GSD' + orange + ':iOS' + reset + ' ' + dim + 'v' + pkg.version + reset + '\n' +
139
140
  ' A meta-prompting, context engineering and spec-driven\n' +
140
141
  ' development system for Claude Code by TÂCHES.\n' +
141
142
  ' iOS adaptation by the-andys.\n';
@@ -880,7 +881,7 @@ function uninstall(isGlobal, runtime = 'claude') {
880
881
  // 4. Remove GSD hooks
881
882
  const hooksDir = path.join(targetDir, 'hooks');
882
883
  if (fs.existsSync(hooksDir)) {
883
- const gsdHooks = ['gsd-statusline.js', 'gsd-check-update.js', 'gsd-check-update.sh'];
884
+ const gsdHooks = ['gsd-statusline.js', 'gsd-check-update.js', 'gsd-check-update.sh', 'gsd-context-monitor.js'];
884
885
  let hookCount = 0;
885
886
  for (const hook of gsdHooks) {
886
887
  const hookPath = path.join(hooksDir, hook);
@@ -946,10 +947,32 @@ function uninstall(isGlobal, runtime = 'claude') {
946
947
  if (settings.hooks.SessionStart.length === 0) {
947
948
  delete settings.hooks.SessionStart;
948
949
  }
949
- // Clean up empty hooks object
950
- if (Object.keys(settings.hooks).length === 0) {
951
- delete settings.hooks;
950
+ }
951
+
952
+ // Remove GSD hooks from PostToolUse
953
+ if (settings.hooks && settings.hooks.PostToolUse) {
954
+ const before = settings.hooks.PostToolUse.length;
955
+ settings.hooks.PostToolUse = settings.hooks.PostToolUse.filter(entry => {
956
+ if (entry.hooks && Array.isArray(entry.hooks)) {
957
+ const hasGsdHook = entry.hooks.some(h =>
958
+ h.command && h.command.includes('gsd-context-monitor')
959
+ );
960
+ return !hasGsdHook;
961
+ }
962
+ return true;
963
+ });
964
+ if (settings.hooks.PostToolUse.length < before) {
965
+ settingsModified = true;
966
+ console.log(` ${green}✓${reset} Removed context monitor hook from settings`);
952
967
  }
968
+ if (settings.hooks.PostToolUse.length === 0) {
969
+ delete settings.hooks.PostToolUse;
970
+ }
971
+ }
972
+
973
+ // Clean up empty hooks object
974
+ if (settings.hooks && Object.keys(settings.hooks).length === 0) {
975
+ delete settings.hooks;
953
976
  }
954
977
 
955
978
  if (settingsModified) {
@@ -1334,11 +1357,8 @@ function install(isGlobal, runtime = 'claude') {
1334
1357
  : targetDir.replace(process.cwd(), '.');
1335
1358
 
1336
1359
  // Path prefix for file references in markdown content
1337
- // For global installs: use full path
1338
- // For local installs: use relative
1339
- const pathPrefix = isGlobal
1340
- ? `${targetDir.replace(/\\/g, '/')}/`
1341
- : `./${dirName}/`;
1360
+ // Always use absolute paths Claude Code does not resolve @./ relative to project CWD
1361
+ const pathPrefix = `${targetDir.replace(/\\/g, '/')}/`;
1342
1362
 
1343
1363
  let runtimeLabel = 'Claude Code';
1344
1364
  if (isOpencode) runtimeLabel = 'OpenCode';
@@ -1502,12 +1522,10 @@ function install(isGlobal, runtime = 'claude') {
1502
1522
  // Gemini shares same hook system as Claude Code for now
1503
1523
  const settingsPath = path.join(targetDir, 'settings.json');
1504
1524
  const settings = cleanupOrphanedHooks(readSettings(settingsPath));
1505
- const statuslineCommand = isGlobal
1506
- ? buildHookCommand(targetDir, 'gsd-statusline.js')
1507
- : 'node ' + dirName + '/hooks/gsd-statusline.js';
1508
- const updateCheckCommand = isGlobal
1509
- ? buildHookCommand(targetDir, 'gsd-check-update.js')
1510
- : 'node ' + dirName + '/hooks/gsd-check-update.js';
1525
+ // Always use absolute paths for hook commands — relative paths fail when CWD changes
1526
+ const statuslineCommand = buildHookCommand(targetDir, 'gsd-statusline.js');
1527
+ const updateCheckCommand = buildHookCommand(targetDir, 'gsd-check-update.js');
1528
+ const contextMonitorCommand = buildHookCommand(targetDir, 'gsd-context-monitor.js');
1511
1529
 
1512
1530
  // Enable experimental agents for Gemini CLI (required for custom sub-agents)
1513
1531
  if (isGemini) {
@@ -1544,6 +1562,27 @@ function install(isGlobal, runtime = 'claude') {
1544
1562
  });
1545
1563
  console.log(` ${green}✓${reset} Configured update check hook`);
1546
1564
  }
1565
+
1566
+ // Configure PostToolUse hook for context window monitoring
1567
+ if (!settings.hooks.PostToolUse) {
1568
+ settings.hooks.PostToolUse = [];
1569
+ }
1570
+
1571
+ const hasContextMonitorHook = settings.hooks.PostToolUse.some(entry =>
1572
+ entry.hooks && entry.hooks.some(h => h.command && h.command.includes('gsd-context-monitor'))
1573
+ );
1574
+
1575
+ if (!hasContextMonitorHook) {
1576
+ settings.hooks.PostToolUse.push({
1577
+ hooks: [
1578
+ {
1579
+ type: 'command',
1580
+ command: contextMonitorCommand
1581
+ }
1582
+ ]
1583
+ });
1584
+ console.log(` ${green}✓${reset} Configured context window monitor hook`);
1585
+ }
1547
1586
  }
1548
1587
 
1549
1588
  // Write file manifest for future modification detection
@@ -19,11 +19,15 @@ Routes to the add-phase workflow which handles:
19
19
  </objective>
20
20
 
21
21
  <execution_context>
22
- @.planning/ROADMAP.md
23
- @.planning/STATE.md
24
22
  @~/.claude/get-shit-done/workflows/add-phase.md
25
23
  </execution_context>
26
24
 
25
+ <context>
26
+ Arguments: $ARGUMENTS (phase description)
27
+
28
+ Roadmap and state are resolved in-workflow via `init phase-op` and targeted tool calls.
29
+ </context>
30
+
27
31
  <process>
28
32
  **Follow the add-phase workflow** from `@~/.claude/get-shit-done/workflows/add-phase.md`.
29
33
 
@@ -23,10 +23,15 @@ Routes to the add-todo workflow which handles:
23
23
  </objective>
24
24
 
25
25
  <execution_context>
26
- @.planning/STATE.md
27
26
  @~/.claude/get-shit-done/workflows/add-todo.md
28
27
  </execution_context>
29
28
 
29
+ <context>
30
+ Arguments: $ARGUMENTS (optional todo description)
31
+
32
+ State is resolved in-workflow via `init todos` and targeted reads.
33
+ </context>
34
+
30
35
  <process>
31
36
  **Follow the add-todo workflow** from `@~/.claude/get-shit-done/workflows/add-todo.md`.
32
37
 
@@ -23,13 +23,7 @@ Verify milestone achieved its definition of done. Check requirements coverage, c
23
23
  <context>
24
24
  Version: $ARGUMENTS (optional — defaults to current milestone)
25
25
 
26
- **Original Intent:**
27
- @.planning/PROJECT.md
28
- @.planning/REQUIREMENTS.md
29
-
30
- **Planned Work:**
31
- @.planning/ROADMAP.md
32
- @.planning/config.json (if exists)
26
+ Core planning files are resolved in-workflow (`init milestone-op`) and loaded only as needed.
33
27
 
34
28
  **Completed Work:**
35
29
  Glob: .planning/phases/*/*-SUMMARY.md
@@ -21,11 +21,15 @@ Routes to the check-todos workflow which handles:
21
21
  </objective>
22
22
 
23
23
  <execution_context>
24
- @.planning/STATE.md
25
- @.planning/ROADMAP.md
26
24
  @~/.claude/get-shit-done/workflows/check-todos.md
27
25
  </execution_context>
28
26
 
27
+ <context>
28
+ Arguments: $ARGUMENTS (optional area filter)
29
+
30
+ Todo state and roadmap correlation are loaded in-workflow using `init todos` and targeted reads.
31
+ </context>
32
+
29
33
  <process>
30
34
  **Follow the check-todos workflow** from `@~/.claude/get-shit-done/workflows/check-todos.md`.
31
35
 
@@ -129,7 +129,9 @@ Continue debugging {slug}. Evidence is in the debug file.
129
129
  </objective>
130
130
 
131
131
  <prior_state>
132
- Debug file: @.planning/debug/{slug}.md
132
+ <files_to_read>
133
+ - .planning/debug/{slug}.md (Debug session state)
134
+ </files_to_read>
133
135
  </prior_state>
134
136
 
135
137
  <checkpoint_response>