blob: a5b38ad199e673ad4e5a84bbdcbfef71cac07c10 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# Refactor
Improve the structure, readability, or maintainability of existing code while preserving behavior unless a behavior change is explicitly requested.
## Instructions
- Inspect the existing implementation before proposing changes.
- Identify the concrete problem the refactor should solve.
- Preserve public behavior and interfaces unless explicitly required otherwise.
- Prefer small, understandable transformations.
- Follow existing project conventions.
- Avoid introducing abstractions without a clear benefit.
- Avoid unrelated cleanup.
- Update affected tests when necessary.
- Run relevant validation after the refactor.
## Before finishing
Verify that:
- intended behavior is preserved
- tests still pass or have been appropriately updated
- no unnecessary dependencies or abstractions were introduced
- the resulting code is simpler or clearer than before
|