mermaid-diagram-ui — Claude Code rule: what it does, how to install
mermaid-diagram-ui guides the agent to analyze requirements and generate Mermaid UI architecture diagrams for Astro and React auth modules.
AGPL-3.0 ★ 267 updated 2026-02-20
.cursor/rules/mermaid-diagram-ui.mdcWhat mermaid-diagram-ui does
This rule assigns the assistant a software architect persona focused on user interface structure. The assistant reads project specifications from .ai/project-prd.md, outlines component boundaries, and details data flows inside an <architecture_analysis> section before writing any diagram markup.
The generated diagram follows flowchart TD conventions and lands in .ai/diagrams/ui.md. The rule enforces Polish terminology, strict node identifier formatting, subgraphs for grouping, and dedicated styling for updated authentication blocks.
The assistant expects an existing .ai/project-prd.md file in the workspace, so missing requirements will block diagram creation.
What it helps with
- map UI architecture across Astro pages and React widgets
- visualize authentication and registration state flows
- enforce valid Mermaid flowchart syntax without broken labels
- document component dependencies in markdown diagrams
Example prompts for the agent
- Analyze the auth specs and generate the UI architecture diagram
- Create the Mermaid component map from .ai/project-prd.md
- Update .ai/diagrams/ui.md with the latest React component structure
How to install mermaid-diagram-ui
Manually: put the files in place
.cursor/rules/mermaid-diagram-ui.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/mermaid-diagram-ui.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/mermaid-diagram-ui.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/mermaid-diagram-ui.mdManually: put the files in place
.clinerules/mermaid-diagram-ui.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about mermaid-diagram-ui
How to install mermaid-diagram-ui in Claude Code?
Add the instruction file directly into your repository at .claude/rules/mermaid-diagram-ui.md.
What does mermaid-diagram-ui do?
It guides Claude Code through reviewing a product requirements doc and building a comprehensive Mermaid diagram of React components and Astro routes.
Which file receives the final diagram?
The rule directs the model to write the diagram into .ai/diagrams/ui.md, wrapping the snippet in <mermaid_diagram> tags.