Python best practices across design patterns, error handling, project structure, and testing. Use when writing Python code, structuring new Python projects, designing APIs for libraries, implementing error handling, or setting up pytest test suites.
Scanned 9/5/2026
Install to Claude Code
npx -y skills add The-AIOS/aios --skill python-best-practices --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Python Best Practices?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/the-aios-python-best-practices)More formats (shields.io, HTML) on the badges page.
---
name: python-best-practices
description: Python best practices across design patterns, error handling, project structure, and testing. Use when writing Python code, structuring new Python projects, designing APIs for libraries, implementing error handling, or setting up pytest test suites.
---
# Python Best Practices
Curated reference for writing production-quality Python — opinionated where it matters, undogmatic where it doesn't.
## When to load which reference
| Working on | Read |
|---|---|
| Module layout, public APIs, package structure | [references/project-structure.md](references/project-structure.md) |
| Design patterns (KISS, SRP, composition, DI) | [references/design-patterns.md](references/design-patterns.md) |
| Validation, exception hierarchies, partial-failure handling | [references/error-handling.md](references/error-handling.md) |
| pytest, fixtures, mocking, parameterization, TDD | [references/testing-patterns.md](references/testing-patterns.md) |
Each reference is an in-depth guide — load only the one relevant to the current task.
## Core principles (all references share)
- **Explicit over implicit** — type hints, named arguments, no magic.
- **Small over abstract** — one function per concept, no premature inheritance.
- **Fail loud at boundaries, validate at the edge** — Pydantic/dataclasses at API surfaces, raw types internally.
- **Test the behavior, not the implementation** — pytest fixtures over class-based setUp, parameterize for variants.
For test-first discipline beyond Python specifics, see [superpowers/test-driven-development](../../superpowers/test-driven-development/SKILL.md).
Is this your skill, or is something wrong with this listing? . Author removals are honored within 72 hours.
No comments yet. Be the first to comment!