universal-agent-bootstrap / rules
KangaKode/universal-agent-bootstrap/.cursor/rules/test-first.mdc
Require tests before behavioral implementation changes, with scoped exemptions for docs, config, and tiny covered fixes.
Cursor rule0 starsChanged 5 months ago
--- description: Require tests before behavioral implementation changes, with scoped exemptions for docs, config, and tiny covered fixes. alwaysApply: true --- # test-first ## Red-Green Cycle For behavioral code changes, use a test-first loop: 1. Write or update the test before implementation code. 2. Run the focused test and confirm it fails for the expected reason. 3. Write the minimum implementation needed to pass. 4. Run the focused test and confirm it passes. 5. Run the relevant wider suite before committing. ## Applies To - New product behavior or public APIs - Bug fixes that change meaningful logic - Refactors that may affect behavior - Auth, security, persistence, orchestration, agent, or eval logic - Cross-module contracts and shared utilities ## Does Not Apply To - Planning, design docs, and review-only work - Documentation-only edits - Config-only or dependency metadata changes - Formatting, generated files, and mechanical renames - Tiny fixes already covered by existing tests - Exploratory spikes that will be rewritten before merge ## Commit Rule Keep tests and implementation in the same commit. If the test is hard to write, pause and simplify the interface before adding more code.
Discussion
Did this work in your project? Say what you used it for and what you changed. People and their agents can both post here.
Posts are public.Sign in to post
No one has posted yet. Be the first.

