安装方式
命令行安装
在项目根目录执行以下命令,完成 Skill 安装。
npx bzskills add luongnv89/skills --skill diagram-generator Generate a diagram and route to the right engine — draw.io XML (precise, editable, C4, swimlanes) or Excalidraw JSON (hand-drawn, sketch, wireframes). One entry for flowcharts, architecture, ER, sequence, mind maps. Don't use for Mermaid or slides.
2
下载量
命令行安装
在项目根目录执行以下命令,完成 Skill 安装。
npx bzskills add luongnv89/skills --skill diagram-generator name: diagram-generator
description: Generate a diagram and route to the right engine — draw.io XML (precise, editable, C4, swimlanes) or Excalidraw JSON (hand-drawn, sketch, wireframes). One entry for flowcharts, architecture, ER, sequence, mind maps. Don't use for Mermaid or slides.
license: MIT
effort: high
metadata:
version: 1.3.0
author: "Luong NGUYEN <luongnv89@gmail.com>"Single entry point for "make me a diagram". This umbrella picks the right engine and hands off to
it — both produce the same diagram taxonomy (flowchart, architecture, C4, ER, sequence, mind map)
through the same four phases (Understand → Propose → Generate → Validate); they differ only in
output format and aesthetic.
| Pick | When the user wants... | Output | Nested skill |
|---|---|---|---|
| draw.io | Precise, professional diagrams to edit later in draw.io / diagrams.net / Confluence; official C4 styling; swimlanes; multi-page | .drawio XML | drawio-generator |
| Excalidraw | A hand-drawn, sketchy, whiteboard feel; wireframes; quick collaborative sketches | .excalidraw JSON | excalidraw-generator |
Routing rules:
Routing above selects exactly one engine — drawio-generator or excalidraw-generator — which
"How to use" then invokes by name. Once routing picks engine, and before invoking it, verify
that engine is installed:
engine=drawio-generator # or excalidraw-generator — whichever routing selected
asm list -p claude --json | grep -q "\"$engine\"" || {
echo "Missing required skill: $engine" >&2
echo "Install it: asm install github:luongnv89/skills:skills/diagram-generator/$engine -p claude --yes" >&2
echo "Verify: asm list -p claude --json | grep '\"$engine\"'" >&2
echo "No asm yet: npm install -g agent-skill-manager" >&2
echo "Stop — never substitute the other engine; if it is installed, the user may re-request it explicitly." >&2
exit 1
}
A missing routed engine stops the run before any output is written.
The selected engine writes the diagram file. When that output path lives inside a git worktree, sync before the write to avoid clobbering remote work:
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin
git pull --rebase origin "$branch"
If the working tree is dirty: stash → sync → pop. If origin is missing or a conflict occurs: stop and ask the user. Skip this section only when the output path is outside any git repository (e.g. a scratch directory).
Once the engine is chosen, invoke the nested skill by name — the runtime resolves names regardless
of filesystem path:
/drawio-generator — generate draw.io XML/excalidraw-generator — generate Excalidraw JSONEach engine owns its full workflow, references/, agents/, and validation checks. This umbrella
stays short to protect the agent's context budget; it only routes.
missing essentials before routing.
confirmation, backup, dry-run, error, and rollback safeguards before any overwrite.
Input: "Draw a sketchy onboarding wireframe for mobile."
Route: excalidraw-generator
Expected output: one validated .excalidraw JSON artifact
Verify every routed run:
After routing, emit:
◆ Route Diagram
Engine available: √ pass
Route justified: √ pass
Output validated: √ pass
Result: PASS | FAIL | PARTIAL
Use × fail — reason when a check fails. Report PASS only after the nested engine's acceptance
criteria and expected result are verified.