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 skills add chandrudp29/skillhub --skill python-patternsgit clone --depth 1 https://github.com/chandrudp29/skillhubWrote 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/chandrudp29/skillhub/python-patterns)<a href="https://agentmods.dev/skills/chandrudp29/skillhub/python-patterns"><img src="https://agentmods.dev/badge/skills/chandrudp29/skillhub/python-patterns/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/skills/chandrudp29/skillhub/python-patterns"><img src="https://agentmods.dev/badge/skills/chandrudp29/skillhub/python-patterns.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.00041 | $0.01531 |
| Opus 5.5 | $0.00016 | $0.00612 |
| Sonnet 5.5 | $0.00008 | $0.00306 |
| Haiku 4.5 | $0.00004 | $0.00153 |
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 1mo 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
result = requests.get(url) # blocks the event loop for everyone How it starts
The opening of the file, as written. The whole thing — 209 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python Patterns
Modern Python (3.10+) patterns for production code. Specific, opinionated, actionable.
When to Use
- Writing new Python modules or services
- Reviewing Python code for quality
- Modernizing Python 2-era or early Python 3 code
- Debugging subtle Python behavior
Type Hints
Always type hint public functions. It's documentation that tools can check.
# Good — clear what goes in and what comes out
def chunk_text(text: str, max_tokens: int = 512) -> list[str]:
...
# Good — complex types use type aliases
from typing import TypeAlias
JsonDict: TypeAlias = dict[str, "JsonValue"]
JsonValue: TypeAlias = str | int | float | bool | None | list["JsonValue"] | JsonDict
# Good — use | for unions (Python 3.10+), not Optional
def find_user(user_id: int) -> User | None:
...
# Good — use dataclass for structured data, not plain dicts
from dataclasses import dataclass, field
@dataclass
class EmbeddingResult:
text: str
vector: list[float]
model: str
token_count: int
metadata: dict[str, str] = field(default_factory=dict)
Async Patterns
Use async for I/O-bound work. Don't use it for CPU-bound work.
import asyncio
import httpx
# Good — concurrent I/O with asyncio.gather
async def fetch_all(urls: list[str]) -> list[dict]:
async with httpx.AsyncClient() as client:
tasks = [client.get(url) for url in urls]
responses = await asyncio.gather(*tasks, return_exceptions=True)
return [r.json() for r in responses if not isinstance(r, Exception)]
# Good — async context manager for resource cleanup
class DatabasePool:
async def __aenter__(self):
self._conn = await connect()
return self._conn
async def __aexit__(self, *args):
await self._conn.close()
# Good — async generator for streaming
async def stream_llm_response(prompt: str):
async with client.stream("POST", "/completions", json={"prompt": prompt}) as r:
async for chunk in r.aiter_lines():
if chunk:
yield chunk
# BAD — blocking I/O in async code
async def bad_example():
import requests
result = requests.get(url) # blocks the event loop for everyone
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.
- 1mo ago First seen · 209 lines · 41 tokens per session scan A 8df2c537650e
python-patterns is a skill published in the GitHub repository chandrudp29/skillhub (14 stars, last pushed 3mo ago), licensed MIT. It adds 41 tokens to every session and 1,531 once invoked, about $0.0002 per session on Opus 5.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-08-30.
Other skills, from other repositories
asyncio-concurrency-patterns
Complete guide for asyncio concurrency patterns including event loops, coroutines, tasks, futures, async context managers, and performance optimization.
fastapi
Use when building, reviewing, testing, securing or shipping a FastAPI / async Python service — routers, Pydantic v2 schemas, dependency injection, async SQLAlchemy 2.0, OAuth2/JWT, ASGITransport tests, production wiring. NOT language-level Python or packaging (that is python), NOT engine-level SQL (that is…
python
Use when the task is Python itself, in any framework or none: PEP 695 generics, mypy --strict typing, dataclass/Protocol/TypedDict/Enum choices, asyncio.TaskGroup, stdlib idioms, src/ layout + pyproject.toml with uv, ruff+mypy+pytest gate. NOT a FastAPI/ASGI service (that is fastapi), NOT a deep pytest suite (that is…
pypi-release
This skill should be used when releasing tunacode-cli to PyPI. It keeps the existing local release checks, then hands the actual PyPI upload to a GitHub Actions workflow that uses the repository's PYPIAPITOKEN secret.
fastapi-expert
Expert-level FastAPI development for high-performance Python APIs with async support. Use when the user mentions Python, API, async, REST, OpenAPI, or Pydantic, or when the task involves FastAPI Features.
plugin-system
Generic plugin system for Python applications. Auto-discovery, validation, fault tolerance. Zero dependencies (Python stdlib only).