Auto-generates code flow diagrams from Python module analysis. Detects when architecture diagrams become stale (code changed, diagram didn't). Use when: creating new modules, reviewing PRs for architecture impact, or checking diagram freshness. Generates mermaid diagrams showing imports, dependencies, and module relationships.
View on GitHub.claude/skills/code-visualizer/SKILL.md
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/rysweet/amplihack/blob/main/.claude/skills/code-visualizer/SKILL.md -a claude-code --skill code-visualizerInstallation paths:
.claude/skills/code-visualizer/# Code Visualizer Skill
## Purpose
Automatically generate and maintain visual code flow diagrams. This skill analyzes Python module structure, detects import relationships, and generates mermaid diagrams. It also monitors for staleness when code changes but diagrams don't.
## Philosophy Alignment
This skill embodies amplihack's core philosophy:
### Ruthless Simplicity
- **Single responsibility**: Visualize code structure - nothing more
- **Minimal dependencies**: Uses only Python AST for analysis, delegates diagram syntax to mermaid-diagram-generator
- **No over-engineering**: Timestamp-based staleness is simple and "good enough" for 90% of cases
### Zero-BS Implementation
- **Real analysis**: Actually parses Python AST to extract imports - no mock data
- **Honest limitations**: Staleness detection is timestamp-based, not semantic (see Limitations section)
- **Working code**: All algorithms shown are functional, not pseudocode
### Modular Design (Bricks & Studs)
- **This skill is one brick**: Code analysis and staleness detection
- **Delegates to other bricks**: mermaid-diagram-generator for syntax, visualization-architect for complex diagrams
- **Clear studs (public contract)**: Analyze modules, generate diagrams, check freshness
## Skill Delegation Architecture
```
code-visualizer (this skill)
├── Responsibilities:
│ ├── Python module analysis (AST parsing)
│ ├── Import relationship extraction
│ ├── Staleness detection (timestamp-based)
│ └── Orchestration of diagram generation
│
└── Delegates to:
├── mermaid-diagram-generator skill
│ ├── Mermaid syntax generation
│ ├── Diagram formatting and styling
│ └── Markdown embedding
│
└── visualization-architect agent
├── Complex multi-level architecture
├── ASCII art alternatives
└── Cross-module dependency graphs
```
**Invocation Pattern:**
```python
# code-visualizer analyzes code structure
modules = analyze_python_modules("src/")
relationships