Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add serejaris/kimi-skills --skill code-to-chartgit clone --depth 1 https://github.com/serejaris/kimi-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/serejaris/kimi-skills/code-to-chart)<a href="https://agentmods.dev/skills/serejaris/kimi-skills/code-to-chart"><img src="https://agentmods.dev/badge/skills/serejaris/kimi-skills/code-to-chart/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/serejaris/kimi-skills/code-to-chart"><img src="https://agentmods.dev/badge/skills/serejaris/kimi-skills/code-to-chart.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00102 | $0.01059 |
| Opus 5 | $0.00051 | $0.00530 |
| Sonnet 5 | $0.00020 | $0.00212 |
| Haiku 4.5 | $0.00010 | $0.00106 |
Grade A, and why
code-to-chart scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Diagram Maker
将代码仓库的 import/依赖关系通过 AST 解析提取出来,自动生成三种图表:
- 架构图(Architecture Diagram) — 模块/目录级别的依赖关系
- 流程图(Flowchart) — 文件级别的 import 调用链路
- 组织架构图(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 |
图表类型:architecture、flowchart、org、all(默认 all) |
--output, -o |
输出目录(默认当前目录) |
--format, -f |
输出格式:mermaid、svg、both(默认 mermaid) |
--max-files |
最大扫描文件数(默认 500) |
--max-depth |
组织架构图最大深度(默认 4) |
--json |
以 JSON 格式输出分析结果 |
工作原理
- 扫描阶段:递归遍历目录,跳过
node_modules、.git、__pycache__等 - 解析阶段:
- Python 文件使用
ast模块解析import和from ... import语句 - JS/TS 文件使用正则匹配
import、require、export from - Go 文件使用正则匹配
import语句 - Java 文件使用正则匹配
import语句
- Python 文件使用
- 解析内部依赖:将 import 路径映射到项目内的实际文件
- 生成图表:将依赖关系转为 Mermaid 图表语法
- 渲染(可选):调用
mmdc(Mermaid CLI)将.mmd渲染为 SVG
适用场景
- 快速了解陌生项目的模块结构
- 代码审查时可视化依赖关系
- 编写技术文档中的架构图
- 发现循环依赖或过度耦合
- 项目重构前的结构分析
依赖
- Python 3.7+(标准库,无需额外安装)
- SVG 输出需要
@mermaid-js/mermaid-cli(可选)
注意事项
- 仅分析静态 import 关系,不追踪动态导入
- 大型项目建议使用
--max-files限制扫描范围 - Mermaid 图在节点过多时可能渲染困难,建议配合
--type分开查看
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 105 lines · 102 tokens per session scan A aca58ba265f0
code-to-chart is a skill published in the GitHub repository serejaris/kimi-skills (6 stars, last pushed 1mo ago), licensed MIT. It adds 102 tokens to every session and 1,059 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
code-to-diagram
Analyze codebases and automatically generate architecture diagrams, flowcharts, and org charts. Uses AST parsing to map import dependencies for Python, JS/TS, Go, and Java, outputting Mermaid or SVG files. Triggered when users ask to visualize code architecture, understand dependencies, draw a flowchart, or create a…
diagram-creator
Create professional diagrams using Mermaid, PlantUML, and other text-based diagram tools. Generate flowcharts, sequence diagrams, architecture diagrams, and more.
tech-diagram
Use this skill when the user wants to turn a description into a technical diagram — architecture diagrams, flowcharts, sequence diagrams, state machines, ER diagrams, class diagrams, or mind maps. Generates brand-consistent Mermaid that the DesireCore chat renders inline as SVG, with a semantic shape/arrow vocabulary…
mermaid-diagram
Use this skill when you need to draw diagrams including: Flowchart, Sequence Diagram, Class Diagram, State Diagram, ER Diagram, User Journey, Gantt Chart, Pie Chart, Quadrant Chart, Requirement Diagram, Gitgraph, Mindmap, Timeline, Sankey, XY Chart (Bar/Line), Block Diagram, Packet Diagram, Kanban, Architecture…
aws-architecture-diagram
AWS architecture diagrams — generate visual network topology diagrams from live AWS infrastructure. Use when drawing AWS network diagrams, visualizing VPCs, mapping Transit Gateway topology, or generating architecture documentation.
fin-arch-diagram
A tool for creating architecture diagrams, process flowcharts, and hierarchy trees. These show how system parts, business steps, decisions, or organizational levels relate to one another.