gsd-pi 2.38.0-dev.7209774 → 2.38.0-dev.785052f

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 (81) hide show
  1. package/README.md +15 -11
  2. package/dist/resources/extensions/gsd/auto-prompts.js +171 -4
  3. package/dist/resources/extensions/gsd/doctor-providers.js +3 -0
  4. package/dist/resources/extensions/gsd/files.js +42 -7
  5. package/dist/resources/extensions/gsd/gitignore.js +16 -3
  6. package/dist/resources/extensions/gsd/guided-flow.js +67 -6
  7. package/dist/resources/extensions/gsd/health-widget-core.js +32 -70
  8. package/dist/resources/extensions/gsd/health-widget.js +3 -86
  9. package/dist/resources/extensions/gsd/migrate-external.js +18 -1
  10. package/dist/resources/extensions/gsd/preferences.js +17 -9
  11. package/dist/resources/extensions/gsd/prompt-loader.js +6 -2
  12. package/dist/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
  13. package/dist/resources/extensions/gsd/prompts/complete-slice.md +1 -1
  14. package/dist/resources/extensions/gsd/prompts/execute-task.md +1 -1
  15. package/dist/resources/extensions/gsd/prompts/guided-complete-slice.md +1 -1
  16. package/dist/resources/extensions/gsd/prompts/guided-execute-task.md +1 -1
  17. package/dist/resources/extensions/gsd/prompts/guided-plan-milestone.md +1 -1
  18. package/dist/resources/extensions/gsd/prompts/guided-plan-slice.md +1 -1
  19. package/dist/resources/extensions/gsd/prompts/guided-research-slice.md +1 -1
  20. package/dist/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
  21. package/dist/resources/extensions/gsd/prompts/plan-milestone.md +1 -1
  22. package/dist/resources/extensions/gsd/prompts/plan-slice.md +1 -1
  23. package/dist/resources/extensions/gsd/prompts/reassess-roadmap.md +1 -1
  24. package/dist/resources/extensions/gsd/prompts/research-milestone.md +1 -1
  25. package/dist/resources/extensions/gsd/prompts/research-slice.md +1 -1
  26. package/dist/resources/extensions/gsd/prompts/run-uat.md +1 -1
  27. package/dist/resources/extensions/gsd/state.js +41 -22
  28. package/dist/resources/extensions/gsd/templates/task-plan.md +3 -0
  29. package/dist/resources/extensions/remote-questions/status.js +4 -2
  30. package/dist/resources/extensions/remote-questions/store.js +4 -2
  31. package/dist/resources/extensions/shared/frontmatter.js +1 -1
  32. package/package.json +1 -1
  33. package/packages/pi-coding-agent/dist/core/skills.d.ts +1 -0
  34. package/packages/pi-coding-agent/dist/core/skills.d.ts.map +1 -1
  35. package/packages/pi-coding-agent/dist/core/skills.js +6 -1
  36. package/packages/pi-coding-agent/dist/core/skills.js.map +1 -1
  37. package/packages/pi-coding-agent/dist/index.d.ts +1 -1
  38. package/packages/pi-coding-agent/dist/index.d.ts.map +1 -1
  39. package/packages/pi-coding-agent/dist/index.js +1 -1
  40. package/packages/pi-coding-agent/dist/index.js.map +1 -1
  41. package/packages/pi-coding-agent/src/core/skills.ts +9 -1
  42. package/packages/pi-coding-agent/src/index.ts +1 -0
  43. package/src/resources/extensions/gsd/auto-prompts.ts +213 -4
  44. package/src/resources/extensions/gsd/doctor-providers.ts +4 -0
  45. package/src/resources/extensions/gsd/files.ts +46 -8
  46. package/src/resources/extensions/gsd/gitignore.ts +17 -3
  47. package/src/resources/extensions/gsd/guided-flow.ts +67 -6
  48. package/src/resources/extensions/gsd/health-widget-core.ts +28 -80
  49. package/src/resources/extensions/gsd/health-widget.ts +3 -89
  50. package/src/resources/extensions/gsd/migrate-external.ts +18 -1
  51. package/src/resources/extensions/gsd/preferences.ts +20 -9
  52. package/src/resources/extensions/gsd/prompt-loader.ts +7 -2
  53. package/src/resources/extensions/gsd/prompts/complete-milestone.md +1 -1
  54. package/src/resources/extensions/gsd/prompts/complete-slice.md +1 -1
  55. package/src/resources/extensions/gsd/prompts/execute-task.md +1 -1
  56. package/src/resources/extensions/gsd/prompts/guided-complete-slice.md +1 -1
  57. package/src/resources/extensions/gsd/prompts/guided-execute-task.md +1 -1
  58. package/src/resources/extensions/gsd/prompts/guided-plan-milestone.md +1 -1
  59. package/src/resources/extensions/gsd/prompts/guided-plan-slice.md +1 -1
  60. package/src/resources/extensions/gsd/prompts/guided-research-slice.md +1 -1
  61. package/src/resources/extensions/gsd/prompts/guided-resume-task.md +1 -1
  62. package/src/resources/extensions/gsd/prompts/plan-milestone.md +1 -1
  63. package/src/resources/extensions/gsd/prompts/plan-slice.md +1 -1
  64. package/src/resources/extensions/gsd/prompts/reassess-roadmap.md +1 -1
  65. package/src/resources/extensions/gsd/prompts/research-milestone.md +1 -1
  66. package/src/resources/extensions/gsd/prompts/research-slice.md +1 -1
  67. package/src/resources/extensions/gsd/prompts/run-uat.md +1 -1
  68. package/src/resources/extensions/gsd/state.ts +38 -20
  69. package/src/resources/extensions/gsd/templates/task-plan.md +3 -0
  70. package/src/resources/extensions/gsd/tests/auto-worktree-milestone-merge.test.ts +4 -3
  71. package/src/resources/extensions/gsd/tests/derive-state.test.ts +43 -0
  72. package/src/resources/extensions/gsd/tests/gitignore-tracked-gsd.test.ts +50 -0
  73. package/src/resources/extensions/gsd/tests/health-widget.test.ts +16 -54
  74. package/src/resources/extensions/gsd/tests/parsers.test.ts +131 -14
  75. package/src/resources/extensions/gsd/tests/plan-slice-prompt.test.ts +209 -0
  76. package/src/resources/extensions/gsd/tests/run-uat.test.ts +5 -1
  77. package/src/resources/extensions/gsd/tests/skill-activation.test.ts +140 -0
  78. package/src/resources/extensions/gsd/types.ts +10 -0
  79. package/src/resources/extensions/remote-questions/status.ts +4 -2
  80. package/src/resources/extensions/remote-questions/store.ts +4 -2
  81. package/src/resources/extensions/shared/frontmatter.ts +1 -1
