feat(workflows): adaptive context enrichment for 1M models

Read context_window config (default 200000) in execute-phase and plan-phase workflows. When >= 500000 (1M-class models), subagent prompts include richer context: executor agents receive CONTEXT.md, RESEARCH.md, and prior wave SUMMARYs; verifier agents receive all PLANs, SUMMARYs, and REQUIREMENTS.md; planner receives prior phase CONTEXT.md for cross-phase decision consistency.

At 200k (default), behavior is unchanged.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tibsfox
2026-04-02 04:16:24 -07:00
parent 94a8005f97
commit 9d430f6637
3 changed files with 181 additions and 0 deletions

View File

@@ -76,6 +76,17 @@ USE_WORKTREES=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get
When `USE_WORKTREES` is `false`, all executor agents run without `isolation="worktree"` — they execute sequentially on the main working tree instead of in parallel worktrees.
Read context window size for adaptive prompt enrichment:
```bash
CONTEXT_WINDOW=$(node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config-get context_window 2>/dev/null || echo "200000")
```
When `CONTEXT_WINDOW >= 500000` (1M-class models), subagent prompts include richer context:
- Executor agents receive prior wave SUMMARY.md files and the phase CONTEXT.md/RESEARCH.md
- Verifier agents receive all PLAN.md, SUMMARY.md, CONTEXT.md files plus REQUIREMENTS.md
- This enables cross-phase awareness and history-aware verification
**If `phase_found` is false:** Error — phase directory not found.
**If `plan_count` is 0:** Error — no plans found in phase.
**If `state_exists` is false but `.planning/` exists:** Offer reconstruct or continue.
@@ -265,6 +276,11 @@ Execute each selected wave in sequence. Within a wave: parallel if `PARALLELIZAT
- .planning/PROJECT.md (Project context — core value, requirements, evolution rules)
- .planning/STATE.md (State)
- .planning/config.json (Config, if exists)
${CONTEXT_WINDOW >= 500000 ? `
- ${phase_dir}/*-CONTEXT.md (User decisions from discuss-phase — honors locked choices)
- ${phase_dir}/*-RESEARCH.md (Technical research — pitfalls and patterns to follow)
- ${prior_wave_summaries} (SUMMARY.md files from earlier waves in this phase — what was already built)
` : ''}
- ./CLAUDE.md (Project instructions, if exists — follow project-specific guidelines and coding conventions)
- .claude/skills/ or .agents/skills/ (Project skills, if either exists — list skills, read SKILL.md for each, follow relevant rules during implementation)
</files_to_read>
@@ -739,6 +755,18 @@ Phase requirement IDs: {phase_req_ids}
Check must_haves against actual codebase.
Cross-reference requirement IDs from PLAN frontmatter against REQUIREMENTS.md — every ID MUST be accounted for.
Create VERIFICATION.md.
<files_to_read>
Read these files before verification:
- {phase_dir}/*-PLAN.md (All plans — understand intent, check must_haves)
- {phase_dir}/*-SUMMARY.md (All summaries — cross-reference claimed vs actual)
- .planning/REQUIREMENTS.md (Requirement traceability)
${CONTEXT_WINDOW >= 500000 ? `- {phase_dir}/*-CONTEXT.md (User decisions — verify they were honored)
- {phase_dir}/*-RESEARCH.md (Known pitfalls — check for traps)
- Prior VERIFICATION.md files from earlier phases (regression check)
` : ''}
</files_to_read>
${VERIFIER_SKILLS}",
subagent_type="gsd-verifier",
model="{verifier_model}"