--- name: ecommerce-test-repair description: 'Fix failing backend and frontend tests, then rerun them. Use for investigating test failures, repairing code or tests, and repeating the loop until suites pass or blockers are documented.' argument-hint: 'Describe whether to fix all current failures or only backend or frontend test failures' --- # Ecommerce Test Repair ## When to use - After the test-implementation step finds failures. - When backend or frontend automated tests are red. - When regressions appear after refactors, SEO changes, or feature work. ## Goal - Analyze failing tests honestly. - Fix the underlying code or the tests, whichever is actually wrong. - Rerun the affected suites. - Produce or update .ai/TEST-REPAIR.md with failure analysis, fixes applied, rerun results, and remaining blockers. ## Required workflow 1. Read the latest .ai/TEST-REPORT.md if it exists. 2. Inspect actual failing output rather than guessing. 3. Before serious backend or frontend edits, create a timestamped snapshot under .backup/ and keep that folder append-only. 4. Classify failures using [failure triage checklist](./assets/failure-triage-checklist.md). 5. Fix root causes instead of patching symptoms when possible. 6. Rerun the affected tests. 7. Repeat until the suite is green or real blockers remain. 8. Write or update .ai/TEST-REPAIR.md using [test repair template](./assets/test-repair-template.md). ## Constraints - Do not weaken tests just to make them pass. - Do not rewrite assertions into meaninglessness. - Do not ignore failing tests without documenting the blocker. ## Outputs - Code or test fixes. - Rerun results. - .ai/TEST-REPAIR.md. ## References - [failure triage checklist](./assets/failure-triage-checklist.md) - [test repair template](./assets/test-repair-template.md)