@@ -20,7 +20,7 @@ All relevant context has been preloaded below — the slice plan, all task summa
20
20
 
21
21
  Then:
22
22
  1. Use the **Slice Summary** and **UAT** output templates from the inlined context above
23
- 2. If a `GSD Skill Preferences` block is present in system context, use it to decide which skills to load and follow during completion, without relaxing required verification or artifact rules
23
+ 2. {{skillActivation}}
24
24
  3. Run all slice-level verification checks defined in the slice plan. All must pass before marking the slice done. If any fail, fix them first.
25
25
  4. If the slice plan includes observability/diagnostic surfaces, confirm they work. Skip this for simple slices that don't have observability sections.
26
26
  5. If `.gsd/REQUIREMENTS.md` exists, update it based on what this slice actually proved. Move requirements between Active, Validated, Deferred, Blocked, or Out of Scope only when the evidence from execution supports that change.
@@ -28,7 +28,7 @@ A researcher explored the codebase and a planner decomposed the work — you are
28
28
 
29
29
  Then:
30
30
  0. Narrate step transitions, key implementation decisions, and verification outcomes as you work. Keep it terse — one line between tool-call clusters, not between every call — but write complete sentences in user-facing prose, not shorthand notes or scratchpad fragments.
31
- 1. **Load relevant skills before writing code.** Check the `GSD Skill Preferences` block in system context and the `<available_skills>` catalog in your system prompt. For each skill that matches this task's technology stack (e.g., React, Next.js, accessibility, component design), `read` its SKILL.md file now. Skills contain implementation rules and patterns that should guide your code. If no skills match this task, skip this step.
31
+ 1. {{skillActivation}} Follow any activated skills before writing code. If no skills match this task, skip this step.
32
32
  2. Execute the steps in the inlined task plan, adapting minor local mismatches when the surrounding code differs from the planner's snapshot
33
33
  3. Build the real thing. If the task plan says "create login endpoint", build an endpoint that actually authenticates against a real store, not one that returns a hardcoded success response. If the task plan says "create dashboard page", build a page that renders real data from the API, not a component with hardcoded props. Stubs and mocks are for tests, not for the shipped feature.
34
34
  4. Write or update tests as part of execution — tests are verification, not an afterthought. If the slice plan defines test files in its Verification section and this is the first task, create them (they should initially fail).
@@ -1,3 +1,3 @@
1
- Complete slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Your working directory is `{{workingDirectory}}` — all file operations must use this path. All tasks are done. Your slice summary is the primary record of what was built — downstream agents (reassess-roadmap, future slice researchers) read it to understand what this slice delivered and what to watch out for. Use the **Slice Summary** and **UAT** output templates below. If a `GSD Skill Preferences` block is present in system context, use it to decide which skills to load and follow during completion, without relaxing required verification or artifact rules. Write `{{sliceId}}-SUMMARY.md` (compress task summaries), write `{{sliceId}}-UAT.md`, and fill the `UAT Type` plus `Not Proven By This UAT` sections explicitly so the artifact states what class of acceptance it covers and what still remains unproven. Review task summaries for `key_decisions` and ensure any significant ones are in `.gsd/DECISIONS.md`. Mark the slice checkbox done in the roadmap, update milestone summary, Do not commit or merge manually — the system handles this after the unit completes.
1
+ Complete slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Your working directory is `{{workingDirectory}}` — all file operations must use this path. All tasks are done. Your slice summary is the primary record of what was built — downstream agents (reassess-roadmap, future slice researchers) read it to understand what this slice delivered and what to watch out for. Use the **Slice Summary** and **UAT** output templates below. {{skillActivation}} Write `{{sliceId}}-SUMMARY.md` (compress task summaries), write `{{sliceId}}-UAT.md`, and fill the `UAT Type` plus `Not Proven By This UAT` sections explicitly so the artifact states what class of acceptance it covers and what still remains unproven. Review task summaries for `key_decisions` and ensure any significant ones are in `.gsd/DECISIONS.md`. Mark the slice checkbox done in the roadmap, update milestone summary, Do not commit or merge manually — the system handles this after the unit completes.
2
2
 
3
3
  {{inlinedTemplates}}
