Instead of one massive prompt, chain smaller focused prompts:
Step 1: Research → “Analyze this codebase and list all API endpoints with their purposes”
Step 2: Plan → “Given these endpoints, design a test strategy covering edge cases”
Step 3: Implement → “Write integration tests for these 3 critical endpoints following the strategy”
Step 4: Review → “Review these tests for coverage gaps and race conditions”
Each step produces focused, high-quality output. The chain naturally creates checkpoints where you can course-correct before the next step.