Skip to content

Agent skill that turns natural language, code, Terraform/K8s, SQL, OpenAPI, AsyncAPI, Protobuf and GraphQL sources into editable, tested draw.io architecture diagrams: incremental sync, multi-view projection, drift diff, CI architecture tests, whiteboard derasterize, interactive HTML/PPTX/Mermaid exports.

docs: add Style Presets section and fix auto-update interval in READMEs

Agents365-aidcb8ec7b96ba
diff --git a/README.md b/README.md
index a39d4e6..bd066d9 100644
--- a/README.md
+++ b/README.md
@@ -227,7 +227,7 @@ clawhub install drawio-pro-skill
## Updates
-The skill auto-checks for updates once per 12 hours on first use in a conversation. When a new version is available, the agent prints a one-line notice in the reply. To apply:
+The skill auto-checks for updates once per 24 hours on first use in a conversation. When a new version is available, the agent prints a one-line notice in the reply. To apply:
```bash
cd <your-install-path>/drawio-skill && git pull
@@ -293,6 +293,8 @@ CI/CD pipeline with a closed loop and 2 spur branches. Edges flow along the peri
- `SKILL.md` — **the only required file**. Loaded by all platforms as the skill instructions.
- `agents/openai.yaml` — OpenAI Codex-specific configuration (UI, policy)
+- `styles/built-in/` — built-in style presets (`default.json`, `corporate.json`, `handdrawn.json`)
+- `references/style-extraction.md` — algorithm reference used during the style-learning flow
- Auto-update is inline in `SKILL.md` (step 0): a 24h-throttled `git pull --ff-only` on first use per conversation
- `README.md` — this file (English, displayed on GitHub homepage)
- `README_CN.md` — Chinese documentation
@@ -302,6 +304,52 @@ CI/CD pipeline with a closed loop and 2 spur branches. Edges flow along the peri
> All example diagrams were generated by Claude Opus 4.6 with this skill.
+## Style Presets
+
+Style presets let you capture and reuse a visual style across diagrams. When a preset is active, it replaces the built-in color palette, shape vocabulary, fonts, and edge defaults.
+
+### Built-in presets
+
+| Name | Description |
+|------|-------------|
+| `default` | Clean blue/green/yellow palette matching the built-in conventions |
+| `corporate` | Muted, professional palette suited for business presentations |
+| `handdrawn` | Sketch-style strokes for informal or whiteboard-style diagrams |
+
+### Apply a preset to a diagram
+
+```
+Draw a microservices architecture using my "corporate" style
+```
+
+Or set a default so all future diagrams use it automatically:
+
+```
+Make "corporate" my default style
+```
+
+### Learn your style from a file
+
+Point the skill at any `.drawio` file or flat image:
+
+```
+Learn my style from ~/diagrams/brand.drawio as "mybrand"
+Learn my style from ~/diagrams/screenshot.png as "mybrand"
+```
+
+The skill extracts colors, shapes, fonts, and edge style, renders a sample diagram for preview, and saves to `~/.drawio-skill/styles/mybrand.json` only after you approve.
+
+### Manage presets
+
+| What you say | What happens |
+|---|---|
+| "list my styles" | Shows all user and built-in presets in a table |
+| "show my `<name>` style" | Pretty-prints the preset JSON |
+| "make `<name>` the default" | Sets it as the active default for all diagrams |
+| "remove default" | Clears the default (reverts to built-in conventions) |
+| "delete `<name>`" | Deletes the user preset (prompts for confirmation) |
+| "rename `<a>` to `<b>`" | Renames a user preset |
+
## Known Limitations
- **Command name varies by platform**: macOS Homebrew installs the command as `draw.io`; some Linux packages use `drawio`. The skill handles both, but verify which name works on your system with `draw.io --version` or `drawio --version`
diff --git a/README_CN.md b/README_CN.md
index ed66072..cef69ba 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -227,7 +227,7 @@ clawhub install drawio-pro-skill
## 更新
-Skill 会在每次对话首次使用时自动检查更新(12 小时节流)。有新版本时,Agent 会在回复中打印一行提示。应用更新:
+Skill 会在每次对话首次使用时自动检查更新(24 小时节流)。有新版本时,Agent 会在回复中打印一行提示。应用更新:
```bash
cd <你的安装路径>/drawio-skill && git pull
@@ -294,6 +294,8 @@ CI/CD 流水线,包含闭合回路和 2 个分支。线条沿矩形外围流
- `SKILL.md` — **唯一必需的文件**,所有平台加载的 skill 指令
- `agents/openai.yaml` — OpenAI Codex 专用配置(界面、策略)
+- `styles/built-in/` — 内置样式预设(`default.json`、`corporate.json`、`handdrawn.json`)
+- `references/style-extraction.md` — 样式学习流程使用的提取算法参考
- 自动更新已内联在 `SKILL.md`(步骤 0):每次会话首次使用时执行 24 小时节流的 `git pull --ff-only`
- `README.md` — 英文说明(GitHub 首页显示)
- `README_CN.md` — 本文件(中文)
@@ -303,6 +305,52 @@ CI/CD 流水线,包含闭合回路和 2 个分支。线条沿矩形外围流
> 所有示例图表均由 Claude Opus 4.6 配合本 skill 生成。
+## 样式预设
+
+样式预设让你捕获并复用视觉风格,跨多张图表保持一致。激活预设后,它会替代内置的配色、形状词汇、字体和连线默认值。
+
+### 内置预设
+
+| 名称 | 说明 |
+|------|------|
+| `default` | 干净的蓝/绿/黄配色,与内置规范保持一致 |
+| `corporate` | 低饱和度专业配色,适合商务演示 |
+| `handdrawn` | 手绘描边风格,适合非正式或白板式图表 |
+
+### 将预设应用到图表
+
+```
+画一个微服务架构图,使用我的 "corporate" 样式
+```
+
+或者设置默认样式,让后续所有图表自动使用:
+
+```
+把 "corporate" 设为我的默认样式
+```
+
+### 从文件中学习样式
+
+指向任意 `.drawio` 文件或图片:
+
+```
+从 ~/diagrams/brand.drawio 学习我的样式,保存为 "mybrand"
+从 ~/diagrams/screenshot.png 学习我的样式,保存为 "mybrand"
+```
+
+Skill 会自动提取配色、形状、字体和连线风格,渲染样例图供预览,确认后才保存至 `~/.drawio-skill/styles/mybrand.json`。
+
+### 管理预设
+
+| 你说的话 | 发生什么 |
+|---|---|
+| "列出我的样式" | 以表格展示所有用户和内置预设 |
+| "显示我的 `<name>` 样式" | 格式化输出预设 JSON |
+| "把 `<name>` 设为默认" | 设为所有图表的默认激活预设 |
+| "取消默认" | 清除默认(恢复内置规范) |
+| "删除 `<name>`" | 删除用户预设(会请求确认) |
+| "把 `<a>` 重命名为 `<b>`" | 重命名用户预设 |
+
## 已知限制
- **命令名因平台而异**:macOS Homebrew 安装的命令是 `draw.io`,部分 Linux 包使用 `drawio`。本 skill 兼容两者,请用 `draw.io --version` 或 `drawio --version` 确认你的系统使用哪个