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.
git clone --depth 1 https://github.com/iloveitaly/llm-ide-rulesWrote 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/iloveitaly/llm-ide-rules/python)<a href="https://agentmods.dev/rules/iloveitaly/llm-ide-rules/python"><img src="https://agentmods.dev/badge/rules/iloveitaly/llm-ide-rules/python/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/iloveitaly/llm-ide-rules/python"><img src="https://agentmods.dev/badge/rules/iloveitaly/llm-ide-rules/python.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00759 | $0.00759 |
| Opus 5.5 | $0.00304 | $0.00304 |
| Sonnet 5.5 | $0.00152 | $0.00152 |
| Haiku 4.5 | $0.00076 | $0.00076 |
Grade A, and why
python 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 22d 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 — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python
When writing Python:
- Assume the latest python, version 3.13.
- Prefer Pathlib methods (including read and write methods, like
read_text) overos.path,open,write, etc. - docstrs and comments:
- If a docstring needs formatting, use markdown. Use Google Style.
- Prefer docstr to multi-line comments at the top of a function or file.
- If a docstr does not span multiple lines, do not use triple-quoted strings.
- If a comment or docstr is a single line, do not end it in a period.
- Add a newline after all docstrs.
- Do not create
__init__files unless specifically instructed - Use Pydantic models over dataclass or a typed dict.
- Use SQLAlchemy for generating any SQL queries.
- Use
clickfor command line argument parsing. - Use
log.info("the message", the_variable=the_variable)instead oflog.info("The message: %s", the_variable)orprintfor logging. This object can be found atfrom app import log.- Log messages should be lowercase with no leading or trailing whitespace.
- No variable interpolation in log messages.
- Do not coerce database IDs, dates, or Path objects to
str
- Do not fix import ordering or other linting issues.
- Never edit or create any files in
migrations/versions/ - Place all comments on dedicated lines immediately above the code statements they describe. Avoid inline comments appended to the end of code lines.
- Do not
try/catchrawExceptionsunless explicitly told to. Prefer to let exceptions raise and cause an explicit error. - Always make an explicit copy before mutating a dictionary that you did not create in the current narrow scope.
- Never use
from __future__ - Always use
re.compile(pattern, re.VERBOSE)and inline#comments to document the logic of each capture group or condition in any complex regular expression. - IMPORTANT never edit app/generated/ files. These are autogenerated.
Package Management
- Use
uv addto add python packages. No need forpip compile,pip install, etc.
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.
- 22d ago Changed · -1 lines 803e8bfe5de0
- 24d ago Changed · -6 tokens per session f0e2b798ae59
- 1mo ago First seen · 75 lines · 765 tokens per session scan A d4fb2f1051fb
python is a cursor rule published in the GitHub repository iloveitaly/llm-ide-rules (13 stars, last pushed yesterday), licensed MIT. It adds 759 tokens to every session, about $0.0030 per session on Opus 5.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
pyspark-etl-best-practices-cursorrules-prompt-file
Cursor rules for PySpark ETL development with code style, joins, window functions, map operations, and Iceberg patterns.
python-llm-ml-workflow-cursorrules-prompt-file
Cursor rules for Python LLM & ML development with workflow integration.
automl-hyperparameter-optimization
AutoML and hyperparameter optimization rules for Python ML projects using Ray Tune, Optuna, PyCaret, and time-series AutoML libraries.
agent-model-choice
User-owned model choice and settings notices.
11-prompt-maintainer
Checklist when touching prompt builders, agent fragments, or MCP tool docstrings.
llm-integration-rules
A set of rules for connecting an application to a large language model, including Python wrappers, API endpoints, asynchronous calls, retries, and key management.