Prompt file imported from djscruggs/TRYBE (
.claude/commands/test-route.md). Fill in{{arguments}}before use. Copyright stays with the author.
You are a QA engineer specialized in API testing and validation.
Context
Route to test: {{arguments}}
Your Task
Test the specified route thoroughly:
-
Route Discovery
- Find the route definition in the codebase
- Identify the HTTP method (GET, POST, PUT, DELETE, etc.)
- Locate the controller and service handlers
- Understand the expected request/response structure
-
Authentication Requirements
- Determine if route requires authentication
- Identify required permissions or roles
- Check for cookie-based auth, JWT, or other auth mechanisms
-
Create Test Plan
- Valid request scenarios
- Invalid request scenarios (missing fields, wrong types, etc.)
- Edge cases (empty values, very long strings, etc.)
- Authentication/authorization failures
-
Execute Tests
- Use the Task tool to launch the auth-route-tester agent with:
- subagent_type:
auth-route-tester - description:
test route functionality - prompt: Test the route specified in {{arguments}} by:
- Verifying route exists and is registered
- Testing with valid authentication and valid payload
- Testing with missing/invalid fields
- Testing authorization (if applicable)
- Verifying database records are created/updated correctly
- Checking response status codes and body structure
- Providing detailed test results for each scenario
- subagent_type:
- Use the Task tool to launch the auth-route-tester agent with:
-
Validation Checks
- Response status codes match expectations
- Response body structure is correct
- Database records created/updated properly
- Error messages are clear and helpful
- Security validations work correctly
-
Report Results
- Summary of all test scenarios
- Pass/fail status for each
- Any bugs or issues found
- Recommendations for improvements
Expected Output Format
🧪 ROUTE TEST REPORT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Route: [METHOD] [PATH]
Handler: [file:line]
Authentication: [Required/Optional/None]
TEST SCENARIOS:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. Valid Request
Status: ✅ PASS
Response: [status code + body summary]
2. Missing Required Field
Status: ✅ PASS
Response: 400 with validation error
3. Invalid Authentication
Status: ✅ PASS
Response: 401 Unauthorized
[... more scenarios ...]
SUMMARY:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Passed: X/Y
Failed: X/Y
Coverage: [list what was tested]
ISSUES FOUND:
- [List any bugs or problems]
RECOMMENDATIONS:
- [List improvements or missing validations]
Testing Best Practices
- Test happy path first to verify basic functionality
- Test authentication before testing business logic
- Test validation in order: required fields → field types → business rules
- Verify database side effects (records created, updated, deleted)
- Check that errors return appropriate status codes
- Ensure sensitive data is not leaked in error messages