api-tester-playbook
Writes an API test playbook covering contracts, authentication, pagination and error handling. Use when building or reviewing API tests.
- License 许可
- MIT
- 所属仓库
- vibbs/company-os
- 最近更新
- 2026-10-21
- Stars
- ★ 6
- Forks
- 2
01 前言 Front Matter
- name
- api-tester-playbook
- description
- Writes an API test playbook covering contracts, authentication, pagination and error handling. Use when building or reviewing API tests.
- user-invocable
- false
03 SKILL.md 正文
API Tester Playbook
Reference
- ID: S-QA-02
- Category: QA
- Inputs: API specification (OpenAPI/Swagger), auth model, endpoint inventory
- Outputs: API test playbook → artifacts/qa/
- Used by: QA Agent
- Tool scripts: ./tools/artifact/validate.sh, ./tools/qa/contract-test.sh
Purpose
Produces a structured API testing playbook that covers contract testing, authentication and authorization edge cases, pagination correctness, rate limiting behavior, and error response validation for every endpoint.
Procedure
- Collect the API specification (OpenAPI/Swagger) or endpoint inventory.
- For each endpoint, generate contract tests: verify response shape matches the schema.
- Design authentication tests: valid tokens, expired tokens, missing tokens, wrong scopes.
- Design authorization tests: tenant isolation, role-based access, resource ownership.
- Design pagination tests: first page, last page, empty results, invalid cursors, page size limits.
- Design error handling tests: 400 (bad input), 404 (not found), 409 (conflict), 429 (rate limit), 500 (server error).
- Design idempotency tests for mutating endpoints (POST, PUT, DELETE).
- Define expected response headers (CORS, cache-control, rate-limit headers).
- Organize tests into a runnable playbook with setup/teardown steps.
- Save the playbook to
artifacts/qa/. - Validate the artifact using
./tools/artifact/validate.sh.
Test Scaffold Generation
After producing the playbook document, generate actual test file scaffolds:
- Read
tech_stack.test_frameworkandtech_stack.languagefromcompany.config.yaml - Generate test files based on stack:
- TypeScript + Jest/Vitest:
tests/integration/api/<endpoint>.test.ts - Python + pytest:
tests/api/test_<endpoint>.py - Go + testing:
internal/<package>/<endpoint>_test.go
- TypeScript + Jest/Vitest:
- Each test file includes: setup/teardown, auth helper, one happy-path test, one error test
- Run
./tools/qa/contract-test.sh <spec> <url>to validate against API spec
The playbook document remains as a companion artifact in artifacts/test-plans/.
Quality Checklist
- [ ] Every endpoint has contract tests
- [ ] Auth edge cases (expired, missing, wrong scope) are covered
- [ ] Authorization boundaries are tested (tenant isolation, RBAC)
- [ ] Pagination is tested for boundary conditions
- [ ] Error responses match documented status codes and shapes
- [ ] Mutating endpoints have idempotency tests
- [ ] Rate limiting behavior is validated
- [ ] Artifact passes validation
04 同仓库更多 Skills
typo-field
Fixture skill with a misspelled top-level field.
spaced-comments
Fixture skill with comments and spaces after block keys.
crlf-comments
Fixture skill with Windows line endings.
claude-fields
Fixture skill using top-level fields Claude Code documents.
workflow-router
Maps an objective to the artifacts, stages and agents it needs. Use when deciding what happens next or which agents to involve.
weekly-review
Summarizes your week: what shipped, AI spend, support themes, security health and next priorities. Use at the end of each week.