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 skills/dds-solutions/ai-tadpole-os/python-patternsnpx skills add DDS-Solutions/AI-TadPole-OS --skill python-patternsgit clone --depth 1 https://github.com/DDS-Solutions/AI-TadPole-OSWrote 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/skills/dds-solutions/ai-tadpole-os/python-patterns)<a href="https://agentmods.dev/skills/dds-solutions/ai-tadpole-os/python-patterns"><img src="https://agentmods.dev/badge/skills/dds-solutions/ai-tadpole-os/python-patterns.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.1 | $0.00030 | $0.00825 |
| Opus 5 | $0.00015 | $0.00413 |
| Sonnet 5 | $0.00006 | $0.00165 |
| Haiku 4.5 | $0.00003 | $0.00082 |
Grade A, and why
python-patterns 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.
- **Golden Rule**: Never execute blocking sync calls (`requests.get`, `time.sleep`) inside an async event loop. How it starts
The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.
[!IMPORTANT] AI Context & Knowledge Heritage
- Subsystem: Agent Skills Registry / python-patterns
- Architecture:
@docs ARCHITECTURE:Documentation- Failure Path: Information drift, legacy terminology, or documentation mismatch.
- Observability: Traceability via
execution/parity_guard.py([SKILL])
Python Patterns
Python development principles and decision-making for modern production systems. Learn to THINK, not memorize patterns.
🎯 Progressive Disclosure & L3 Reference Index
Read REQUIRED core logic below; consult deep L3 Reference Guides on demand:
| L3 Reference Guide | Purpose | Trigger / When to Load |
|---|---|---|
references/framework_cheatsheets.md |
FastAPI vs Django vs Flask, async drivers, test fixtures | Framework selection & database setup |
1. Core Decision Trees
🏗️ Framework & Concurrency Selection
What are you building?
├── High-concurrency API / ML Serving ➔ FastAPI (Async, Pydantic v2, ASGI)
├── Full-Stack / Admin Backoffice ➔ Django 5.0+ (Batteries-included, ORM)
├── Lightweight CLI / Script / Worker ➔ Python Standard Library / Click / Typer
└── Background Distributed Tasks ➔ Celery / ARQ (Redis backend)
⚡ Async vs Sync Rules
- Use
async deffor: I/O-bound operations (Database queries, REST API requests, WebSockets, File streams). - Use
def(Sync) for: CPU-bound computation, image processing, or blocking legacy libraries (run via threadpools). - Golden Rule: Never execute blocking sync calls (
requests.get,time.sleep) inside an async event loop.
2. Type Hinting & Validation Standards
from typing import Optional, Union, Callable
from pydantic import BaseModel, Field
# 1. Strict Typing for All Public Interfaces
def process_record(record_id: str, handler: Callable[[dict], bool]) -> Optional[dict]:
...
# 2. Pydantic v2 for Domain Validation & Serialized Contracts
class AgentExecutionRequest(BaseModel):
agent_id: str = Field(..., description="Unique agent identifier")
budget_usd: float = Field(default=1.0, ge=0.01, le=100.0)
strict_sandbox: bool = True
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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 · 82 lines · 30 tokens per session scan A 7d73e74704dc
python-patterns is a skill published in the GitHub repository DDS-Solutions/AI-TadPole-OS (8 stars, last pushed today), licensed MIT. It adds 30 tokens to every session and 825 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
dd-code-generation
Use pup CLI for immediate Datadog operations or generate code for integration into applications.
adding-personhog-rpc
Guide for adding a new RPC to personhog-replica and personhog-router. Covers eligibility checks, proto definition, code generation for Python and Node.js clients, Rust implementation (storage trait, postgres queries, service handler, router wiring), and index compatibility validation. Use when adding a new gRPC…
splitting-oversized-modules
Split an oversized Python module (a thousand-plus-line logic.py, models.py, api.py, or its test file) into a package of one module per concern, mechanically and provably without changing behavior. Use on a request to split / break up / decompose a god module or move functions out of one, once a human has agreed to…
writing-dataclasses
House rules for Python dataclasses in PostHog: when to reach for one instead of a tuple or dict[str, Any], which decorator to use (@frozen from posthog.dataclasses), how to name, construct, consume and evolve them, how to keep secrets out of repr, and when a function should accept a dataclass instead of its unpacked…
extending-personhog-test-harness
When and how to add scenarios, chaos events, and invariants to the personhog e2e test harness (rust/personhog-test-harness). Use after fixing a bug or regression in the personhog leader path (leader, router, writer, replica, coordination protocol) so the fix gets a permanent regression scenario; when adding a new…
migrating-llm-gateway-callers
Migrates an LLM caller from services/llm-gateway to PostHog/ai-gateway. Use when adding a gateway caller, converting an existing Python gateway integration, adopting shared Go-capable client builders, changing gateway URLs or headers for a caller, or removing a Python fallback. Inventories the caller's contract…