Skip to main content
rule CX Codex

mermaid-diagram-auth — Claude Code rule: auth diagram

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.

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-auth.mdc
Open on GitHub

What mermaid-diagram-auth does

The rule points Claude Code to .ai/project-prd.md for project requirements and sets .ai/diagrams/auth.md as the output file. The requested diagram covers Browser, Middleware, Astro API, and Supabase Auth, with login, sign-up, redirects, and the response to an expired token.

Before drawing, the agent is asked to identify the auth flows and the actors involved. The output should be in Polish and use Mermaid sequenceDiagram syntax, including numbered steps, declared participants, conditional branches, and activation blocks. It also sets a line-length limit and asks the agent to check the diagram for syntax and rendering issues.

The project needs .ai/project-prd.md for the requirements review. Without that file, the agent has no referenced project specification to base the diagram on.

What it helps with

  • Map the login and sign-up sequence
  • Show where tokens are checked and refreshed
  • Document redirects after authentication
  • Describe what happens when a session token expires
  • Check the diagram against project requirements

Example prompts for the agent

  • Create an auth diagram from .ai/project-prd.md and save it to .ai/diagrams/auth.md.
  • Show how Middleware and Supabase Auth handle an expired token in Mermaid.
  • Review the login and sign-up flows, then write a Polish sequence diagram.

How to install mermaid-diagram-auth

Manually: put the files in place

.cursor/rules/mermaid-diagram-auth.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-auth

How do I install mermaid-diagram-auth in Claude Code?

Save the rule as .claude/rules/mermaid-diagram-auth.md in the project.

What does mermaid-diagram-auth do?

It instructs Claude Code to review auth requirements and produce a Mermaid sequence diagram for login and sign-up. The target file is .ai/diagrams/auth.md.

Which technologies does the rule cover?

Its requested auth flow uses React, Astro, and Supabase Auth. The agent is directed to read project requirements from .ai/project-prd.md.

Similar IDE rules

IDE rules catalog →

From the same set24

The whole set →
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-ui mermaid-diagram-ui guides the agent to analyze requirements and generate Mermaid UI architecture diagrams for Astro and React auth modules. 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 10x-research 10x-research spawns parallel sub-agents to investigate your codebase comprehensively. Finds architectural patterns, component connections, and generates a markdown research report with code references. CX Codex +1 ★ 267repo stars

Project sponsors

Companies that keep this analytics open