Each mapper agent explores a focus area and writes documents directly to .planning/codebase/. The orchestrator only receives confirmations, then reads the 8 docs to generate CLAUDE.md with coding rules that Claude Code auto-loads every session.
Output: .planning/codebase/ folder with 8 structured documents + CLAUDE.md at project root. </objective>
<execution_context> @~/.claude/devflow/workflows/map-codebase.md </execution_context>
<context> Focus area: $ARGUMENTS (optional - if provided, tells agents to focus on specific subsystem)Load project state if exists: Check for .planning/STATE.md - loads context if project already initialized
This command can run:
- •Before /df:new-project (brownfield codebases) - creates codebase map first
- •After /df:new-project (greenfield codebases) - updates codebase map as code evolves
- •Anytime to refresh codebase understanding </context>
<when_to_use> Use map-codebase for:
- •Brownfield projects before initialization (understand existing code first)
- •Refreshing codebase map after significant changes
- •Onboarding to an unfamiliar codebase
- •Before major refactoring (understand current state)
- •When STATE.md references outdated codebase info
Skip map-codebase for:
- •Greenfield projects with no code yet (nothing to map)
- •Trivial codebases (<5 files) </when_to_use>
<success_criteria>
- • .planning/codebase/ directory created
- • All 8 codebase documents written by mapper agents
- • Documents follow template structure
- • Parallel agents completed without errors
- • CLAUDE.md generated at project root with prescriptive coding rules
- • CLAUDE.md uses <!-- DEVFLOW:START/END --> markers (preserves user content on re-run)
- • User knows next steps </success_criteria>