thinking-partner
A deterministic thinking partner that challenges assumptions and applies mental models to sharpen decisions, solve problems, and think more clearly. Use this…
Analyze an existing codebase. Maps structure, architecture, conventions, and concerns.
$ npx -y skills add SienkLogic/plan-build-run --skill scan --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/scanContext preview
The summary Claude sees to decide when to auto-load this skill.
Analyze an existing codebase. Maps structure, architecture, conventions, and concerns.
name: scan description: "Analyze an existing codebase. Maps structure, architecture, conventions, and concerns." allowed-tools: Read, Write, Bash, Glob, Grep, Task, AskUserQuestion argument-hint: "[--focus tech|arch|quality|concerns]"
**STOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Using the Read tool on this SKILL.md file wastes ~7,600 tokens. Begin executing Step 1 immediately.**
**Before ANY tool calls**, display this banner:
╔══════════════════════════════════════════════════════════════╗ ║ PLAN-BUILD-RUN ► SCANNING CODEBASE ║ ╚══════════════════════════════════════════════════════════════╝
Then proceed to Step 1.
You are running the **scan** skill. Your job is to analyze an existing codebase and produce a comprehensive map of its structure, architecture, conventions, and concerns. This is the entry point for brownfield projects — codebases that already have code before Plan-Build-Run is introduced.
This skill **spawns 4 parallel Task(subagent_type: "pbr:codebase-mapper")** agents for analysis.
---
Reference: `skills/shared/context-budget.md` for the universal orchestrator rules. Reference: `skills/shared/agent-type-resolution.md` for agent type fallback when spawning Task() subagents.
Additionally for this skill:
---
**Understand before you change.** Scanning a codebase is about building a mental model of what exists. Every file produced by this skill becomes context that the planner and executor use to make informed decisions. Accuracy matters more than speed.
---
Run the CLI to get scan metadata:
pbr-tools init map-codebase
Extract from init JSON: `mapper_model`, `commit_docs`, `codebase_dir`, `existing_maps`, `has_maps`, `codebase_dir_exists`, `intel_enabled`, `has_intel_dir`, `depth_profile`.
If the CLI fails, display a branded ERROR box: "Failed to load scan context. Ensure pbr-tools.js is available." and stop.
Use `has_maps` from init context.
**If `has_maps` is true:**
Present to user via AskUserQuestion:
question: "A codebase analysis already exists. What would you like to do?" header: "Scan" options:
**If `has_maps` is false:** **CRITICAL: Create the codebase directory NOW. Do not skip this step.**
mkdir -p .planning/codebase
Use `depth_profile` from init context to determine how many mappers to spawn and which focus areas.
**Default mappings by depth:**
**Extended context override:** If `features.extended_context` is `true` in `.planning/config.json`, always spawn 4 mappers regardless of depth profile.
Display to the user:
◐ Spawning {mapper_count} codebase mapper(s) in parallel...
→ Technology stack analysis
→ Architecture patterns
→ Code quality assessment
→ Concerns & risks(Only list the focus areas that will actually be spawned.)
Spawn `{mapper_count}` parallel `Task(subagent_type: "pbr:codebase-mapper")` agents, one for each focus area. All should be spawned in a single response for maximum parallelism.
For each agent, read `${CLAUDE_SKILL_DIR}/templates/mapper-prompt.md.tmpl` and fill in the placeholders:
| Agent | Focus | Output Files | When | |-------|-------|-------------|------| | 1 | tech | STACK.md, INTEGRATIONS.md | Always | | 2 | arch | ARCHITECTURE.md, STRUCTURE.md | Always | | 3 | quality | CONVENTIONS.md, TESTING.md | standard + comprehensive | | 4 | concerns | CONCERNS.md | standard + comprehensive |
As each agent completes, check the Task() output for the `## MAPPING COMPLETE` marker:
⚠ Codebase mapper ({focus_area}) did not report MAPPING COMPLETE.
Output may be incomplete — check .planning/codebase/ for partial results.After all agents complete, verify the expected files exist:
ls -la .planning/codebase/ wc -l .planning/codebase/*.md
**Verification checklist:**
For any missing files, display:
╔══════════════════════════════════════════════════════════════╗ ║ ERROR ║ ╚════════════
Plan it. Build it. Run it. A Claude Code plugin for structured development with context-engineered agents.
Repo: SienkLogic/plan-build-run
A deterministic thinking partner that challenges assumptions and applies mental models to sharpen decisions, solve problems, and think more clearly. Use this…
Run audit, prioritize findings, auto-fix via quick tasks, test, and commit.
Review past Claude Code sessions for PBR workflow compliance and UX quality.
Run multiple phases hands-free. Chains discuss, plan, build, and verify automatically.
Manage backlog items — ideas not ready for active planning. Add, review, promote, or remove.
Start a new project. Deep questioning, research, requirements, and roadmap.