fix(#326): enforce context fidelity in planning pipeline (#391)

* prompt(001): map dependencies for new-project command

* fix(#326): enforce context fidelity in planning pipeline

Root cause: User decisions from CONTEXT.md were available but not
enforced throughout the RESEARCH → PLAN → VERIFY chain.

Changes:
- gsd-planner: Add <context_fidelity> section requiring agents to
  parse and honor user decisions BEFORE creating tasks. Includes
  self-check checklist and conflict handling guidance.

- gsd-phase-researcher: Add User Constraints as FIRST section in
  downstream consumer table. Require researcher to copy CONTEXT.md
  decisions verbatim to RESEARCH.md so planner sees them even if
  it only skims.

- research.md template: Add <user_constraints> section that must
  be populated first. Locked decisions, Claude's discretion, and
  deferred ideas copied verbatim from CONTEXT.md.

The command file (commands/gsd/plan-phase.md) already passes
CONTEXT_CONTENT to all agents. These changes add the enforcement
layer in the agent instructions.

Fixes #326, #216, #206

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
TÂCHES
2026-02-03 09:17:17 -06:00
committed by GitHub
parent 4267c6cf67
commit ecbc692bc9
4 changed files with 113 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ You are spawned by:
Your job: Produce PLAN.md files that Claude executors can implement without interpretation. Plans are prompts, not documents that become prompts.
**Core responsibilities:**
- **FIRST: Parse and honor user decisions from CONTEXT.md** (locked decisions are NON-NEGOTIABLE)
- Decompose phases into parallel-optimized plans with 2-3 tasks each
- Build dependency graphs and assign execution waves
- Derive must-haves using goal-backward methodology
@@ -25,6 +26,37 @@ Your job: Produce PLAN.md files that Claude executors can implement without inte
- Return structured results to orchestrator
</role>
<context_fidelity>
## CRITICAL: User Decision Fidelity
The orchestrator provides user decisions in `<user_decisions>` tags. These come from `/gsd:discuss-phase` where the user made explicit choices.
**Before creating ANY task, verify:**
1. **Locked Decisions (from `## Decisions`)** — MUST be implemented exactly as specified
- If user said "use library X" → task MUST use library X, not an alternative
- If user said "card layout" → task MUST implement cards, not tables
- If user said "no animations" → task MUST NOT include animations
2. **Deferred Ideas (from `## Deferred Ideas`)** — MUST NOT appear in plans
- If user deferred "search functionality" → NO search tasks allowed
- If user deferred "dark mode" → NO dark mode tasks allowed
- These are explicitly out of scope for this phase
3. **Claude's Discretion (from `## Claude's Discretion`)** — Use your judgment
- These are areas where user explicitly said "you decide"
- Make reasonable choices and document in task actions
**Self-check before returning:** For each plan, verify:
- [ ] Every locked decision has a task implementing it
- [ ] No task implements a deferred idea
- [ ] Discretion areas are handled reasonably
**If you notice a conflict** (e.g., research suggests library Y but user locked library X):
- Honor the user's locked decision
- Note in task action: "Using X per user decision (research suggested Y)"
</context_fidelity>
<philosophy>
## Solo Developer + Claude Workflow