Api test
Skill xvirobotics/metaskill/examples/fullstack-web/.claude/skills/api-test
Metaskill: A Meta-Skill for Autonomous AI Agent Team Generation
npx -y skills add xvirobotics/metaskill --skill api-testAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
What its author says it does
Copied from the file, not written here
Run API integration tests against the running backend, verify endpoints return expected responses and status codes. Use after deploying a preview or starting the dev server.
SKILL.md
3.7 KB, 942 tokens by cl100k_base, as published. Nobody here has run it
You are an API integration test agent. Your job is to verify that all API endpoints are responding correctly by running integration tests against a live server.
Current State
Current branch: !git branch --show-current
Recent changes: !git diff --name-only HEAD~3 2>/dev/null || echo "fewer than 3 commits"
Test Procedure
Step 1: Verify Server is Running
curl -sf http://localhost:3000/api/health && echo "Server is healthy" || echo "Server is not responding"
If the server is not running, report that the server must be started first (with npm run dev or /deploy-preview) and stop.
Step 2: Run Integration Tests
Run the API integration test suite:
DATABASE_URL="${DATABASE_URL_TEST:-postgresql://test:test@localhost:5432/myapp_test}" npx vitest run --config vitest.integration.config.ts 2>/dev/null || npx vitest run tests/integration/ 2>/dev/null || npx vitest run --grep "integration|api|endpoint"
If a dedicated integration test config or directory exists, use it. Otherwise, run tests that match integration/API patterns.
Step 3: Manual Endpoint Verification
If integration tests are not set up yet, manually verify key endpoints:
Health Check:
curl -s -w "\nHTTP_STATUS:%{http_code}" http://localhost:3000/api/health
Auth Endpoints (if they exist):
# Register
curl -s -w "\nHTTP_STATUS:%{http_code}" -X POST http://localhost:3000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]","password":"TestPass123!","name":"Test User"}'
# Login
curl -s -w "\nHTTP_STATUS:%{http_code}" -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]","password":"TestPass123!"}'
List Endpoints (verify pagination):
curl -s -w "\nHTTP_STATUS:%{http_code}" http://localhost:3000/api/users?page=1&limit=10
Validation Testing (send invalid data):
curl -s -w "\nHTTP_STATUS:%{http_code}" -X POST http://localhost:3000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"not-an-email"}'
Expected: 400 status with validation error envelope.
404 Handling:
curl -s -w "\nHTTP_STATUS:%{http_code}" http://localhost:3000/api/nonexistent
Expected: 404 status with error envelope.
Step 4: Check Response Format Consistency
For each response, verify:
- Success responses use
{ "data": ... }envelope - Error responses use
{ "error": { "code": "...", "message": "..." } }envelope - List responses include pagination meta:
{ "data": [...], "meta": { "total": N, "page": N, "limit": N } } - Content-Type header is
application/json
Report Format
## API Test Results
**Server:** http://localhost:3000
**Status:** PASS / FAIL
### Endpoint Results
| Method | Endpoint | Expected | Actual | Status |
|--------|----------|----------|--------|--------|
| GET | /api/health | 200 | [code] | pass/fail |
| POST | /api/auth/register | 201 | [code] | pass/fail |
| POST | /api/auth/login | 200 | [code] | pass/fail |
| GET | /api/users | 200 | [code] | pass/fail |
| POST | /api/auth/register (invalid) | 400 | [code] | pass/fail |
| GET | /api/nonexistent | 404 | [code] | pass/fail |
### Response Format Checks
- JSON envelope consistency: pass/fail
- Error format consistency: pass/fail
- Pagination meta present on list endpoints: pass/fail
### Issues Found
[List any failures with details]
### Summary
[Tested N endpoints, M passed, K failed]
Gives 0 of the 12 instructions most test skills give in 942 tokens
Counted across 964 of the 1,571 authors here whose files we hold, read 2026-08-06
- close the browser when donein 55 of 964, across 12 files
- wait for network idle statein 51 of 964, across 6 files
- launch chromium in headless modein 49 of 964, across 6 files
- use descriptive selectors for elementsin 49 of 964, across 6 files
- run provided scripts with help flag firstin 49 of 964, across 6 files
- add appropriate explicit waitsin 48 of 964, across 5 files
- use bundled scripts as black boxesin 46 of 964, across 3 files
- do not read script source codein 46 of 964, across 3 files
- use sync playwright for scriptsin 46 of 964, across 3 files
- inspect dom before executing actionsin 46 of 964, across 3 files
- run the full test suitein 36 of 964, across 34 files
- write the failing test firstin 25 of 964, across 18 files
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.