Cursor rule
.cursor/rules/docs-diagram.mdc[object Object]
Cursor rules
Quality
65/100
Scores the file, not the repository.Length
837 words
5 headings · 6 code blocksRepository
1.4k
— · pushed 5 days agoLast changed
3 days ago
First indexed 3 days ago.123456# Create GitHub-Compatible Mermaid Diagrams78**Your Task: When asked to create a diagram, generate it using Mermaid syntax suitable for rendering directly in GitHub Flavored Markdown. Store the diagram in a new file at `docs/diagrams/<diagram-name>.md`. Adhere strictly to the following rules to ensure compatibility and readability.**910## File Existence Check1112Run the following command to see which source documents are available:1314```bash15ls . docs16```1718Use the output to know which files exist before proceeding.1920## I. Preliminary Step: Gather Context for the Diagram2122Before generating any diagram, you **MUST** attempt to read and understand the content of the following project documents (if they exist and are relevant to the diagram request):2324- `NOTES.md`25- `docs/PRD.md` (Product Requirements Document)26- `docs/TECH_STACK.md`27- `docs/openapi.yaml` (or other API specifications)28- Any other architecture or design documents in `docs/` related to the subject of the diagram.2930This context is essential for creating an accurate and meaningful diagram.3132## II. Core Diagramming Rules for GitHub Mermaid33341. **Correct Fenced Code Block:**35 - Always start the Mermaid block with triple backticks and `mermaid`: `` ```mermaid ``.36 - Always end the block with triple backticks: ` ``` `.37 - **Example:**38```markdown39 ```mermaid40 graph TD41 A[Start] --> B{Decision};42 B -- Yes --> C[Action 1];43 B -- No --> D[Action 2];44```45```46472. **Use Well-Supported Diagram Types:**48 GitHub generally has good support for these common types:49 - `graph` (Flowcharts - `TD` or `TB` is often best for readability)50 - `sequenceDiagram`51 - `classDiagram`52 - `stateDiagram-v2` (Prefer v2 for better features/rendering)53 - `erDiagram` (Entity Relationship)54 - `pie` (Pie charts)55 - `gantt` (Gantt charts)56 - `mindmap` (Basic indented structure only - **NO ICONS**)57 - *Avoid newer or less common diagram types, as GitHub's Mermaid version may not be the latest.*58593. **General Syntax Best Practices:**60 - **Node IDs:** Use simple alphanumeric IDs (e.g., `node1`, `processA`). Avoid spaces or special characters in IDs.61 - **Node/Actor/State Labels (CRITICAL):** **ALWAYS use double quotes (`"..."`)** for labels, especially if they contain spaces, punctuation, special characters (like hyphens, periods, colons), or Mermaid keywords. This is the most common source of rendering errors.62 - **Correct:** `A["User Input: Text"] --> B["Validate Data (Step 1)"];`63 - **Incorrect (Potential Error):** `A[User Input: Text] --> B[Validate Data (Step 1)];`64 - **Arrows:** Use standard arrow types (`-->`, `---`, `==>`, `->>`, etc.).65 - **Comments:** Use `%%` for comments within the Mermaid code if needed (e.g., `%% This is a comment %%`).66674. **`mindmap` Specifics for GitHub:**68 - GitHub **supports the basic `mindmap` structure** using indentation (spaces or tabs) to define hierarchy.69 - Each node/item **MUST** be on its own line with correct indentation relative to its parent.70 - GitHub **DOES NOT support** advanced `mindmap` features like `::icon()` syntax. Using icons **WILL CAUSE RENDERING ERRORS**.71 - Stick to plain text nodes for mind maps.72 - **Correct `mindmap` (GitHub Compatible):**73 ```mermaid74 mindmap75 Root76 Parent Node77 Child Item 178 Child Item 279```80 - **Incorrect `mindmap` (GitHub Incompatible - Uses Icons):**81```mermaid82 mindmap83 Root84 ::icon(fa fa-star) Parent Node85 ::icon(fa fa-one) Child Item 186```87885. **Layout Preference for Flowcharts (`graph`):**89 - For `graph` diagrams, prefer `TD` (Top Down) or `TB` (Top Bottom) for better readability within Markdown document flow. Example: `graph TD;`.90916. **Styling: Let GitHub Handle It (CRITICAL):**92 - **DO NOT** attempt to set themes (e.g., `%%{init: {'theme': 'dark'}}%%`).93 - **DO NOT** try to apply custom styling using `classDef`, `style`, or inline CSS attributes *within the Mermaid code*.94 - GitHub **ignores** these directives and applies its own styling based on the user's current GitHub theme (light, dark, or dimmed). Your diagram will adapt automatically. Forcing themes or styles will likely be ignored or look inconsistent.95967. **Keep Diagrams Focused and Manageable:**97 - Avoid overly complex diagrams with an excessive number of nodes, edges, or deep nesting in a single block. While GitHub can render complex diagrams, they might become hard to read or hit rendering performance limits.98 - If a concept is very complex, consider breaking it down into multiple, simpler, linked diagrams.991008. **Verification (If Possible):**101 - If you have access to a GitHub Markdown preview environment, use it to test your Mermaid syntax. This is the best way to catch errors.1021039. **Note on Automated Edits:**104 - Be aware that automated code editing tools may sometimes struggle with precise changes within Mermaid blocks, especially with syntax sensitive to indentation (like mindmaps) or quoting.105 - **Always carefully review any automated edits** made to Mermaid blocks. If errors occur or the diagram doesn't render as expected, manual correction might be required.106107## III. Output File108109- Place the generated Mermaid diagram (within its fenced code block) into a new Markdown file.110- Save the file to `docs/diagrams/<diagram-name>.md`, where `<diagram-name>` is a descriptive name for the diagram (e.g., `user-authentication-flow.md`, `database-schema.md`).111112**REMEMBER: Your goal is to create a clear, accurate Mermaid diagram in `docs/diagrams/<diagram-name>.md` that renders correctly on GitHub. Key success factors are: using ` ```mermaid `, quoting all labels meticulously (`"Like This!"`), avoiding themes/custom styles, and for mindmaps, using only basic indentation (NO icons). Always gather context from project docs first.**113
Also in skillrecordings/egghead-next
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| skillrecordings/egghead-next.cursor/rules/project-todos-next.mdc · 1.4k | Cursor rules | docs | 45/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/_global.mdc · 1.4k | Cursor rules | teststyletypesgit+1 | 89/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/benchmarks-create.mdc · 1.4k | Cursor rules | no sections | 38/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/cli-github-search.mdc · 1.4k | Cursor rules | no sections | 51/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/cli-pack.mdc · 1.4k | Cursor rules | arch | 52/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/cli-worktree.mdc · 1.4k | Cursor rules | setupgit | 56/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/cli-wrangler.mdc · 1.4k | Cursor rules | styledatabase | 52/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/docs-openapi-spec.mdc · 1.4k | Cursor rules | archapi | 58/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/docs-prd.mdc · 1.4k | Cursor rules | archagent-behaviourdocs | 58/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/docs-structure.mdc · 1.4k | Cursor rules | archdocs | 49/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/docs-sync.mdc · 1.4k | Cursor rules | docs | 45/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/docs-tech-stack.mdc · 1.4k | Cursor rules | testlint-formatarchagent-behaviour+1 | 58/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/gh-docs-sync.mdc · 1.4k | Cursor rules | docs | 53/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/gh-task-continue.mdc · 1.4k | Cursor rules | git | 65/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/gh-task-execute.mdc · 1.4k | Cursor rules | gitagent-behaviour | 62/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/gh-task-plan.mdc · 1.4k | Cursor rules | teststylearchtypes+2 | 96/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/logging-session.mdc · 1.4k | Cursor rules | lint-formatstylearchgit | 62/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/pnpm-fixes.mdc · 1.4k | Cursor rules | setupbuildstyledependencies | 68/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/project-update-rules.mdc · 1.4k | Cursor rules | buildtestlint-formatstyle+7 | 96/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/project-update-user-rules.mdc · 1.4k | Cursor rules | buildtestlint-formatstyle+7 | 96/100 | 3 days ago |
Diff against .cursor/rules/project-todos-next.mdc Diff against .cursor/rules/_global.mdc Diff against .cursor/rules/benchmarks-create.mdc Diff against .cursor/rules/cli-github-search.mdc Diff against .cursor/rules/cli-pack.mdc Diff against .cursor/rules/cli-worktree.mdc Diff against .cursor/rules/cli-wrangler.mdc Diff against .cursor/rules/docs-openapi-spec.mdc Diff against .cursor/rules/docs-prd.mdc Diff against .cursor/rules/docs-structure.mdc Diff against .cursor/rules/docs-sync.mdc Diff against .cursor/rules/docs-tech-stack.mdc Diff against .cursor/rules/gh-docs-sync.mdc Diff against .cursor/rules/gh-task-continue.mdc Diff against .cursor/rules/gh-task-execute.mdc Diff against .cursor/rules/gh-task-plan.mdc Diff against .cursor/rules/logging-session.mdc Diff against .cursor/rules/pnpm-fixes.mdc Diff against .cursor/rules/project-update-rules.mdc Diff against .cursor/rules/project-update-user-rules.mdc
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
