Tooluck logoTooluck
SKILL.md

codegen-diagram

Agent skill fromxstongxue/best-skills

基于当前项目/代码生成 Draw.io 图表,支持技术栈图、系统架构图、数据结构图、E-R 图四种类型。输出符合 Draw.io 语法的 .drawio 文件(mxGraph XML),可直接导入 Draw.io 编辑。当用户提到技术栈、系统架构、数据结构、E-R 图时使用。

How to install codegen-diagram

install codegen-diagram
# install the best-skills pack with the skills CLI
npx skills add xstongxue/best-skills

# or add only this skill to Claude Code: copy the folder

skills/codegen-diagram/

# into

~/.claude/skills/codegen-diagram/ (all projects)

.claude/skills/codegen-diagram/ (one project)

skills/codegen-diagram/SKILL.md

Apache-2.0Full file
1# 代码生成·项目图表
2
3本 Skill 指导 Agent 基于**当前项目/代码仓库**生成 Draw.io 格式图表,支持四种类型:技术栈图、系统架构图、数据结构图、E-R 图。
4
5## Step 0:任务识别
6
7
8| 用户表述 / 关键词 | 执行 |
9| ------------------ | ----------------------------- |
10| 技术栈、整体技术栈、组件选型 | `reference/tech-stack.md` |
11| 系统架构、分层结构、调用流程 | `reference/system-arch.md` |
12| 数据结构图、表结构图、实体字段关系图 | `reference/data-structure.md` |
13| E-R 图、实体关系图、数据库关系图 | `reference/er-diagram.md` |
14
15
16## 使用时机
17
18- 用户需要根据当前项目画技术栈图、系统架构图、数据结构图或 E-R 图
19- 用户提到「根据当前项目」「根据代码」「画我们系统的……」
20
21## 通用规范(四种图表共用)
22
23### Draw.io 基础
24
25- 使用 **mxGraphModel**,画布背景 `#FFFFFF`
26- 仅使用 Draw.io 内置形状,确保可立即打开与编辑
27- 节点标签简洁,符合技术文档表达习惯
28
29### 色彩与字体
30
31
32| 用途 | 颜色值 |
33| ------ | ------- |
34| 主色调 | #3366CC |
35| 副色调 | #7FBFFF |
36| 强调色 | #FF9966 |
37| 深色背景字体 | #FFFFFF |
38| 浅色背景字体 | #333333 |
39| 画布背景 | #FFFFFF |
40
41
42- 字体:Helvetica,字号 11–13
43- 连接线:`endArrow=classicBlockThin` 或 `blockThin`
44
45### 输出要求
46
471. 图表总览(1–2 段文字)
482. 完整 mxGraph XML(可保存为 .drawio)
493. 导入与使用说明
504. 图题与论文引用建议

Excerpt shown under the repository's Apache-2.0 license.

More skills in best-skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates