AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Code To Chart

skill-serejaris-kimi-skills-code-to-chart · by serejaris

解析代码仓库的 import/依赖关系,自动生成架构图、流程图和组织架构图,输出 Mermaid 文本或 SVG 图片。支持 Python、JavaScript、TypeScript、Go 和 Java 项目。当用户需要可视化代码结构、分析模块依赖、生成架构文档,或提及“代码架构图”、“依赖关系图”、“流程图”、“组织架构图”、“Mermaid 图”等关键词时触发。

No reviews yet
0 installs
26 views
0.0% view→install

Install

$ agentstack add skill-serejaris-kimi-skills-code-to-chart

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-serejaris-kimi-skills-code-to-chart)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Code To Chart? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Diagram Maker

将代码仓库的 import/依赖关系通过 AST 解析提取出来,自动生成三种图表:

  1. 架构图(Architecture Diagram) — 模块/目录级别的依赖关系
  2. 流程图(Flowchart) — 文件级别的 import 调用链路
  3. 组织架构图(Org Chart) — 目录/文件的层级结构

支持语言:Python、JavaScript、TypeScript、Go、Java

输出格式:Mermaid 文本(.mmd)或 SVG 图片(需系统安装 mmdc

使用方式

基础用法:分析整个项目

python3 scripts/analyze_codebase.py /path/to/project

输出三张 Mermaid 图到 stdout,同时写入当前目录下的 .mmd 文件。

指定图表类型

# 仅生成架构图
python3 scripts/analyze_codebase.py /path/to/project --type architecture

# 仅生成流程图
python3 scripts/analyze_codebase.py /path/to/project --type flowchart

# 仅生成组织架构图
python3 scripts/analyze_codebase.py /path/to/project --type org

指定输出目录和格式

# 输出到指定目录
python3 scripts/analyze_codebase.py /path/to/project --output /tmp/diagrams

# 输出 SVG(需要 mmdc)
python3 scripts/analyze_codebase.py /path/to/project --format svg

# 同时输出 Mermaid 和 SVG
python3 scripts/analyze_codebase.py /path/to/project --format both

输出 JSON 分析结果

python3 scripts/analyze_codebase.py /path/to/project --json

参数说明

| 参数 | 说明 | |------|------| | directory | 要分析的代码目录(必填) | | --type, -t | 图表类型:architectureflowchartorgall(默认 all) | | --output, -o | 输出目录(默认当前目录) | | --format, -f | 输出格式:mermaidsvgboth(默认 mermaid) | | --max-files | 最大扫描文件数(默认 500) | | --max-depth | 组织架构图最大深度(默认 4) | | --json | 以 JSON 格式输出分析结果 |

工作原理

  1. 扫描阶段:递归遍历目录,跳过 node_modules.git__pycache__
  2. 解析阶段
  • Python 文件使用 ast 模块解析 importfrom ... import 语句
  • JS/TS 文件使用正则匹配 importrequireexport from
  • Go 文件使用正则匹配 import 语句
  • Java 文件使用正则匹配 import 语句
  1. 解析内部依赖:将 import 路径映射到项目内的实际文件
  2. 生成图表:将依赖关系转为 Mermaid 图表语法
  3. 渲染(可选):调用 mmdc(Mermaid CLI)将 .mmd 渲染为 SVG

适用场景

  • 快速了解陌生项目的模块结构
  • 代码审查时可视化依赖关系
  • 编写技术文档中的架构图
  • 发现循环依赖或过度耦合
  • 项目重构前的结构分析

依赖

  • Python 3.7+(标准库,无需额外安装)
  • SVG 输出需要 @mermaid-js/mermaid-cli(可选)

注意事项

  • 仅分析静态 import 关系,不追踪动态导入
  • 大型项目建议使用 --max-files 限制扫描范围
  • Mermaid 图在节点过多时可能渲染困难,建议配合 --type 分开查看

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.