skills/endpoint-validator/SKILL.md
Deterministic API endpoint validation with pass/fail reporting.
npx skillsauth add notque/claude-code-toolkit endpoint-validatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Deterministic HTTP endpoint validation following a Discover, Validate, Report pattern. Finds endpoints, tests each against expectations, and produces machine-readable results with clear pass/fail verdicts and CI-compatible exit codes.
| Signal | Load These Files | Why |
|---|---|---|
| Security header WARNs, HSTS/CSP/X-Frame issues | security-headers.md | Routes to the matching deep reference |
| Config errors, hardcoded IPs, timeout problems | endpoint-config-preferred-patterns.md | Routes to the matching deep reference |
| 401/403 failures, Bearer/API-key/cookie auth | auth-endpoint-patterns.md | Routes to the matching deep reference |
Goal: Locate or receive endpoint definitions before making any requests.
Step 1: Read repository CLAUDE.md
Check for and follow any repository-level CLAUDE.md before running validation. It may contain base URL conventions, environment variable names, or endpoint paths relevant to the project.
Step 2: Search for endpoint configuration
Look for definitions in priority order:
endpoints.json in project roottests/endpoints.jsonPrefer config files checked into version control over ad-hoc endpoint lists. Manually listing endpoints every run leads to drift and missed endpoints.
Step 3: Parse and validate configuration
Configuration must contain base_url and at least one endpoint:
{
"base_url": "http://localhost:8000",
"endpoints": [
{"path": "/health", "expect_status": 200},
{"path": "/api/v1/users", "expect_key": "data", "timeout": 10},
{"path": "/api/v1/search?q=test", "max_time": 2.0}
]
}
Each endpoint supports these fields:
path (required): URL path appended to base_urlexpect_status (default: 200): Expected HTTP status codeexpect_key (optional): Top-level JSON key that must exist in response. Only top-level key presence is checked -- full JSON schema validation is out of scope.timeout (default: 5): Request timeout in seconds. The 5-second default prevents hanging on unresponsive endpoints.max_time (optional): Fail if response exceeds this threshold in secondsmethod (optional): HTTP method. Defaults to GET. POST/PUT/DELETE require explicit configuration with a request body -- send mutating requests only when the user explicitly configures them.headers (optional): Additional headers per endpoint (e.g., Accept, Content-Type, Authorization)If base_url points to a production host and the config includes POST/PUT/DELETE endpoints, warn the user before proceeding. Mutating production data or triggering rate limits during a smoke test is a serious risk. Use staging environments for write operations; reserve production for GET-only health checks.
Use hostnames or environment variables instead of hardcoded IP addresses in base_url (e.g., http://192.168.1.42:8000). They break on every other machine and CI environment. Use localhost with a configurable port or environment variables instead.
Step 4: Confirm base URL is reachable
Make a single request to base_url before running the full suite. If unreachable, report immediately rather than failing every endpoint individually.
Gate: Configuration parsed, base URL reachable, at least one endpoint defined. Proceed only when gate passes.
Opus 4.7 override: Opus 4.7 trades tool calls for reasoning by default. In verification, that default is wrong. Run the command. Do not reason about whether the command would pass. Do not summarize the expected output. Execute the check, paste the exit code, paste the relevant output. A verification phase that produces a verdict without an observed tool result is not a verification — it is a guess with a rigor aesthetic.
Goal: Test each endpoint against its expected criteria and collect structured results.
Step 1: Execute requests sequentially
Test endpoints one at a time for predictable, reproducible output. For each endpoint:
base_url + pathThis skill sends one request per endpoint. It is not a load tester or stress tester -- it validates contract compliance, not throughput.
Step 2: Evaluate against expectations
For each response, check in order:
expect_status? If not, mark FAIL.expect_key set, parse JSON and check key exists. If missing or not valid JSON, mark FAIL.max_time set and elapsed exceeds it, mark SLOW. Flag slow endpoints -- they indicate degradation that becomes failure under load.Strict-Transport-Security -- HSTS enforcement (expected on HTTPS endpoints)Content-Security-Policy -- XSS mitigationX-Content-Type-Options -- should be nosniffX-Frame-Options -- clickjacking prevention (or CSP frame-ancestors)Skip security header checks for localhost/127.0.0.1 endpoints (development environments typically omit these). Only check on non-localhost base URLs unless explicitly configured.
Step 3: Handle failures gracefully
expect_key set: Record as FAIL with "Invalid JSON response"Gate: All endpoints tested. Every result has a clear PASS, FAIL, or SLOW verdict. Proceed only when gate passes.
Goal: Produce structured, machine-readable output with summary statistics.
Step 1: Format individual results
ENDPOINT VALIDATION REPORT
==========================
Base URL: http://localhost:8000
Endpoints: 15 tested
RESULTS:
/api/health 200 OK 45ms
/api/users 200 OK 123ms
/api/products 500 FAIL "Internal Server Error"
/api/slow 200 SLOW 3.2s > 2.0s threshold
SECURITY HEADERS (non-localhost only):
/api/health WARN Missing: Content-Security-Policy, X-Frame-Options
/api/users OK All security headers present
/api/products SKIP (endpoint failed)
Step 2: Produce summary
SUMMARY:
Passed: 13/15 (86.7%)
Failed: 1 (status error)
Slow: 1 (exceeded threshold)
Security header warnings: 3 endpoints missing headers
Step 3: Set exit code
max_time was set)Gate: Report printed, exit code set. Validation complete.
User says: "Validate all endpoints before we deploy" Actions:
endpoints.json in project root (DISCOVER)User says: "Check if the API is still working after the database migration" Actions:
Cause: Service not running, wrong port, or network issue Solution:
ps aux, docker ps, or equivalent)netstat -tlnp or ss -tlnp)Cause: Service overwhelmed, wrong host, or proxy misconfiguration Solution:
curl -vCause: Endpoint returns HTML, XML, or empty body instead of JSON Solution:
expect_key if endpoint legitimately returns non-JSON| Task Type | Load This Reference |
|-----------|-------------------|
| Security header WARNs, HSTS/CSP/X-Frame issues | references/security-headers.md |
| Config errors, hardcoded IPs, timeout problems | references/endpoint-config-preferred-patterns.md |
| 401/403 failures, Bearer/API-key/cookie auth | references/auth-endpoint-patterns.md |
# GitHub Actions example
# TODO: scripts/validate_endpoints.py not yet implemented
# Manual alternative: use curl to validate endpoints from endpoints.json
- name: Validate API endpoints
run: |
jq -r '.endpoints[].path' endpoints.json | while read path; do
curl -sf "$BASE_URL$path" > /dev/null && echo "PASS: $path" || echo "FAIL: $path"
done
# Pre-deployment gate
# TODO: scripts/validate_endpoints.py not yet implemented
# Manual alternative: iterate endpoints.json with curl
jq -r '.endpoints[].path' endpoints.json | while read path; do
curl -sf "http://localhost:8000$path" > /dev/null || { echo "FAIL: $path"; exit 1; }
done
documentation
Document translation: quick/normal/refined modes with chunked parallel subagents and glossary support.
development
AI image generation: Gemini and Nano Banana backends; single/series/batch workflows with prompt-to-disk.
testing
Unified voice content generation pipeline with mandatory validation and joy-check. 13-phase pipeline: LOAD, GROUND, STATS-CHECKPOINT, GENERATE, HOOK-GATE, VALIDATE, REFINE, VARIETY-GATE, JOY-CHECK, ANTI-AI, CLOSE-GATE, OUTPUT, CLEANUP. Use when writing articles, blog posts, or any content that uses a voice profile. Use for "write article", "blog post", "write in voice", "generate content", "draft article", "write about".
documentation
Critique-and-rewrite loop for voice fidelity validation.