custom-plan
Create a structured feature plan using PLAN + WORKING_MEMORY + USER_VERIFICATION (tasklist) files
Analyze API endpoints, identify test gaps, update test script, and run API tests
How it fires
How this command gets triggered: by you, by Claude, or both.
/test-apiContext preview
What this command does when you run it.
Analyze API endpoints, identify test gaps, update test script, and run API tests
description: "Analyze API endpoints, identify test gaps, update test script, and run API tests" allowed-tools: ["bash", "read", "write", "edit", "glob", "grep"]
Analyzes the API server endpoints, compares against existing test coverage, identifies gaps, updates the test script, and runs the tests.
1. **Analyzes API Server Code**
2. **Analyzes Existing Test Coverage**
3. **Identifies Test Gaps**
4. **Updates Test Script**
5. **Runs Tests**
/test-api
/test-api --start-server
/test-api --analyze-only
/test-api --update-only
When you run `/test-api`, I will:
Read the API server implementation:
For each discovered endpoint, extract:
Follow imports to handler files:
Read `scripts/test_api.sh` and extract all `run_test` calls.
Parse test definitions to extract:
Build a map of tested endpoints.
Compare discovered endpoints (Step 1) with tested endpoints (Step 2).
For each untested endpoint, classify as:
Group gaps by API domain (infer from path prefix).
For each gap, generate test cases following the existing pattern from `test_api.sh`:
run_test "POST /api/resource create valid" POST "/api/resource" 200 '{"field":"value"}' || failures=$((failures+1))
run_test "POST /api/resource missing field" POST "/api/resource" 400 '{}' || failures=$((failures+1))
run_test "GET /api/resource/:id not found" GET "/api/resource/does-not-exist" 404 || failures=$((failures+1))For each endpoint, generate:
Insert new tests into appropriate sections in `test_api.sh`:
Look for multi-step workflows that need testing:
For recently modified files (use git to detect), add integration tests that verify:
Check if server is running:
curl -sS http://localhost:3001/health > /dev/null 2>&1
If `--start-server` flag is present and server is not running:
pnpm dev > /tmp/dexto-dev-server.log 2>&1 & echo $! > /tmp/dexto-dev-server.pid sleep 10 # Wait for server startup
Execute tests:
bash scripts/test_api.sh
Report results with summary.
If server was started by this script:
kill $(cat /tmp/dexto-dev-server.pid) 2>/dev/null || true rm -f /tmp/dexto-dev-server.pid /tmp/dexto-dev-server.log
Follow these patterns when generating tests:
# Create
run_test "POST /api/<example> create" POST "/api/<example>" 201 '{"name":"test"}' || failures=$((failures+1))
# List
run_test "GET /api/<example> list" GET "/api/<example>" 200 || failures=$((failures+1))
# Get by ID
run_test "GET /api/<example>/:id" GET "/api/<example>/test-id" 200 || failures=$((failures+1))
# Update
run_test "PUT /api/<example>/:id" PUT "/api/<example>/test-id" 200 '{"name":"updated"}' || failures=$((failures+1))
# Delete
run_test "DELETE /api/<example>/:id" DELETE "/api/<example>/test-id" 200 || failures=$((failures+1))run_test "POST /api/<example> missing required field" POST "/api/<example>" 400 '{}' || failures=$((failures+1))
run_test "POST /api/<example> invalid type" POST "/api/<example>" 400 '{"name":123}' || failures=$((failures+1))run_test "GET /api/<example>/:id not found" G
Agent harness and tookit for building AI agents and agentic applications. CLI and SDKs included
Create a structured feature plan using PLAN + WORKING_MEMORY + USER_VERIFICATION (tasklist) files
Analyze a file or folder for code slop and quality issues compared to main branch
Start the Dexto development server with optional agent file selection
Update Agent Registry documentation to match agent-registry.json
Update MCP Registry documentation to match server-registry-data.json