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/technickai/ai-coding-config/python-coding-standardsgit clone --depth 1 https://github.com/TechNickAI/ai-coding-configWhat 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.00008 | $0.01255 |
| Opus 5 | $0.00004 | $0.00628 |
| Sonnet 5 | $0.00002 | $0.00251 |
| Haiku 4.5 | $0.00001 | $0.00126 |
Grade A, and why
python-coding-standards scanned grade A with 1 finding 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
response = requests.get(url) This is a copy
88% identical to python-coding-standards — 26 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.
How it starts
The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python Guidelines
Imports - NON-NEGOTIABLE
ALL imports go at the top of the file. Every single one. If you're even thinking about putting an import inside a function, stop.
Exception: circular import issues (genuinely rare).
Don't abbreviate packages ("pandas" not "pd", "numpy" not "np").
Modern Python
We use python 3.13+ and follow modern best practices:
- Use
Pathlib for files instead ofopen - Use
var!sinstead ofstr(var) - Prefer walrus operator (:=) to reduce repetition in code
- Use modern union syntax
X | Yinstead ofUnion[X, Y] - Use underscore separators in large numbers:
Decimal(1_000_000)notDecimal("1000000")
Attribute and Method Naming
We make everything public by default. We're all consenting adults here.
Only use underscore prefix (_internal) when accessing something would genuinely break
functionality - like thread locks or internal state that must be accessed through
methods. This is extremely rare.
Async vs Sync
Default to synchronous code. We use Celery for background jobs with multiple workers, so we don't need async to free up CPU. Synchronous code is simpler, easier to debug, and easier to maintain.
When given a choice between sync and async, we choose sync.
def fetch_data(url: str) -> dict:
response = requests.get(url)
return response.json()
If a library only provides async API, we can wrap it with asyncio.run():
import asyncio
def sync_wrapper(param: str) -> dict:
"""Synchronous wrapper for async-only library"""
return asyncio.run(async_library_call(param))
Async is appropriate for WebSocket connections, async-only libraries that can't be easily wrapped, or specific performance-critical paths where async provides clear, measured benefits. Ask for confirmation before introducing async patterns.
Exception Handling - READ THIS COMPLETELY
DO NOT SWALLOW ERRORS. This is the hill we die on.
Default: let exceptions bubble up. We use Sentry for centralized error tracking, so exceptions that bubble up get caught and reported automatically - we get alerted and can fix them. Write functions with NO try/except:
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 · 170 lines · 8 tokens per session scan A 7ef969c73603
python-coding-standards is a cursor rule published in the GitHub repository TechNickAI/ai-coding-config (24 stars, last pushed 2mo ago), licensed MIT. It adds 8 tokens to every session and 1,255 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). It is 88% identical to python-coding-standards, differing in 26 lines, and is treated as a copy.
Other cursor rules, from other repositories
infra-devops
Infrastructure, Cloud, Terraform, Docker & CI/CD Agent.
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.