skills/mermaid-diagrams/SKILL.md
Design, repair, and standardize Markdown-embedded Mermaid diagrams with syntax-safe, renderer-portable authoring and restrained visual taste. Use when Codex needs to create or fix Mermaid code for flowcharts, sequence diagrams, state diagrams, class diagrams, ER diagrams, timelines, or other Mermaid-backed technical visuals in Markdown, docs, ADRs, blog posts, architecture notes, or any writing workflow. Also use when another skill already decided that a diagram is needed and the remaining task is to turn that visual plan into clean Mermaid that avoids parser breakage, crowding, awkward layout, and decorative styling.
npx skillsauth add Refinex-Space/Refinex-Skills mermaid-diagramsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill exists for one narrow job: turn a diagram idea into Mermaid that is correct, readable, and portable across common Markdown renderers. The standard is not fancy Mermaid. The standard is question-first modeling, lowest-common-denominator syntax, and restrained aesthetics.
The skill is intentionally downstream of diagram selection. If another workflow has already decided that the document needs a sequenceDiagram or flowchart, do not reopen that decision unless it is clearly wrong. Your job is to make the chosen diagram type work cleanly.
Prioritize these goals in order:
When these goals conflict, cut complexity before adding styling.
Follow this sequence every time.
Write four internal lines before emitting Mermaid:
flowchart, sequenceDiagram, stateDiagram-v2, classDiagram, erDiagram, timeline, or another Mermaid type only when justifiedLR, RL, TB, or BT when the type supports itIf the request mixes temporal order, static structure, and branching logic in one picture, split it. One diagram should answer one question.
Choose a layout that keeps cognitive load low:
sequenceDiagram.flowchart, and only one nesting level.Good Mermaid aesthetics come mostly from node budgeting, direction choice, and label discipline.
Default to the most portable Markdown-safe subset unless the user explicitly asks for renderer-specific features and the environment is known to support them.
Portable defaults:
```mermaid.flowchart LR, sequenceDiagram, stateDiagram-v2, classDiagram, erDiagram, timeline.Avoid by default:
click, or interactive behaviorstyle, linkStyle, and classDef combinationsRead references/authoring-standard.md for the exact safe-authoring rules and parser pitfalls.
The default output should already look good without custom colors. Use styling only when it clarifies semantic roles.
Strong default:
If styling is added, keep it sparse and consistent. Read references/styling-standard.md before using classDef, style, or theme variables.
Before returning Mermaid:
subgraph, direction, classDef, or quoted labels is syntactically correct.Run references/final-checklist.md as the last pass.
When this skill is used from tech-writing, tech-rewrite, or tech-planner:
If the upstream plan says a diagram is required but the selected type is clearly mismatched, fix the type briefly and say why. Otherwise, do not reopen the higher-level writing workflow.
Read only what the current task needs:
references/authoring-standard.md — portable syntax rules, parser pitfalls, and layout disciplinereferences/styling-standard.md — restrained color and styling rules for Markdown Mermaidreferences/pattern-cookbook.md — per-diagram-type authoring defaults and compact examplesreferences/final-checklist.md — last-pass validation loop before deliveryThe safest way to make Mermaid diagrams look better is usually not to decorate them. It is to ask a sharper question, remove half a layer of detail, shorten three labels, and split one overloaded picture into two. When in doubt, simplify.
development
Deep initialization of project AGENTS.md hierarchy and control plane for AI coding agents. Use this skill whenever the user wants to set up, initialize, bootstrap, or create AGENTS.md / CLAUDE.md files for their project, or when they mention "init-deep", "harness setup", "control plane", "agent context", "project initialization for agents", or want to make their codebase agent-ready. Also trigger when a user says things like "set up my repo for Claude Code", "make this project work better with agents", "create agent instructions", "bootstrap harness", or "initialize agent docs". This skill handles both existing large codebases (where hierarchical, module-scoped AGENTS.md files are needed) and new/small projects (where brainstorming with the user comes first). Do NOT use this skill for routine code changes, bug fixes, or general documentation — it is specifically for creating the structured agent control plane.
development
Detect and fix drift in project AGENTS.md files and agent control plane. Use this skill whenever the user wants to audit, recalibrate, refresh, update, or fix their existing AGENTS.md files, or when they mention "drift", "stale AGENTS.md", "outdated agent instructions", "recalibrate", "sync agents", "audit control plane", "AGENTS.md is wrong/old/broken", or when they suspect their agent harness has fallen out of sync with the codebase. Also trigger when a user says things like "my agents keep making wrong assumptions", "Claude doesn't understand the new structure", "we refactored but the AGENTS.md is old", "check if my AGENTS.md is still accurate", or "update my agent docs". This skill is the companion to init-deep — init-deep creates the control plane from scratch, drift-doctor maintains it over time. Do NOT use for initial creation of AGENTS.md (use init-deep instead). Do NOT use for general code review or documentation updates unrelated to agent context.
development
Use when adding, fixing, reviewing, or generating code comments, docstrings, Javadoc, JSDoc/TSDoc, rustdoc, SQL comments, or documentation comments for source, markup, configuration, or database files.
development
Enforce production-grade Java development standards when writing, reviewing, or architecting Java code. Covers commenting, core Java idioms (Stream, collections, concurrency, generics), 23 GoF design patterns, SonarQube/Alibaba p3c/Lombok rules, Spring Boot MVC structure, Spring Cloud DDD microservices, MyBatis/JPA/transaction management, exception handling, logging, REST API design, testing, and security. Trigger whenever the user writes Java code, reviews Java code, designs a Spring Boot or Spring Cloud project, implements a design pattern, fixes code smells, discusses architecture, or asks about Java best practices. Also trigger when Java code is pasted for feedback or the user asks about package structure, DTO/VO/PO conventions, or coding standards.