jeffreylean/dotfiles/codebase-explorer
Claude Code and agent skill by jeffreylean/dotfiles
- community
Checking that the SKILL.md file is still in the repository.
Use when user asks to understand a repository, generate a navigation map, explain architecture/execution flow, or surface interesting core implementations. Produces timestamped report in ~/Documents/my-brain/codebase. Uses a 5-phase divide-and-conquer strategy: scout → semantic partitioning → parallel workers → hierarchical reduction → cross-cutting validation.
Install
npx vskill@latest install jeffreylean/dotfiles/codebase-explorerSKILL.md
The same SKILL.md was published earlier as jeffreylean/dotfiles/codebase-explorer.
Codebase Explorer
Explore a repo deeply and output an onboarding-first map report.
When to Use
- “What does this repo do?”
- “Give me architecture / flow overview”
- “Map the codebase so I can navigate it quickly”
- “Find interesting implementations in the core”
- “Deep dive into X area/module”
Setup
ast-grep (sg) is required.
If missing, stop and ask user to install before continuing.
Commands
Workflow
All subagents use the built-in Agent tool (subagent_type=code). Max concurrency = 4 at every phase.
1) Resolve target
Priority:
- GitHub URL -> clone into
/Users/jeffreylean/Project/personal/opensource/<repo> - Local path -> use path
- Else -> current working directory
2) Inventory
Run the file inventory script (produces file list + LOC per module — used as scout input, not as final partitioning):
Exclude test packages/files from exploration scope:
- dirs:
test,tests,__tests__,e2e,cypress,__snapshots__ - files:
*.test.*,*.spec.*,*_test.*,test_*.*,conftest.py
3) Phase 0 — Scout
Launch one scout subagent. Its job is to understand the repo shape and output a semantic concern map.
Scout prompt:
4) Phase 1 — Divide
Parse the scout's concern map. Each concern becomes one worker assignment.
If total concerns > 4: batch them into groups of 4 and run batches sequentially. If total concerns ≤ 4: run all workers in one parallel batch.
5) Phase 2 — Conquer (parallel workers)
For each batch, spawn up to 4 worker subagents in parallel. Each worker gets one concern.
Worker prompt:
Collect all worker JSON outputs before proceeding.
6) Phase 3 — Reduce
If total concerns ≤ 4: skip L1 reduction, go straight to final synthesizer.
If total concerns > 4: run L1 group mergers first.
Group related concerns together (use relatedConcerns links from scout output). Launch up to 4 merger subagents in parallel, each merging a cluster of 2–3 worker outputs:
Merger prompt:
7) Phase 4 — Synthesize
Launch one final synthesizer subagent:
8) Phase 5 — Cross-cutting pass
After the report is written, launch one cross-cutting subagent to validate the architecture with a real end-to-end trace:
Write exactly one report: ~/Documents/my-brain/codebase/{repo-name}-{YYYYMMDD-HHmmss}.md
Default: onboarding length. If user asked about a specific area, add a deep-dive section for that area.
9) Display report inline
After the cross-cutting pass completes, read the final report and print its full contents to the conversation so the user can read it immediately without opening any file.
Output Contract
Use template: assets/output-template.md
Required sections:
- What this repository does
- High-level architecture map (ASCII)
- Core execution flow (ASCII)
- Key modules/packages + navigation table
- Interesting core implementations (+ rationale + paths)
- Entry points + recommended reading order
Scope rule: focus on runtime/production code by default; ignore tests unless user explicitly asks for testing architecture.
Optional sections (when meaningful):
- Data model / schema map
- Build/deploy/test map
Gotchas
- Never run without
sg. - Never exceed 4 parallel subagents at any phase.
- Never use Mermaid (ASCII only).
- Scout must skim broadly — stop it from deep-reading; that's workers' job.
- Never more than 8 concerns from scout; push back and merge if scout returns more.
- Every source file must belong to exactly one concern — no orphans, no duplicates.
- Workers must read ALL files in their concern — do not skip files due to size or count.
- Avoid raw tree dumps; provide navigable map.
- Keep onboarding default; deep-dive only on requested area.
- Do not explore test packages/files unless user explicitly asks.
- Always include file path evidence for key claims.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingagents/claude/skills/codebase-explorer/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jeffreylean/dotfiles/codebase-explorer)