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 Global-mindee/WAY --skill python-best-practicesgit clone --depth 1 https://github.com/Global-mindee/WAYWrote 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/global-mindee/way/python-best-practices)<a href="https://agentmods.dev/skills/global-mindee/way/python-best-practices"><img src="https://agentmods.dev/badge/skills/global-mindee/way/python-best-practices/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/global-mindee/way/python-best-practices"><img src="https://agentmods.dev/badge/skills/global-mindee/way/python-best-practices.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.00024 | $0.01901 |
| Opus 5 | $0.00012 | $0.00950 |
| Sonnet 5 | $0.00005 | $0.00380 |
| Haiku 4.5 | $0.00002 | $0.00190 |
Grade A, and why
python-best-practices 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 6d 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 — 283 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python Best Practices
Type Hints (3.12+ Syntax)
# Use built-in generics (3.9+), no need for typing.List, typing.Dict
def process_items(items: list[str]) -> dict[str, int]:
return {item: len(item) for item in items}
# Union with | syntax (3.10+)
def find_user(user_id: int) -> User | None:
...
# Type parameter syntax (3.12+)
type Vector[T] = list[T]
type Matrix[T] = list[Vector[T]]
def first[T](items: list[T]) -> T:
return items[0]
# TypedDict for structured dicts
from typing import TypedDict
class UserResponse(TypedDict):
id: int
name: str
email: str
active: bool
Always type function signatures. Use mypy --strict or pyright in CI. Use type: ignore comments sparingly with justification.
Dataclasses vs Pydantic
Dataclasses (internal data, no validation needed)
from dataclasses import dataclass, field
@dataclass(frozen=True, slots=True)
class Point:
x: float
y: float
def distance_to(self, other: "Point") -> float:
return ((self.x - other.x) ** 2 + (self.y - other.y) ** 2) ** 0.5
@dataclass
class Config:
host: str = "localhost"
port: int = 8080
tags: list[str] = field(default_factory=list)
Use frozen=True for immutable value objects. Use slots=True for memory efficiency.
Pydantic (external input, validation required)
from pydantic import BaseModel, Field, field_validator
class CreateUserRequest(BaseModel):
model_config = {"strict": True}
email: str = Field(max_length=255)
name: str = Field(min_length=1, max_length=100)
age: int = Field(ge=13, le=150)
@field_validator("email")
@classmethod
def validate_email(cls, v: str) -> str:
if "@" not in v:
raise ValueError("Invalid email format")
return v.lower()
Rule: Use dataclasses for domain models and internal structs. Use Pydantic for API boundaries, config files, and external data parsing.
Async Patterns
import asyncio
import httpx
async def fetch_user(client: httpx.AsyncClient, user_id: int) -> User:
response = await client.get(f"/users/{user_id}")
response.raise_for_status()
return User(**response.json())
async def fetch_all_users(user_ids: list[int]) -> list[User]:
async with httpx.AsyncClient(base_url="https://api.example.com") as client:
tasks = [fetch_user(client, uid) for uid in user_ids]
return await asyncio.gather(*tasks)
async def process_with_semaphore(items: list[str], max_concurrent: int = 10):
semaphore = asyncio.Semaphore(max_concurrent)
async def bounded_process(item: str):
async with semaphore:
return await process_item(item)
return await asyncio.gather(*[bounded_process(i) for i in items])
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.
- 6d ago First seen · 283 lines · 24 tokens per session scan A fc78210958dd
python-best-practices is a skill published in the GitHub repository Global-mindee/WAY (11 stars, last pushed 2d ago), licensed MIT. It adds 24 tokens to every session and 1,901 once invoked, about $0.0001 per session on Opus 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-09-03.
Other skills, from other repositories
temporal-python-testing
Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.
test-corpus
The testdocuments submodule is a bucket-fetched fixture corpus that is not committed. This skill covers readtestfixture, missing fixtures, valid A/B controls, and submodule push order. Load before running Rust tests on a fresh clone, setting up an A/B control, adding a fixture-backed test, or diagnosing…
python-providers
Create, modify, test, or package Python provider adapters under python/providers, including framework-specific dependencies, public imports, type inference, and provider metadata. Use for Python provider work only; use python-sdk for core SDK changes.
adk-verify-snippets
Checks that every Python code block in a Markdown file actually compiles and runs, by extracting each block to a temporary file, executing it in an isolated subprocess, and writing a pass/fail report with per-snippet coverage. Use when the user asks to verify, test, or validate the code samples in a README, a guide…
adk-setup
Sets up a local ADK Python development environment in a git clone of the open-source adk-python repository: a uv virtual environment, all dependency extras, pre-commit hooks, and a first unit-test run. Runs only when explicitly requested, never on its own. Use when asked to set up, bootstrap, or repair a development…
typescript
TypeScript strict mode with eslint and jest.