contractlisted
Install: claude install-skill createusernam/setup_project
# /contract — Contract-First Development
## Why this skill exists
From the Anthropic Applied AI talk on long-running agents (May 2026): the generator and the evaluator **must negotiate, on disk, what "done" means — before any code is written**. Self-evaluation is a trap; a standalone critic tuned against a concrete contract is tractable.
But "done means" cannot just be acceptance criteria. To run **autonomous** cycles without a human in the loop, the contract must also fix:
1. **User flow** — JTBD-framed primary path + error paths. The evaluator replays it via Playwright.
2. **Integrations** — API endpoints, request/response shapes, error codes, data flow across boundaries. Otherwise the generator hallucinates contracts on the fly.
3. **Acceptance criteria** — 15-30 granular, weighted, machine-verifiable rules.
Vague spec → vague critique → the generator shrugs. **27 granular criteria** (Anthropic's example) plus a fixed user flow and API spec → the agent knows exactly what fails and where.
## Where this fits in the pipeline
```
/grill-with-docs (with design lens if frontend) →
/planning-with-files →
[project setup: /design-rubric — ONE TIME if first frontend feature] →
[frontend: /design-first — wireframe → APPROVE → api-contract.json] →
/contract ← YOU ARE HERE
→ /to-issues
→ /build-loop OR /tdd
→ /code-review-expert
→ ship
```
The contract is the **hard gate** before any autonomous cycle.