@@ -1,3 +1,3 @@
1
- Execute the next task: {{taskId}} ("{{taskTitle}}") in slice {{sliceId}} of milestone {{milestoneId}}. Read the task plan (`{{taskId}}-PLAN.md`), load relevant summaries from prior tasks, and execute each step. Verify must-haves when done. If the task touches UI, browser flows, DOM behavior, or user-visible web state, exercise the real flow in the browser, prefer `browser_batch` for obvious sequences, prefer `browser_assert` for explicit pass/fail verification, use `browser_diff` when an action's effect is ambiguous, and use browser diagnostics when validating async or failure-prone UI. If you made an architectural, pattern, or library decision, append it to `.gsd/DECISIONS.md`. Use the **Task Summary** output template below. Write `{{taskId}}-SUMMARY.md`, mark it done, commit, and advance. If a `GSD Skill Preferences` block is present in system context, use it to decide which skills to load and follow during execution, without relaxing required verification or artifact rules. If running long and not all steps are finished, stop implementing and prioritize writing a clean partial summary over attempting one more step — a recoverable handoff is more valuable than a half-finished step with no documentation. If verification fails, debug methodically: form a hypothesis and test that specific theory before changing anything, change one variable at a time, read entire functions not just the suspect line, distinguish observable facts from assumptions, and if 3+ fixes fail without progress stop and reassess your mental model — list what you know for certain, what you've ruled out, and form fresh hypotheses. Don't fix symptoms — understand why something fails before changing code.
1
+ Execute the next task: {{taskId}} ("{{taskTitle}}") in slice {{sliceId}} of milestone {{milestoneId}}. Read the task plan (`{{taskId}}-PLAN.md`), load relevant summaries from prior tasks, and execute each step. Verify must-haves when done. If the task touches UI, browser flows, DOM behavior, or user-visible web state, exercise the real flow in the browser, prefer `browser_batch` for obvious sequences, prefer `browser_assert` for explicit pass/fail verification, use `browser_diff` when an action's effect is ambiguous, and use browser diagnostics when validating async or failure-prone UI. If you made an architectural, pattern, or library decision, append it to `.gsd/DECISIONS.md`. Use the **Task Summary** output template below. Write `{{taskId}}-SUMMARY.md`, mark it done, commit, and advance. {{skillActivation}} If running long and not all steps are finished, stop implementing and prioritize writing a clean partial summary over attempting one more step — a recoverable handoff is more valuable than a half-finished step with no documentation. If verification fails, debug methodically: form a hypothesis and test that specific theory before changing anything, change one variable at a time, read entire functions not just the suspect line, distinguish observable facts from assumptions, and if 3+ fixes fail without progress stop and reassess your mental model — list what you know for certain, what you've ruled out, and form fresh hypotheses. Don't fix symptoms — understand why something fails before changing code.
2
2
 
3
3
  {{inlinedTemplates}}
@@ -1,4 +1,4 @@
1
- Plan milestone {{milestoneId}} ("{{milestoneTitle}}"). Read `.gsd/DECISIONS.md` if it exists — respect existing decisions. Read `.gsd/REQUIREMENTS.md` if it exists and treat Active requirements as the capability contract. If `REQUIREMENTS.md` is missing, continue in legacy compatibility mode but explicitly note missing requirement coverage. Use the **Roadmap** output template below. Create `{{milestoneId}}-ROADMAP.md` in the milestone directory with slices, risk levels, dependencies, demo sentences, verification classes, milestone definition of done, requirement coverage, and a boundary map. Write success criteria as observable truths, not implementation tasks. If the milestone crosses multiple runtime boundaries, include an explicit final integration slice that proves the assembled system works end-to-end in a real environment. If planning produces structural decisions, append them to `.gsd/DECISIONS.md`. If a `GSD Skill Preferences` block is present in system context, use it to decide which skills to load and follow during planning, without overriding required roadmap formatting.
1
+ Plan milestone {{milestoneId}} ("{{milestoneTitle}}"). Read `.gsd/DECISIONS.md` if it exists — respect existing decisions. Read `.gsd/REQUIREMENTS.md` if it exists and treat Active requirements as the capability contract. If `REQUIREMENTS.md` is missing, continue in legacy compatibility mode but explicitly note missing requirement coverage. Use the **Roadmap** output template below. Create `{{milestoneId}}-ROADMAP.md` in the milestone directory with slices, risk levels, dependencies, demo sentences, verification classes, milestone definition of done, requirement coverage, and a boundary map. Write success criteria as observable truths, not implementation tasks. If the milestone crosses multiple runtime boundaries, include an explicit final integration slice that proves the assembled system works end-to-end in a real environment. If planning produces structural decisions, append them to `.gsd/DECISIONS.md`. {{skillActivation}}
2
2
 
3
3
  ## Requirement Rules
4
4
 
