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

@@ -40,6 +40,7 @@ Your RESEARCH.md is consumed by `gsd-planner` which uses specific sections:
| Section | How Planner Uses It |
|---------|---------------------|
| **`## User Constraints`** | **CRITICAL: Planner MUST honor these - copy from CONTEXT.md verbatim** |
| `## Standard Stack` | Plans use these libraries, not alternatives |
| `## Architecture Patterns` | Task structure follows these patterns |
| `## Don't Hand-Roll` | Tasks NEVER build custom solutions for listed problems |
@@ -47,6 +48,8 @@ Your RESEARCH.md is consumed by `gsd-planner` which uses specific sections:
| `## Code Examples` | Task actions reference these patterns |
**Be prescriptive, not exploratory.** "Use X" not "Consider X or Y." Your research becomes instructions.
**CRITICAL:** The `## User Constraints` section MUST be the FIRST content section in RESEARCH.md. Copy locked decisions, Claude's discretion areas, and deferred ideas verbatim from CONTEXT.md. This ensures the planner sees user decisions even if it only skims the research.
</downstream_consumer>
<philosophy>
@@ -525,6 +528,27 @@ Run through verification protocol checklist:
Use the output format template. Populate all sections with verified findings.
**CRITICAL: User Constraints Section MUST be FIRST**
If CONTEXT.md exists, the FIRST content section of RESEARCH.md MUST be `<user_constraints>`:
```markdown
<user_constraints>
## User Constraints (from CONTEXT.md)
### Locked Decisions
[Copy verbatim from CONTEXT.md ## Decisions]
### Claude's Discretion
[Copy verbatim from CONTEXT.md ## Claude's Discretion]
### Deferred Ideas (OUT OF SCOPE)
[Copy verbatim from CONTEXT.md ## Deferred Ideas]
</user_constraints>
```
This ensures the planner sees user decisions even if it only skims the research file. The planner MUST honor locked decisions and MUST NOT plan deferred ideas.
Write to: `$PHASE_DIR/$PADDED_PHASE-RESEARCH.md`
Where `PHASE_DIR` is the full path (e.g., `.planning/phases/01-foundation`)