/goal-workflow-skills:insight-diagramfrom goal-workflow-skills
Analyzes codebases and generates UML diagrams, architecture diagrams, and flowcharts. Supports 17 diagram types, renders as HTML+SVG via architecture-diagram skill, and saves to docs/.
Ships in goal-workflow-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
分析任意代码库,自动生成 UML 14种图 + 架构图 + 流程图,使用 /architecture-diagram 渲染为 HTML+SVG。
描述系统的物理组成和静态结构。
| 编号 | 图表类型 | 英文标识 | 关注点 |
|---|---|---|---|
| 1 | 系统架构图 | architecture | 组件关系、全局视角(非UML,最常用) |
| 2 | 类图 | class | 定义类、属性、操作及关系 |
| 3 | 对象图 | object | 特定时刻的对象实例及其关系 |
| 4 | 组件图 | component | 系统组件及其依赖关系 |
| 5 | 部署图 | deployment | 物理硬件、节点及软件部署 |
| 6 | 包图 | package | 将模型元素分组组织 |
| 7 | 复合结构图 | composite-structure | 类的内部结构 |
| 8 | 剖面图 | profile | 扩展UML元模型、自定义构造型 |
描述系统与外部参与者或系统内部的交互过程。
| 编号 | 图表类型 | 英文标识 | 关注点 |
|---|---|---|---|
| 9 | 流程图 | flowchart | 主流程与分支(非UML,最常用) |
| 10 | 用例图 | usecase | 从用户角度展示系统功能 |
| 11 | 活动图 | activity | 过程的流程或步骤 |
| 12 | 状态机图 | state-machine | 对象生命周期的状态变迁 |
| 13 | 序列图 | sequence | 按时间顺序展示对象间交互 |
| 14 | 通信图 | communication | 侧重于对象间的组织关系 |
| 15 | 定时图 | timing | 侧重于状态变化的时间约束 |
| 16 | 交互概览图 | interaction-overview | 结合活动图和时序图 |
| 17 | 泳道图 | swimlane | 跨组件/角色职责流程(活动图变体) |
本技能的 examples/ 目录包含 13 个已完成的图表 HTML 文件,作为视觉样式和内容结构的参考模板。生成任何图表前,必须先阅读对应的示例文件,以确保风格一致、结构规范。
| 文件 | 图表类型 | 英文标识 |
|---|---|---|
examples/architecture.html | 系统架构图 | architecture |
examples/class.html | 类图 | class |
examples/object.html | 对象图 | object |
examples/component.html | 组件图 | component |
examples/deployment.html | 部署图 | deployment |
examples/flowchart.html | 流程图 | flowchart |
examples/usecase.html | 用例图 | usecase |
examples/activity.html | 活动图 | activity |
examples/sequence.html | 序列图 | sequence |
examples/communication.html | 通信图 | communication |
examples/dfd.html | 数据流图 | dfd |
examples/interaction-overview.html | 交互概览图 | interaction-overview |
examples/swimlane.html | 泳道图 | swimlane |
生成前必读: 调用 /architecture-diagram 前,先用 Read 工具阅读对应类型的示例文件,从中提取:
结构对齐: 生成的图表应与示例保持相同的结构层次:
内容替换而非照搬: 示例中的业务数据(NovaShield 风控系统)是虚构的参考案例,生成时需替换为目标项目的真实架构信息。只参考布局和样式,不复制业务内容。
无对应示例的类型: 对于包图 (package)、复合结构图 (composite-structure)、剖面图 (profile)、状态机图 (state-machine)、定时图 (timing) 这 5 种没有示例文件的图表类型,参考最相近的已有示例(如包图参考组件图,状态机图参考活动图),并沿用相同的视觉语言。
读取项目关键文件,提取架构信息:
CLAUDE.md(如存在)获取项目概览CLAUDE.md(如存在)获取模块细节**/*.go, **/*.py, **/*.ts 等)main.go, app.py, index.ts 等)识别顶层组件从以上信息中提炼出:
使用 AskUserQuestion 让用户选择要生成的图表(multiSelect: true),分4组展示:
第1组 — 结构性图形(静态):
第2组 — 结构性图形续 + 部署:
第3组 — 行为性图形(动态):
第4组 — 交互图 + 常用非UML:
默认推荐:architecture + sequence + flowchart
对每个选中的图表类型:
examples/<标识>.html(如 examples/architecture.html),提取布局模式、节点样式、标注方式/architecture-diagram skill,传入图表类型、标题、内容描述、输出路径,必须指定 light 风格docs/<标识>.html(如 docs/architecture.html)生成规则:
批量生成顺序(宏观→微观): architecture → component → deployment → package → composite-structure → profile → class → object → usecase → flowchart → activity → state-machine → swimlane → sequence → communication → timing → interaction-overview
生成的 SVG 常见三类几何缺陷,必须用脚本逐张校验并修正:
python3 skills/insight-diagram/scripts/review_svg.py docs/<标识>.html --min-gap 8
# 批量: python3 skills/insight-diagram/scripts/review_svg.py docs/*.html --min-gap 8
脚本检查(与三条核心要求一一对应):
ERROR 深入框内:端点穿入框内部 >8px → 缩短连线,让它止于边缘。WARNING 空接:端点悬空、距最近框 >8px 且不汇入任何其它连线 → 把端点对齐到框边或汇合点。ERROR):非嵌套的两个框在水平、垂直两个方向都有交叠 → 必须移开其中一个。嵌套(一个完全包住另一个,如分组边界框包子节点)是允许的。WARNING):投影相邻的两框净间距 < --min-gap(默认 8px)→ 拉开距离。处理原则:
docs/<标识>.html 里对应的 <rect>/<line>/<path> 坐标,而非重新生成整张图。--strict 让 WARNING 也阻断。全部完成后输出:
examples/activity.html (opens in a new tab)examples/architecture.html (opens in a new tab)examples/class.html (opens in a new tab)examples/communication.html (opens in a new tab)examples/component.html (opens in a new tab)examples/deployment.html (opens in a new tab)examples/dfd.html (opens in a new tab)examples/flowchart.html (opens in a new tab)examples/interaction-overview.html (opens in a new tab)examples/object.html (opens in a new tab)examples/sequence.html (opens in a new tab)examples/swimlane.html (opens in a new tab)examples/usecase.html (opens in a new tab)references/extraction-strategy.md (opens in a new tab)scripts/review_svg.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
22 skills in this plugin
/article-iconsIllustrate an article (Markdown, HTML, etc.) with animated-style icons from itshover.com/icons. Fetches icons as clean inline SVG and places them at section headings, key concepts, lists, and callouts. Triggers on: /article-icons, 配图, 给文章配图标, add icons to article, illustrate with icons./code-to-specReverse-engineer a SPEC document from an existing project. Analyzes code, config, tests, and structure to produce a comprehensive specification. Triggers on: code-to-spec, reverse spec, generate spec, 逆向规格, 生成规格文档, 生成设计文档, 生成设计方案, extract spec, document this project, what does this project do./debug-itDisciplined bug diagnosis, performance regression forensics, and root-cause fixing: build a tight red-capable feedback loop -> minimise -> rank 3-5 falsifiable hypotheses -> instrument -> attack failed premises -> fix root causes -> lock down with regression test and proof. Triggers on: /debug-it, debug this, diagnose bug, root cause, perf regression, 排查 bug, 根因定位, 诊断问题, 性能退化排查./design-itUse when turning a requirement, spec, or feature brief into a single self-contained HTML design document in a fixed house style — one styled HTML page with a table-of-contents, architecture/sequence SVG diagrams, code/SQL/YAML blocks, callout boxes, an aligned-decisions (已对齐结论) panel, test cases, and a code index. Reuse for any new 需求/设计文档 that should look identical every time./graphGraph engineering for parallel task execution: convert a task, PRD, SPEC, or issue set into a dependency graph (DAG), layer it into supersteps, then implement each independent node concurrently with subagents — each node runs /goal → /review-it → /ship-it in an isolated git worktree, with a fan-in barrier between waves. Triggers on: graph, graph engineering, build a graph, task graph, dependency graph, DAG, parallel implement, 并发实现, 并行实现, 任务图, 把任务变成图, fan-out fan-in, superstep, dynamic workflow./humanize-it对指定文档进行去 AI 味的改写。自动选择最合适的人性化策略(humanizer-zh / humanize-chinese / technical-writing), 迭代改写直到效果达标或迭代 42 次为止。适用于中文文本的去 AI 化处理,包括通用文章、技术文档、学术论文等。 Use when user says: "humanize this", "去AI味", "降AIGC", "人性化改写", "改成人话", "去除AI痕迹", "humanize document", "make text human-like", "去机器味", "降低AI率", "过AIGC检测"
npx claudepluginhub smallnest/goal-workflow --plugin goal-workflow-skillsOther plugins' skills for the same job