원클릭으로
map
Analyze existing codebase for brownfield project support
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Analyze existing codebase for brownfield project support
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Initialize a Megazord project with configuration and planning structure
Systematic four-phase debugging (reproduce, isolate, root-cause, fix)
Socratic brainstorming to explore approaches before implementation
Execute the current phase plan (subagent or Agent Teams mode)
Show all available Megazord skills with descriptions and usage examples
Complete milestone lifecycle -- audit, archive, deferred items, and next version preparation
| name | map |
| description | Analyze existing codebase for brownfield project support |
| disable-model-invocation | false |
Analyze an existing codebase by spawning parallel mapper agents that produce structured analysis documents. Enables brownfield project onboarding by understanding architecture, tech stack, code quality, and concerns.
Reference @skills/init/design-system.md for visual output formatting.
Reference @skills/map/mapper.md for agent spawning patterns.
Output the stage banner:
╔═══════════════════════════════════════════════╗
║ ⚡ MEGAZORD ► MAP ║
╚═══════════════════════════════════════════════╝
Read .planning/megazord.config.json. If missing, display an error box and stop:
╔═══════════════════════════════════════════════╗
║ ✗ Project Not Initialized ║
╠═══════════════════════════════════════════════╣
║ No megazord.config.json found. ║
║ Run /mz:init to set up your project first. ║
╚═══════════════════════════════════════════════╝
If config exists, continue loading:
.planning/megazord.config.json for project settings.Determine the plugin path:
plugin_path from the config JSON.plugin_path is not set in config, try ~/.claude/plugins/mz. Check if ~/.claude/plugins/mz/bin/megazord.mjs exists.Plugin path not configured. Run
/mz:settingsand setplugin_path, or re-run/mz:init.
Parse the user's message for arguments:
/mz:map architecture, /mz:map tech, etc.arch -> architectureconventions -> qualitytech, architecture, quality, concernsDisplay the target:
▸ Target
{focus area name, or "All areas" if no focus specified}
Check if .planning/codebase/ directory exists and contains analysis documents.
Use Bash to check: ls .planning/codebase/*.md 2>/dev/null | wc -l
If existing documents found AND no focus parameter was given:
Use AskUserQuestion to offer 3 options:
Handle each choice:
.planning/codebase/ directory and recreate it: rm -rf .planning/codebase/If existing documents found AND focus parameter was given:
Use AskUserQuestion:
Handle each choice:
If no existing documents: Proceed to mapping.
mkdir -p .planning/codebase/
Read the mapper agent definition ONCE and reuse for all spawns:
Read {plugin_path}/agents/mz-mapper.md -> mapper_instructions
Before spawning, determine the model for mapper agents:
model_profile and model_overrides from the loaded config.model_overrides.mapper is set and not "inherit". If so, use that value. Otherwise, use the profile mapping: quality->opus, balanced->sonnet, budget->haiku.{plugin_path}/agents/mz-mapper.md frontmatter model field to the resolved value. Use simple string replacement to rewrite the model: {value} line.For each selected focus area, spawn one Task tool agent. Spawn ALL agents in parallel (or just the focused one if a focus parameter was given).
For each agent, the Task prompt must include:
<focus> tags<output_dir> tagsImportant: Use subagent_type="mz-mapper" for all agents. The agent definition is loaded from the registered agent file (frontmatter already updated with the resolved model). See @skills/map/mapper.md for the exact prompt structure.
Fallback: If spawning with subagent_type="mz-mapper" fails, fall back to subagent_type="general-purpose" with the agent definition embedded inline in <agent_role> tags.
Display progress for each active agent:
▸ Mapping
◆ Mapping tech...
◆ Mapping architecture...
◆ Mapping quality...
◆ Mapping concerns...
Wait for all agents to complete.
After completion, verify that expected output files exist. Use Bash to check file presence and line counts -- do NOT read the file content:
wc -l .planning/codebase/STACK.md .planning/codebase/INTEGRATIONS.md .planning/codebase/ARCHITECTURE.md .planning/codebase/STRUCTURE.md .planning/codebase/CONVENTIONS.md .planning/codebase/TESTING.md .planning/codebase/CONCERNS.md 2>/dev/null
Update the progress display with results:
▸ Mapping
✓ tech (STACK.md, INTEGRATIONS.md)
✓ architecture (ARCHITECTURE.md, STRUCTURE.md)
✓ quality (CONVENTIONS.md, TESTING.md)
✓ concerns (CONCERNS.md)
If any expected files are missing, display a warning but continue:
⚠ Missing: {filename} -- agent may have failed
Only run synthesis when ALL 4 areas were mapped (not on focused single-area runs).
Spawn the synthesis agent (model is already set from the frontmatter update in Step 5):
Task(
prompt="<focus>synthesis</focus>
<output_dir>.planning/codebase/</output_dir>
<instructions>Read all 7 documents in .planning/codebase/ (STACK.md, INTEGRATIONS.md,
ARCHITECTURE.md, STRUCTURE.md, CONVENTIONS.md, TESTING.md, CONCERNS.md).
Produce a compact executive SUMMARY.md with cross-cutting insights.
Write SUMMARY.md to the output directory. Return confirmation only.</instructions>",
subagent_type="mz-mapper",
description="Map codebase: synthesis"
)
Fallback: If spawning with subagent_type="mz-mapper" fails, fall back to subagent_type="general-purpose" with the agent definition embedded inline in <agent_role> tags.
Display:
▸ Synthesis
◆ Synthesizing findings...
Wait for completion, then verify SUMMARY.md exists:
wc -l .planning/codebase/SUMMARY.md 2>/dev/null
Update display:
▸ Synthesis
✓ SUMMARY.md produced
Display the results action box showing all produced documents:
╔═══════════════════════════════════════════════╗
║ Codebase Mapped ║
╠═══════════════════════════════════════════════╣
║ ║
║ ▸ Documents ║
║ STACK.md ({N} lines) ║
║ INTEGRATIONS.md ({N} lines) ║
║ ARCHITECTURE.md ({N} lines) ║
║ STRUCTURE.md ({N} lines) ║
║ CONVENTIONS.md ({N} lines) ║
║ TESTING.md ({N} lines) ║
║ CONCERNS.md ({N} lines) ║
║ SUMMARY.md ({N} lines) ║
║ ║
║ ▸ Areas Mapped ║
║ ✓ tech ✓ architecture ║
║ ✓ quality ✓ concerns ║
║ ║
╚═══════════════════════════════════════════════╝
For focused runs, only show the documents from the mapped area.
End with the Next Up block:
═══════════════════════════════════════════════════
▸ Next Up
**Plan from analysis** -- create roadmap from codebase map
`/mz:plan`
═══════════════════════════════════════════════════
/mz:init. Exit./mz:settings. Exit.wc -l).{plugin_path} resolution from config (same pattern as /mz:plan Step 2).arch for architecture, conventions for quality.