一键导入
draw-mermaid
Generate or update a Mermaid diagram in a subagent to keep the main context clean. Dark-mode-safe colors and accessibility built in.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate or update a Mermaid diagram in a subagent to keep the main context clean. Dark-mode-safe colors and accessibility built in.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Conduct a decision-tree interview with the user to lock in requirements, motivation, scope, and non-goals before planning.
Stage 3 of three-stage planning pipeline. Produce a file-level implementation plan via detail-planner/detail-reviewer loop, then get user approval. Inputs are confirmed intent (<session-id>-intent.md) and outline (<session-id>-outline.md) from prior stages.
Edit source code for the current task. Delegates editing and lint/typecheck/self-repair to a subagent.
Plan and write test cases with high reasoning effort. Test iteration runs in a subagent to minimize confirmations.
Explore the codebase to understand existing patterns, constraints, and relevant files before planning.
Investigate git history, docs/history.md, and GitHub issue/PR timeline since the relevant issue opened, to surface changes that may invalidate the issue's premises.
| name | draw-mermaid |
| description | Generate or update a Mermaid diagram in a subagent to keep the main context clean. Dark-mode-safe colors and accessibility built in. |
| model | sonnet |
| argument-hint | <what to diagram — or 'update: <change description>' to revise an existing diagram> |
Generate a diagram without loading diagram logic into the main context window. Two modes depending on what's available:
bin/draw-diagram-gemini produces an SVG fileDM-1. If args are empty, output:
No description provided. Usage:
/draw-mermaid <what to diagram>
and stop.
DM-2. Check for Gemini CLI:
Run via Bash: command -v gemini > /dev/null 2>&1 && echo GEMINI_AVAILABLE || echo GEMINI_ABSENT
DM-3. If GEMINI_AVAILABLE — generate SVG:
docs/workflow.svg; use a path from args if specified (e.g. --output docs/foo.svg)&& chaining):
printf '%s' "<prompt>" | draw-diagram-gemini --output <output-path>
Where <prompt> is the user's description from args, plus any existing Mermaid diagram
from conversation context if this is an "update" request..DM-4. If GEMINI_ABSENT — generate Mermaid (fallback):
subagent_type: general-purpose, model: sonnet) with
a self-contained prompt that includes:
mermaid code block — no prose, no explanation.Use <br/> inside node labels — never \n. Mermaid treats \n as a literal string.
P2a["2a · survey-code<br/>skippable"] ✓
P2a["2a · survey-code\nskippable"] ✗
Define all colors in classDef blocks at the top; apply with class. Never inline fill:
on individual nodes.
classDef required fill:#1d4ed8,stroke:#1e3a8a,color:#fff
class S1,S2 required
GitHub renders Mermaid in light and dark themes. Use dark fills + white text so contrast holds in both (≥ 4.5:1 on white, ≥ 3:1 on dark). Never use light pastels for text-bearing nodes.
| Role | Fill | Stroke | Text |
|---|---|---|---|
| Terminal (start/end) | #16a34a | #14532d | #fff |
| Required step | #1d4ed8 | #1e3a8a | #fff |
| Skippable step | #475569 | #334155 | #fff |
| Decision | #b45309 | #92400e | #fff |
| Parallel | #6d28d9 | #4c1d95 | #fff |
Avoid red/green pairings — deuteranopia (8% of male users) makes them indistinguishable.
Use style (not classDef) for subgraphs. Pick a tint of the dominant color:
style Plan fill:#1e3a8a,stroke:#1d4ed8,color:#fff
style Review fill:#4c1d95,stroke:#6d28d9,color:#fff
Color alone must not be the only signal. Back it up with:
([]), decisions {}, steps []