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/nedcodes-ok/cursorrules-collection/ruffgit clone --depth 1 https://github.com/nedcodes-ok/cursorrules-collectionWrote 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/nedcodes-ok/cursorrules-collection/ruff)<a href="https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/ruff"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/ruff.svg" alt="Measured on agentmods" 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 | $0.00555 | $0.00555 |
| Opus 5 | $0.00278 | $0.00278 |
| Sonnet 5 | $0.00111 | $0.00111 |
| Haiku 4.5 | $0.00056 | $0.00056 |
Grade A, and why
ruff 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.
What it actually says
Ruff Cursor Rules
You are an expert in Ruff Python linting and formatting. Follow these rules:
Configuration
- Configure in pyproject.toml [tool.ruff] or standalone ruff.toml — not both
- Set target-version = "py312" (or your minimum Python version) explicitly
- Set line-length = 88 (Black default) or 120 — be explicit, don't rely on default
- Use src = ["src"] to help Ruff resolve first-party imports correctly
Rule Selection
- Start with select = ["E", "F", "W", "I", "UP", "B", "SIM", "N"] for a solid baseline
- Add "S" (bandit) for security, "PT" for pytest style, "D" for docstrings as needed
- Use ignore sparingly and document why: ignore = ["E501"] # handled by formatter
- Use per-file-ignores for test/migration exceptions: {"tests/" = ["S101"], "migrations/" = ["E501"]}
Formatting
- Use ruff format as a drop-in Black replacement — same output, faster
- Don't mix Ruff formatter with Black — pick one
- Set format.quote-style = "double" and format.indent-style = "space" explicitly
- Use ruff check --fix && ruff format for the standard fix-then-format workflow
Import Sorting
- Enable isort rules with "I" in select — Ruff replaces isort entirely
- Configure [tool.ruff.isort] for known-first-party, known-third-party if needed
- Use force-single-line = true if your team prefers one import per line
- Set combine-as-imports = true to group aliased imports
Integration
- Run in CI: ruff check . && ruff format --check .
- Use --fix only in local development, never in CI (CI should fail, not auto-fix)
- Pre-commit hook: use ruff-pre-commit (official) — not generic pre-commit hooks
- VS Code: install charliermarsh.ruff extension, disable pylint/flake8/isort extensions
Noqa & Suppression
- Use inline # noqa: RULE_CODE with specific codes — never bare # noqa
- Use per-file-ignores over blanket noqa comments when an entire file needs exceptions
- Run ruff check --statistics to see which rules fire most — fix patterns, not symptoms
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 · 45 lines · 555 tokens per session scan A 734f16963d36
ruff is a cursor rule published in the GitHub repository nedcodes-ok/cursorrules-collection (37 stars, last pushed 6mo ago), licensed MIT. It adds 555 tokens to every session, about $0.0028 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-09-03.
Other cursor rules, from other repositories
python
Python best practices.
cursorrules
You are building an AI/ML project with Python. The project uses PyTorch for model training, handles data pipelines with proper validation, tracks experiments systematically, and follows production ML engineering practices. Code is type-hinted, tested, and reproducible.
10-backend-fastapi
FastAPI backend rules.
04-kotlin
Cursor rule "04-kotlin" from orbitalsonic/AndroidPilot, covering kotlin rules, prefer, coroutines, null safety and naming.
rule
AI/ML Python development (PyTorch, scikit-learn).
typescript
TypeScript best practices.