feat: Add codebase exploration to architect agent prompts
Architect agents (discuss, plan, detail, refine) were producing generic analysis disconnected from the actual codebase. They had full tool access in their worktrees but were never instructed to explore the code. - Add CODEBASE_EXPLORATION shared constant: read project docs, explore structure, check existing patterns, use subagents for parallel exploration - Inject into all 4 architect prompts after INPUT_FILES - Strengthen discuss prompt: analysis method references codebase, examples cite specific paths, definition_of_done requires codebase references - Fix spawnArchitectDiscuss to pass full context (pages/phases/tasks) via gatherInitiativeContext() — was only passing bare initiative metadata - Update docs/agent.md with new tag ordering and shared block table
This commit is contained in:
@@ -60,6 +60,25 @@ You are in an isolated git worktree. Other agents work in parallel on separate b
|
||||
- Run \`git status\` before committing
|
||||
</git_workflow>`;
|
||||
|
||||
export const CODEBASE_EXPLORATION = `
|
||||
<codebase_exploration>
|
||||
Before beginning your analysis, explore the actual codebase to ground every decision in reality.
|
||||
|
||||
**Step 1 — Read project docs**
|
||||
Check for CLAUDE.md, README.md, and docs/ at the repo root. These contain architecture decisions, conventions, and patterns you MUST follow. If they exist, read them first — they override any assumptions.
|
||||
|
||||
**Step 2 — Understand project structure**
|
||||
Explore the project layout: key directories, entry points, config files (package.json, tsconfig, pyproject.toml, go.mod, etc.). Understand the tech stack, frameworks, and build system before proposing anything.
|
||||
|
||||
**Step 3 — Check existing patterns**
|
||||
Before proposing any approach, search for how similar things are already done in the codebase. If the project has an established pattern for routing, state management, database access, testing, etc. — your decisions must build on those patterns, not invent new ones.
|
||||
|
||||
**Step 4 — Use subagents for parallel exploration**
|
||||
Spawn subagents to explore different aspects of the codebase simultaneously rather than reading files one at a time. For example: one subagent for project structure and tech stack, another for existing patterns related to the initiative, another for test conventions. Parallelize aggressively.
|
||||
|
||||
**Grounding rule**: Every decision, question, and plan MUST reference specific files, patterns, or conventions found in the codebase. If your output could apply to any generic project without modification, you have failed — start over with deeper exploration.
|
||||
</codebase_exploration>`;
|
||||
|
||||
export const CONTEXT_MANAGEMENT = `
|
||||
<context_management>
|
||||
When reading multiple files or running independent commands, execute them in parallel rather than sequentially. After each commit, update your progress file (see Progress Tracking).
|
||||
|
||||
Reference in New Issue
Block a user