@@ -1,3 +1,3 @@
1
- Plan slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.gsd/DECISIONS.md` if it exists — respect existing decisions. Read `.gsd/REQUIREMENTS.md` if it exists — identify which Active requirements the roadmap says this slice owns or supports, and ensure the plan delivers them. Read the roadmap boundary map, any existing context/research files, and dependency summaries. Use the **Slice Plan** and **Task Plan** output templates below. Decompose into tasks with must-haves. Fill the `Proof Level` and `Integration Closure` sections truthfully so the plan says what class of proof this slice really delivers and what end-to-end wiring still remains. Write `{{sliceId}}-PLAN.md` and individual `T##-PLAN.md` files in the `tasks/` subdirectory. If planning produces structural decisions, append them to `.gsd/DECISIONS.md`. If a `GSD Skill Preferences` block is present in system context, use it to decide which skills to load and follow during planning, without overriding required plan formatting. Before committing, self-audit the plan: every must-have maps to at least one task, every task has complete sections (steps, must-haves, verification, observability impact, inputs, and expected output), task ordering is consistent with no circular references, every pair of artifacts that must connect has an explicit wiring step, task scope targets 2–5 steps and 3–8 files (6–8 steps or 8–10 files — consider splitting; 10+ steps or 12+ files — must split), the plan honors locked decisions from context/research/decisions artifacts, the proof-level wording does not overclaim live integration if only fixture/contract proof is planned, every Active requirement this slice owns has at least one task with verification that proves it is met, and every task produces real user-facing progress — if the slice has a UI surface at least one task builds the real UI, if it has an API at least one task connects it to a real data source, and showing the completed result to a non-technical stakeholder would demonstrate real product progress rather than developer artifacts.
1
+ Plan slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.gsd/DECISIONS.md` if it exists — respect existing decisions. Read `.gsd/REQUIREMENTS.md` if it exists — identify which Active requirements the roadmap says this slice owns or supports, and ensure the plan delivers them. Read the roadmap boundary map, any existing context/research files, and dependency summaries. Use the **Slice Plan** and **Task Plan** output templates below. Decompose into tasks with must-haves. Fill the `Proof Level` and `Integration Closure` sections truthfully so the plan says what class of proof this slice really delivers and what end-to-end wiring still remains. Write `{{sliceId}}-PLAN.md` and individual `T##-PLAN.md` files in the `tasks/` subdirectory. If planning produces structural decisions, append them to `.gsd/DECISIONS.md`. {{skillActivation}} Before committing, self-audit the plan: every must-have maps to at least one task, every task has complete sections (steps, must-haves, verification, observability impact, inputs, and expected output), task ordering is consistent with no circular references, every pair of artifacts that must connect has an explicit wiring step, task scope targets 2–5 steps and 3–8 files (6–8 steps or 8–10 files — consider splitting; 10+ steps or 12+ files — must split), the plan honors locked decisions from context/research/decisions artifacts, the proof-level wording does not overclaim live integration if only fixture/contract proof is planned, every Active requirement this slice owns has at least one task with verification that proves it is met, and every task produces real user-facing progress — if the slice has a UI surface at least one task builds the real UI, if it has an API at least one task connects it to a real data source, and showing the completed result to a non-technical stakeholder would demonstrate real product progress rather than developer artifacts.
2
2
 
3
3
  {{inlinedTemplates}}
@@ -1,4 +1,4 @@
1
- Research slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.gsd/DECISIONS.md` if it exists — respect existing decisions, don't contradict them. Read `.gsd/REQUIREMENTS.md` if it exists — identify which Active requirements this slice owns or supports and target research toward risks, unknowns, and constraints that could affect delivery of those requirements. If a `GSD Skill Preferences` block is present in system context, use it to decide which skills to load and follow during research, without relaxing required verification or artifact rules. Explore the relevant code — use `rg`/`find` for targeted reads, or `scout` if the area is broad or unfamiliar. Check libraries with `resolve_library`/`get_library_docs` — skip this for libraries already used in the codebase. Use the **Research** output template below. Write `{{sliceId}}-RESEARCH.md` in the slice directory.
1
+ Research slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.gsd/DECISIONS.md` if it exists — respect existing decisions, don't contradict them. Read `.gsd/REQUIREMENTS.md` if it exists — identify which Active requirements this slice owns or supports and target research toward risks, unknowns, and constraints that could affect delivery of those requirements. {{skillActivation}} Explore the relevant code — use `rg`/`find` for targeted reads, or `scout` if the area is broad or unfamiliar. Check libraries with `resolve_library`/`get_library_docs` — skip this for libraries already used in the codebase. Use the **Research** output template below. Write `{{sliceId}}-RESEARCH.md` in the slice directory.
2
2
 
3
3
  **You are the scout.** A planner agent reads your output in a fresh context to decompose this slice into tasks. Write for the planner — surface key files, where the work divides naturally, what to build first, and how to verify. If the research doc is vague, the planner re-explores code you already read. If it's precise, the planner decomposes immediately.
4
4
 
@@ -1 +1 @@
1
- Resume interrupted work. Find the continue file (`{{sliceId}}-CONTINUE.md` or `continue.md`) in slice {{sliceId}} of milestone {{milestoneId}}, read it, and use it as the recovery contract for where to pick up. Do **not** delete the continue file immediately. Keep it until the task is successfully completed or you have written a newer summary/continue artifact that clearly supersedes it. If the resumed attempt fails again, update or replace the continue file so no recovery context is lost. If a `GSD Skill Preferences` block is present in system context, use it to decide which skills to load and follow during execution, without relaxing required verification or artifact rules.
1
+ Resume interrupted work. Find the continue file (`{{sliceId}}-CONTINUE.md` or `continue.md`) in slice {{sliceId}} of milestone {{milestoneId}}, read it, and use it as the recovery contract for where to pick up. Do **not** delete the continue file immediately. Keep it until the task is successfully completed or you have written a newer summary/continue artifact that clearly supersedes it. If the resumed attempt fails again, update or replace the continue file so no recovery context is lost. {{skillActivation}}
@@ -44,7 +44,7 @@ Narrate your decomposition reasoning — why you're grouping work this way, what
44
44
 
45
45
  Then:
46
46
  1. Use the **Roadmap** output template from the inlined context above
