code-to-chart

code-to-chart is a skill for Claude Code, Codex from serejaris/kimi-skills. It costs 102 tokens per session (1,059 once invoked), scanned A, original, MIT.

A code-structure diagram maker that examines how files and modules depend on one another. It supports Python, JavaScript, TypeScript, Go, and Java, and produces Mermaid text or SVG images.

In plain words
What is it for?
Use it to create architecture diagrams, file-level flowcharts, or folder and file hierarchy charts for a code repository.
Why use it?
It turns hard-to-follow import relationships and folder layouts into diagrams that are easier to inspect and document.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create architecture diagrams, file-level flowcharts, or folder and file hierarchy charts for a code repository.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/serejaris/kimi-skills/code-to-chart
Install

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.

Any agent
npx skills add serejaris/kimi-skills --skill code-to-chart
Clone the repo
git clone --depth 1 https://github.com/serejaris/kimi-skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for code-to-chart

README.md
[![agentmods](https://agentmods.dev/badge/skills/serejaris/kimi-skills/code-to-chart/github.svg)](https://agentmods.dev/skills/serejaris/kimi-skills/code-to-chart)
Your own site
<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.

agentmods 80×15 button for code-to-chart

Your own site · 80×15
<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>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,059 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 9d ago against content hash aca58ba265f0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

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.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/analyze_codebase.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/code-to-chart/SKILL.md · 105 lines

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 解析提取出来,自动生成三种图表:

  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 语句
  3. 解析内部依赖:将 import 路径映射到项目内的实际文件
  4. 生成图表:将依赖关系转为 Mermaid 图表语法
  5. 渲染(可选):调用 mmdc(Mermaid CLI)将 .mmd 渲染为 SVG

适用场景

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

依赖

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

注意事项

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

Read the full file on GitHub · 105 lines

Files

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.

Changes

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.

  1. 9d ago First seen · 105 lines · 102 tokens per session scan A aca58ba265f0

Subscribe to this mod's changes

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.

Related

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…

zebbern/claude-code-guide · 74 tokens

diagram-creator

Create professional diagrams using Mermaid, PlantUML, and other text-based diagram tools. Generate flowcharts, sequence diagrams, architecture diagrams, and more.

claude-office-skills/skills · 34 tokens

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…

desirecore/market · 210 tokens

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…

wecode-ai/Wegent · 102 tokens

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.

automateyournetwork/netclaw · 43 tokens

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.

csmar432/finai-research · 72 tokens