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/lay4u/awesome-ai-rules/cursorrulesgit clone --depth 1 https://github.com/Lay4U/awesome-ai-rulesWhat 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.00466 | $0.00466 |
| Opus 5 | $0.00233 | $0.00233 |
| Sonnet 5 | $0.00093 | $0.00093 |
| Haiku 4.5 | $0.00047 | $0.00047 |
Grade A, and why
cursorrules 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 — 48 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Cursor Go Rules
IDE-First Defaults
- Always format on save with
gofmt(orgoimportswhen available). - Never accept code that is unformatted; formatting is non-negotiable.
- Organize imports automatically; avoid manual import micromanagement.
- Keep editor diagnostics on for
go vetandgolangci-lint.
Go Code Style
- Prefer small packages with focused responsibilities.
- Package names must be short, lowercase, and without underscores.
- Prefer composition over inheritance-style embedding chains.
- Avoid
init(); use explicit constructors and setup functions. - Keep exported APIs minimal and stable.
Error Handling
- Use explicit error returns; Go has no exceptions for normal control flow.
- Return early on errors and keep happy-path unindented.
- Wrap errors with
%wwhen adding context. - Compare with
errors.Is/errors.Asinstead of string matching. - Do not swallow errors; either handle, wrap, or return them.
Interfaces and API Design
- Prefer small interfaces (1-3 methods) near the consuming package.
- Accept interfaces in function parameters when behavior is needed.
- Return concrete structs from constructors for better discoverability.
- Avoid exporting interfaces prematurely.
Concurrency and Context
- Pass
context.Contextas the first parameter for request-scoped work. - Never store
context.Contextinside structs. - Use goroutines only with a clear lifecycle and cancellation path.
- Prefer channels for coordination, not as a replacement for all state.
- Close channels only from the sender side.
- Guard shared mutable state with
sync.Mutex/sync.RWMutex.
Testing in the Editor Loop
- Use table-driven tests for branch-heavy logic.
- Run
go test ./...before finalizing changes. - Use
testify/requirefor must-stop assertions andassertfor continued checks. - Keep tests deterministic; avoid sleeps when synchronization primitives are possible.
- Add race checks (
go test -race ./...) when touching concurrency.
Modules and Dependencies
- Use Go modules and keep
go.mod/go.sumin sync. - Prefer standard library packages before adding new dependencies.
- Add dependencies deliberately; remove unused ones promptly.
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 · 48 lines · 466 tokens per session scan A 1e53d9a50f51
cursorrules is a cursor rule published in the GitHub repository Lay4U/awesome-ai-rules (5 stars, last pushed 6mo ago), licensed MIT. It adds 466 tokens to every session, about $0.0023 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-31.
Other cursor rules, from other repositories
database
Drizzle ORM and database conventions for the API package.
react
React and Next.js component conventions.
testing
Testing conventions for Vitest and React Testing Library -- the agent pulls this in when writing or modifying tests.
always
Global project conventions applied to every request.
ankra-cli
Ankra CLI rules and best practices for managing Kubernetes clusters via the Ankra platform.
code-style-consistency-cursorrules-prompt-file
Cursor rules for code development with style consistency integration.