47
- 2. If a `GSD Skill Preferences` block is present in system context, use it to decide which skills to load and follow during planning, without overriding required roadmap formatting
47
+ 2. {{skillActivation}}
48
48
  3. Create the roadmap: decompose into demoable vertical slices — as many as the work genuinely needs, no more. A simple feature might be 1 slice. Don't decompose for decomposition's sake.
49
49
  4. Order by risk (high-risk first)
50
50
  5. Write `{{outputPath}}` with checkboxes, risk, depends, demo sentences, proof strategy, verification classes, milestone definition of done, **requirement coverage**, and a boundary map. Write success criteria as observable truths, not implementation tasks. If the milestone crosses multiple runtime boundaries, include an explicit final integration slice that proves the assembled system works end-to-end in a real environment
@@ -47,7 +47,7 @@ Then:
47
47
  1. Read the templates:
48
48
  - `~/.gsd/agent/extensions/gsd/templates/plan.md`
49
49
  - `~/.gsd/agent/extensions/gsd/templates/task-plan.md`
50
- 2. **Load relevant skills.** Check the `GSD Skill Preferences` block in system context and the `<available_skills>` catalog in your system prompt. `read` any skill files relevant to this slice's technology stack before decomposing. When writing task plans, note which installed skills are relevant in the task description so executors know which to load.
50
+ 2. {{skillActivation}} Record the installed skills you expect executors to use in each task plan's `skills_used` frontmatter.
51
51
  3. Define slice-level verification — the objective stopping condition for this slice:
52
52
  - For non-trivial slices: plan actual test files with real assertions. Name the files.
53
53
  - For simple slices: executable commands or script assertions are fine.
@@ -22,7 +22,7 @@ The following user thoughts were captured during execution and deferred to futur
22
22
 
23
23
  {{deferredCaptures}}
24
24
 
25
- If a `GSD Skill Preferences` block is present in system context, use it to decide which skills to load and follow during reassessment, without relaxing required verification or artifact rules.
25
+ {{skillActivation}}
26
26
 
27
27
  Then assess whether the remaining roadmap still makes sense given what was just built.
28
28
 
@@ -21,7 +21,7 @@ Write for the roadmap planner. It needs to understand: what exists in the codeba
21
21
  A milestone adding a small feature to an established codebase needs targeted research — check the relevant code, confirm the approach, note constraints. A milestone introducing new technology, building a new system, or spanning multiple unfamiliar subsystems needs deep research — explore broadly, look up docs, investigate alternatives. Match your effort to the actual uncertainty, not the template's section count. Include only sections that have real content.
22
22
 
23
23
  Then research the codebase and relevant technologies. Narrate key findings and surprises as you go — what exists, what's missing, what constrains the approach.
24
- 1. If a `GSD Skill Preferences` block is present in system context, use it to decide which skills to load and follow during research, without relaxing required verification or artifact rules
24
+ 1. {{skillActivation}}
25
25
  2. **Skill Discovery ({{skillDiscoveryMode}}):**{{skillDiscoveryInstructions}}
26
26
  3. Explore relevant code. For small/familiar codebases, use `rg`, `find`, and targeted reads. For large or unfamiliar codebases, use `scout` to build a broad map efficiently before diving in.
27
27
  4. Use `resolve_library` / `get_library_docs` for unfamiliar libraries — skip this for libraries already used in the codebase
@@ -42,7 +42,7 @@ An honest "this is straightforward, here's the pattern to follow" is more valuab
42
42
 
43
43
  Research what this slice needs. Narrate key findings and surprises as you go — what exists, what's missing, what constrains the approach.
44
44
  0. If `REQUIREMENTS.md` was preloaded above, identify which Active requirements this slice owns or supports. Research should target these requirements — surfacing risks, unknowns, and implementation constraints that could affect whether the slice actually delivers them.
45
- 1. **Load relevant skills.** Check the `GSD Skill Preferences` block in system context and the `<available_skills>` catalog in your system prompt. `read` any skill files relevant to this slice's technology stack before exploring code. Reference specific rules from loaded skills in your findings where they inform the implementation approach.
45
+ 1. {{skillActivation}} Reference specific rules from loaded skills in your findings where they inform the implementation approach.
46
46
  2. **Skill Discovery ({{skillDiscoveryMode}}):**{{skillDiscoveryInstructions}}
47
47
  3. Explore relevant code for this slice's scope. For targeted exploration, use `rg`, `find`, and reads. For broad or unfamiliar subsystems, use `scout` to map the relevant area first.
48
48
  4. Use `resolve_library` / `get_library_docs` for unfamiliar libraries — skip this for libraries already used in the codebase
@@ -10,7 +10,7 @@ All relevant context has been preloaded below. Start working immediately without
10
10
 
11
11
  {{inlinedContext}}
12
12
 
13
- If a `GSD Skill Preferences` block is present in system context, use it to decide which skills to load and follow during UAT execution, without relaxing required verification or artifact rules.
13
+ {{skillActivation}}
14
14
 
15
15
  ---
16
16
 
@@ -126,7 +126,12 @@ export async function getActiveMilestoneId(basePath: string): Promise<string | n
126
126
  // A draft milestone is still "active" — this function only determines which milestone is current.
127
127
  }
128
128
  const roadmap = parseRoadmap(content);
129
- if (!isMilestoneComplete(roadmap)) return mid;
129
+ if (!isMilestoneComplete(roadmap)) {
130
+ // Summary is the terminal artifact — if it exists, the milestone is
131
+ // complete even when roadmap checkboxes weren't ticked (#864).
132
+ const summaryFile = resolveMilestoneFile(basePath, mid, "SUMMARY");
133
+ if (!summaryFile) return mid;
134
+ }
130
135
  }
