Fix Failing Integration Endpoints
Automatically detects and resolves issues in failing API integration endpoints through iterative testing and code modifications.
Goal
Restore full functionality to all integration API endpoints
How to Run
The agent will automatically run integration tests, identify failures, and apply fixes until all tests pass or maximum iterations are reached.
- 01
Initialize Environment
Ensure Node.js, npm, and required dependencies are installed. Navigate to the project directory.
- 02
Execute Loop
Run this prompt in your preferred agent environment (Cursor, Claude Code, etc.). The agent will handle testing and fixes iteratively.
Workflow Steps
- 01
Run integration test suite to identify failing endpoints
- 02
Analyze test failure logs and stack traces to determine root cause
- 03
Implement targeted fixes for identified API endpoint issues
- 04
Re-run integration tests to verify fixes
- 05
If tests still fail and iterations remain, return to step 1
Kickoff Prompt
Start the "Fix Failing Integration Endpoints" loop. Goal: Restore full functionality to all integration API endpoints Max iterations: 10 Between iterations run: npm run test:integration Exit when: All integration tests pass successfully Start by executing 'npm run test:integration' to identify failing API endpoints. For each failing test, analyze the error message and relevant API code to determine the cause. Apply minimal, focused fixes to resolve the issue, then re-run the tests. Continue this process until all integration tests pass or you've reached 10 iterations. Self-pace this loop. After each iteration, run `npm run test:integration` and evaluate the output, and only continue if the exit condition is not met (All integration tests pass successfully). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.
Guardrails
hardcoded- ·Only modify files directly related to API integration endpoints
- ·Maintain backward compatibility with existing API contracts
- ·Ensure all changes are covered by existing or new unit tests
- ·Do not proceed if database connections or external services are unavailable
Flow Diagram
Related loops — API
API
Resolve API Error Responses
This loop standardizes API error responses across the application to improve client-side error handling and debugging. It ensures all error responses follow a consistent structure (e.g., RFC 7807 Problem Details format) with appropriate HTTP status codes and machine-readable error codes.
API
API Performance Budget
A coding loop focused on optimizing API performance to ensure P95 latency stays under a defined target threshold. This loop iteratively runs load tests, analyzes bottlenecks, and implements optimizations until the goal is achieved or maximum iterations are reached.
API
Generate Missing API Docs
Automatically identifies and documents all undocumented API endpoints in the project. The agent iteratively generates OpenAPI/Swagger documentation until all endpoints meet the required documentation standards.