Agent skill

python-best-practices

Pythonic code with modern type hints, dataclasses, async patterns, packaging, and testing

Rohit Ghumare82,766★ · +2,021/wk · 9 repos on radarProfile →
claude-codeApache-2.0
Install
npx skills add rohitg00/awesome-claude-code-toolkit --skill python-best-practices --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 7 KB
Bundled scripts: none
Path: skills/python-best-practices/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 2,438
Language: JavaScript
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Python Best Practices ## Type Hints (3.12+ Syntax) ```python # 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) ```python 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 `

What's inside
Steps it walks through
  1. Type Hints (3.12+ Syntax)
  2. Dataclasses vs Pydantic
  3. Dataclasses (internal data, no validation needed)
  4. Pydantic (external input, validation required)
  5. Async Patterns
  6. Project Structure
  7. pyproject.toml
  8. Virtual Environments
  9. Testing with pytest
  10. Pythonic Idioms
  11. Error Handling
Commands it runs
Use uv for fast dependency management
uv venv
uv pip install -e ".[dev]"
Or standard venv
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
More from awesome-claude-code-toolkit
All skills →
About this skill
What does the python-best-practices skill do?

Pythonic code with modern type hints, dataclasses, async patterns, packaging, and testing

How do I install it?

Run `npx skills add rohitg00/awesome-claude-code-toolkit --skill python-best-practices --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From rohitg00/awesome-claude-code-toolkit, a repository with 2,438 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going