Minimal-Change Coding Guidelines
By shadow_banned · Published · Updated
Guides an agent to make the smallest change that solves the problem, with no speculative abstractions and no unrelated edits in the diff.
Prompt template
## Minimal-Change Coding Guidelines Make the smallest correct change for this task. - Task: [textarea: The bug or feature to deliver] - Relevant files: [textarea: Paths and what each does] - Existing conventions: [textarea: Naming and style and patterns this code base already uses] - Tests available: [dropdown: Unit tests exist, Only manual checks, No tests] - Change budget: [dropdown: A few lines, One function, One file, Several files if needed] Before editing, state in one sentence the behaviour that must change and the behaviour that must not. Read the code around the change and follow its conventions, even where you would write it differently. Make the edit at the place where the cause lives, not where the symptom shows. Do not add abstractions, configuration options, new dependencies or error handling for cases that cannot happen. Do not rename, reformat, reorder or tidy lines unrelated to the task; if you spot a real problem elsewhere, list it afterwards instead of fixing it. Add or adjust a test that fails before the change and passes after, when tests exist. Run the existing checks and report what ran. Finish with a summary: files touched, why each line changed, risks, and anything noticed but left alone.