131
136
  return null;
132
137
  }
@@ -258,7 +263,13 @@ async function _deriveStateImpl(basePath: string): Promise<GSDState> {
258
263
  }
259
264
  const rmap = parseRoadmap(rc);
260
265
  roadmapCache.set(mid, rmap);
261
- if (!isMilestoneComplete(rmap)) continue;
266
+ if (!isMilestoneComplete(rmap)) {
267
+ // Summary is the terminal artifact — if it exists, the milestone is
268
+ // complete even when roadmap checkboxes weren't ticked (#864).
269
+ const sf = resolveMilestoneFile(basePath, mid, "SUMMARY");
270
+ if (sf) completeMilestoneIds.add(mid);
271
+ continue;
272
+ }
262
273
  const sf = resolveMilestoneFile(basePath, mid, "SUMMARY");
263
274
  if (sf) completeMilestoneIds.add(mid);
264
275
  }
@@ -357,26 +368,33 @@ async function _deriveStateImpl(basePath: string): Promise<GSDState> {
357
368
  } else {
358
369
  registry.push({ id: mid, title, status: 'complete' });
359
370
  }
360
- } else if (!activeMilestoneFound) {
361
- // Check milestone-level dependencies before promoting to active
362
- const contextFile = resolveMilestoneFile(basePath, mid, "CONTEXT");
363
- const contextContent = contextFile ? await cachedLoadFile(contextFile) : null;
364
- const deps = parseContextDependsOn(contextContent);
365
- const depsUnmet = deps.some(dep => !completeMilestoneIds.has(dep));
366
- if (depsUnmet) {
367
- registry.push({ id: mid, title, status: 'pending', dependsOn: deps });
368
- // Do NOT set activeMilestoneFound — let the loop continue to the next milestone
371
+ } else {
372
+ // Roadmap slices not all checked but if a summary exists, the milestone
373
+ // is still complete. The summary is the terminal artifact (#864).
374
+ const summaryFile = resolveMilestoneFile(basePath, mid, "SUMMARY");
375
+ if (summaryFile) {
376
+ registry.push({ id: mid, title, status: 'complete' });
377
+ } else if (!activeMilestoneFound) {
378
+ // Check milestone-level dependencies before promoting to active
379
+ const contextFile = resolveMilestoneFile(basePath, mid, "CONTEXT");
380
+ const contextContent = contextFile ? await cachedLoadFile(contextFile) : null;
381
+ const deps = parseContextDependsOn(contextContent);
382
+ const depsUnmet = deps.some(dep => !completeMilestoneIds.has(dep));
383
+ if (depsUnmet) {
384
+ registry.push({ id: mid, title, status: 'pending', dependsOn: deps });
385
+ // Do NOT set activeMilestoneFound — let the loop continue to the next milestone
386
+ } else {
387
+ activeMilestone = { id: mid, title };
388
+ activeRoadmap = roadmap;
389
+ activeMilestoneFound = true;
390
+ registry.push({ id: mid, title, status: 'active', ...(deps.length > 0 ? { dependsOn: deps } : {}) });
391
+ }
369
392
  } else {
370
- activeMilestone = { id: mid, title };
371
- activeRoadmap = roadmap;
372
- activeMilestoneFound = true;
373
- registry.push({ id: mid, title, status: 'active', ...(deps.length > 0 ? { dependsOn: deps } : {}) });
393
+ const contextFile2 = resolveMilestoneFile(basePath, mid, "CONTEXT");
394
+ const contextContent2 = contextFile2 ? await cachedLoadFile(contextFile2) : null;
395
+ const deps2 = parseContextDependsOn(contextContent2);
396
+ registry.push({ id: mid, title, status: 'pending', ...(deps2.length > 0 ? { dependsOn: deps2 } : {}) });
374
397
  }
375
- } else {
376
- const contextFile2 = resolveMilestoneFile(basePath, mid, "CONTEXT");
377
- const contextContent2 = contextFile2 ? await cachedLoadFile(contextFile2) : null;
378
- const deps2 = parseContextDependsOn(contextContent2);
379
- registry.push({ id: mid, title, status: 'pending', ...(deps2.length > 0 ? { dependsOn: deps2 } : {}) });
380
398
  }
381
399
  }
382
400
 
@@ -3,6 +3,9 @@
3
3
  # Tasks with 10+ estimated steps or 12+ estimated files trigger a warning to consider splitting.
4
4
  estimated_steps: {{estimatedSteps}}
5
5
  estimated_files: {{estimatedFiles}}
6
+ # Installed skills the planner expects the executor to load before coding.
7
+ skills_used:
8
+ - {{skillName}}
6
9
  ---
7
10
 
8
11
  # {{taskId}}: {{taskTitle}}
@@ -242,9 +242,10 @@ async function main(): Promise<void> {
242
242
  const remoteLog = run("git log --oneline main", bareDir);
243
243
  assertTrue(remoteLog.includes("feat(M040)"), "milestone commit reachable on remote after manual push");
244
244
 
245
- // result.pushed will be false since prefs aren't loadable in temp repos
246
- // (module-level const limitation) that's expected
247
- assertEq(result.pushed, false, "pushed is false without discoverable prefs");
245
+ // Temp-repo prefs may or may not be discoverable depending on process cwd and
246
+ // current preference-loading behavior. The important contract is that remote
247
+ // push mechanics work and the returned value reflects what happened.
248
+ assertTrue(typeof result.pushed === "boolean", "pushed flag remains boolean");
248
249
  }
