Python Library
Use for Python packages published internally or externally, or any codebase where imports and public APIs are contracts.
Defaults
- Package manager: uv
- Build backend: existing backend, often hatchling
- Format/lint: Ruff
- Type check: ty and/or pyright when configured
- Tests: pytest
- Docs: load
skills/docs/SKILL.md - Final checks: load
skills/verification/SKILL.md
Workflow
- Inspect
pyproject.toml, package layout, exports, examples, README, tests, and build config. - Identify public API: modules, imports, functions, classes, CLI entrypoints, documented examples.
- Preserve compatibility unless the user explicitly asks for a breaking change.
- Keep package metadata, dependencies, optional extras, and entrypoints explicit.
- Verify behavior, imports, packaging, and docs/examples touched by the change.
Public API Rules
- Treat exported imports as contracts.
- Keep public facade explicit, usually
__init__.pyorapi.py. - Deprecate before breaking when practical.
- Avoid surprising import-time side effects.
- Keep examples aligned with real API.
- Do not leak internal module layout into public imports unless intentional.
Suggested Layout
src/myapp/
├── __init__.py
├── api.py
├── core/
└── integrations/
tests/
├── unit/
├── integration/
└── compatibility/
Verification
- package import path
- public API behavior tests
- README/example commands when touched
uv build- configured format, lint, type, tests