Preserve existing behavior
Updated 2026-02-13
Do not change behavior or add "improvements" unless explicitly requested; avoid altering semantics of existing code. Use in any AI-assisted editor.
Use in Cursor, Windsurf, Codeium, or any AI-assisted editor.
Rule
# Preserve existing behavior
Do **not** change the behavior of existing code unless the user explicitly asks for a behavior change.
- **Semantics:** Fixing a bug means making the code match the intended behavior the user describes—not "improving" logic in unrelated ways.
- **Avoid:** "While I was here" changes: performance tweaks, API simplifications, or style changes that alter what the code does.
- **Refactors:** If you rename, move, or restructure code, ensure observable behavior (outputs, side effects, edge cases) stays the same unless the user requested a change.