cursorrules

Coding rules for Python 3.12 projects that use FastAPI, a Python web framework, plus Pydantic, SQLAlchemy, uv, and Loguru. They set expectations for naming, formatting, documentation, errors, type hints, and small changes.

In plain words
What is it for?
Writing and reviewing Python web APIs, database code, configuration, logging, and tests while following PEP 8, the common Python style guide.
Why use it?
They give the coding assistant consistent project standards, reducing unclear code, unnecessary complexity, and unintended edits to other files.

Cursor rule for Cursor

Install

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.

agentmods
npx agentmods add rules/mtwn105/decipher-research-agent/cursorrules
Clone the repo
git clone --depth 1 https://github.com/mtwn105/decipher-research-agent

Made for: Cursor.

Per session 324 This file is loaded in full into every session.
When invoked 324 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin 98% copy Near-identical to another mod in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00324 $0.00324
Opus 5 $0.00162 $0.00162
Sonnet 5 $0.00065 $0.00065
Haiku 4.5 $0.00032 $0.00032

Measured yesterday against content hash c1af908fac2d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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 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.

Origin

This is a copy

98% identical to main-rule — 5 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

backend/.cursorrules · 29 lines

What it actually says

You are an expert in Python, FastAPI, and scalable API development.

Here are some best practices and rules you must follow:

  • Python Version: Python 3.12

  • Frameworks and Tools:

    • pydantic
    • fastapi
    • sqlalchemy
    • uv for dependency management
    • loguru for logging

Coding Standards

  1. Use Meaningful Names: Choose descriptive variable, function, and class names.
  2. Follow PEP 8: Adhere to the Python Enhancement Proposal 8 style guide for formatting.
  3. Use Docstrings: Document functions and classes with docstrings to explain their purpose.
  4. Keep It Simple: Write simple and clear code; avoid unnecessary complexity.
  5. Use List Comprehensions: Prefer list comprehensions for creating lists over traditional loops when appropriate.
  6. Handle Exceptions: Use try-except blocks to handle exceptions gracefully.
  7. Use Type Hints: Utilize type hints for better code clarity and type checking.
  8. Avoid Global Variables: Limit the use of global variables to reduce side effects.
  9. Write Minimal Code: Only write the minimum code necessary to achieve the goal. Avoid overengineering.
  10. Don't Modify Other Files Without Permission: Do not make changes in files you weren’t explicitly asked to edit.

Important: Do not write any code until you're at least 95% confident in the requirement. Ask for clarification if needed.

Changes

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.

  1. yesterday First seen · 29 lines · 324 tokens per session scan A c1af908fac2d

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository mtwn105/decipher-research-agent (152 stars, last pushed 1y ago), licensed MIT. It adds 324 tokens to every session, about $0.0016 per session on Opus 5. A static security scan graded it A with 0 findings. It is 98% identical to main-rule, differing in 5 lines, and is treated as a copy.