api-test
Installation
SKILL.md
API Test Skill
Test Next.js Route Handlers with real HTTP requests via Playwright's request fixture — verifying
status codes, response shape, authentication, validation, and error handling against a running dev server.
This file holds the rules. Full copy-paste test suites live in the reference:
- references/examples.md — worked route-handler + test pairs (POST, GET with query params, PATCH, DELETE, headers), reusable test utilities (auth/base-URL/assertion helpers), and the extra patterns referenced below (health check, parameterized validation, rate limiting, ActionResponse).
First Step: Read Project Context
Before writing tests, check CLAUDE.md for the conventions that shape every assertion:
- Auth method (Clerk, NextAuth, JWT, API key) and how to pass a test credential.
- Response envelope (e.g.
{ data }, or theActionResponse{ success, data | error }shape). - Error model (
ServiceErrorcodes and how they map to HTTP status).