Change code safely
For a small, well-understood task use Code; for a large one, prepare a plan in Plan first.
-
Describe the expected behavior and what must not change. State a verifiable criterion, such as a specific test or a build configuration.
-
Limit the changes with an Edit Scope. For files that must never be changed in any task, use
.writeignore.Edit Scope limits the files and folders the agent may change.
-
Ask the agent to first find the related usages and existing tests, then make the minimal edits.
-
Ask it to run the narrowest suitable test, then a broader configuration if your project rules require it.
-
Open Agent Changes, review every changed file, and reject unrelated edits.
-
For an independent check, run Auto Review. How to handle the issues it finds is described in the reviewing the agent's changes route.
Example prompt:
Change the validation in this method so that an empty name is rejected before
the repository is called. Work only in the attached files and do not change the
public API. Find the existing tests, make the minimal edit, and run the matching
IDE test configuration. At the end, list the changed files and the run result.