@tuan_son.dinh/gsd 2.6.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.
- package/LICENSE +21 -0
- package/README.md +453 -0
- package/dist/app-paths.d.ts +4 -0
- package/dist/app-paths.js +6 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +269 -0
- package/dist/loader.d.ts +2 -0
- package/dist/loader.js +70 -0
- package/dist/logo.d.ts +16 -0
- package/dist/logo.js +25 -0
- package/dist/onboarding.d.ts +43 -0
- package/dist/onboarding.js +418 -0
- package/dist/pi-migration.d.ts +14 -0
- package/dist/pi-migration.js +57 -0
- package/dist/resource-loader.d.ts +22 -0
- package/dist/resource-loader.js +60 -0
- package/dist/tool-bootstrap.d.ts +4 -0
- package/dist/tool-bootstrap.js +74 -0
- package/dist/wizard.d.ts +7 -0
- package/dist/wizard.js +25 -0
- package/package.json +60 -0
- package/patches/@mariozechner+pi-coding-agent+0.57.1.patch +108 -0
- package/patches/@mariozechner+pi-tui+0.57.1.patch +47 -0
- package/pkg/dist/modes/interactive/theme/dark.json +85 -0
- package/pkg/dist/modes/interactive/theme/light.json +84 -0
- package/pkg/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/pkg/dist/modes/interactive/theme/theme.d.ts +78 -0
- package/pkg/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/pkg/dist/modes/interactive/theme/theme.js +949 -0
- package/pkg/dist/modes/interactive/theme/theme.js.map +1 -0
- package/pkg/package.json +8 -0
- package/scripts/postinstall.js +127 -0
- package/src/resources/GSD-WORKFLOW.md +661 -0
- package/src/resources/agents/researcher.md +29 -0
- package/src/resources/agents/scout.md +56 -0
- package/src/resources/agents/worker.md +31 -0
- package/src/resources/extensions/ask-user-questions.ts +249 -0
- package/src/resources/extensions/bg-shell/index.ts +2808 -0
- package/src/resources/extensions/browser-tools/BROWSER-TOOLS-V2-PROPOSAL.md +1277 -0
- package/src/resources/extensions/browser-tools/core.js +1057 -0
- package/src/resources/extensions/browser-tools/index.ts +4989 -0
- package/src/resources/extensions/browser-tools/package.json +20 -0
- package/src/resources/extensions/context7/index.ts +428 -0
- package/src/resources/extensions/context7/package.json +11 -0
- package/src/resources/extensions/get-secrets-from-user.ts +352 -0
- package/src/resources/extensions/google-search/index.ts +323 -0
- package/src/resources/extensions/google-search/package.json +9 -0
- package/src/resources/extensions/gsd/activity-log.ts +69 -0
- package/src/resources/extensions/gsd/auto.ts +2744 -0
- package/src/resources/extensions/gsd/commands.ts +313 -0
- package/src/resources/extensions/gsd/crash-recovery.ts +85 -0
- package/src/resources/extensions/gsd/dashboard-overlay.ts +521 -0
- package/src/resources/extensions/gsd/docs/preferences-reference.md +176 -0
- package/src/resources/extensions/gsd/doctor.ts +690 -0
- package/src/resources/extensions/gsd/files.ts +732 -0
- package/src/resources/extensions/gsd/git-service.ts +597 -0
- package/src/resources/extensions/gsd/gitignore.ts +168 -0
- package/src/resources/extensions/gsd/guided-flow.ts +817 -0
- package/src/resources/extensions/gsd/index.ts +558 -0
- package/src/resources/extensions/gsd/metrics.ts +374 -0
- package/src/resources/extensions/gsd/migrate/command.ts +218 -0
- package/src/resources/extensions/gsd/migrate/index.ts +42 -0
- package/src/resources/extensions/gsd/migrate/parser.ts +323 -0
- package/src/resources/extensions/gsd/migrate/parsers.ts +624 -0
- package/src/resources/extensions/gsd/migrate/preview.ts +48 -0
- package/src/resources/extensions/gsd/migrate/transformer.ts +346 -0
- package/src/resources/extensions/gsd/migrate/types.ts +370 -0
- package/src/resources/extensions/gsd/migrate/validator.ts +55 -0
- package/src/resources/extensions/gsd/migrate/writer.ts +539 -0
- package/src/resources/extensions/gsd/observability-validator.ts +408 -0
- package/src/resources/extensions/gsd/package.json +11 -0
- package/src/resources/extensions/gsd/paths.ts +308 -0
- package/src/resources/extensions/gsd/preferences.ts +757 -0
- package/src/resources/extensions/gsd/prompt-loader.ts +50 -0
- package/src/resources/extensions/gsd/prompts/complete-milestone.md +25 -0
- package/src/resources/extensions/gsd/prompts/complete-slice.md +29 -0
- package/src/resources/extensions/gsd/prompts/discuss.md +189 -0
- package/src/resources/extensions/gsd/prompts/doctor-heal.md +29 -0
- package/src/resources/extensions/gsd/prompts/execute-task.md +61 -0
- package/src/resources/extensions/gsd/prompts/guided-complete-slice.md +1 -0
- package/src/resources/extensions/gsd/prompts/guided-discuss-milestone.md +3 -0
- package/src/resources/extensions/gsd/prompts/guided-discuss-slice.md +59 -0
- package/src/resources/extensions/gsd/prompts/guided-execute-task.md +1 -0
- package/src/resources/extensions/gsd/prompts/guided-plan-milestone.md +23 -0
- package/src/resources/extensions/gsd/prompts/guided-plan-slice.md +1 -0
- package/src/resources/extensions/gsd/prompts/guided-research-slice.md +11 -0
- package/src/resources/extensions/gsd/prompts/guided-resume-task.md +1 -0
- package/src/resources/extensions/gsd/prompts/plan-milestone.md +65 -0
- package/src/resources/extensions/gsd/prompts/plan-slice.md +51 -0
- package/src/resources/extensions/gsd/prompts/queue.md +85 -0
- package/src/resources/extensions/gsd/prompts/reassess-roadmap.md +48 -0
- package/src/resources/extensions/gsd/prompts/replan-slice.md +39 -0
- package/src/resources/extensions/gsd/prompts/research-milestone.md +37 -0
- package/src/resources/extensions/gsd/prompts/research-slice.md +28 -0
- package/src/resources/extensions/gsd/prompts/review-migration.md +66 -0
- package/src/resources/extensions/gsd/prompts/run-uat.md +109 -0
- package/src/resources/extensions/gsd/prompts/system.md +187 -0
- package/src/resources/extensions/gsd/prompts/worktree-merge.md +123 -0
- package/src/resources/extensions/gsd/session-forensics.ts +487 -0
- package/src/resources/extensions/gsd/skill-discovery.ts +137 -0
- package/src/resources/extensions/gsd/state.ts +460 -0
- package/src/resources/extensions/gsd/templates/context.md +76 -0
- package/src/resources/extensions/gsd/templates/decisions.md +8 -0
- package/src/resources/extensions/gsd/templates/milestone-summary.md +73 -0
- package/src/resources/extensions/gsd/templates/plan.md +131 -0
- package/src/resources/extensions/gsd/templates/preferences.md +24 -0
- package/src/resources/extensions/gsd/templates/project.md +31 -0
- package/src/resources/extensions/gsd/templates/reassessment.md +28 -0
- package/src/resources/extensions/gsd/templates/requirements.md +81 -0
- package/src/resources/extensions/gsd/templates/research.md +46 -0
- package/src/resources/extensions/gsd/templates/roadmap.md +118 -0
- package/src/resources/extensions/gsd/templates/slice-context.md +58 -0
- package/src/resources/extensions/gsd/templates/slice-summary.md +99 -0
- package/src/resources/extensions/gsd/templates/state.md +19 -0
- package/src/resources/extensions/gsd/templates/task-plan.md +52 -0
- package/src/resources/extensions/gsd/templates/task-summary.md +57 -0
- package/src/resources/extensions/gsd/templates/uat.md +54 -0
- package/src/resources/extensions/gsd/tests/activity-log-prune.test.ts +327 -0
- package/src/resources/extensions/gsd/tests/auto-preflight.test.ts +56 -0
- package/src/resources/extensions/gsd/tests/auto-supervisor.test.mjs +53 -0
- package/src/resources/extensions/gsd/tests/complete-milestone.test.ts +225 -0
- package/src/resources/extensions/gsd/tests/cost-projection.test.ts +160 -0
- package/src/resources/extensions/gsd/tests/derive-state-deps.test.ts +341 -0
- package/src/resources/extensions/gsd/tests/derive-state.test.ts +689 -0
- package/src/resources/extensions/gsd/tests/discuss-prompt.test.ts +38 -0
- package/src/resources/extensions/gsd/tests/doctor.test.ts +505 -0
- package/src/resources/extensions/gsd/tests/git-service.test.ts +1313 -0
- package/src/resources/extensions/gsd/tests/idle-recovery.test.ts +308 -0
- package/src/resources/extensions/gsd/tests/metrics-io.test.ts +201 -0
- package/src/resources/extensions/gsd/tests/metrics.test.ts +217 -0
- package/src/resources/extensions/gsd/tests/migrate-command.test.ts +390 -0
- package/src/resources/extensions/gsd/tests/migrate-parser.test.ts +786 -0
- package/src/resources/extensions/gsd/tests/migrate-transformer.test.ts +657 -0
- package/src/resources/extensions/gsd/tests/migrate-validator-parsers.test.ts +443 -0
- package/src/resources/extensions/gsd/tests/migrate-writer-integration.test.ts +318 -0
- package/src/resources/extensions/gsd/tests/migrate-writer.test.ts +420 -0
- package/src/resources/extensions/gsd/tests/must-have-parser.test.ts +309 -0
- package/src/resources/extensions/gsd/tests/parsers.test.ts +1351 -0
- package/src/resources/extensions/gsd/tests/plan-milestone.test.ts +163 -0
- package/src/resources/extensions/gsd/tests/plan-quality-validator.test.ts +386 -0
- package/src/resources/extensions/gsd/tests/reassess-prompt.test.ts +171 -0
- package/src/resources/extensions/gsd/tests/remote-questions.test.ts +155 -0
- package/src/resources/extensions/gsd/tests/remote-status.test.ts +99 -0
- package/src/resources/extensions/gsd/tests/replan-slice.test.ts +521 -0
- package/src/resources/extensions/gsd/tests/requirements.test.ts +125 -0
- package/src/resources/extensions/gsd/tests/resolve-ts-hooks.mjs +34 -0
- package/src/resources/extensions/gsd/tests/resolve-ts.mjs +11 -0
- package/src/resources/extensions/gsd/tests/run-uat.test.ts +348 -0
- package/src/resources/extensions/gsd/tests/unit-runtime.test.ts +247 -0
- package/src/resources/extensions/gsd/tests/workflow-config.test.mjs +53 -0
- package/src/resources/extensions/gsd/tests/workspace-index.test.ts +94 -0
- package/src/resources/extensions/gsd/tests/worktree-integration.test.ts +253 -0
- package/src/resources/extensions/gsd/tests/worktree-manager.test.ts +160 -0
- package/src/resources/extensions/gsd/tests/worktree.test.ts +264 -0
- package/src/resources/extensions/gsd/types.ts +159 -0
- package/src/resources/extensions/gsd/unit-runtime.ts +184 -0
- package/src/resources/extensions/gsd/workspace-index.ts +203 -0
- package/src/resources/extensions/gsd/worktree-command.ts +845 -0
- package/src/resources/extensions/gsd/worktree-manager.ts +392 -0
- package/src/resources/extensions/gsd/worktree.ts +183 -0
- package/src/resources/extensions/mac-tools/index.ts +852 -0
- package/src/resources/extensions/mac-tools/swift-cli/Package.swift +22 -0
- package/src/resources/extensions/mac-tools/swift-cli/Sources/main.swift +1318 -0
- package/src/resources/extensions/mcporter/index.ts +429 -0
- package/src/resources/extensions/remote-questions/config.ts +81 -0
- package/src/resources/extensions/remote-questions/discord-adapter.ts +128 -0
- package/src/resources/extensions/remote-questions/format.ts +163 -0
- package/src/resources/extensions/remote-questions/manager.ts +192 -0
- package/src/resources/extensions/remote-questions/remote-command.ts +307 -0
- package/src/resources/extensions/remote-questions/slack-adapter.ts +92 -0
- package/src/resources/extensions/remote-questions/status.ts +31 -0
- package/src/resources/extensions/remote-questions/store.ts +77 -0
- package/src/resources/extensions/remote-questions/types.ts +75 -0
- package/src/resources/extensions/search-the-web/cache.ts +78 -0
- package/src/resources/extensions/search-the-web/command-search-provider.ts +95 -0
- package/src/resources/extensions/search-the-web/format.ts +258 -0
- package/src/resources/extensions/search-the-web/http.ts +238 -0
- package/src/resources/extensions/search-the-web/index.ts +65 -0
- package/src/resources/extensions/search-the-web/native-search.ts +157 -0
- package/src/resources/extensions/search-the-web/provider.ts +118 -0
- package/src/resources/extensions/search-the-web/tavily.ts +116 -0
- package/src/resources/extensions/search-the-web/tool-fetch-page.ts +519 -0
- package/src/resources/extensions/search-the-web/tool-llm-context.ts +561 -0
- package/src/resources/extensions/search-the-web/tool-search.ts +576 -0
- package/src/resources/extensions/search-the-web/url-utils.ts +91 -0
- package/src/resources/extensions/shared/confirm-ui.ts +126 -0
- package/src/resources/extensions/shared/interview-ui.ts +613 -0
- package/src/resources/extensions/shared/next-action-ui.ts +197 -0
- package/src/resources/extensions/shared/progress-widget.ts +282 -0
- package/src/resources/extensions/shared/terminal.ts +23 -0
- package/src/resources/extensions/shared/thinking-widget.ts +107 -0
- package/src/resources/extensions/shared/ui.ts +400 -0
- package/src/resources/extensions/shared/wizard-ui.ts +551 -0
- package/src/resources/extensions/slash-commands/audit.ts +88 -0
- package/src/resources/extensions/slash-commands/clear.ts +10 -0
- package/src/resources/extensions/slash-commands/create-extension.ts +297 -0
- package/src/resources/extensions/slash-commands/create-slash-command.ts +234 -0
- package/src/resources/extensions/slash-commands/index.ts +12 -0
- package/src/resources/extensions/subagent/agents.ts +126 -0
- package/src/resources/extensions/subagent/index.ts +1020 -0
- package/src/resources/extensions/voice/index.ts +195 -0
- package/src/resources/extensions/voice/speech-recognizer.swift +154 -0
- package/src/resources/skills/debug-like-expert/SKILL.md +231 -0
- package/src/resources/skills/debug-like-expert/references/debugging-mindset.md +253 -0
- package/src/resources/skills/debug-like-expert/references/hypothesis-testing.md +373 -0
- package/src/resources/skills/debug-like-expert/references/investigation-techniques.md +337 -0
- package/src/resources/skills/debug-like-expert/references/verification-patterns.md +425 -0
- package/src/resources/skills/debug-like-expert/references/when-to-research.md +361 -0
- package/src/resources/skills/frontend-design/SKILL.md +45 -0
- package/src/resources/skills/swiftui/SKILL.md +208 -0
- package/src/resources/skills/swiftui/references/animations.md +921 -0
- package/src/resources/skills/swiftui/references/architecture.md +1561 -0
- package/src/resources/skills/swiftui/references/layout-system.md +1186 -0
- package/src/resources/skills/swiftui/references/navigation.md +1492 -0
- package/src/resources/skills/swiftui/references/networking-async.md +214 -0
- package/src/resources/skills/swiftui/references/performance.md +1706 -0
- package/src/resources/skills/swiftui/references/platform-integration.md +204 -0
- package/src/resources/skills/swiftui/references/state-management.md +1443 -0
- package/src/resources/skills/swiftui/references/swiftdata.md +297 -0
- package/src/resources/skills/swiftui/references/testing-debugging.md +247 -0
- package/src/resources/skills/swiftui/references/uikit-appkit-interop.md +218 -0
- package/src/resources/skills/swiftui/workflows/add-feature.md +191 -0
- package/src/resources/skills/swiftui/workflows/build-new-app.md +311 -0
- package/src/resources/skills/swiftui/workflows/debug-swiftui.md +192 -0
- package/src/resources/skills/swiftui/workflows/optimize-performance.md +197 -0
- package/src/resources/skills/swiftui/workflows/ship-app.md +203 -0
- package/src/resources/skills/swiftui/workflows/write-tests.md +235 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GSD Prompt Loader
|
|
3
|
+
*
|
|
4
|
+
* Reads .md prompt templates from the prompts/ directory and substitutes
|
|
5
|
+
* {{variable}} placeholders with provided values.
|
|
6
|
+
*
|
|
7
|
+
* Templates live at prompts/ relative to this module's directory.
|
|
8
|
+
* They use {{variableName}} syntax for substitution.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { readFileSync } from "node:fs";
|
|
12
|
+
import { join, dirname } from "node:path";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
|
|
15
|
+
const promptsDir = join(dirname(fileURLToPath(import.meta.url)), "prompts");
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Load a prompt template and substitute variables.
|
|
19
|
+
*
|
|
20
|
+
* @param name - Template filename without .md extension (e.g. "execute-task")
|
|
21
|
+
* @param vars - Key-value pairs to substitute for {{key}} placeholders
|
|
22
|
+
*/
|
|
23
|
+
export function loadPrompt(name: string, vars: Record<string, string> = {}): string {
|
|
24
|
+
const path = join(promptsDir, `${name}.md`);
|
|
25
|
+
let content = readFileSync(path, "utf-8");
|
|
26
|
+
|
|
27
|
+
// Check BEFORE substitution: find all {{varName}} placeholders the template
|
|
28
|
+
// declares and verify every one has a value in vars. Checking after substitution
|
|
29
|
+
// would also flag {{...}} patterns injected by inlined content (e.g. template
|
|
30
|
+
// files embedded in {{inlinedContext}}), producing false positives.
|
|
31
|
+
const declared = content.match(/\{\{[a-zA-Z][a-zA-Z0-9_]*\}\}/g);
|
|
32
|
+
if (declared) {
|
|
33
|
+
const missing = [...new Set(declared)]
|
|
34
|
+
.map(m => m.slice(2, -2))
|
|
35
|
+
.filter(key => !(key in vars));
|
|
36
|
+
if (missing.length > 0) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
`loadPrompt("${name}"): template declares {{${missing.join("}}, {{")}}}} but no value was provided. ` +
|
|
39
|
+
`This usually means the extension code in memory is older than the template on disk. ` +
|
|
40
|
+
`Restart pi to reload the extension.`
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
for (const [key, value] of Object.entries(vars)) {
|
|
46
|
+
content = content.replaceAll(`{{${key}}}`, value);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return content.trim();
|
|
50
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
You are executing GSD auto-mode.
|
|
2
|
+
|
|
3
|
+
## UNIT: Complete Milestone {{milestoneId}} ("{{milestoneTitle}}")
|
|
4
|
+
|
|
5
|
+
All relevant context has been preloaded below — the roadmap, all slice summaries, requirements, decisions, and project context are inlined. Start working immediately without re-reading these files.
|
|
6
|
+
|
|
7
|
+
{{inlinedContext}}
|
|
8
|
+
|
|
9
|
+
Then:
|
|
10
|
+
1. Read the milestone-summary template at `~/.gsd/agent/extensions/gsd/templates/milestone-summary.md`
|
|
11
|
+
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
|
|
12
|
+
3. Verify each **success criterion** from the milestone definition in `{{roadmapPath}}`. For each criterion, confirm it was met with specific evidence from slice summaries, test results, or observable behavior. List any criterion that was NOT met.
|
|
13
|
+
4. Verify the milestone's **definition of done** — all slices are `[x]`, all slice summaries exist, and any cross-slice integration points work correctly.
|
|
14
|
+
5. Validate **requirement status transitions**. For each requirement that changed status during this milestone, confirm the transition is supported by evidence. Requirements can move between Active, Validated, Deferred, Blocked, or Out of Scope — but only with proof.
|
|
15
|
+
6. Write `{{milestoneSummaryAbsPath}}` using the milestone-summary template. Fill all frontmatter fields and narrative sections. The `requirement_outcomes` field must list every requirement that changed status with `from_status`, `to_status`, and `proof`.
|
|
16
|
+
7. Update `.gsd/REQUIREMENTS.md` if any requirement status transitions were validated in step 5.
|
|
17
|
+
8. Update `.gsd/PROJECT.md` to reflect milestone completion and current project state.
|
|
18
|
+
9. Do not commit manually — the system auto-commits your changes after this unit completes.
|
|
19
|
+
10. Update `.gsd/STATE.md`
|
|
20
|
+
|
|
21
|
+
**Important:** Do NOT skip the success criteria and definition of done verification (steps 3-4). The milestone summary must reflect actual verified outcomes, not assumed success. If any criterion was not met, document it clearly in the summary and do not mark the milestone as passing verification.
|
|
22
|
+
|
|
23
|
+
**You MUST write `{{milestoneSummaryAbsPath}}` AND update PROJECT.md before finishing.**
|
|
24
|
+
|
|
25
|
+
When done, say: "Milestone {{milestoneId}} complete."
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
You are executing GSD auto-mode.
|
|
2
|
+
|
|
3
|
+
## UNIT: Complete Slice {{sliceId}} ("{{sliceTitle}}") — Milestone {{milestoneId}}
|
|
4
|
+
|
|
5
|
+
All relevant context has been preloaded below — the slice plan, all task summaries, and the milestone roadmap are inlined. Start working immediately without re-reading these files.
|
|
6
|
+
|
|
7
|
+
{{inlinedContext}}
|
|
8
|
+
|
|
9
|
+
**Match effort to complexity.** A simple slice with 1-2 tasks needs a brief summary and lightweight verification. A complex slice with 5 tasks across multiple subsystems needs thorough verification and a detailed summary. Scale the work below accordingly.
|
|
10
|
+
|
|
11
|
+
Then:
|
|
12
|
+
1. Read the templates:
|
|
13
|
+
- `~/.gsd/agent/extensions/gsd/templates/slice-summary.md`
|
|
14
|
+
- `~/.gsd/agent/extensions/gsd/templates/uat.md`
|
|
15
|
+
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
|
|
16
|
+
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.
|
|
17
|
+
4. If the slice plan includes observability/diagnostic surfaces, confirm they work. Skip this for simple slices that don't have observability sections.
|
|
18
|
+
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.
|
|
19
|
+
6. Write `{{sliceSummaryAbsPath}}` (compress all task summaries).
|
|
20
|
+
7. Write `{{sliceUatAbsPath}}`.
|
|
21
|
+
8. Review task summaries for `key_decisions`. Append any significant decisions to `.gsd/DECISIONS.md` if missing.
|
|
22
|
+
9. Mark {{sliceId}} done in `{{roadmapPath}}` (change `[ ]` to `[x]`)
|
|
23
|
+
10. Do not commit or squash-merge manually — the system auto-commits your changes and handles the merge after this unit succeeds.
|
|
24
|
+
11. Update `.gsd/PROJECT.md` if it exists — refresh current state if needed.
|
|
25
|
+
12. Update `.gsd/STATE.md`
|
|
26
|
+
|
|
27
|
+
**You MUST mark {{sliceId}} as `[x]` in `{{roadmapPath}}` AND write `{{sliceSummaryAbsPath}}` before finishing.**
|
|
28
|
+
|
|
29
|
+
When done, say: "Slice {{sliceId}} complete."
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
{{preamble}}
|
|
2
|
+
|
|
3
|
+
Ask: "What's the vision?" once, and then use whatever the user replies with as the vision input to continue.
|
|
4
|
+
|
|
5
|
+
Special handling: if the user message is not a project description (for example, they ask about status, branch state, or other clarifications), treat it as the vision input and proceed with discussion logic instead of repeating "What's the vision?".
|
|
6
|
+
|
|
7
|
+
## Reflection Step
|
|
8
|
+
|
|
9
|
+
After the user describes their idea, **do not ask questions yet**. First, prove you understood by reflecting back:
|
|
10
|
+
|
|
11
|
+
1. Summarize what you understood in your own words — concretely, not abstractly.
|
|
12
|
+
2. Give an honest size read: roughly how many milestones, roughly how many slices in the first one. Base this on the actual work involved, not a classification label. A config change might be 1 milestone with 1 slice. A social network might be 5 milestones with 8+ slices each. Use your judgment.
|
|
13
|
+
3. Include scope honesty — a bullet list of the major capabilities you're hearing: "Here's what I'm hearing: [bullet list of major capabilities]."
|
|
14
|
+
4. Ask: "Did I get that right, or did I miss something?" — plain text, not `ask_user_questions`. Let them correct freely.
|
|
15
|
+
|
|
16
|
+
This prevents runaway questioning by forcing comprehension proof before anything else. Do not skip this step. Do not combine it with the first question round.
|
|
17
|
+
|
|
18
|
+
## Vision Mapping
|
|
19
|
+
|
|
20
|
+
After reflection is confirmed, decide the approach based on the actual scope — not a label:
|
|
21
|
+
|
|
22
|
+
**If the work spans multiple milestones:** Before drilling into details, map the full landscape:
|
|
23
|
+
1. Propose a milestone sequence — names, one-line intents, rough dependencies
|
|
24
|
+
2. Present this to the user for confirmation or adjustment
|
|
25
|
+
3. Only then begin the deep Q&A — and scope the Q&A to the full vision, not just M001
|
|
26
|
+
|
|
27
|
+
**If the work fits in a single milestone:** Proceed directly to questioning.
|
|
28
|
+
|
|
29
|
+
**Anti-reduction rule:** If the user describes a big vision, plan the big vision. Do not ask "what's the minimum viable version?" or try to reduce scope unless the user explicitly asks for an MVP or minimal version. When something is complex or risky, phase it into a later milestone — do not cut it. The user's ambition is the target, and your job is to sequence it intelligently, not shrink it.
|
|
30
|
+
|
|
31
|
+
## Mandatory Investigation Before First Question Round
|
|
32
|
+
|
|
33
|
+
Before asking your first question, do a mandatory investigation pass. This is not optional.
|
|
34
|
+
|
|
35
|
+
1. **Scout the codebase** — `ls`, `find`, `rg`, or `scout` for broad unfamiliar areas. Understand what already exists, what patterns are established, what constraints current code imposes.
|
|
36
|
+
2. **Check library docs** — `resolve_library` / `get_library_docs` for any tech the user mentioned. Get current facts about capabilities, constraints, API shapes, version-specific behavior.
|
|
37
|
+
3. **Web search** — `search-the-web` if the domain is unfamiliar, if you need current best practices, or if the user referenced external services/APIs you need facts about. Use `fetch_page` for full content when snippets aren't enough.
|
|
38
|
+
|
|
39
|
+
This happens ONCE, before the first round. The goal: your first questions should reflect what's actually true, not what you assume.
|
|
40
|
+
|
|
41
|
+
For subsequent rounds, continue investigating between rounds — check docs, search, or scout as needed to make each round's questions smarter. But the first-round investigation is mandatory and explicit.
|
|
42
|
+
|
|
43
|
+
## Questioning Philosophy
|
|
44
|
+
|
|
45
|
+
You are a thinking partner, not an interviewer.
|
|
46
|
+
|
|
47
|
+
**Start open, follow energy.** Let the user's enthusiasm guide where you dig deeper. If they light up about a particular aspect, explore it. If they're vague about something, that's where you probe.
|
|
48
|
+
|
|
49
|
+
**Challenge vagueness, make abstract concrete.** When the user says something abstract ("it should be smart" / "it needs to handle edge cases" / "good UX"), push for specifics. What does "smart" mean in practice? Which edge cases? What does good UX look like for this specific interaction?
|
|
50
|
+
|
|
51
|
+
**Questions must be about the experience, not the implementation.** Never ask "what auth provider?" — ask "when someone logs in, what should that feel like?" Never ask "what database?" — ask "when they come back tomorrow, what should they see?" Implementation is your job. Understanding what they want to experience is the discussion's job.
|
|
52
|
+
|
|
53
|
+
**Freeform rule:** When the user selects "Other" or clearly wants to explain something freely, stop using `ask_user_questions` and switch to plain text follow-ups. Let them talk. Resume structured questions when appropriate.
|
|
54
|
+
|
|
55
|
+
**Anti-patterns — never do these:**
|
|
56
|
+
- **Checklist walking** — going through a predetermined list of topics regardless of what the user said
|
|
57
|
+
- **Canned questions** — asking generic questions that could apply to any project
|
|
58
|
+
- **Corporate speak** — "What are your key success metrics?" / "Who are the stakeholders?"
|
|
59
|
+
- **Interrogation** — rapid-fire questions without acknowledging or building on answers
|
|
60
|
+
- **Rushing** — trying to get through questions quickly to move to planning
|
|
61
|
+
- **Shallow acceptance** — accepting vague answers without probing ("Sounds good!" then moving on)
|
|
62
|
+
- **Premature constraints** — asking about tech stack, deployment targets, or architecture before understanding what they're building
|
|
63
|
+
- **Asking about technical skill** — never ask "how technical are you?" or "are you familiar with X?" — adapt based on how they communicate
|
|
64
|
+
|
|
65
|
+
## Depth Enforcement
|
|
66
|
+
|
|
67
|
+
Do NOT offer to proceed until ALL of the following are satisfied. Track these internally as a background checklist:
|
|
68
|
+
|
|
69
|
+
- [ ] **What they're building** — concrete enough that you could explain it to a stranger
|
|
70
|
+
- [ ] **Why it needs to exist** — the problem it solves or the desire it fulfills
|
|
71
|
+
- [ ] **Who it's for** — even if just themselves
|
|
72
|
+
- [ ] **What "done" looks like** — observable outcomes, not abstract goals
|
|
73
|
+
- [ ] **The biggest technical unknowns / risks** — what could fail, what hasn't been proven
|
|
74
|
+
- [ ] **What external systems/services this touches** — APIs, databases, third-party services, hardware
|
|
75
|
+
|
|
76
|
+
**Questioning depth should match scope.** Simple, well-defined work needs fewer rounds — maybe 1-2. Large, ambiguous visions need more — maybe 4+. Don't pad rounds to hit a number. Stop when the depth checklist is satisfied and you genuinely understand the work.
|
|
77
|
+
|
|
78
|
+
Do not count the reflection step as a question round. Rounds start after reflection is confirmed.
|
|
79
|
+
|
|
80
|
+
## Wrap-up Gate
|
|
81
|
+
|
|
82
|
+
Only after the depth checklist is fully satisfied and you genuinely understand the work, offer to proceed.
|
|
83
|
+
|
|
84
|
+
The wrap-up gate must include a scope reflection:
|
|
85
|
+
"Here's what I'm planning to build: [list of capabilities with rough complexity]. Does this match your vision, or did I miss something?"
|
|
86
|
+
|
|
87
|
+
Then offer options: "Ready to confirm requirements and milestone plan (Recommended)", "I have more to discuss"
|
|
88
|
+
|
|
89
|
+
If the user wants to keep going, keep asking. If they're ready, proceed.
|
|
90
|
+
|
|
91
|
+
## Focused Research
|
|
92
|
+
|
|
93
|
+
For a new project or any project that does not yet have `.gsd/REQUIREMENTS.md`, do a focused research pass before roadmap creation.
|
|
94
|
+
|
|
95
|
+
Research is advisory, not auto-binding. Use the discussion output to identify:
|
|
96
|
+
- table stakes the product space usually expects
|
|
97
|
+
- domain-standard behaviors the user may or may not want
|
|
98
|
+
- likely omissions that would make the product feel incomplete
|
|
99
|
+
- plausible anti-features or scope traps
|
|
100
|
+
- differentiators worth preserving
|
|
101
|
+
|
|
102
|
+
If the research suggests requirements the user did not explicitly ask for, present them as candidate requirements to confirm, defer, or reject. Do not silently turn research into scope.
|
|
103
|
+
|
|
104
|
+
For multi-milestone visions, research should cover the full landscape, not just the first milestone. Research findings may affect milestone sequencing, not just slice ordering within M001.
|
|
105
|
+
|
|
106
|
+
## Capability Contract
|
|
107
|
+
|
|
108
|
+
Before writing a roadmap, produce or update `.gsd/REQUIREMENTS.md`.
|
|
109
|
+
|
|
110
|
+
Use it as the project's explicit capability contract.
|
|
111
|
+
|
|
112
|
+
Requirements must be organized into:
|
|
113
|
+
- Active
|
|
114
|
+
- Validated
|
|
115
|
+
- Deferred
|
|
116
|
+
- Out of Scope
|
|
117
|
+
- Traceability
|
|
118
|
+
|
|
119
|
+
Each requirement should include:
|
|
120
|
+
- stable ID (`R###`)
|
|
121
|
+
- title
|
|
122
|
+
- class
|
|
123
|
+
- status
|
|
124
|
+
- description
|
|
125
|
+
- why it matters
|
|
126
|
+
- source (`user`, `inferred`, `research`, or `execution`)
|
|
127
|
+
- primary owning slice
|
|
128
|
+
- supporting slices
|
|
129
|
+
- validation status
|
|
130
|
+
- notes
|
|
131
|
+
|
|
132
|
+
Rules:
|
|
133
|
+
- Keep requirements capability-oriented, not a giant feature inventory
|
|
134
|
+
- Every Active requirement must either be mapped to a roadmap owner, explicitly deferred, blocked with reason, or moved out of scope
|
|
135
|
+
- Product-facing work should capture launchability, primary user loop, continuity, and failure visibility when relevant
|
|
136
|
+
- Later milestones may have provisional ownership, but the first planned milestone should map requirements to concrete slices wherever possible
|
|
137
|
+
|
|
138
|
+
For multi-milestone projects, requirements should span the full vision. Requirements owned by later milestones get provisional ownership. The full requirement set captures the user's complete vision — milestones are the sequencing strategy, not the scope boundary.
|
|
139
|
+
|
|
140
|
+
If the project is new or has no `REQUIREMENTS.md`, confirm candidate requirements with the user before writing the roadmap.
|
|
141
|
+
|
|
142
|
+
**Print the requirements in chat before asking for confirmation.** Do not say "here are the requirements" and then only write them to a file. The user must see them in the terminal. Print a markdown table with columns: ID, Title, Status, Owner, Source. Group by status (Active, Deferred, Out of Scope). After the table, ask: "Confirm, adjust, or add?"
|
|
143
|
+
|
|
144
|
+
## Scope Assessment
|
|
145
|
+
|
|
146
|
+
Before moving to output, confirm the size estimate from your reflection still holds. Discussion often reveals hidden complexity or simplifies things. If the scope grew or shrank significantly during Q&A, adjust the milestone and slice counts accordingly. Be honest — if something you thought was multi-milestone turns out to be 3 slices, plan 3 slices. If something you thought was simple turns out to need multiple milestones, say so.
|
|
147
|
+
|
|
148
|
+
## Output Phase
|
|
149
|
+
|
|
150
|
+
### Roadmap Preview
|
|
151
|
+
|
|
152
|
+
Before writing any files, **print the planned roadmap in chat** so the user can see and approve it. Print a markdown table with columns: Slice, Title, Risk, Depends, Demo. One row per slice. Below the table, print the milestone definition of done as a bullet list.
|
|
153
|
+
|
|
154
|
+
Ask: "Ready to write the plan, or want to adjust?" Only proceed to writing files after the user confirms.
|
|
155
|
+
|
|
156
|
+
### Naming Convention
|
|
157
|
+
|
|
158
|
+
Directories use bare IDs. Files use ID-SUFFIX format. Titles live inside file content, not in names.
|
|
159
|
+
- Milestone dir: `.gsd/milestones/{{milestoneId}}/`
|
|
160
|
+
- Milestone files: `{{milestoneId}}-CONTEXT.md`, `{{milestoneId}}-ROADMAP.md`
|
|
161
|
+
- Slice dirs: `S01/`, `S02/`, etc.
|
|
162
|
+
|
|
163
|
+
### Single Milestone
|
|
164
|
+
|
|
165
|
+
Once the user is satisfied, in a single pass:
|
|
166
|
+
1. `mkdir -p .gsd/milestones/{{milestoneId}}/slices`
|
|
167
|
+
2. Write or update `.gsd/PROJECT.md` — read the template at `~/.gsd/agent/extensions/gsd/templates/project.md` first. Describe what the project is, its current state, and list the milestone sequence.
|
|
168
|
+
3. Write or update `.gsd/REQUIREMENTS.md` — read the template at `~/.gsd/agent/extensions/gsd/templates/requirements.md` first. Confirm requirement states, ownership, and traceability before roadmap creation.
|
|
169
|
+
4. Write `{{contextAbsPath}}` — read the template at `~/.gsd/agent/extensions/gsd/templates/context.md` first. Preserve key risks, unknowns, existing codebase constraints, integration points, and relevant requirements surfaced during discussion.
|
|
170
|
+
5. Write `{{roadmapAbsPath}}` — read the template at `~/.gsd/agent/extensions/gsd/templates/roadmap.md` first. Decompose into demoable vertical slices with checkboxes, risk, depends, demo sentences, proof strategy, verification classes, milestone definition of done, requirement coverage, and a boundary map. 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.
|
|
171
|
+
6. Seed `.gsd/DECISIONS.md` — read the template at `~/.gsd/agent/extensions/gsd/templates/decisions.md` first. Append rows for any architectural or pattern decisions made during discussion.
|
|
172
|
+
7. Update `.gsd/STATE.md`
|
|
173
|
+
8. Commit: `docs({{milestoneId}}): context, requirements, and roadmap`
|
|
174
|
+
|
|
175
|
+
After writing the files and committing, say exactly: "Milestone {{milestoneId}} ready." — nothing else. Auto-mode will start automatically.
|
|
176
|
+
|
|
177
|
+
### Multi-Milestone
|
|
178
|
+
|
|
179
|
+
Once the user confirms the milestone split, in a single pass:
|
|
180
|
+
1. `mkdir -p .gsd/milestones/{{milestoneId}}/slices` for each milestone
|
|
181
|
+
2. Write `.gsd/PROJECT.md` — read the template at `~/.gsd/agent/extensions/gsd/templates/project.md` first.
|
|
182
|
+
3. Write `.gsd/REQUIREMENTS.md` — read the template at `~/.gsd/agent/extensions/gsd/templates/requirements.md` first. Capture Active, Deferred, Out of Scope, and any already Validated requirements. Later milestones may have provisional ownership where slice plans do not exist yet.
|
|
183
|
+
4. Write a `CONTEXT.md` for **every** milestone — capture the intent, scope, risks, constraints, user-visible outcome, completion class, final integrated acceptance, and relevant requirements for each. Each future milestone's CONTEXT.md should be rich enough that a planning agent encountering it fresh — with no memory of this conversation — can understand the intent, constraints, dependencies, what this milestone unlocks, and what "done" looks like.
|
|
184
|
+
5. Write a `ROADMAP.md` for **only the first milestone** — detail-planning later milestones now is waste because the codebase will change. Include requirement coverage and a milestone definition of done.
|
|
185
|
+
6. Seed `.gsd/DECISIONS.md`.
|
|
186
|
+
7. Update `.gsd/STATE.md`
|
|
187
|
+
8. Commit: `docs: project plan — N milestones` (replace N with the actual milestone count)
|
|
188
|
+
|
|
189
|
+
After writing the files and committing, say exactly: "Milestone M001 ready." — nothing else. Auto-mode will start automatically.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
You are executing GSD doctor heal mode.
|
|
2
|
+
|
|
3
|
+
The doctor has already scanned the repo and optionally applied deterministic fixes. You are now responsible for resolving the remaining issues using the smallest safe set of changes.
|
|
4
|
+
|
|
5
|
+
Rules:
|
|
6
|
+
1. Prioritize the active milestone or the explicitly requested scope. Do not fan out across unrelated historical milestones unless the report explicitly scopes you there.
|
|
7
|
+
2. Read before edit.
|
|
8
|
+
3. Prefer fixing authoritative artifacts over masking warnings.
|
|
9
|
+
4. For missing summaries or UAT files, generate the real artifact from existing slice/task context when possible — do not leave placeholders if you can reconstruct the real content.
|
|
10
|
+
5. After each repair cluster, verify the relevant invariant directly from disk.
|
|
11
|
+
6. When done, rerun `/gsd doctor {{doctorCommandSuffix}}` mentally by ensuring the remaining issue set for this scope is reduced or cleared.
|
|
12
|
+
|
|
13
|
+
## Doctor Summary
|
|
14
|
+
|
|
15
|
+
{{doctorSummary}}
|
|
16
|
+
|
|
17
|
+
## Structured Issues
|
|
18
|
+
|
|
19
|
+
{{structuredIssues}}
|
|
20
|
+
|
|
21
|
+
## Requested Scope
|
|
22
|
+
|
|
23
|
+
{{scopeLabel}}
|
|
24
|
+
|
|
25
|
+
Then:
|
|
26
|
+
- Repair the unresolved issues in scope
|
|
27
|
+
- Keep changes minimal and targeted
|
|
28
|
+
- If unresolved issues remain outside scope, leave them untouched and mention them briefly
|
|
29
|
+
- End with: "GSD doctor heal complete."
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
You are executing GSD auto-mode.
|
|
2
|
+
|
|
3
|
+
## UNIT: Execute Task {{taskId}} ("{{taskTitle}}") — Slice {{sliceId}} ("{{sliceTitle}}"), Milestone {{milestoneId}}
|
|
4
|
+
|
|
5
|
+
Start with the inlined context below. Treat the inlined task plan as the authoritative local execution contract for this unit. Use the referenced source artifacts to verify details, resolve ambiguity, and run the required checks — do not waste time reconstructing context that is already provided here.
|
|
6
|
+
|
|
7
|
+
{{resumeSection}}
|
|
8
|
+
|
|
9
|
+
{{carryForwardSection}}
|
|
10
|
+
|
|
11
|
+
{{taskPlanInline}}
|
|
12
|
+
|
|
13
|
+
{{slicePlanExcerpt}}
|
|
14
|
+
|
|
15
|
+
## Backing Source Artifacts
|
|
16
|
+
- Slice plan: `{{planPath}}`
|
|
17
|
+
- Task plan source: `{{taskPlanPath}}`
|
|
18
|
+
- Prior task summaries in this slice:
|
|
19
|
+
{{priorTaskLines}}
|
|
20
|
+
|
|
21
|
+
Then:
|
|
22
|
+
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.
|
|
23
|
+
1. 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
|
|
24
|
+
2. Execute the steps in the inlined task plan
|
|
25
|
+
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.
|
|
26
|
+
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).
|
|
27
|
+
5. When implementing non-trivial runtime behavior (async flows, API boundaries, background processes, error paths), add or preserve agent-usable observability. Skip this for simple changes where it doesn't apply.
|
|
28
|
+
6. Verify must-haves are met by running concrete checks (tests, commands, observable behaviors)
|
|
29
|
+
7. Run the slice-level verification checks defined in the slice plan's Verification section. Track which pass. On the final task of the slice, all must pass before marking done. On intermediate tasks, partial passes are expected — note which ones pass in the summary.
|
|
30
|
+
8. If the task touches UI, browser flows, DOM behavior, or user-visible web state:
|
|
31
|
+
- exercise the real flow in the browser
|
|
32
|
+
- prefer `browser_batch` when the next few actions are obvious and sequential
|
|
33
|
+
- prefer `browser_assert` for explicit pass/fail verification of the intended outcome
|
|
34
|
+
- use `browser_diff` when an action's effect is ambiguous
|
|
35
|
+
- use console/network/dialog diagnostics when validating async, stateful, or failure-prone UI
|
|
36
|
+
- record verification in terms of explicit checks passed/failed, not only prose interpretation
|
|
37
|
+
9. If the task plan includes an Observability Impact section, verify those signals directly. Skip this step if the task plan omits the section.
|
|
38
|
+
10. **If execution is running long or verification fails:**
|
|
39
|
+
|
|
40
|
+
**Context budget:** If you've used most of your context and haven't finished all steps, stop implementing and prioritize writing the task summary with clear notes on what's done and what remains. A partial summary that enables clean resumption is more valuable than one more half-finished step with no documentation. Never sacrifice summary quality for one more implementation step.
|
|
41
|
+
|
|
42
|
+
**Debugging discipline:** If a verification check fails or implementation hits unexpected behavior:
|
|
43
|
+
- Form a hypothesis first. State what you think is wrong and why, then test that specific theory. Don't shotgun-fix.
|
|
44
|
+
- Change one variable at a time. Make one change, test, observe. Multiple simultaneous changes mean you can't attribute what worked.
|
|
45
|
+
- Read completely. When investigating, read entire functions and their imports, not just the line that looks relevant.
|
|
46
|
+
- Distinguish "I know" from "I assume." Observable facts (the error says X) are strong evidence. Assumptions (this library should work this way) need verification.
|
|
47
|
+
- Know when to stop. If you've tried 3+ fixes without progress, your mental model is probably wrong. Stop. List what you know for certain. List what you've ruled out. Form fresh hypotheses from there.
|
|
48
|
+
- Don't fix symptoms. Understand *why* something fails before changing code. A test that passes after a change you don't understand is luck, not a fix.
|
|
49
|
+
11. **Blocker discovery:** If execution reveals that the remaining slice plan is fundamentally invalid — not just a bug or minor deviation, but a plan-invalidating finding like a wrong API, missing capability, or architectural mismatch — set `blocker_discovered: true` in the task summary frontmatter and describe the blocker clearly in the summary narrative. Do NOT set `blocker_discovered: true` for ordinary debugging, minor deviations, or issues that can be fixed within the current task or the remaining plan. This flag triggers an automatic replan of the slice.
|
|
50
|
+
12. If you made an architectural, pattern, library, or observability decision during this task that downstream work should know about, append it to `.gsd/DECISIONS.md` (read the template at `~/.gsd/agent/extensions/gsd/templates/decisions.md` if the file doesn't exist yet). Not every task produces decisions — only append when a meaningful choice was made.
|
|
51
|
+
13. Read the template at `~/.gsd/agent/extensions/gsd/templates/task-summary.md`
|
|
52
|
+
14. Write `{{taskSummaryAbsPath}}`
|
|
53
|
+
15. Mark {{taskId}} done in `{{planPath}}` (change `[ ]` to `[x]`)
|
|
54
|
+
16. Do not commit manually — the system auto-commits your changes after this unit completes.
|
|
55
|
+
17. Update `.gsd/STATE.md`
|
|
56
|
+
|
|
57
|
+
You are on the slice branch. All work stays here.
|
|
58
|
+
|
|
59
|
+
**You MUST mark {{taskId}} as `[x]` in `{{planPath}}` AND write `{{taskSummaryAbsPath}}` before finishing.**
|
|
60
|
+
|
|
61
|
+
When done, say: "Task {{taskId}} complete."
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Complete slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. All tasks are done. Read the templates at `~/.gsd/agent/extensions/gsd/templates/slice-summary.md` and `uat.md`. 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 STATE.md, update milestone summary, and leave the slice branch clean for the extension to squash-merge back to main automatically.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Discuss milestone {{milestoneId}} ("{{milestoneTitle}}"). Identify gray areas, ask the user about them, and write `{{milestoneId}}-CONTEXT.md` in the milestone directory with the decisions. Read the template at `~/.gsd/agent/extensions/gsd/templates/context.md` first. If a `GSD Skill Preferences` block is present in system context, use it to decide which skills to load and follow; do not override required artifact rules.
|
|
2
|
+
|
|
3
|
+
**Investigate between question rounds to make your questions smarter.** Before each round of questions, do enough lightweight research that your questions are grounded in reality — not guesses about what exists or what's possible. Check library docs (`resolve_library`/`get_library_docs`) when tech choices are relevant, search the web (`search-the-web` with `freshness`/`domain` filters, then `fetch_page` for full content) to verify the landscape, scout the codebase (`rg`, `find`, `scout`) to understand what already exists. Don't go deep — just enough that your next question reflects what's actually true. The goal is to ask questions the user can't answer by saying "did you check the docs?" or "look at the code."
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
You are interviewing the user to surface behavioural, UX, and usage grey areas for slice **{{sliceId}}: {{sliceTitle}}** of milestone **{{milestoneId}}**.
|
|
2
|
+
|
|
3
|
+
Your goal is **not** to settle tech stack, naming conventions, or architecture — that happens during research and planning. Your goal is to produce a context file that captures the human decisions: what this slice should feel like, how it should behave, what edge cases matter, where scope begins and ends, and what the user cares about that won't be obvious from the roadmap entry alone.
|
|
4
|
+
|
|
5
|
+
{{inlinedContext}}
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Interview Protocol
|
|
10
|
+
|
|
11
|
+
### Before your first question round
|
|
12
|
+
|
|
13
|
+
Do a lightweight targeted investigation so your questions are grounded in reality:
|
|
14
|
+
- Scout the codebase (`rg`, `find`, or `scout` for broad unfamiliar areas) to understand what already exists that this slice touches or builds on
|
|
15
|
+
- Check the roadmap context above to understand what surrounds this slice — what comes before, what depends on it
|
|
16
|
+
- Identify the 3–5 biggest behavioural unknowns: things where the user's answer will materially change what gets built
|
|
17
|
+
|
|
18
|
+
Do **not** go deep — just enough that your questions reflect what's actually true rather than what you assume.
|
|
19
|
+
|
|
20
|
+
### Question rounds
|
|
21
|
+
|
|
22
|
+
Ask **1–3 questions per round** using `ask_user_questions`. Keep each question focused on one of:
|
|
23
|
+
- **UX and user-facing behaviour** — what does the user see, click, trigger, or experience?
|
|
24
|
+
- **Edge cases and failure states** — what happens when things go wrong or are in unusual states?
|
|
25
|
+
- **Scope boundaries** — what is explicitly in vs out for this slice? What deferred to later?
|
|
26
|
+
- **Feel and experience** — tone, responsiveness, feedback, transitions, what "done" feels like to the user
|
|
27
|
+
|
|
28
|
+
After the user answers, investigate further if any answer opens a new unknown, then ask the next round.
|
|
29
|
+
|
|
30
|
+
### Check-in after each round
|
|
31
|
+
|
|
32
|
+
After each round of answers, use `ask_user_questions` to ask:
|
|
33
|
+
|
|
34
|
+
> "I think I have a solid picture of this slice. Ready to wrap up and write the context file, or is there more to cover?"
|
|
35
|
+
|
|
36
|
+
Options:
|
|
37
|
+
- "Wrap up — write the context file" *(recommended after ~2–3 rounds)*
|
|
38
|
+
- "Keep going — more to discuss"
|
|
39
|
+
|
|
40
|
+
If the user wants to keep going, keep asking. Stop when they say wrap up.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Output
|
|
45
|
+
|
|
46
|
+
Once the user is ready to wrap up:
|
|
47
|
+
|
|
48
|
+
1. Read the slice context template at `~/.gsd/agent/extensions/gsd/templates/slice-context.md`
|
|
49
|
+
2. `mkdir -p {{sliceDirAbsPath}}`
|
|
50
|
+
3. Write `{{contextAbsPath}}` — use the template structure, filling in:
|
|
51
|
+
- **Goal** — one sentence: what this slice delivers
|
|
52
|
+
- **Why this Slice** — why now, what it unblocks
|
|
53
|
+
- **Scope / In Scope** — what was confirmed in scope during the interview
|
|
54
|
+
- **Scope / Out of Scope** — what was explicitly deferred or excluded
|
|
55
|
+
- **Constraints** — anything the user flagged as a hard constraint
|
|
56
|
+
- **Integration Points** — what this slice consumes and produces
|
|
57
|
+
- **Open Questions** — anything still unresolved, with current thinking
|
|
58
|
+
4. Commit: `git -C {{projectRoot}} add {{contextAbsPath}} && git -C {{projectRoot}} commit -m "docs({{milestoneId}}/{{sliceId}}): slice context from discuss"`
|
|
59
|
+
5. Say exactly: `"{{sliceId}} context written."` — nothing else.
|
|
@@ -0,0 +1 @@
|
|
|
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`. Read the template at `~/.gsd/agent/extensions/gsd/templates/task-summary.md`. 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.
|
|
@@ -0,0 +1,23 @@
|
|
|
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. Read the template at `~/.gsd/agent/extensions/gsd/templates/roadmap.md`. 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.
|
|
2
|
+
|
|
3
|
+
## Requirement Rules
|
|
4
|
+
|
|
5
|
+
- Every relevant Active requirement must be mapped to a slice, deferred, blocked with reason, or moved out of scope.
|
|
6
|
+
- Each requirement gets one primary owner and may have supporting slices.
|
|
7
|
+
- Surface orphaned Active requirements instead of silently ignoring them.
|
|
8
|
+
- Product-facing milestones should cover launchability, primary user loop, continuity, and failure visibility when relevant.
|
|
9
|
+
|
|
10
|
+
## Planning Doctrine
|
|
11
|
+
|
|
12
|
+
- **Risk-first means proof-first.** The earliest slices should prove the hardest thing works by shipping the real feature through the uncertain path. If auth is the risk, the first slice ships a real login page with real session handling that a user can actually use — not a CLI command that returns "authenticated: true". Proof is the shipped feature working. There is no separate "proof" artifact. Do not plan spikes, proof-of-concept slices, or validation-only slices — the proof is the real feature, built through the risky path.
|
|
13
|
+
- **Every slice is vertical, demoable, and shippable.** Every slice ships real, user-facing functionality. "Demoable" means you could show a stakeholder and they'd see real product progress — not a developer showing a terminal command. If the only way to demonstrate the slice is through a test runner or a curl command, the slice is missing its UI/UX surface. Add it. A slice that only proves something but doesn't ship real working code is not a slice — restructure it.
|
|
14
|
+
- **Brownfield bias.** When planning against an existing codebase, ground slices in existing modules, conventions, and seams. Prefer extending real patterns over inventing new ones.
|
|
15
|
+
- **Each slice should establish something downstream slices can depend on.** Think about what stable surface this slice creates for later work — an API, a data shape, a proven integration path.
|
|
16
|
+
- **Avoid foundation-only slices.** If a slice doesn't produce something demoable end-to-end, it's probably a layer, not a vertical slice. Restructure it.
|
|
17
|
+
- **Verification-first.** When planning slices, know what "done" looks like before detailing implementation. Each slice's demo line should describe concrete, verifiable evidence — not vague "it works" claims.
|
|
18
|
+
- **Plan for integrated reality, not just local proof.** Distinguish contract proof from live integration proof. If the milestone involves multiple runtime boundaries, one slice must explicitly prove the assembled system through the real entrypoint or runtime path.
|
|
19
|
+
- **Truthful demo lines only.** If a slice is proven by fixtures or tests only, say so. Do not phrase harness-level proof as if the user can already perform the live end-to-end behavior unless that has actually been exercised.
|
|
20
|
+
- **Completion must imply capability.** If every slice in this roadmap were completed exactly as written, the milestone's promised outcome should actually work at the proof level claimed. Do not write slices that can all be checked off while the user-visible capability still does not exist.
|
|
21
|
+
- **Don't invent risks.** If the project is straightforward, skip the proof strategy and just ship value in smart order. Not everything has major unknowns.
|
|
22
|
+
- **Ship features, not proofs.** A completed slice should leave the product in a state where the new capability is actually usable through its real interface. A login flow slice ends with a working login page, not a middleware function. An API slice ends with endpoints that return real data from a real store, not hardcoded fixtures. A dashboard slice ends with a real dashboard rendering real data, not a component that renders mock props. If a slice can't ship the real thing yet because a dependency isn't built, it should ship with realistic stubs that are clearly marked for replacement — but the user-facing surface must be real.
|
|
23
|
+
- **Ambition matches the milestone.** The number and depth of slices should match the milestone's ambition. A milestone promising "core platform with auth, data model, and primary user loop" should have enough slices to actually deliver all three as working features — not two proof-of-concept slices and a note that "the rest will come in the next milestone." If the milestone's context promises an outcome, the roadmap must deliver it.
|
|
@@ -0,0 +1 @@
|
|
|
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. Read the templates at `~/.gsd/agent/extensions/gsd/templates/plan.md` and `task-plan.md`. 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.
|
|
@@ -0,0 +1,11 @@
|
|
|
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`. Read the template at `~/.gsd/agent/extensions/gsd/templates/research.md`. Write `{{sliceId}}-RESEARCH.md` in the slice directory with summary, don't-hand-roll, common pitfalls, and relevant code sections.
|
|
2
|
+
|
|
3
|
+
## Strategic Questions to Answer
|
|
4
|
+
|
|
5
|
+
Research should drive planning decisions, not just collect facts. Explicitly address:
|
|
6
|
+
|
|
7
|
+
- **What should be proven first?** What's the riskiest assumption — the thing that, if wrong, invalidates downstream work?
|
|
8
|
+
- **What existing patterns should be reused?** What modules, conventions, or infrastructure already exist that the plan should build on rather than reinvent?
|
|
9
|
+
- **What boundary contracts matter?** What interfaces, data shapes, event formats, or invariants will slices need to agree on?
|
|
10
|
+
- **What constraints does the existing codebase impose?** What can't be changed, what's expensive to change, what patterns must be respected?
|
|
11
|
+
- **Are there known failure modes that should shape slice ordering?** Pitfalls that mean certain work should come before or after other work?
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Resume interrupted work. Find the continue file (`{{sliceId}}-CONTINUE.md` or `continue.md`) in slice {{sliceId}} of milestone {{milestoneId}}, then pick up from where you left off. Delete the continue file after reading it. 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.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
You are executing GSD auto-mode.
|
|
2
|
+
|
|
3
|
+
## UNIT: Plan Milestone {{milestoneId}} ("{{milestoneTitle}}")
|
|
4
|
+
|
|
5
|
+
All relevant context has been preloaded below — start working immediately without re-reading these files.
|
|
6
|
+
|
|
7
|
+
{{inlinedContext}}
|
|
8
|
+
|
|
9
|
+
Narrate your decomposition reasoning — why you're grouping work this way, what risks are driving the order, what verification strategy you're choosing and why.
|
|
10
|
+
|
|
11
|
+
Then:
|
|
12
|
+
1. Read the template at `~/.gsd/agent/extensions/gsd/templates/roadmap.md`
|
|
13
|
+
2. Read `.gsd/REQUIREMENTS.md` if it exists. Treat **Active** requirements as the capability contract for planning. If it does not exist, continue in legacy compatibility mode but explicitly note that requirement coverage is operating without a contract.
|
|
14
|
+
3. 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
|
|
15
|
+
4. 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.
|
|
16
|
+
5. Order by risk (high-risk first)
|
|
17
|
+
6. 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
|
|
18
|
+
7. If planning produced structural decisions (e.g. slice ordering rationale, technology choices, scope exclusions), append them to `.gsd/DECISIONS.md` (read the template at `~/.gsd/agent/extensions/gsd/templates/decisions.md` if the file doesn't exist yet)
|
|
19
|
+
8. Update `.gsd/STATE.md`
|
|
20
|
+
|
|
21
|
+
## Requirement Mapping Rules
|
|
22
|
+
|
|
23
|
+
- Every Active requirement relevant to this milestone must be in one of these states by the end of planning: mapped to a slice, explicitly deferred, blocked with reason, or moved out of scope.
|
|
24
|
+
- Each requirement should have one accountable primary owner and may have supporting slices.
|
|
25
|
+
- Product-facing milestones should cover launchability, primary user loop, continuity, and failure visibility when relevant.
|
|
26
|
+
- A slice may support multiple requirements, but should not exist with no requirement justification unless it is clearly enabling work for a mapped requirement.
|
|
27
|
+
- Include a compact coverage summary in the roadmap so omissions are mechanically visible.
|
|
28
|
+
- If `.gsd/REQUIREMENTS.md` exists and an Active requirement has no credible path, surface that clearly. Do not silently ignore orphaned Active requirements.
|
|
29
|
+
|
|
30
|
+
## Planning Doctrine
|
|
31
|
+
|
|
32
|
+
Apply these when decomposing and ordering slices:
|
|
33
|
+
|
|
34
|
+
- **Risk-first means proof-first.** The earliest slices should prove the hardest thing works by shipping the real feature through the uncertain path. If auth is the risk, the first slice ships a real login page with real session handling that a user can actually use — not a CLI command that returns "authenticated: true". Proof is the shipped feature working. There is no separate "proof" artifact. Do not plan spikes, proof-of-concept slices, or validation-only slices — the proof is the real feature, built through the risky path.
|
|
35
|
+
- **Every slice is vertical, demoable, and shippable.** Every slice ships real, user-facing functionality. "Demoable" means you could show a stakeholder and they'd see real product progress — not a developer showing a terminal command. If the only way to demonstrate the slice is through a test runner or a curl command, the slice is missing its UI/UX surface. Add it. A slice that only proves something but doesn't ship real working code is not a slice — restructure it.
|
|
36
|
+
- **Brownfield bias.** When planning against an existing codebase, ground slices in existing modules, conventions, and seams. Prefer extending real patterns over inventing new ones.
|
|
37
|
+
- **Each slice should establish something downstream slices can depend on.** Think about what stable surface this slice creates for later work — an API, a data shape, a proven integration path.
|
|
38
|
+
- **Avoid foundation-only slices.** If a slice doesn't produce something demoable end-to-end, it's probably a layer, not a vertical slice. Restructure it.
|
|
39
|
+
- **Verification-first.** When planning slices, know what "done" looks like before detailing implementation. Each slice's demo line should describe concrete, verifiable evidence — not vague "it works" claims.
|
|
40
|
+
- **Plan for integrated reality, not just local proof.** Distinguish contract proof from live integration proof. If the milestone involves multiple runtime boundaries, one slice must explicitly prove the assembled system through the real entrypoint or runtime path.
|
|
41
|
+
- **Truthful demo lines only.** If a slice is proven by fixtures or tests only, say so. Do not phrase harness-level proof as if the user can already perform the live end-to-end behavior unless that has actually been exercised.
|
|
42
|
+
- **Completion must imply capability.** If every slice in this roadmap were completed exactly as written, the milestone's promised outcome should actually work at the proof level claimed. Do not write slices that can all be checked off while the user-visible capability still does not exist.
|
|
43
|
+
- **Don't invent risks.** If the project is straightforward, skip the proof strategy and just ship value in smart order. Not everything has major unknowns.
|
|
44
|
+
- **Ship features, not proofs.** A completed slice should leave the product in a state where the new capability is actually usable through its real interface. A login flow slice ends with a working login page, not a middleware function. An API slice ends with endpoints that return real data from a real store, not hardcoded fixtures. A dashboard slice ends with a real dashboard rendering real data, not a component that renders mock props. If a slice can't ship the real thing yet because a dependency isn't built, it should ship with realistic stubs that are clearly marked for replacement — but the user-facing surface must be real.
|
|
45
|
+
- **Ambition matches the milestone.** The number and depth of slices should match the milestone's ambition. A milestone promising "core platform with auth, data model, and primary user loop" should have enough slices to actually deliver all three as working features — not two proof-of-concept slices and a note that "the rest will come in the next milestone." If the milestone's context promises an outcome, the roadmap must deliver it.
|
|
46
|
+
- **Right-size the decomposition.** Match slice count to actual complexity. If the work is small enough to build and verify in one pass, it's one slice — don't split it into three just because you can identify sub-steps. Multiple requirements can share a single slice. Conversely, don't cram genuinely independent capabilities into one slice just to keep the count low. Let the work dictate the structure.
|
|
47
|
+
|
|
48
|
+
## Single-Slice Fast Path
|
|
49
|
+
|
|
50
|
+
If the roadmap has only one slice, also write the slice plan and task plans inline during this unit — don't leave them for a separate planning session.
|
|
51
|
+
|
|
52
|
+
1. Read the templates:
|
|
53
|
+
- `~/.gsd/agent/extensions/gsd/templates/plan.md`
|
|
54
|
+
- `~/.gsd/agent/extensions/gsd/templates/task-plan.md`
|
|
55
|
+
2. `mkdir -p {{milestonePath}}/slices/S01/tasks`
|
|
56
|
+
3. Write the S01 plan file at `{{milestonePath}}/slices/S01/S01-PLAN.md`
|
|
57
|
+
4. Write individual task plans at `{{milestonePath}}/slices/S01/tasks/T01-PLAN.md`, etc.
|
|
58
|
+
5. For simple slices, keep the plan lean — omit Proof Level, Integration Closure, and Observability sections if they would all be "none". Executable verification commands are sufficient.
|
|
59
|
+
|
|
60
|
+
This eliminates a separate research-slice + plan-slice cycle when the work is straightforward.
|
|
61
|
+
|
|
62
|
+
**You MUST write the file `{{outputAbsPath}}` before finishing.**
|
|
63
|
+
{{skipObservabilityNote}}
|
|
64
|
+
|
|
65
|
+
When done, say: "Milestone {{milestoneId}} planned."
|