$npx -y skills add sordi-ai/skill-everything --skill drawioApply when creating or reviewing architecture diagrams, Mermaid diagrams, or draw.io files.
| 1 | # Sub-Skill: Diagrams (draw.io / Mermaid) |
| 2 | |
| 3 | **Purpose:** Ensure diagrams are version-controlled as source, rendered consistently, and kept in sync with the system they describe. |
| 4 | |
| 5 | --- |
| 6 | |
| 7 | ## Rules |
| 8 | |
| 9 | ### Source Control |
| 10 | |
| 11 | 1. **Commit source, not just exports.** Always commit diagram source files (`.drawio`, `.mmd`, `.puml`) alongside or instead of rendered image exports. Reference: ERR-2026-027 |
| 12 | 2. **No binary-only diagrams.** Never commit only a PNG or SVG export without the editable source; reviewers cannot diff or modify a raster image. |
| 13 | 3. **One source file per diagram.** Use a single canonical source file per diagram; avoid duplicating the same diagram in multiple formats. |
| 14 | |
| 15 | ### Format Selection |
| 16 | |
| 17 | 4. **Prefer diagram-as-code.** Prefer Mermaid or PlantUML over draw.io XML when the diagram fits a supported diagram type; text diffs are reviewable. |
| 18 | 5. **Match diagram type to content.** Use `sequenceDiagram` for request flows, `flowchart` for decision logic, `C4Context`/`C4Container` for architecture, `erDiagram` for data models. |
| 19 | 6. **Set layout direction explicitly.** Always declare layout direction (`LR`, `TD`) in Mermaid flowcharts; never rely on the default, which varies by renderer. |
| 20 | |
| 21 | ### Rendering Pipeline |
| 22 | |
| 23 | 7. **Document the render command.** Always include the render command or CI step in the repo README or Makefile so any contributor can regenerate exports. |
| 24 | 8. **Regenerate exports in CI.** Ensure CI regenerates diagram exports from source and fails if the committed export differs from the generated one. |
| 25 | 9. **Pin renderer version.** Always pin the Mermaid CLI or draw.io CLI version in CI to prevent silent rendering changes across upgrades. |
| 26 | |
| 27 | ### Quality & Consistency |
| 28 | |
| 29 | 10. **Use consistent node naming.** Always use the same label for the same system component across all diagrams in the repo; divergent names cause confusion. |
| 30 | 11. **Add alt text to exported images.** Always add descriptive alt text to diagram images embedded in documentation for accessibility. |
| 31 | 12. **Review diagrams in PRs.** Before merging, verify that any diagram change accurately reflects the system change described in the PR. |
| 32 | |
| 33 | --- |
| 34 | |
| 35 | ## See also |
| 36 | |
| 37 | - `skills/svg-check/SKILL.md` |
| 38 | - `skills/error-log/SKILL.md` |