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/document-modulegit 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.00020 | $0.01281 |
| Opus 5 | $0.00010 | $0.00641 |
| Sonnet 5 | $0.00004 | $0.00256 |
| Haiku 4.5 | $0.00002 | $0.00128 |
Grade A, and why
document-module 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 2d 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 — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Document a Module
Thesis: Use this when documenting an existing module.
plan-feature.mdcplans forward. This documents backward — capturing what was built, why, and how it behaves.
Order of Operations
- Schema first — read the migrations in
backend/migrations/to understand tables, enums, relationships, indexes - Service logic — each service module lives in its own subpackage at
backend/internal/service/<module>/. Read<module>.go(plus split files likeauth_password.go,auth_verify.go) for business rules, auth checks, transactions, status transitions - Handler surface — read
backend/internal/handler/*.gofor request validation and response shapes; route registration lives inbackend/internal/wire/routes.go - Frontend routes — read
frontend/src/routes/(private)/*.tsxfor pages, modals, state management - Write the spec — fill
docs/modules/_templates/spec.mdand save it todocs/modules/{module}/spec.md
Evidence Standards
- Every business rule must be marked:
[Verified: service/auth/auth.go, Refresh()]— confirmed by reading the code[NEEDS VERIFICATION]— inferred from naming or partial evidence
- Do NOT invent business rules. If you can't confirm it, mark it unverified.
- Use function names in
[Verified:]annotations, not line numbers. Line numbers drift with every PR; function names are stable. - File paths are good — they can be verified with
lsorglob. Include them freely.
Anti-Rot Rules
These are the #1 source of documentation staleness. Follow strictly:
- Never put exact line counts in docs. Use complexity tiers (Low/Medium/High/Critical) or approximate scale (
~3k lines). Exact counts are wrong after the next PR. - Never list code quality issues (missing error handling, unused imports, dead code) in docs. Those are linter/grep concerns, not documentation. They go stale the moment someone cleans up code.
- Do list architectural concerns (file too large for splitting, duplicated utility, drift risk between frontend/backend). These change rarely and help future developers.
- Never put exact line numbers in Known Issues. Use function names or describe the pattern.
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.
- 2d ago First seen · 96 lines · 20 tokens per session scan A 62bb8051e21e
document-module is a cursor rule published in the GitHub repository golid-ai/golid (40 stars, last pushed 2mo ago), licensed MIT. It adds 20 tokens to every session and 1,281 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
cursorrules
AGENTS.md.
git-commits
Git commit safety — commits are human-only; AI suggests, never executes.
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.
token-optimization
Agent-mode tool-call efficiency. Cuts the largest hidden cost in modern AI IDEs — wasted tool calls and oversized context windows.
config-resilience
Config warn-and-continue for non-sensitive keys; Auth/ACL/JWT/secrets/DB credentials fail closed.