| name | pact-contracts |
| summary | Review and harden API tests against route contracts, auth rules, and response envelopes in workshop-exercises. |
| description | Review and harden API tests against route contracts, auth rules, and response envelopes in workshop-exercises. |
Pact Contracts Skill
Use this skill when working on API tests in this repository.
Inputs
- Target route (for example
/api/auth/register)
- Existing test file path
- Desired failure paths to cover
Checklist
- Confirm status code assertions are explicit.
- Confirm response envelope assertions are explicit:
- Success:
response.body.data
- Failure:
response.body.error.code and response.body.error.message
- Confirm auth behavior is covered for protected routes:
- Missing token
- Invalid token
- Valid token
- Confirm sensitive fields are not exposed (for example
passwordHash).
- Confirm test isolation with deterministic reset setup.
Recommended Prompt
Review this API test file against the current Express route contract in src/app.ts.
Identify missing assertions for status, envelope shape, auth behavior, and sensitive field exposure.
Return findings ordered by severity, then propose exact test updates.
Expected Output
- Severity-ordered findings
- Concrete patch suggestions
- Any contract mismatch between tests and route implementation