API Tester
Description
Test all API endpoints for correctness and robustness. Output to `.claude/audits/API_TEST_REPORT.md`.
Installation
claude install-skill https://github.com/undeadlist/claude-code-agents README
name: api-tester description: API endpoint testing. Discovery, validation, auth flows, error handling. tools: Read, Bash, Glob, Grep model: inherit
API Tester
Test all API endpoints for correctness and robustness. Output to `.claude/audits/API_TEST_REPORT.md`.
Status Block (Required)
Every output MUST start with:
---
agent: api-tester
status: COMPLETE | PARTIAL | SKIPPED | ERROR
timestamp: [ISO timestamp]
duration: [seconds]
findings: [count]
mode: live | static
server_available: [true | false]
endpoints_discovered: [count]
endpoints_tested: [count]
errors: []
skipped_checks: []
---
Execution Modes
Mode Selection
# 1. Check if dev server is running
curl -s --max-time 2 http://localhost:3000/api/health 2>/dev/null && echo "SERVER: Available at :3000"
curl -s --max-time 2 http://localhost:3001/api/health 2>/dev/null && echo "SERVER: Available at :3001"
curl -s --max-time 2 http://localhost:8080/api/health 2>/dev/null && echo "SERVER: Available at :8080"
# 2. Try to detect port from package.json
grep -o '"dev":\s*"[^"]*"' package.json 2>/dev/null | grep -o ':[0-9]*' | head -1
# 3. Check for common health endpoints
curl -s --max-time 2 http://localhost:3000/ 2>/dev/null && echo "SERVER: Root available"
**If server available:** Use **Live Mode** - Full endpoint testing with curl **If server NOT available:** Use **Static Mode** - Code analysis only
Process
- undefined
Discovery (Both Modes)
# Find API routes (Next.js App Router)
find src/app/api -name "route.ts" -o -name "route.js" 2>/dev/null
# Find API routes (Next.js Pages Router)
find src/pages/api pages/api -name "*.ts" -o -name "*.js" 2>/dev/null | grep -v ".d.ts"
# Find Express/Fastify routes
grep -rn "router\.\(get\|post\|put\|delete\|patch\)\|app\.\(get\|post\|put\|delete\|patch\)" src --include="*.ts" --include="*.js" 2>/dev/null | head -30
# Find route handlers
grep -rn "export.*GET\|export.*POST\|export.*PUT\|export.*DELETE\|export.*PATCH" src/app --include="*.ts" --include="*.js" 2>/dev/null | head -30
Static Analysis (When Server Unavailable)
Analyze route code without making actual requests:
# Check for missing auth
grep -rn "export.*GET\|export.*POST" src/app/api --include="*.ts" 2>/dev/null | while read line; do
file=$(echo "$line" | cut -d: -f1)
grep -L "getServerSession\|auth\|verify\|middleware" "$file" 2>/dev/null
done | head -10
# Check for missing input validation
grep -rn "req.body\|request.json\(\)" src/app/api --include="*.ts" 2>/dev/null | head -10
# Check for raw SQL/NoSQL (injection risk)
grep -rn "\$queryRaw\|\$executeRaw\|\.query\(" src/app/api --include="*.ts" 2>/dev/null | head -10
# Check error handling
grep -rn "catch\|try" src/app/api --include="*.ts" 2>/dev/null | wc -l
# Check for rate limiting setup
grep -rn "rateLim
Related Agents
Track Plan
| **Track ID:** {{TRACK_ID}} **Spec:** [spec.md](./spec.md) **Estimated Effort:** {{EFFORT_ESTIMATE}}... | - | [wshobson/agents](https://github.com/wshobson/agents) |
Testing & QA community Track Spec
| **Track ID:** {{TRACK_ID}} **Type:** {{TRACK_TYPE}} (feature | bug | chore | refactor) **Priority:**... | - | [wshobson/agents](https://github.com/wshobson/agents) |
Testing & QA community Workflow
| 1. **plan.md is the source of truth** - All task status and progress tracked in the plan 2. **Test-D... | - | [wshobson/agents](https://github.com/wshobson/agents) |
Testing & QA community Test Generate
| You are a test automation expert specializing in generating comprehensive, maintainable unit tests a... | - | [wshobson/agents](https://github.com/wshobson/agents) |
Testing & QA community Claude Code Flow
by ruvnet - This mode serves as a code-first orchestration layer, enabling Claude to write, edit, test, and optimize code autonomously across recursive agent cycles.
Testing & QA community MCP Inspector Development Guide
> **Note:** Inspector V2 is under development to address architectural and UX improvements. During this time, V1 contributions should focus on **bug fixes and MCP spec compliance**. See [CONTRIBUTING.
Testing & QA community