/py-pit:implementation-protocolfrom py-pit
Orchestrates feature implementation with a behavior-first, minimal-patch discipline. Defines observable success criteria before coding, enforces a contract between intent, change, and proof.
Ships in py-pit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill orchestrates how you turn a feature request into a verified, reviewable change. It is not about writing code — it is about enforcing a contract between intent, change, and proof.
The discipline here exists because the most common failure mode for AI-driven implementation is overbuilding: hallucinated architecture, speculative abstractions, scope creep, and "looks correct" completion without proof. This skill prevents all of that by anchoring every action to observable behavior and failing signals.
Never start with implementation. Start by defining what success looks like in concrete, observable terms.
Before touching any code, establish:
Before proceeding, produce a short ledger that makes the rest of the process auditable. Write it in conversation (or in .dev/todos/<feature>.md if the user prefers a file). The ledger has four sections:
## Behaviors
- [ ] B1: POST /items returns 201 with created item
- [ ] B2: POST /items with missing name returns 422
- ...
## Files to change
- src/api/routes/items.py (new router)
- src/models/item.py (new model)
- ...
## Tests to add/update
- tests/test_items.py::test_create_item (B1)
- tests/test_items.py::test_create_item_missing_name (B2)
- ...
## Proof commands
- uv run pytest tests/test_items.py
- uv run pytest tests/ (full suite)
- uv run ruff check .
Every behavior gets an ID (B1, B2, ...). Every test references the behavior it proves. Every file references the behavior it serves. In Phase 3, every diff line must trace back to a behavior ID in this ledger. In Phase 6, every behavior must have a passing test.
This is what makes "every diff line maps to a behavior" auditable instead of rhetorical.
Not every request arrives fully specified. The rule for ambiguity:
This preserves momentum. Models tend to over-ask, and premature clarification stalls more implementations than it saves. When in doubt, pick the simpler reading, document it, and move.
The ledger's ## Tests to add/update section is your test plan. Write those tests now - they should fail, confirming the behavior doesn't exist yet. If they pass before you've written any implementation, either the tests are wrong or the feature already exists. Treat these tests as hypotheses until Phase 4 validates them.
Before writing any implementation, understand how the codebase already does things. Search before you infer. Infer before you invent.
Specifically, answer:
If the repo has a skills/ plugin or CLAUDE.md with conventions, follow those. If a sibling skill (uv, click-cli, fastapi-errors, sqlalchemy-models, pydantic-schemas, etc.) covers part of the work, defer to it rather than reinventing.
When multiple plausible implementation paths exist, prefer the one most consistent with the nearest existing feature, even if another path seems cleaner. "Nearest" means: same domain, same module, or most similar in shape to what you're building.
This is a hard tie-breaker, not a suggestion. If the repo puts business logic in route handlers and you think it belongs in a service layer, you put it in route handlers. The time to introduce a new pattern is when the user explicitly asks for one, not when you're implementing a feature.
The first implementation must be the smallest change that plausibly satisfies the behavior. This is a hard constraint, not a suggestion.
Concretely:
Every line in your diff must map to a required behavior from Phase 1. If a change cannot be justified by a specific behavior — remove it. This is the single most important discipline in this entire skill. Scope creep is how agents drift, and it happens silently, one "helpful" addition at a time.
If your diff introduces changes that are not referenced in the ledger, you are overbuilding. Stop and remove them.
Verification is adversarial. Your job is to try to break your own solution.
Run, in order:
If anything fails, you are now in the iteration loop (Phase 5). Do not declare the task done because "the main path works."
Tests you just wrote might be:
If a test passed suspiciously easily, or if it tests something trivial, examine it critically. A good test would fail if the feature were removed.
Progress is driven by failing signals, not intuition.
The loop:
Do not wander. Do not fix things that aren't failing. Do not "improve" code that passes its tests. The failing signal tells you exactly where to focus.
If you find yourself making changes without a corresponding failing signal, stop and ask: what behavior am I trying to satisfy? If you can't name one, you're drifting.
The task is done when — and only when — all of these are true:
The task is not done when:
If you cannot check a box, go back to the relevant phase.
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (robhowley/py-pit-skills) — no native marketplace selected
npx claudepluginhub p/robhowley-py-pit16 skills in this plugin
/alembic-migrationsProduction-safe Alembic migration workflows for SQLAlchemy 2.x projects. Use this skill when adding Alembic, generating migrations, reviewing autogenerate diffs, fixing broken migrations, or establishing a safe schema evolution workflow in a Python backend./background-jobs-boundariesGuardrails for background work in FastAPI and Python services. Prevent misuse of in-process background execution (e.g. FastAPI BackgroundTasks)./click-cliDesign, generate, and improve Python CLIs using the Click library. Focus on idiomatic architecture, command groups, modular layouts, CLI UX conventions, and avoiding common Click anti-patterns.Other plugins' skills for the same job