Claude Code API Contract Skill for Paginated List Endpoints
Agree on query parameters, response types and empty-page behavior before frontend and backend work diverge.
中文Install in Claude Code
Bring the API and UI requirements for the same feature. A Markdown contract in a scratch project is sufficient.
- Get the complete `plugins/community/sprint/skills/api-contract` directory from the pinned GitHub checkout.
- Copy it under the target project's `.claude/skills/`. Confirm `.claude/skills/api-contract/SKILL.md`, open Claude Code at the project root, and call `/api-contract`.
Example task
Write the contract for `GET /books` with `page` and `limit`. Cover a populated page, a valid empty result and an invalid request.What to check
The same success envelope covers populated and empty lists. The invalid request uses a separately defined error response.
Original SKILL.md on GitHub · Updated
Frequently asked question
Should the contract explain the database query?
Document the request and response behavior clients can observe. Keep persistence implementation in service design.