# mermaid-diagram-ui

mermaid-diagram-ui guides the agent to analyze requirements and generate Mermaid UI architecture diagrams for Astro and React auth modules.

- rule · `type=rule` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline · ★ 267 repo stars
- Author: przeprogramowani
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/przeprogramowani/ai-rules-builder/tree/HEAD/.cursor/rules/mermaid-diagram-ui.mdc
- Updated: 2026-02-20
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/mermaid-diagram-ui

## What it 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.

## Install

### Cursor (native platform)

**Manually: put the files in place**
- File: `.cursor/rules/mermaid-diagram-ui.mdc` — Frontmatter: description, globs, alwaysApply

### Claude Code

**Manually: put the files in place**
- File: `.claude/rules/mermaid-diagram-ui.md` — The paths frontmatter field limits the files: move globs from the source into paths

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/mermaid-diagram-ui.instructions.md` — The applyTo field sets which files it applies to: move globs from the source into applyTo

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/mermaid-diagram-ui.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/mermaid-diagram-ui.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/przeprogramowani/ai-rules-builder/tree/HEAD/.cursor/rules/mermaid-diagram-ui.mdc

## When to use it
- 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
- 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

## Similar
- [external-diagram-mermaid-generate](https://affpapa.org/en/nevibecode/skills/external-diagram-mermaid-generate.md) — skill · 5600 installs
- [mermaid-diagram-specialist](https://affpapa.org/en/nevibecode/skills/mermaid-diagram-specialist.md) — skill · 145 installs
- [agent-mermaid-diagram-specialist](https://affpapa.org/en/nevibecode/plugins/agent-mermaid-diagram-specialist.md) — plugin · ★ 2707 repo stars
- [mermaid-diagram-generator](https://affpapa.org/en/nevibecode/skills/mermaid-diagram-generator.md) — skill · 348 installs
- [design-doc-mermaid](https://affpapa.org/en/nevibecode/skills/design-doc-mermaid.md) — skill · 101800 installs
- [pretty-mermaid](https://affpapa.org/en/nevibecode/skills/pretty-mermaid.md) — skill · 4700 installs

From the same set: [przeprogramowani/ai-rules-builder](https://affpapa.org/en/nevibecode/by/przeprogramowani/ai-rules-builder.md) — 24 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
