Skip to content

fix: feed codebase conventions to planner agent for brownfield projects#936

Open
amanape wants to merge 1 commit intogsd-build:mainfrom
amanape:fix/plan-phase-read-codebase-maps
Open

fix: feed codebase conventions to planner agent for brownfield projects#936
amanape wants to merge 1 commit intogsd-build:mainfrom
amanape:fix/plan-phase-read-codebase-maps

Conversation

@amanape
Copy link
Contributor

@amanape amanape commented Mar 4, 2026

What

Feed .planning/codebase/CONVENTIONS.md to the planner agent during /gsd:plan-phase for brownfield projects.

Why

The planner creates PLAN.md files without knowledge of existing conventions — plans may specify wrong directories or ignore established patterns. This is critical because /gsd:discuss-phase (which does read conventions) is optional.

Details

  • init.cjs: Add has_codebase_map to cmdInitPlanPhase result
  • plan-phase.md: Parse has_codebase_map from init; conditionally add <codebase_context> with CONVENTIONS.md to planner prompt
  • planner-subagent-prompt.md: Add CONVENTIONS.md to template's <planning_context>

Pros: Safety net when discuss-phase is skipped. Plans reference established patterns. Conditional — zero cost for greenfield.
Cons: Adds one file to planner context. Partial overlap with discuss-phase's codebase scout (but discuss-phase is optional).

Related: #935 (new-project questioning), #937 (phase prompt template) — together these ensure CONVENTIONS.md flows through questioning → planning → execution.

Testing

  • Tested on macOS
  • Tested on Windows
  • Tested on Linux

Checklist

  • Follows GSD style (no enterprise patterns, no filler)
  • Updates CHANGELOG.md for user-facing changes
  • No unnecessary dependencies added
  • Works on Windows (backslash paths tested)

Breaking Changes

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant