codegen-diagram

codegen-diagram is a skill for Claude Code, Codex from xstongxue/best-skills. It costs 84 tokens per session (550 once invoked), scanned A, original, Apache-2.0.

A project-to-diagram skill that creates editable Draw.io files from a codebase. Draw.io is a tool for making and editing diagrams.

In plain words
What is it for?
It is for creating technology-stack, system-architecture, data-structure, and entity-relationship diagrams, which show database entities and how they relate.
Why use it?
It turns project details into a visual document instead of leaving developers to map the system by hand. It also keeps the output in a format that Draw.io can open and edit.

Skill for Claude CodeCodex

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

Good fit It is for creating technology-stack, system-architecture, data-structure, and entity-relationship diagrams, which show database entities and how they relate.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xstongxue/best-skills/codegen-diagram
About the project

best-skills is a collection of reusable skills for coding agents, including tools for writing papers, creating diagrams and presentations, generating code documentation, and other tasks. Users install its skills into agents such as Cursor, Claude Code, Codex, or OpenClaw so those agents can recognize relevant requests and run the corresponding workflows. The catalogue entries are examples of the skills included in the collection.

xstongxue/best-skills · 2,811 stars · on GitHub

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 xstongxue/best-skills --skill codegen-diagram
Clone the repo
git clone --depth 1 https://github.com/xstongxue/best-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 codegen-diagram

README.md
[![agentmods](https://agentmods.dev/badge/skills/xstongxue/best-skills/codegen-diagram/github.svg)](https://agentmods.dev/skills/xstongxue/best-skills/codegen-diagram)
Your own site
<a href="https://agentmods.dev/skills/xstongxue/best-skills/codegen-diagram"><img src="https://agentmods.dev/badge/skills/xstongxue/best-skills/codegen-diagram/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 codegen-diagram

Your own site · 80×15
<a href="https://agentmods.dev/skills/xstongxue/best-skills/codegen-diagram"><img src="https://agentmods.dev/badge/skills/xstongxue/best-skills/codegen-diagram.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 550 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00084 $0.00550
Opus 5 $0.00042 $0.00275
Sonnet 5 $0.00017 $0.00110
Haiku 4.5 $0.00008 $0.00055

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

Security

Grade A, and why

codegen-diagram 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 11d 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.

skills/codegen-diagram/SKILL.md · 55 lines

What it actually says

代码生成·项目图表

本 Skill 指导 Agent 基于当前项目/代码仓库生成 Draw.io 格式图表,支持四种类型:技术栈图、系统架构图、数据结构图、E-R 图。

Step 0:任务识别

用户表述 / 关键词 执行
技术栈、整体技术栈、组件选型 reference/tech-stack.md
系统架构、分层结构、调用流程 reference/system-arch.md
数据结构图、表结构图、实体字段关系图 reference/data-structure.md
E-R 图、实体关系图、数据库关系图 reference/er-diagram.md

使用时机

  • 用户需要根据当前项目画技术栈图、系统架构图、数据结构图或 E-R 图
  • 用户提到「根据当前项目」「根据代码」「画我们系统的……」

通用规范(四种图表共用)

Draw.io 基础

  • 使用 mxGraphModel,画布背景 #FFFFFF
  • 仅使用 Draw.io 内置形状,确保可立即打开与编辑
  • 节点标签简洁,符合技术文档表达习惯

色彩与字体

用途 颜色值
主色调 #3366CC
副色调 #7FBFFF
强调色 #FF9966
深色背景字体 #FFFFFF
浅色背景字体 #333333
画布背景 #FFFFFF
  • 字体:Helvetica,字号 11–13
  • 连接线:endArrow=classicBlockThinblockThin

输出要求

  1. 图表总览(1–2 段文字)
  2. 完整 mxGraph XML(可保存为 .drawio)
  3. 导入与使用说明
  4. 图题与论文引用建议
Files

What ships with it

4 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. 11d ago First seen · 55 lines · 84 tokens per session scan A dddd1fee87d6

Subscribe to this mod's changes

codegen-diagram is a skill published in the GitHub repository xstongxue/best-skills (2,811 stars, last pushed 16d ago), licensed Apache-2.0. It adds 84 tokens to every session and 550 once invoked, about $0.0004 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-30.

Related

Other skills, from other repositories

cherry-studio-feedback

A guide for handling Cherry Studio bug reports, interface problems, user-experience issues, and feature suggestions.

CherryHQ/cherry-studio · 37 tokens

frontend-design

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

anthropics/claude-plugins-official · 40 tokens

visual-plan

Turn ordinary text plans into rich interactive visual plans with diagrams, file maps, annotated code, open questions, and UI/prototype review when useful.

BuilderIO/skills · 32 tokens

visual-edit

Open a running local app in Design overview mode as URL-backed iframe screens for visual editing, flow review, duplication, and route-state exploration. Use when the user asks to inspect, compare, or edit a real local app visually in Design.

BuilderIO/skills · 51 tokens

muapi-ui-design

Generate high-fidelity UI/UX mockups for mobile and web apps using Atomic Design principles — creates wireframes and design systems via muapi.ai.

SamurAIGPT/Generative-Media-Skills · 34 tokens

display-glasses-with-jetpack-compose-glimmer

Provides guidelines for developing projected Android XR apps for display glasses using the Jetpack Compose Glimmer UI toolkit. This skill covers foundational Glimmer design principles, workflows for implementing Jetpack Compose Glimmer, and interaction models for the glasses form factor. Use this skill to build an…

android/skills · 91 tokens