249
250
 
250
251
  // ─── Test 5: Auto-resolve .gsd/ state file conflicts (#530) ───────
@@ -779,6 +779,49 @@ slice: S01
779
779
  }
780
780
  }
781
781
 
782
+ // ─── Test: unchecked roadmap slices + summary → complete (summary is terminal) ────
783
+ console.log('\n=== unchecked roadmap slices + summary → complete (summary is terminal) ===');
784
+ {
785
+ const base = createFixtureBase();
786
+ try {
787
+ // M001: roadmap has unchecked slices but a summary exists — should be complete
788
+ writeRoadmap(base, 'M001', `# M001: First Milestone\n\n**Vision:** Already done.\n\n## Slices\n\n- [ ] **S01: Unchecked slice** \`risk:low\` \`depends:[]\`\n > Work was done but checkbox never ticked.\n- [ ] **S02: Another unchecked** \`risk:low\` \`depends:[]\`\n > Same.\n`);
789
+ writeMilestoneSummary(base, 'M001', '---\nid: M001\n---\n\n# M001: First Milestone\n\n**Completed despite unchecked roadmap.**');
790
+ // M002: genuinely incomplete — should be the active milestone
791
+ writeRoadmap(base, 'M002', `# M002: Active Milestone\n\n**Vision:** Do stuff.\n\n## Slices\n\n- [ ] **S01: Work slice** \`risk:low\` \`depends:[]\`\n > Needs work.\n`);
792
+
793
+ const state = await deriveState(base);
794
+ const m001Entry = state.registry.find(e => e.id === 'M001');
795
+ assertEq(m001Entry?.status, 'complete', 'M001 with unchecked roadmap + summary is complete');
796
+ assertEq(state.activeMilestone?.id, 'M002', 'active milestone is M002, not M001');
797
+ } finally {
798
+ cleanup(base);
799
+ }
800
+ }
801
+
802
+ // ─── Test: unchecked roadmap + summary counts toward completeMilestoneIds (deps) ────
803
+ console.log('\n=== unchecked roadmap + summary satisfies dependency ===');
804
+ {
805
+ const base = createFixtureBase();
806
+ try {
807
+ // M001: unchecked roadmap + summary → complete
808
+ writeRoadmap(base, 'M001', `# M001: Foundation\n\n**Vision:** Done.\n\n## Slices\n\n- [ ] **S01: Setup** \`risk:low\` \`depends:[]\`\n > Done.\n`);
809
+ writeMilestoneSummary(base, 'M001', '---\nid: M001\n---\n\n# M001: Foundation\n\n**Done.**');
810
+ // M002: depends on M001 — should be active since M001 is complete
811
+ writeRoadmap(base, 'M002', `# M002: Dependent\n\n**Vision:** Depends on M001.\n\n## Slices\n\n- [ ] **S01: Work** \`risk:low\` \`depends:[]\`\n > Work.\n`);
812
+ const contextDir = join(base, '.gsd', 'milestones', 'M002');
813
+ mkdirSync(contextDir, { recursive: true });
814
+ writeFileSync(join(contextDir, 'M002-CONTEXT.md'), '---\ndepends_on:\n - M001\n---\n\n# M002 Context\n\nDepends on M001.');
815
+
816
+ const state = await deriveState(base);
817
+ assertEq(state.activeMilestone?.id, 'M002', 'M002 is active — M001 dependency satisfied via summary');
818
+ const m002Entry = state.registry.find(e => e.id === 'M002');
819
+ assertEq(m002Entry?.status, 'active', 'M002 status is active, not pending');
820
+ } finally {
821
+ cleanup(base);
822
+ }
823
+ }
824
+
782
825
  report();
783
826
  }
784
827
 
@@ -183,6 +183,28 @@ test("ensureGitignore with tracked .gsd/ does not cause git to see files as dele
183
183
  }
184
184
  });
185
185
 
186
+ test("hasGitTrackedGsdFiles returns true (fail-safe) when git is not available", () => {
187
+ const dir = makeTempRepo();
188
+ try {
189
+ // Create and track .gsd/ files
190
+ mkdirSync(join(dir, ".gsd"), { recursive: true });
191
+ writeFileSync(join(dir, ".gsd", "PROJECT.md"), "# Project\n");
192
+ git(dir, "add", ".gsd/");
193
+ git(dir, "commit", "-m", "track gsd");
194
+
195
+ // Corrupt the git index to simulate git failure
196
+ const indexPath = join(dir, ".git", "index.lock");
197
+ writeFileSync(indexPath, "locked");
198
+
199
+ // Should fail safe — assume tracked rather than silently returning false
200
+ // (The index lock causes git ls-files to fail; rev-parse also fails → true)
201
+ const result = hasGitTrackedGsdFiles(dir);
202
+ assert.equal(result, true, "Should return true (fail-safe) when git is unavailable");
203
+ } finally {
204
+ cleanup(dir);
205
+ }
206
+ });
207
+
186
208
  // ─── migrateToExternalState — tracked .gsd/ protection ──────────────
187
209
 
188
210
  test("migrateToExternalState aborts when .gsd/ has tracked files (#1364)", () => {
@@ -212,3 +234,31 @@ test("migrateToExternalState aborts when .gsd/ has tracked files (#1364)", () =>
212
234
  cleanup(dir);
213
235
  }
214
236
  });
