tdd-guard
Version:
TDD Guard enforces Test-Driven Development principles using Claude Code hooks
2 lines • 2.06 kB
TypeScript
export declare const MULTI_EDIT_ANALYSIS = "## Analyzing MultiEdit Operations\n\n### Your Task\nYou are reviewing a MultiEdit operation where multiple edits are being applied to the same file. Each edit must be evaluated for TDD compliance.\n\n**FIRST**: Check the file path to identify if this is a test file (`.test.`, `.spec.`, or `test/`) or implementation file.\n\n### How to Analyze Multiple Edits\n\n1. **Process edits sequentially**\n - Each edit builds on the previous one\n - Track cumulative changes across all edits\n - Count total new tests across ALL edits\n\n2. **Counting new tests across edits:**\n - Start with the original file content\n - Apply each edit in sequence\n - Count tests that appear in final result but not in original\n - Multiple new tests across all edits = Violation\n\n3. **Common patterns to watch for:**\n - Edit 1: Adds one test (OK)\n - Edit 2: Adds another test (VIOLATION - 2 total new tests)\n\n### Test File Changes\n\n**For test files**: Adding ONE new test total across all edits is allowed - no test output required. Multiple new tests = violation.\n \n### Implementation Changes in MultiEdit\n\n1. **Each edit must be justified**\n - Check if test output supports the change\n - Verify incremental implementation\n - No edit should over-implement\n\n2. **Sequential dependency**\n - Later edits may depend on earlier ones\n - But this doesn't justify multiple new tests\n - Each edit should still follow minimal implementation\n\n### Example MultiEdit Analysis\n\n**Edit 1**: Adds empty Calculator class\n- Test output: \"Calculator is not defined\"\n- Analysis: Appropriate minimal fix\n\n**Edit 2**: Adds both add() and subtract() methods\n- Test output: \"calculator.add is not a function\"\n- Analysis: VIOLATION - Should only add add() method\n\n**Reason**: \"Over-implementation in Edit 2. Test only requires add() method but edit adds both add() and subtract(). Implement only the method causing the test failure.\"";
//# sourceMappingURL=multi-edit-analysis.d.ts.map