Skip to content

Latest commit

 

History

History
116 lines (83 loc) · 3.51 KB

README.md

File metadata and controls

116 lines (83 loc) · 3.51 KB

code-visualizer

A Claude Code skill that reads your backend API routes and opens an interactive map in the browser — color-coded by danger level, sortable by importance, with guided walkthroughs of each route.

Route detail view showing a flowchart, danger badge, and risk summary

What it does

  1. Scans all route files in your project
  2. Scores each route by complexity, danger (exposed write / guarded / safe), and importance
  3. Opens a visual map in your browser — click any route to dive in
  4. Walks you through each route with a Mermaid flowchart, risk summary, and design notes

Requirements

Installation

For humans

git clone https://github.com/KeKeDou810/code-visualizer ~/.claude/skills/code-visualizer

Then configure your project:

cp ~/.claude/skills/code-visualizer/visualizer.config.example.json \
   ~/.claude/skills/code-visualizer/visualizer.config.json

Edit visualizer.config.json and point it at your project:

For Claude (agent-readable instructions)

If you are a Claude agent helping a user install this skill, follow these steps:

  1. Run git clone https://github.com/KeKeDou810/code-visualizer ~/.claude/skills/code-visualizer
  2. Run cp ~/.claude/skills/code-visualizer/visualizer.config.example.json ~/.claude/skills/code-visualizer/visualizer.config.json
  3. Ask the user for their project path, framework, and API directory, then write those values into ~/.claude/skills/code-visualizer/visualizer.config.json using the schema below.
  4. Confirm by saying: "Skill installed. Try: visualize the backend"

No further registration is needed — Claude Code auto-discovers skills placed in ~/.claude/skills/.

The config schema (only path and label are required — Claude auto-discovers routes for any framework):

{
  "projects": {
    "my-app": {
      "path": "/path/to/your/project",
      "label": "my-app"
    }
  },
  "default": "my-app"
}

Optional fields if you want to pin the scan pattern:

{
  "projects": {
    "my-app": {
      "path": "/path/to/your/project",
      "label": "my-app",
      "apiDir": "src/app/api",
      "routePattern": "**/route.ts"
    }
  },
  "default": "my-app"
}

Usage

Just tell Claude to visualize your backend:

帮我可视化一下后端
visualize the backend
分析一下这个项目的 API 结构

Claude will start a local server, scan your routes, and open the map. You can then:

  • Click any route card to see a detailed breakdown
  • Type "开始" / "start" to walk through routes in order of importance
  • Ask follow-up questions about any route

Supported frameworks

Works with any backend. Claude explores the project structure and identifies routes automatically.

Framework Auto-detected? Notes
Next.js App Router Yes Detects export function GET/POST/... in route.ts files
Express / Fastify Yes Detects router.get(, app.post(, etc.
Flask / Django Yes Detects @app.route, def get(, decorators
Any other framework Best-effort Claude reads the project and infers conventions

You can also pin the scan pattern manually via apiDir + routePattern in config.

How danger levels work

Level Meaning
🔴 Exposed Write operation with no auth check
🟠 Guarded Write operation behind auth
🟢 Safe Read-only operation

License

MIT