agentleFS
sordi-aisordi-ai/skill-everything/.cursor/rules/drawio.mdc

skill-everything / rules

Cursor rule20 starsChanged 7 months agoMITView on GitHub

Apply when creating or reviewing architecture diagrams, Mermaid diagrams, or draw.io files.

The file

Show its rules and text

We split this drawio.mdc into the rules it gives an agent

13 rules. About 0 are common, 10 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Purpose: Ensure diagrams are version-controlled as source, rendered consistently, and kept in sync with the system they describe.

    line 8
  2. Very specific:

    Commit source, not just exports: Always commit diagram source files (.drawio, .mmd, .puml) alongside or instead of rendered image exports.

    line 16
  3. Distinctive:

    No binary-only diagrams: Never commit only a PNG or SVG export without the editable source.

    line 17
  4. Distinctive:

    One source file per diagram: Use a single canonical source file per diagram.

    line 18
  5. Distinctive:

    Prefer diagram-as-code: Prefer Mermaid or PlantUML over draw.io XML when the diagram fits a supported diagram type.

    line 22
  6. Very specific:

    Match diagram type to content: Use sequenceDiagram for request flows, flowchart for decision logic, C4Context/C4Container for architecture, …

    line 23
  7. Very specific:

    Set layout direction explicitly: Always declare layout direction (LR, TD) in Mermaid flowcharts.

    line 24
  8. Distinctive:

    Document the render command: Always include the render command or CI step in the repo README or Makefile so any contributor can regenerate …

    line 28
  9. Distinctive:

    Regenerate exports in CI: Ensure CI regenerates diagram exports from source and fails if the committed export differs from the generated …

    line 29
  10. Distinctive:

    Pin renderer version: Always pin the Mermaid CLI or draw.io CLI version in CI to prevent silent rendering changes across upgrades.

    line 30
  11. Distinctive:

    Use consistent node naming: Always use the same label for the same system component across all diagrams in the repo.

    line 34
  12. Distinctive:

    Add alt text to exported images: Always add descriptive alt text to diagram images embedded in documentation for accessibility.

    line 35
  13. Distinctive:

    Review diagrams in PRs: Before merging, verify that any diagram change accurately reflects the system change described in the PR.

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 7,324 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
drawio.mdc
---
description: Apply when creating or reviewing architecture diagrams, Mermaid diagrams, or draw.io files.
alwaysApply: false
---

# Sub-Skill: Diagrams (draw.io / Mermaid)

**Purpose:** Ensure diagrams are version-controlled as source, rendered consistently, and kept in sync with the system they describe.

---

## Rules

### Source Control

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
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.
3. **One source file per diagram.** Use a single canonical source file per diagram; avoid duplicating the same diagram in multiple formats.

### Format Selection

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.
5. **Match diagram type to content.** Use `sequenceDiagram` for request flows, `flowchart` for decision logic, `C4Context`/`C4Container` for architecture, `erDiagram` for data models.
6. **Set layout direction explicitly.** Always declare layout direction (`LR`, `TD`) in Mermaid flowcharts; never rely on the default, which varies by renderer.

### Rendering Pipeline

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.
8. **Regenerate exports in CI.** Ensure CI regenerates diagram exports from source and fails if the committed export differs from the generated one.
9. **Pin renderer version.** Always pin the Mermaid CLI or draw.io CLI version in CI to prevent silent rendering changes across upgrades.

### Quality & Consistency

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.
11. **Add alt text to exported images.** Always add descriptive alt text to diagram images embedded in documentation for accessibility.
12. **Review diagrams in PRs.** Before merging, verify that any diagram change accurately reflects the system change described in the PR.

---

## See also

- `skills/svg-check/SKILL.md`
- `skills/error-log/SKILL.md`

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.