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.
npx agentmods add rules/golid-ai/golid/write-rulesgit clone --depth 1 https://github.com/golid-ai/golidWhat 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 | $0.00022 | $0.00939 |
| Opus 5 | $0.00011 | $0.00469 |
| Sonnet 5 | $0.00004 | $0.00188 |
| Haiku 4.5 | $0.00002 | $0.00094 |
Grade A, and why
write-rules 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 3d 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 — 103 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Writing Cursor Rules
Thesis: Every rule opens with a thesis. The thesis is the contract — everything below it is the implementation.
Structure
-
Thesis (required) — one sentence after the heading. States what the rule enforces and why. This is the most important line — a thesis enables the AI to generalize to novel situations; a pointer only enables pattern-matching.
-
Refrain (optional) — a short verb-driven phrase that captures the rule's rhythm. Only add one when the rule describes a natural action sequence. Good:
Validate → Authorize → Execute → Respond(verbs with momentum). Bad:Config → Env → Script → Constructor(nouns — a process label, not a refrain). -
Reference files — "Follow the established patterns in X" goes here, not in the thesis. The thesis says what; references say where.
-
Sections — BAD/GOOD examples for the highest-consequence patterns. Keep examples minimal — one BAD, one GOOD, showing the exact mistake and fix.
When to Create a New Rule
- A pattern has been explained 3+ times across conversations
- A bug was caused by violating a convention that isn't written down
- A new file category has no glob coverage
When to Extend an Existing Rule
- The new guidance applies to the same file glob
- It's a sub-pattern of an existing rule's thesis
Updating Rules During Execution
When a code change invalidates or reveals a gap in an existing rule, update the rule in the same pass — not as a follow-up task. Stale rules are worse than missing rules because they actively mislead.
Update triggers (only these — don't edit rules speculatively):
- Bug fix exposed an unwritten convention → add to the relevant domain rule
- Refactor moved/renamed files referenced by a rule → update the references
- New pattern discovered (naming conflict, type safety convention) → add to the rule covering that file category
- Audit finding that should be enforced going forward → add to audit checklist AND the relevant domain rule
- A repeated implementation miss exposes a workflow gap → update the workflow
rule that owns the missed step, not just the local domain rule. Example:
missed OpenAPI/spec/frontend type sync belongs in
slice-and-shipcloseout.
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.
- 3d ago First seen · 103 lines · 22 tokens per session scan A ec52d48d1866
write-rules is a cursor rule published in the GitHub repository golid-ai/golid (40 stars, last pushed 2mo ago), licensed MIT. It adds 22 tokens to every session and 939 once invoked, about $0.0001 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
adapter-features
Database-specific features must be implemented in the specialized adapter only. Base adapters (postgres, mysql, etc.) must remain database-agnostic.
unit-tests-tdd
TDD required for behavior changes; ≥80% package coverage on touched packages; unit-test conventions.
backend
You are an expert in Go, Gin, Gorm, Gen, Cosy (https://cosy.uozi.org/) with a deep understanding of best practices and performance optimization techniques in these technologies.
version-management
Automatically commit and push changes after completing any feature, bug fix, or significant addition.
architecture
Feature-first architecture boundaries for enjoyplayer.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.