Skip to main content
rule CX Codex

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

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/mermaid-diagram-ui.mdc
Open on GitHub

What 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.mdc

Frontmatter: description, globs, alwaysApply

Step 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.

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set24

The whole set →
10x-implement 10x-implement — a command to implement approved technical plans step-by-step in Claude Code. Reads the plan, tracks progress, and verifies each phase before moving on. CX Codex +1 ★ 267repo stars shadcn-plan-session shadcn-plan-session runs an interactive UI planning session for an MVP using product specs, tech stack notes, and API endpoints. CX Codex +1 ★ 267repo stars shadcn-view-implement The shadcn-view-implement command guides Claude Code through building a shadcn/ui view from an implementation plan. It pauses after a small batch of work so you can review the result. CX Codex +1 ★ 267repo stars shadcn-ui-plan shadcn-ui-plan turns a product requirements doc, API plan and planning session notes into a UI architecture saved to .ai/ui-plan.md. CX Codex +1 ★ 267repo stars mermaid-diagram-auth The mermaid-diagram-auth rule guides Claude Code through project auth requirements and asks it to create a Mermaid sequence diagram. Use it to map sign-up, login, sessions, and token handling. CX Codex +1 ★ 267repo stars shadcn-view-plan shadcn-view-plan — a Claude Code command that produces a structured implementation plan for a single frontend view and writes it to .ai/{view}-view-implementation-plan.md. CX Codex +1 ★ 267repo stars mermaid-diagram-journey mermaid-diagram-journey guides Claude Code to build a Mermaid state diagram for login and onboarding flows straight from project requirements. CX Codex +1 ★ 267repo stars supabase This rule guides Supabase Auth setup in Astro apps with SSR. It covers middleware, auth endpoints, protected routes, and server-side cookies. CX Codex +1 ★ 267repo stars

Project sponsors

Companies that keep this analytics open