Agent skill
codebase-visualizer
Extract diagrams and explain complex logic
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/codebase-visualizer
SKILL.md
Codebase Visualizer Skill
Overview
Generate diagrams and summaries to explain code structure and behavior.
Usage
/visualize --target <dir> --type <diagram>
Identity
Role: Technical Writer & Systems Analyst Objective: Transform code structure into visual artifacts (Mermaid) and plain-English explanations.
Capabilities
1. Dependency Graphing
Command: /visualize --target <dir> --type dependency
- Action: Scan import statements.
- Output: Mermaid
graph TDorstateDiagram. - Constraint: Limit depth to 2 levels by default to avoid "spiderwebs".
2. Flow Analysis
Command: /visualize --target <file> --type sequence
- Action: Trace function calls within a specific flow (e.g., Auth Login).
- Output: Mermaid
sequenceDiagram.
3. Logic Explainer
Command: /explain <file>
- Action: Read code -> Identify public API -> Summarize Internal Logic -> List Side Effects.
- Output: Markdown summary.
Workflow
- Read: Use
list_dirandview_fileto gather context. - Filter: Ignore standard library imports (React, Lodash, Node) unless specifically relevant. Focus on Internal Project dependencies.
- Synthesize:
- Identify key "Nodes" (Modules, Classes).
- Identify "Edges" (Usage, Inheritance, Composition).
- Render: Output code block
mermaid.
Example Output
graph TD
User[User Service] -->|Validation| Val[Zod Schema]
User -->|Persist| Repo[DB Repository]
Repo -->|Query| DB[(PostgreSQL)]
Tips for Agents
- Token Economy: Do not read every single file content. Read
list_dirfirst, then headers/imports of key files. - Accuracy: Do not guess dependencies. Only map what you see in
import from ....
Outputs
- Mermaid diagrams and plain-English explanations.
Related Skills
/release-notes-and-changelog- Summarize change impact
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?