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/btseee/clean-code-skills/clean-codegit clone --depth 1 https://github.com/btseee/clean-code-skillsWhat 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.01307 | $0.01307 |
| Opus 5 | $0.00654 | $0.00654 |
| Sonnet 5 | $0.00261 | $0.00261 |
| Haiku 4.5 | $0.00131 | $0.00131 |
Grade A, and why
clean-code 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 yesterday.
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 — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Clean Code
Use these rules for every coding task in Cursor.
Clean Code Rules (clean-code-skills)
These rules govern all code you write, edit, review, test, or refactor in this project, in any language or framework. They are the non-negotiable summary; the full skill has the reasoning, the workflows, and the checklists.
Read the skill before non-trivial work. First existing path wins: .claude/skills/clean-code/SKILL.md, .agents/skills/clean-code/SKILL.md, .github/skills/clean-code/SKILL.md, skills/clean-code/SKILL.md. Its references/ folder holds the depth: architecture.md, principles.md, smell-triage.md, session-protocol.md, new-project.md, project-refactor.md, audit-report.md.
Load project context first. Read .clean/context.json, .clean/architecture.md, .clean/decisions.md, and .clean/ledger.md if they exist, then the project's own instruction files. A recorded decision is settled. A declared architecture outranks your instincts. Project instructions outrank this block.
Work Loop
- Frame: name the behavior change, the assumptions that affect design, the smallest scope, and the check that will prove it.
- Read first: nearby code, naming, tests, error style, framework idioms. Search for an existing implementation before writing anything new.
- Place: decide which unit owns the responsibility and which side of which boundary it sits on.
- Edit surgically: smallest diff that solves the task; targeted edits over whole-file regeneration; remove what your change orphaned; no unrelated changes.
- Verify: run the narrowest meaningful check, then broader checks as risk demands. Never claim success without evidence.
- Review the diff: dead code, duplication, mixed responsibilities, wrong-way dependencies, swallowed errors, wrong-place files, missing tests.
Dependency Direction
- Source dependencies point inward, toward higher-level policy. Nothing in an inner layer may name anything in an outer one — no class, function, variable, annotation, or data format.
- Business rules are the highest level. The database, web, UI, framework, and delivery mechanism are details. When policy needs something from a detail, declare the interface on the policy side and implement it outside.
- All SQL stays in the data-access layer. Rows, result sets, ORM types, and framework request or response objects never travel inward — pass a simple structure shaped for the inner side.
- Never derive a business object from a framework base class or annotate one. Keep dependency-injection wiring in
main. - Keep the component graph acyclic. Do not add a boundary, layer, or service you cannot justify now.
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.
- yesterday First seen · 73 lines · 1,307 tokens per session scan A 3ad86c73ed92
clean-code is a cursor rule published in the GitHub repository btseee/clean-code-skills (7 stars, last pushed 11d ago), licensed MIT. It adds 1,307 tokens to every session, about $0.0065 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
lean
The smallest working change. Efficiency is not carelessness. Active during delivery in the aiops bundle; off during grill/alignment.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.