About python-services
A skill for Python service and CLI work, aimed at developers implementing or reviewing Python systems. It emphasizes validated boundaries, restrained concurrency, idempotency, and project checks.
Key features
- 01Validate inputs and responses
- 02Handle concurrency and cancellation
- 03Set timeouts and permitted retries
- 04Enforce job idempotency
- 05Preserve API and migration behavior
- 06Run pytest, Ruff, and ty checks
Use cases
- 01Reviewing external API validation
- 02Implementing resilient background jobs
- 03Configuring Python CLI and tests
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ iliaal/ ai-skills --skill python-servicesAfter installing, type/python-servicesin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
SPEC.mdreferences/cli-tools.mdconcurrency-and-resilience.mdfastapi.mdservice-boundaries.mdtooling-and-tests.mdDetails
From the project READMEPython Services & CLI
Working rules
- Validate external inputs and responses at boundaries; preserve exception causes.
- Keep missing results distinct from empty results. When an empty collection means success, require the response field instead of defaulting it to empty; an all-default model can validate
{}as success. Test missing, misspelled, explicitly empty, and populated payloads through the real validation boundary. - Keep simple sequential work synchronous. Bound concurrent work, preserve cancellation, and keep task references.
- Give network calls timeouts; retry only failures and operations whose semantics permit it.
- Enforce job idempotency with atomic writes and database constraints.
- Preserve published API behavior and shared migration history.
- Match telemetry to an operational question and verify its output.
Discipline
- Simplicity first: every change as simple as possible, impact minimal code
- Only touch what's necessary; avoid introducing unrelated changes
- No hacky workarounds: if a fix feels wrong, step back and implement the clean solution
- Before adding a new abstraction, verify it appears in 3+ places. If not, inline it.
- Verify: see Verify section below; pass all checks with zero warnings before declaring done
Verify
uv run pytestpasses with zero failuresuv run ruff check .passes with zero warningsuv run ty check .passes with zero errors- Coverage target: 80%+ (
uv run pytest --cov; add--cov-report=htmlfor a browsable report)
Task-specific references
Read the relevant reference before implementing or reviewing the matching behavior:
- For packaging, environment configuration, CLI setup, or pytest behavior: tooling-and-tests.md.
- For asyncio, background jobs, retries, pooling, timeouts, or health checks: concurrency-and-resilience.md.
- For APIs, validation, errors, migrations, logging, metrics, or traces: service-boundaries.md.
Existing specialized references, when the corresponding topic applies:
Comments
Markdown supported