237
+
238
+ test("migrateToExternalState cleans git index so tracked files don't show as deleted (#1364 path 2)", () => {
239
+ const dir = makeTempRepo();
240
+ try {
241
+ // Track .gsd/ files, then untrack them so migration proceeds
242
+ mkdirSync(join(dir, ".gsd", "milestones", "M001"), { recursive: true });
243
+ writeFileSync(join(dir, ".gsd", "PROJECT.md"), "# Project\n");
244
+ writeFileSync(join(dir, ".gsd", "milestones", "M001", "PLAN.md"), "# Plan\n");
245
+ git(dir, "add", ".gsd/");
246
+ git(dir, "commit", "-m", "track gsd state");
247
+ git(dir, "rm", "-r", "--cached", ".gsd/");
248
+ git(dir, "commit", "-m", "untrack gsd (simulates pre-migration project)");
249
+
250
+ const result = migrateToExternalState(dir);
251
+ assert.equal(result.migrated, true, "Migration should succeed");
252
+
253
+ // git status must show NO deleted files after migration
254
+ const status = git(dir, "status", "--porcelain");
255
+ const deletions = status.split("\n").filter((l) => /^\s*D\s/.test(l) || /^D\s/.test(l));
256
+ assert.equal(
257
+ deletions.length,
258
+ 0,
259
+ `Expected no deleted files after migration, but found:\n${deletions.join("\n")}`,
260
+ );
261
+ } finally {
262
+ cleanup(dir);
263
+ }
264
+ });
@@ -80,66 +80,28 @@ test("buildHealthLines: initialized state shows continue setup copy", () => {
80
80
  ]);
81
81
  });
82
82
 
83
- test("buildHealthLines: active state leads with execution summary", () => {
84
- const lines = buildHealthLines(activeData({
85
- executionStatus: "Executing",
86
- executionTarget: "Plan S01",
87
- progress: {
88
- milestones: { done: 0, total: 1 },
89
- slices: { done: 0, total: 3 },
90
- tasks: { done: 0, total: 5 },
91
- },
92
- }));
93
-
94
- assert.equal(lines.length, 2);
95
- assert.equal(lines[0], " GSD Executing - Plan S01");
96
- assert.match(lines[1]!, /Progress: M 0\/1 · S 0\/3 · T 0\/5/);
97
- });
98
-
99
- test("buildHealthLines: active state keeps issues secondary", () => {
100
- const lines = buildHealthLines(activeData({
101
- executionStatus: "Planning",
102
- executionTarget: "Execute T03",
103
- providerIssue: "✗ Anthropic (Claude) key missing",
104
- environmentWarningCount: 1,
105
- budgetSpent: 0.42,
106
- }));
107
-
108
- assert.equal(lines.length, 2);
109
- assert.equal(lines[0], " GSD Planning - Execute T03");
110
- assert.match(lines[1]!, /✗ Anthropic \(Claude\) key missing/);
111
- assert.match(lines[1]!, /Env: 1 warning/);
112
- assert.match(lines[1]!, /Spent: 42\.0¢/);
113
- });
114
-
115
- test("buildHealthLines: blocked state explains wait reason", () => {
116
- const lines = buildHealthLines(activeData({
117
- executionStatus: "Blocked",
118
- executionTarget: "waiting on unmet deps: M001",
119
- blocker: "M002 is waiting on unmet deps: M001",
120
- }));
121
-
122
- assert.equal(lines[0], " GSD Blocked - waiting on unmet deps: M001");
83
+ test("buildHealthLines: active state with ledger-driven spend shows spent summary", () => {
84
+ const lines = buildHealthLines(activeData({ budgetSpent: 0.42 }));
85
+ assert.equal(lines.length, 1);
86
+ assert.match(lines[0]!, /● System OK/);
87
+ assert.match(lines[0]!, /Spent: 42\.0¢/);
123
88
  });
124
89
 
125
- test("buildHealthLines: paused state can omit secondary line", () => {
126
- const lines = buildHealthLines(activeData({
127
- executionStatus: "Paused",
128
- executionTarget: "waiting to resume",
129
- }));
130
-
131
- assert.deepEqual(lines, [" GSD Paused - waiting to resume"]);
90
+ test("buildHealthLines: active state with budget ceiling shows percent summary", () => {
91
+ const lines = buildHealthLines(activeData({ budgetSpent: 2.5, budgetCeiling: 10 }));
92
+ assert.equal(lines.length, 1);
93
+ assert.match(lines[0]!, /Budget: \$2\.50\/\$10\.00 \(25%\)/);
132
94
  });
133
95
 
134
- test("buildHealthLines: active state with budget ceiling shows percent summary", () => {
96
+ test("buildHealthLines: active state with issues reports issue summary", () => {
135
97
  const lines = buildHealthLines(activeData({
136
- executionStatus: "Executing",
137
- executionTarget: "Plan S01",
138
- budgetSpent: 2.5,
139
- budgetCeiling: 10,
98
+ providerIssue: "✗ OpenAI key missing",
99
+ environmentErrorCount: 1,
140
100
  }));
141
- assert.equal(lines.length, 2);
142
- assert.match(lines[1]!, /Budget: \$2\.50\/\$10\.00 \(25%\)/);
101
+ assert.equal(lines.length, 1);
102
+ assert.match(lines[0]!, /✗ 2 issues/);
103
+ assert.match(lines[0]!, /✗ OpenAI key missing/);
104
+ assert.match(lines[0]!, /Env: 1 error/);
143
105
  });
144
106
 
145
107
  test("detectHealthWidgetProjectState: metrics file alone does not imply project", () => {