Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/OriginTrail/dkgWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/origintrail/dkg/mermaid-diagram-preset)<a href="https://agentmods.dev/rules/origintrail/dkg/mermaid-diagram-preset"><img src="https://agentmods.dev/badge/rules/origintrail/dkg/mermaid-diagram-preset/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/origintrail/dkg/mermaid-diagram-preset"><img src="https://agentmods.dev/badge/rules/origintrail/dkg/mermaid-diagram-preset.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00860 | $0.00860 |
| Opus 5 | $0.00430 | $0.00430 |
| Sonnet 5 | $0.00172 | $0.00172 |
| Haiku 4.5 | $0.00086 | $0.00086 |
Grade A, and why
mermaid-diagram-preset scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Mermaid Sequence Diagram Preset
Every Mermaid sequence diagram in this repo MUST start with the shared init directive below. Mermaid's defaults are too tight: rect borders collide with adjacent arrows, stacked Note pills overlap each other, and multi-participant diagrams get cramped horizontally.
The preset
%%{init: { 'sequence': { 'messageMargin': 55, 'noteMargin': 15, 'boxMargin': 15, 'actorMargin': 70 } } }%%
sequenceDiagram
...
For diagrams with nested rect blocks (e.g., phase-based lifecycle diagrams), bump boxMargin to 20:
%%{init: { 'sequence': { 'messageMargin': 55, 'noteMargin': 15, 'boxMargin': 20, 'actorMargin': 70 } } }%%
Why these numbers
| Setting | Default | Preset | Effect |
|---|---|---|---|
messageMargin |
35 | 55 | Vertical spacing between arrows. Main anti-overlap lever. |
noteMargin |
10 | 15 | Padding inside Note pills so text doesn't crowd borders. |
boxMargin |
10 | 15 (20 for nested rect) |
Space around rect blocks so they don't kiss neighboring arrows. |
actorMargin |
50 | 70 | Horizontal spacing between participant columns. |
Companion rules (learned the hard way)
These rules keep diagrams readable beyond the preset:
- Do not use
<br/>inside notes. Split into multipleNote over X:lines or collapse into a single sentence.<br/>works but produces hard-to-read dense pills. - Avoid stacking 3+ consecutive
Note over X:on the same participant. Mermaid renders each as a separate pill; they frequently overlap neighboringrectborders. Collapse into one concise sentence, or intersperse with arrows. - Do not indent multi-line math inside a
Note(e.g.," = 840e18 · 1e18 / 8000"). Mermaid preserves the whitespace and widens the pill, causing horizontal collisions. Put the math on one line or use apre-style code block outside the diagram.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 67 lines · 860 tokens per session scan A e4b2945b2a9b
mermaid-diagram-preset is a cursor rule published in the GitHub repository OriginTrail/dkg (148 stars, last pushed yesterday), licensed Apache-2.0. It adds 860 tokens to every session, about $0.0043 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
cursor-memory
Shokunin memory system: persistent context across sessions.
System Components and Requirements
Transforms Databricks Unity Catalog tables into a materialized knowledge graph, with ontology design and reasoning exposed as tools via MCP.
yaml
Rules for modifying YAML files (.yaml, .yml) in go-crypto-wallet.
tests-unit
../../.agents/rules/tests-unit.md.
gps-skin-ui
/Users/theodoreaddo/.cursor/rules/gps-skin-ui.mdc.
langgraph-best-practices
Comprehensive reference for building LangGraph agent workflows including core concepts, graph construction patterns, state management, advanced patterns like Send API and Command, and production-ready code examples.