article-icons
Illustrate an article (Markdown, HTML, etc.) with animated-style icons from itshover.com/icons. Fetches icons as clean inline SVG and places them at section…
为任意项目生成 UML 图、架构图和流程图。分析代码库后让用户选择要生成的图表类型,使用 architecture-diagram skill 渲染为 HTML+SVG,保存到 docs/ 目录。适用于任何软件项目的文档可视化。
$ npx -y skills add smallnest/goal-workflow --skill insight-diagram --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/insight-diagramContext preview
The summary Claude sees to decide when to auto-load this skill.
为任意项目生成 UML 图、架构图和流程图。分析代码库后让用户选择要生成的图表类型,使用 architecture-diagram skill 渲染为 HTML+SVG,保存到 docs/ 目录。适用于任何软件项目的文档可视化。
name: insight-diagram description: 为任意项目生成 UML 图、架构图和流程图。分析代码库后让用户选择要生成的图表类型,使用 architecture-diagram skill 渲染为 HTML+SVG,保存到 docs/ 目录。适用于任何软件项目的文档可视化。
分析任意代码库,自动生成 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 |
1. **生成前必读**: 调用 `/architecture-diagram` 前,先用 Read 工具阅读对应类型的示例文件,从中提取:
2. **结构对齐**: 生成的图表应与示例保持相同的结构层次:
3. **内容替换而非照搬**: 示例中的业务数据(NovaShield 风控系统)是虚构的参考案例,生成时需替换为目标项目的真实架构信息。只参考布局和样式,不复制业务内容。
4. **无对应示例的类型**: 对于包图 (package)、复合结构图 (composite-structure)、剖面图 (profile)、状态机图 (state-machine)、定时图 (timing) 这 5 种没有示例文件的图表类型,参考最相近的已有示例(如包图参考组件图,状态机图参考活动图),并沿用相同的视觉语言。
读取项目关键文件,提取架构信息:
1. 读取项目根目录的 `CLAUDE.md`(如存在)获取项目概览 2. 读取各子目录的 `CLAUDE.md`(如存在)获取模块细节 3. 用 Glob 扫描源码文件结构(`**/*.go`, `**/*.py`, `**/*.ts` 等) 4. 读取入口文件(`main.go`, `app.py`, `index.ts` 等)识别顶层组件 5. 用 Grep 搜索关键模式:接口定义、函数签名、依赖注入、配置项
从以上信息中提炼出:
使用 AskUserQuestion 让用户选择要生成的图表(multiSelect: true),分4组展示:
**第1组 — 结构性图形(静态):**
**第2组 — 结构性图形续 + 部署:**
**第3组 — 行为性图形(动态):**
**第4组 — 交互图 + 常用非UML:**
默认推荐:architecture + sequence + flowchart
对每个选中的图表类型:
1. **先读示例**: 用 Read 工具阅读 `examples/<标识>.html`(如 `examples/architecture.html`),提取布局模式、节点样式、标注方式 2. 根据步骤 1 提取的架构信息,整理出该图表应展示的元素和关系 3. 调用 `/architecture-diagram` skill,传入图表类型、标题、内容描述、输出路径,**必须指定 light 风格** 4. 输出文件保存到 `docs/<标识>.html`(如 `docs/architecture.html`) 5. **生成后必须 review**: 运行几何校验脚本,按结果修正后再继续下一张(见下方「步骤 3.5」) 6. 简要报告完成状态
**生成规则:**
批量生成顺序(宏观→微观): 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
脚本检查(与三条核心要求一一对应):
1. **箭头落点**:每个带箭头的端点必须恰好落在目标框/椭圆/菱形的**边缘线**上(容差 6px)。
2. **框重叠**(`ERROR`):非嵌套的两个框在水平、垂直两个方向都有交叠 → 必须移开其中一个。嵌套(一个完全包住另一个,如分组边界框包子节点)是允许的。 3. **框间距**(`WARNING`):投影相邻的两框净间距 < `--min-gap`(默认 8px)→ 拉开距离。
处理原则:
全部完成后输出:
An AI-driven development workflow — from PRD to shipped code, all within Claude Code.
Illustrate an article (Markdown, HTML, etc.) with animated-style icons from itshover.com/icons. Fetches icons as clean inline SVG and places them at section…
Reverse-engineer a SPEC document from an existing project. Analyzes code, config, tests, and structure to produce a comprehensive specification. Triggers on:…
Use 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…
Graph engineering for parallel task execution: convert a task, PRD, SPEC, or issue set into a dependency graph (DAG), layer it into supersteps, then implement…
对指定文档进行去 AI 味的改写。自动选择最合适的人性化策略(humanizer-zh / humanize-chinese / technical-writing), 迭代改写直到效果达标或迭代 42 次为止。适用于中文文本的去 AI 化处理,包括通用文章、技术文档、学术论文等。 Use when user…
使用 ListenHub API 将文本转换为语音(TTS)。支持三种模式:快速合成(/v1/tts)、 多角色脚本(/v1/speech)、长文本流式合成(/v1/flow-speech/episodes)。 音色未指定时自动获取音色列表供用户选择,默认使用 chat-girl-105-cn(晓曼)。 Use…