diff --git a/get-shit-done/templates/context.md b/get-shit-done/templates/context.md index eed462bac..9ec7eac5e 100644 --- a/get-shit-done/templates/context.md +++ b/get-shit-done/templates/context.md @@ -54,6 +54,24 @@ Template for `.planning/phases/XX-name/{phase_num}-CONTEXT.md` - captures implem + +## Canonical References + +**Downstream agents MUST read these before planning or implementing.** + +[List every spec, ADR, feature doc, or design doc that defines requirements or constraints for this phase. Use full relative paths so agents can read them directly. Group by topic area when the phase has multiple concerns.] + +### [Topic area 1] +- `path/to/spec-or-adr.md` — [What this doc decides/defines that's relevant] +- `path/to/doc.md` §N — [Specific section and what it covers] + +### [Topic area 2] +- `path/to/feature-doc.md` — [What capability this defines] + +[If the project has no external specs: "No external specs — requirements are fully captured in decisions above"] + + + ## Existing Code Insights @@ -124,6 +142,18 @@ Display posts from followed users in a scrollable feed. Users can view posts and + +## Canonical References + +### Feed display +- `docs/features/social-feed.md` — Feed requirements, post card fields, engagement display rules +- `docs/decisions/adr-012-infinite-scroll.md` — Scroll strategy decision, virtualization requirements + +### Empty states +- `docs/design/empty-states.md` — Empty state patterns, illustration guidelines + + + ## Specific Ideas @@ -186,6 +216,15 @@ CLI command to backup database to local file or S3. Supports full and incrementa + +## Canonical References + +### Backup CLI +- `docs/features/backup-restore.md` — Backup requirements, supported backends, encryption spec +- `docs/decisions/adr-007-cli-conventions.md` — Flag naming, exit codes, output format standards + + + ## Specific Ideas @@ -248,6 +287,15 @@ Organize existing photo library into structured folders. Handle duplicates and a + +## Canonical References + +### Organization rules +- `docs/features/photo-organization.md` — Grouping rules, duplicate policy, naming spec +- `docs/decisions/adr-003-exif-handling.md` — EXIF extraction strategy, fallback for missing metadata + + + ## Specific Ideas @@ -291,7 +339,14 @@ The output should answer: "What does the researcher need to investigate? What ch **After creation:** - File lives in phase directory: `.planning/phases/XX-name/{phase_num}-CONTEXT.md` -- `gsd-phase-researcher` uses decisions to focus investigation -- `gsd-planner` uses decisions + research to create executable tasks +- `gsd-phase-researcher` uses decisions to focus investigation AND reads canonical_refs to know WHAT docs to study +- `gsd-planner` uses decisions + research to create executable tasks AND reads canonical_refs to verify alignment - Downstream agents should NOT need to ask the user again about captured decisions + +**CRITICAL — Canonical references:** +- The `` section is MANDATORY. Every CONTEXT.md must have one. +- If your project has external specs, ADRs, or design docs, list them with full relative paths grouped by topic +- If ROADMAP.md lists `Canonical refs:` per phase, extract and expand those +- Inline mentions like "see ADR-019" scattered in decisions are useless to downstream agents — they need full paths and section references in a dedicated section they can find +- If no external specs exist, say so explicitly — don't silently omit the section diff --git a/get-shit-done/workflows/discuss-phase.md b/get-shit-done/workflows/discuss-phase.md index 0fae77273..761c01b83 100644 --- a/get-shit-done/workflows/discuss-phase.md +++ b/get-shit-done/workflows/discuss-phase.md @@ -272,6 +272,15 @@ Analyze the phase to identify gray areas worth discussing. **Use both `prior_dec 1. **Domain boundary** — What capability is this phase delivering? State it clearly. +1b. **Initialize canonical refs accumulator** — Start building the `` list for CONTEXT.md. This accumulates throughout the entire discussion, not just this step. + + **Source 1 (now):** Copy `Canonical refs:` from ROADMAP.md for this phase. Expand each to a full relative path. + **Source 2 (now):** Check REQUIREMENTS.md and PROJECT.md for any specs/ADRs referenced for this phase. + **Source 3 (scout_codebase):** If existing code references docs (e.g., comments citing ADRs), add those. + **Source 4 (discuss_areas):** When the user says "read X", "check Y", or references any doc/spec/ADR during discussion — add it immediately. These are often the MOST important refs because they represent docs the user specifically wants followed. + + This list is MANDATORY in CONTEXT.md. Every ref must have a full relative path so downstream agents can read it directly. If no external docs exist, note that explicitly. + 2. **Check prior decisions** — Before generating gray areas, check if any were already decided: - Scan `` for relevant choices (e.g., "Ctrl+C only, no single-key shortcuts") - These are **pre-answered** — don't re-ask unless this phase has conflicting needs @@ -420,6 +429,14 @@ Ask 4 questions per area before offering to continue or move on. Each answer oft - Loop: discuss new areas, then prompt again - If "I'm ready for context": Proceed to write_context +**Canonical ref accumulation during discussion:** +When the user references a doc, spec, or ADR during any answer — e.g., "read adr-014", "check the MCP spec", "per browse-spec.md" — immediately: +1. Read the referenced doc (or confirm it exists) +2. Add it to the canonical refs accumulator with full relative path +3. Use what you learned from the doc to inform subsequent questions + +These user-referenced docs are often MORE important than ROADMAP.md refs because they represent docs the user specifically wants downstream agents to follow. Never drop them. + **Question design:** - Options should be concrete, not abstract ("Cards" not "Option A") - Each answer should inform the next question @@ -481,6 +498,27 @@ mkdir -p ".planning/phases/${padded_phase}-${phase_slug}" + +## Canonical References + +**Downstream agents MUST read these before planning or implementing.** + +[MANDATORY section. Write the FULL accumulated canonical refs list here. +Sources: ROADMAP.md refs + REQUIREMENTS.md refs + user-referenced docs during +discussion + any docs discovered during codebase scout. Group by topic area. +Every entry needs a full relative path — not just a name.] + +### [Topic area 1] +- `path/to/adr-or-spec.md` — [What it decides/defines that's relevant] +- `path/to/doc.md` §N — [Specific section reference] + +### [Topic area 2] +- `path/to/feature-doc.md` — [What this doc defines] + +[If no external specs: "No external specs — requirements fully captured in decisions above"] + + + ## Existing Code Insights @@ -669,6 +707,7 @@ Route to `confirm_creation` step (existing behavior — show manual next steps). - Each selected area explored until user satisfied (with code-informed and prior-decision-informed options) - Scope creep redirected to deferred ideas - CONTEXT.md captures actual decisions, not vague vision +- CONTEXT.md includes canonical_refs section with full file paths to every spec/ADR/doc downstream agents need (MANDATORY — never omit) - CONTEXT.md includes code_context section with reusable assets and patterns - Deferred ideas preserved for future phases - STATE.md updated with session info diff --git a/get-shit-done/workflows/plan-phase.md b/get-shit-done/workflows/plan-phase.md index 9f4ccc576..bca0b312f 100644 --- a/get-shit-done/workflows/plan-phase.md +++ b/get-shit-done/workflows/plan-phase.md @@ -77,6 +77,7 @@ Generating CONTEXT.md from requirements... - Extract all requirements, user stories, acceptance criteria, and constraints from the PRD - Map each to a locked decision (everything in the PRD is treated as a locked decision) - Identify any areas the PRD doesn't cover and mark as "Claude's Discretion" + - **Extract canonical refs** from ROADMAP.md for this phase, plus any specs/ADRs referenced in the PRD — expand to full file paths (MANDATORY) - Create CONTEXT.md in the phase directory 4. Write CONTEXT.md: @@ -106,6 +107,21 @@ Generating CONTEXT.md from requirements... + +## Canonical References + +**Downstream agents MUST read these before planning or implementing.** + +[MANDATORY. Extract from ROADMAP.md and any docs referenced in the PRD. +Use full relative paths. Group by topic area.] + +### [Topic area] +- `path/to/spec-or-adr.md` — [What it decides/defines] + +[If no external specs: "No external specs — requirements fully captured in decisions above"] + + + ## Specific Ideas diff --git a/get-shit-done/workflows/quick.md b/get-shit-done/workflows/quick.md index 259e24456..e0251d74e 100644 --- a/get-shit-done/workflows/quick.md +++ b/get-shit-done/workflows/quick.md @@ -217,9 +217,18 @@ ${any_specific_references_or_examples_from_discussion} [If none: "No specific requirements — open to standard approaches"] + + +## Canonical References + +${any_specs_adrs_or_docs_referenced_during_discussion} + +[If none: "No external specs — requirements fully captured in decisions above"] + + ``` -Note: Quick task CONTEXT.md omits `` and `` sections (no codebase scouting, no phase scope to defer to). Keep it lean. +Note: Quick task CONTEXT.md omits `` and `` sections (no codebase scouting, no phase scope to defer to). Keep it lean. The `` section is included when external docs were referenced — omit it only if no external docs apply. Report: `Context captured: ${QUICK_DIR}/${next_num}-CONTEXT.md`