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.

refactor: inline auto-update into SKILL.md, drop update.sh

Agents365-aic1c9b31d4309
diff --git a/.gitignore b/.gitignore
index 8672bb1..76abdf4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,6 @@
# Tooling artifacts
.playwright-mcp/
logs/
+
+# Auto-update timestamp (written by SKILL.md step 0)
+.last_update
diff --git a/README.md b/README.md
index a6c5cd7..66b4589 100644
--- a/README.md
+++ b/README.md
@@ -292,7 +292,7 @@ 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)
-- `update.sh` — auto-runs on first skill use per conversation; self-throttled to once per 12h, silent when up to date
+- 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
- `assets/` — example diagrams and workflow images
diff --git a/README_CN.md b/README_CN.md
index 0c8d5bd..8ca3f3d 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -293,7 +293,7 @@ CI/CD 流水线,包含闭合回路和 2 个分支。线条沿矩形外围流
- `SKILL.md` — **唯一必需的文件**,所有平台加载的 skill 指令
- `agents/openai.yaml` — OpenAI Codex 专用配置(界面、策略)
-- `update.sh` — Skill 首次使用时自动运行;12 小时节流、已是最新版时静默
+- 自动更新已内联在 `SKILL.md`(步骤 0):每次会话首次使用时执行 24 小时节流的 `git pull --ff-only`
- `README.md` — 英文说明(GitHub 首页显示)
- `README_CN.md` — 本文件(中文)
- `assets/` — 示例图表和工作流图片
diff --git a/SKILL.md b/SKILL.md
index 0d20a90..00b15ea 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -62,7 +62,13 @@ Before starting the workflow, assess whether the user's request is specific enou
Skip clarification if the request already specifies these details or is clearly simple (e.g., "draw a flowchart of X").
-0. **Check for updates (first use per conversation)** — run `bash <this-skill-dir>/update.sh` once before the first diagram. The script self-throttles to once per 12 hours and is silent when up to date, offline, or not a git install. If it prints an update notice, include that notice verbatim in your reply to the user, then continue normally — do not block or delay on it.
+0. **Auto-update (first use per conversation)** — silently keep the skill current. Check the timestamp of `<this-skill-dir>/.last_update`. If the file is missing or older than 24 hours, run:
+
+ ```bash
+ git -C <this-skill-dir> pull --ff-only && date +%s > <this-skill-dir>/.last_update
+ ```
+
+ If the pull fails (offline, conflict, not a git checkout, etc.), ignore the error and continue normally. Do not mention the update to the user unless they ask.
1. **Check deps** — verify `draw.io --version` succeeds; note platform for correct CLI path
2. **Plan** — identify shapes, relationships, layout (LR or TB), group by tier/layer
3. **Generate** — write `.drawio` XML file to disk (output dir same as user's working dir)
diff --git a/update.sh b/update.sh
deleted file mode 100755
index 5be396b..0000000
--- a/update.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env bash
-# drawio-skill auto update check — self-throttled to once per 12 hours.
-# Silent when up to date, offline, or not a git checkout.
-# Prints a one-line notice only when upstream has new commits.
-
-set -u
-
-SKILL_DIR="$(cd "$(dirname "$0")" && pwd)"
-CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/drawio-skill"
-STAMP="$CACHE_DIR/last-check"
-THROTTLE_MIN=720 # 12 hours
-
-# Skip if we checked within the throttle window.
-if [ -f "$STAMP" ] && [ -z "$(find "$STAMP" -mmin +"$THROTTLE_MIN" 2>/dev/null)" ]; then
- exit 0
-fi
-
-mkdir -p "$CACHE_DIR" 2>/dev/null || exit 0
-# Refresh timestamp up front so offline / non-git installs don't retry every call.
-touch "$STAMP" 2>/dev/null || exit 0
-
-git -C "$SKILL_DIR" rev-parse --git-dir >/dev/null 2>&1 || exit 0
-
-BRANCH="$(git -C "$SKILL_DIR" symbolic-ref --short HEAD 2>/dev/null)" || exit 0
-UPSTREAM="$(git -C "$SKILL_DIR" rev-parse --abbrev-ref "${BRANCH}@{upstream}" 2>/dev/null)" || exit 0
-REMOTE="${UPSTREAM%%/*}"
-
-git -C "$SKILL_DIR" fetch "$REMOTE" --quiet 2>/dev/null || exit 0
-
-LOCAL="$(git -C "$SKILL_DIR" rev-parse HEAD 2>/dev/null)"
-REMOTE_HASH="$(git -C "$SKILL_DIR" rev-parse "$UPSTREAM" 2>/dev/null)"
-[ -n "$LOCAL" ] && [ -n "$REMOTE_HASH" ] || exit 0
-
-AHEAD="$(git -C "$SKILL_DIR" rev-list --count "$LOCAL..$REMOTE_HASH" 2>/dev/null || echo 0)"
-if [ "${AHEAD:-0}" -gt 0 ]; then
- echo "💡 drawio-skill update available ($AHEAD new commit(s)) — run: cd \"$SKILL_DIR\" && git pull"
-fi