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/code-style-and-zen-of-pythongit 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.00003 | $0.00879 |
| Opus 5 | $0.00002 | $0.00439 |
| Sonnet 5 | $0.00001 | $0.00176 |
| Haiku 4.5 | $0.00000 | $0.00088 |
Grade A, and why
code-style-and-zen-of-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 2d 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.
This is a copy
92% identical to code-style-and-zen-of-python — 1 line 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 — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code Style and Zen of Python
Line Length
- Max 88 chars (per Ruff config)
Comments
File-Level Comments
Be THOROUGH at the top of files. Explain what the file does, why it exists, and how it fits into the larger system. This helps both humans and AI understand context quickly.
"""User authentication and session management.
Handles user login, logout, token generation, and session validation.
Integrates with external OAuth providers (Google, GitHub) and maintains
local session state in Redis for performance. Session tokens expire after
24 hours but can be refreshed up to 7 days from initial login.
"""
Function Comments
Keep function docstrings USEFUL without redundant fluff. Type hints already document parameters and return types, so focus the docstring on what the function does and why.
# Standard pattern for complex functions - explain the what and why
def create_agent_from_task(self, task_id: str) -> dict:
"""Create a new agent from a ClickUp task description.
Parses task description for agent requirements, generates the .agent
file with system/user prompts, creates PR with the new file, and
returns PR URL for review.
"""
# Simple functions need just one clear line
def validate_email(email: str) -> bool:
"""Check if email format is valid and domain is not blacklisted."""
def process_payment(order_id: str, amount: Decimal) -> Payment:
"""Charge the customer via Stripe and update order status to paid."""
def send_welcome_email(user: User) -> None:
"""Send onboarding email with account setup instructions."""
def calculate_shipping_cost(weight: Decimal, destination: str) -> Decimal:
"""Calculate shipping based on weight and zone rates from ShipStation."""
Avoid restating type hints in Args/Returns sections - they add no value since types are already declared.
Inline Comments
Be SPARSE with inline comments. Only add them when the code is doing something non-obvious or when explaining business logic that isn't clear from the code itself.
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.
- 2d ago First seen · 120 lines · 3 tokens per session scan A 80d3126da4e1
code-style-and-zen-of-python is a cursor rule published in the GitHub repository TechNickAI/ai-coding-config (24 stars, last pushed 2mo ago), licensed MIT. It adds 3 tokens to every session and 879 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to code-style-and-zen-of-python, differing in 1 line, 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.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
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.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.