Code Quality Fix All
Fix code quality issues identified in a code quality review. This skill systematically addresses issues found by the code-quality-review-all skill for ANY code quality topic, with validation and testing at each step.
Expected Arguments
When invoked, this skill expects the path to a code quality topic as an argument (e.g., agent_artefacts/code_quality/private_api_imports).
If not provided, the skill will ask the user for the topic path. Within the topic path, there are several files:
- README.md - contains description of the issue and examples of how to fix it
- results.json - contains list of all identified issues
- SUMMARY.md - contains summary of the identified issues
Filters and options are specified interactively after the skill starts by using the AskUserQuestion tool to present options unless specified otherwise in arguments.
- Which issue types to target:
- all
- specific types
- Fix complexity level (easy only, medium and below, or all)
- Which evaluations to fix (all, specific ones, evaluations with small number of issues)
- Maximum number of issues to fix in this run
Workflow
Phase 1: Understanding the Topic and Planning
Read topic documentation
- Read the README.md to understand:
- What code quality issue this topic addresses
- Why it matters (stability, maintainability, etc.)
- How to detect the issue
- How to fix the issue (fix patterns, examples)
- Read results.json to get all identified issues
- Identify which issues are in scope based on arguments
Analyze and categorize issues
- Analyze fix complexity based on:
- issue_description
- suggested_fix from results.json
- Fix examples in README.md
- Classify as:
- Easy: Single-line changes, clear fix pattern in README
- Medium: Multi-line changes, well-documented fix approach
- Hard: No clear fix pattern, requires research or copying code
- Group issues by evaluation and issue type
- Generate statistics for presenting to user
Ask user for filtering preferences
- Use
AskUserQuestion tool to ask:
- Which evaluations to fix? (all / specific ones / most affected)
- Which issue types to target? (all / specific types)
- Fix complexity level? (easy only / easy+medium / all)
- Max issues per run? (all / limit to specific number)
- Apply filters based on user responses
- Present filtered plan with:
- Number of issues to fix
- Breakdown by evaluation and issue type
- Complexity distribution
- Ask for final confirmation to proceed
Validate understanding of fixes
- For each unique issue type in scope:
- Check if README.md documents how to fix it
- Look for "Good Examples" and "Bad Examples" sections
- Check "suggested_fix" field in results.json
- If fix approach is unclear for any issue type:
- Research the correct approach
- Update
<topic>/README.md with findings
- Ask user for guidance if still uncertain
Phase 2: Pre-Fix Validation
For each issue to be fixed:
Read and understand context
- Read the entire file containing the issue (not just the line)
- Understand how the problematic code is used
- Look for related issues in the same file
- Check for patterns that might affect the fix (e.g., multiple occurrences)
- Identify any cascading changes needed (related imports, type hints, etc.)
Validate the suggested fix
- Review the "suggested_fix" from results.json
- Check against fix patterns in README.md
- Verify the fix won't break functionality
- For complex fixes:
- Check if dependencies/alternatives actually exist
- Validate that replacement code follows same patterns
- Consider edge cases
Estimate change scope
- Count how many lines will change for this fix
- Identify if cascading changes are needed
- Determine if multiple files need updating
- If changes exceed 100 lines for a single issue:
- Alert user with:
- Issue details
- Why the change is large
- What will change
- Get explicit approval before proceeding
Phase 3: Applying Fixes
Apply fixes systematically
- Process one evaluation at a time
- Within each evaluation, group by issue type
- For each fix:
- Use Edit tool to apply the change
- Follow the suggested_fix guidance
- Apply fix patterns from README.md
- Handle related issues in same file together
- Add comments if the fix requires it (e.g., copied code attribution)
- Track what was fixed
Verify changes compile/parse
- After fixing each file, validate:
- File is syntactically valid (Python can parse it)
- No obvious import errors introduced
- Code follows repository patterns
- If validation fails:
- Investigate the issue
- Attempt to fix validation error
- Rollback change if cannot be resolved
Track progress
- Maintain list of:
- Issues successfully fixed (file, line, issue type)
- Issues that couldn't be fixed (with reasons)
- Evaluations that have been modified
- Files that were changed
Phase 4: Testing and Validation
Run linting
- Run repository's linter on modified files (ruff, flake8, mypy, etc.)
- Check for:
- Import errors
- Type checking errors
- Style violations introduced
- Fix any linting issues that result from changes
- If linting issues can't be fixed, document them
Run unit tests
Identify test files for each modified evaluation
Run unit tests for affected evaluations using pytest:
Basic test commands:
# Run tests for a specific evaluation
uv run pytest tests/<evaluation_name>/
# Run a specific test file
uv run pytest tests/test_file.py
# Run a specific test
uv run pytest tests/test_file.py::TestClass::test_method
# Run slow tests (excluded by default)
uv run pytest --runslow tests/
# Skip dataset download tests
uv run pytest -m 'not dataset_download' tests/
# Run only slow tests
uv run pytest -m slow tests/
Test markers to be aware of:
@pytest.mark.slow - Tests taking >10 seconds
@pytest.mark.dataset_download - Tests that download datasets
@pytest.mark.docker - Tests using Docker
@pytest.mark.huggingface - HuggingFace-related tests
Focus on tests for the specific evaluation
Look for test failures or errors
IMPORTANT: Do NOT run full evaluations (they take too long) unless user explicitly requests it
Handle test failures
- For each test failure:
- Read test output carefully
- Determine if failure is caused by the fix
- Check if it's a pre-existing failure
- If caused by fix:
- Try to adjust the fix to make tests pass
- If cannot be resolved, rollback the change
- Document the issue for user review
- If pre-existing:
- Note it but don't block on it
- Inform user
Phase 5: Re-Review and Handle Remaining Issues
Update results.json with fix status
For each issue that was fixed, add "fix_status" field after "suggested_fix":
{
...
"suggested_fix": "...",
"fix_status": "fixed - please review"
}
For issues that couldn't be fixed, add explanation:
"fix_status": "not fixed - reason: ..."
IMPORTANT: Do NOT remove any entries from results.json - only add/update "fix_status"
The code-quality-review-all skill owns results.json and is responsible for removing entries
Re-run code quality review
- IMPORTANT: Use Task tool to spawn subagent running code-quality-review-all skill
- Pass the same topic path
- This will update results.json with current state
- Compare results before and after to identify:
- Issues that are now resolved (no longer appear)
- New issues that may have been introduced
- Issues that still remain despite fix attempts
Fix remaining issues if in scope
- For each new or remaining in-scope issue:
- Investigate why previous fix didn't work
- Attempt alternative fix approach
- Update "fix_status" with attempt results
- Repeat this process until no more in-scope issues can be fixed
Update topic's README.md
- Add any knowledge that you have discovered that will be useful in detecting or fixing topic-related issues in the future
- Do not remove examples of bad code or patterns that were fixed - they will be useful in future reviews and fixes of future evaluations.
Update SUMMARY.md
- Add a "Recent Fixes" section with:
- Date of fix run
- Number of issues fixed
- Which evaluations were updated
- Keep historical data (don't remove past information)
- Update recommendations to reflect remaining work
Run markdown linters
- Use
uv run pre-commit run markdownlint-fix to fix markdown linting issues
Phase 6: Create PR Description and Present Results
Create/Update PR description (cumulative)
Read existing PR_DESCRIPTION.md if it exists (from previous runs)
Cumulative tracking: PR description represents ALL changes from branch base, not just this run
If PR_DESCRIPTION.md exists:
- Parse existing content to extract previous runs' data
- Append information from this run
- Update cumulative statistics
If PR_DESCRIPTION.md doesn't exist (first run):
Format for GitHub/GitLab pull request with:
- Summary: Brief overview of the code quality topic and total fixes (2-3 sentences)
- Overall Changes (cumulative from all runs):
- Total issues fixed across all runs by type
- Total evaluations affected
- Total files modified
- Fix Sessions: List each run session with:
- Date/time of run
- Issues fixed in that session
- Complexity level targeted (easy/medium/all)
- Fixed Issues (cumulative): Table or list with all file paths and issue types from all runs
- Testing (from latest run):
- Which tests were run
- Pass/fail status
- Any test issues encountered
- Remaining Issues (current state):
- Count of issues still open
- Brief note on what remains
- Review Notes (cumulative):
- Any complications or special considerations from any run
- Areas that need extra attention during review
Use proper markdown formatting for PR readability
IMPORTANT: Do NOT commit PR_DESCRIPTION.md - it's only for creating the PR
Example structure:
## Summary
Fix private API imports code quality issues across evaluations.
## Overall Changes
- Total issues fixed: 25
- Evaluations affected: 8
## Fix Sessions
### Session 1: 2026-01-18 10:30 (Easy issues)
- Fixed 10 easy issues
- Targeted: Easy complexity, All evaluations
### Session 2: 2026-01-18 14:15 (Medium issues)
- Fixed 15 medium issues
- Targeted: Medium complexity, Specific evaluations
## Fixed Issues
[Table of all fixed issues from all sessions]
## Testing
[Latest test results]
## Remaining Issues
6 issues remain (4 hard, 2 require investigation)
## Review Notes
- Session 1: All tests passed
- Session 2: One test required adjustment in fortress/scorer.py
Present results to user
- Show high-level summary for this run:
- X issues fixed in this session
- Y issues remain
- Z tests passed
- Show cumulative progress from PR_DESCRIPTION.md:
- Total issues fixed across all runs
- Number of fix sessions completed
- Show before/after statistics from SUMMARY.md
- List modified files from this run
- Display content of PR_DESCRIPTION.md for user review
- Do NOT automatically commit - let user review changes
Offer next steps
- Create commit and PR: Offer to:
- Commit all changes (source files, results.json, SUMMARY.md)
- Create pull request with description from PR_DESCRIPTION.md
- Note: PR_DESCRIPTION.md itself is NOT committed (it's just for PR description)
- The PR description includes cumulative changes from all fix sessions on this branch
- Run more fixes: If issues remain, suggest running skill again with different filters
- Running again will append to PR_DESCRIPTION.md, creating cumulative tracking
- This allows iterative fixing: easy issues first, then medium, then hard
- Manual review needed: List any issues that require manual attention
Important Guidelines
Safety First
- Never batch all fixes blindly - Validate each fix type before applying en masse
- Always read before editing - Understand context before changing code
- Verify fixes don't break functionality - Run tests incrementally
- Be conservative - Skip fixes you're uncertain about rather than risk breaking code
- Get approval for large changes - Alert user when fixes exceed 100 lines
- Have rollback strategy - Be able to revert if fixes cause problems
Context is Critical
- Understand the quality issue - Read README.md thoroughly
- Understand why code was written that way - There might be good reasons
- Look for patterns - Similar issues often need similar fixes
- Check related code - Fixes might require updating nearby code
- Read existing comments - Developers might have documented why they used certain patterns
Validation at Every Step
- Verify fix patterns from README - Don't guess how to fix
- Check suggested_fix in results.json - Use provided guidance
- Validate changes compile - Ensure code parses after changes
- Run linters - Catch style and import issues
- Run tests - Detect regressions immediately
- Re-run review - Verify fixes actually resolve issues
Communication
- Show plan before executing - Let user see what will be fixed
- Alert for large changes - Get approval for fixes >10 lines
- Report uncertainties - Flag issues where fix approach is unclear
- Show progress - Keep user informed during fixes
- Explain failures - Document why certain issues couldn't be fixed
- Provide detailed reports - Create comprehensive fix reports
What NOT to Do
- Don't assume you know how to fix - Always consult README.md and results.json
- Don't remove entries from results.json - Only add/update "fix_status" field
- Don't replace PR_DESCRIPTION.md - Append to it to maintain cumulative history across runs
- Don't run full evaluations - Only run unit tests (evaluations are slow)
- Don't commit automatically - Let user review changes first
- Don't commit PR_DESCRIPTION.md - It's only for creating the PR
- Don't fix issues you can't validate - Skip rather than risk breaking
- Don't ignore test failures - Investigate or rollback
- Don't make unrelated changes - Only fix the specific quality issues
- Don't assume all issues of same type are identical - Context matters
1---2name: code-quality-fix-all3description: Fix code quality issues identified in a code quality review stored in agent_artefacts/code_quality/<topic>/. Systematically addresses issues found by the code-quality-review-all skill for ANY code quality topic, with validation and testing at each step. Use when user asks to fix issues from a code quality review, or asks to fix issues from agent_artefacts/code_quality/<topic>.4---5
6# Code Quality Fix All
7
8Fix code quality issues identified in a code quality review. This skill systematically addresses issues found by the `code-quality-review-all` skill for ANY code quality topic, with validation and testing at each step.
9
10## Expected Arguments
11
12When invoked, this skill expects the path to a code quality topic as an argument (e.g., `agent_artefacts/code_quality/private_api_imports`).
13
14If not provided, the skill will ask the user for the topic path. Within the topic path, there are several files:
15
16- README.md - contains description of the issue and examples of how to fix it
17- results.json - contains list of all identified issues
18- SUMMARY.md - contains summary of the identified issues
19
20**Filters and options** are specified interactively after the skill starts by using the `AskUserQuestion` tool to present options unless specified otherwise in arguments.
21
22- Which issue types to target:
23 - all
24 - specific types
25 - Fix complexity level (easy only, medium and below, or all)
26- Which evaluations to fix (all, specific ones, evaluations with small number of issues)
27- Maximum number of issues to fix in this run
28
29## Workflow
30
31### Phase 1: Understanding the Topic and Planning
32
331. **Read topic documentation**
34 - Read the README.md to understand:
35 - What code quality issue this topic addresses
36 - Why it matters (stability, maintainability, etc.)
37 - How to detect the issue
38 - How to fix the issue (fix patterns, examples)
39 - Read results.json to get all identified issues
40 - Identify which issues are in scope based on arguments
41
422. **Analyze and categorize issues**
43 - Analyze fix complexity based on:
44 - issue_description
45 - suggested_fix from results.json
46 - Fix examples in README.md
47 - Classify as:
48 - **Easy**: Single-line changes, clear fix pattern in README
49 - **Medium**: Multi-line changes, well-documented fix approach
50 - **Hard**: No clear fix pattern, requires research or copying code
51 - Group issues by evaluation and issue type
52 - Generate statistics for presenting to user
53
543. **Ask user for filtering preferences**
55 - Use `AskUserQuestion` tool to ask:
56 - Which evaluations to fix? (all / specific ones / most affected)
57 - Which issue types to target? (all / specific types)
58 - Fix complexity level? (easy only / easy+medium / all)
59 - Max issues per run? (all / limit to specific number)
60 - Apply filters based on user responses
61 - Present filtered plan with:
62 - Number of issues to fix
63 - Breakdown by evaluation and issue type
64 - Complexity distribution
65 - Ask for final confirmation to proceed
66
674. **Validate understanding of fixes**
68 - For each unique issue type in scope:
69 - Check if README.md documents how to fix it
70 - Look for "Good Examples" and "Bad Examples" sections
71 - Check "suggested_fix" field in results.json
72 - If fix approach is unclear for any issue type:
73 - Research the correct approach
74 - Update `<topic>/README.md` with findings
75 - Ask user for guidance if still uncertain
76
77### Phase 2: Pre-Fix Validation
78
79For each issue to be fixed:
80
811. **Read and understand context**
82 - Read the entire file containing the issue (not just the line)
83 - Understand how the problematic code is used
84 - Look for related issues in the same file
85 - Check for patterns that might affect the fix (e.g., multiple occurrences)
86 - Identify any cascading changes needed (related imports, type hints, etc.)
87
882. **Validate the suggested fix**
89 - Review the "suggested_fix" from results.json
90 - Check against fix patterns in README.md
91 - Verify the fix won't break functionality
92 - For complex fixes:
93 - Check if dependencies/alternatives actually exist
94 - Validate that replacement code follows same patterns
95 - Consider edge cases
96
973. **Estimate change scope**
98 - Count how many lines will change for this fix
99 - Identify if cascading changes are needed
100 - Determine if multiple files need updating
101 - **If changes exceed 100 lines for a single issue:**
102 - Alert user with:
103 - Issue details
104 - Why the change is large
105 - What will change
106 - Get explicit approval before proceeding
107
108### Phase 3: Applying Fixes
109
1101. **Apply fixes systematically**
111 - Process one evaluation at a time
112 - Within each evaluation, group by issue type
113 - For each fix:
114 - Use Edit tool to apply the change
115 - Follow the suggested_fix guidance
116 - Apply fix patterns from README.md
117 - Handle related issues in same file together
118 - Add comments if the fix requires it (e.g., copied code attribution)
119 - Track what was fixed
120
1212. **Verify changes compile/parse**
122 - After fixing each file, validate:
123 - File is syntactically valid (Python can parse it)
124 - No obvious import errors introduced
125 - Code follows repository patterns
126 - If validation fails:
127 - Investigate the issue
128 - Attempt to fix validation error
129 - Rollback change if cannot be resolved
130
1313. **Track progress**
132 - Maintain list of:
133 - Issues successfully fixed (file, line, issue type)
134 - Issues that couldn't be fixed (with reasons)
135 - Evaluations that have been modified
136 - Files that were changed
137
138### Phase 4: Testing and Validation
139
1401. **Run linting**
141 - Run repository's linter on modified files (ruff, flake8, mypy, etc.)
142 - Check for:
143 - Import errors
144 - Type checking errors
145 - Style violations introduced
146 - Fix any linting issues that result from changes
147 - If linting issues can't be fixed, document them
148
1492. **Run unit tests**
150 - Identify test files for each modified evaluation
151 - Run unit tests for affected evaluations using pytest:
152
153 **Basic test commands:**
154
155 ```bash
156 # Run tests for a specific evaluation
157 uv run pytest tests/<evaluation_name>/
158
159 # Run a specific test file
160 uv run pytest tests/test_file.py
161
162 # Run a specific test
163 uv run pytest tests/test_file.py::TestClass::test_method
164
165 # Run slow tests (excluded by default)
166 uv run pytest --runslow tests/
167
168 # Skip dataset download tests
169 uv run pytest -m 'not dataset_download' tests/
170
171 # Run only slow tests
172 uv run pytest -m slow tests/
173 ```
174
175 **Test markers to be aware of:**
176 - `@pytest.mark.slow` - Tests taking >10 seconds
177 - `@pytest.mark.dataset_download` - Tests that download datasets
178 - `@pytest.mark.docker` - Tests using Docker
179 - `@pytest.mark.huggingface` - HuggingFace-related tests
180
181 - Focus on tests for the specific evaluation
182 - Look for test failures or errors
183 - **IMPORTANT**: Do NOT run full evaluations (they take too long) unless user explicitly requests it
184
1853. **Handle test failures**
186 - For each test failure:
187 - Read test output carefully
188 - Determine if failure is caused by the fix
189 - Check if it's a pre-existing failure
190 - If caused by fix:
191 - Try to adjust the fix to make tests pass
192 - If cannot be resolved, rollback the change
193 - Document the issue for user review
194 - If pre-existing:
195 - Note it but don't block on it
196 - Inform user
197
198### Phase 5: Re-Review and Handle Remaining Issues
199
2001. **Update results.json with fix status**
201 - For each issue that was fixed, add `"fix_status"` field after `"suggested_fix"`:
202
203 ```json
204 {
205 ...
206 "suggested_fix": "...",
207 "fix_status": "fixed - please review"
208 }
209 ```
210
211 - For issues that couldn't be fixed, add explanation:
212
213 ```json
214 "fix_status": "not fixed - reason: ..."
215 ```
216
217 - **IMPORTANT**: Do NOT remove any entries from results.json - only add/update "fix_status"
218 - The code-quality-review-all skill owns results.json and is responsible for removing entries
219
2202. **Re-run code quality review**
221 - **IMPORTANT**: Use Task tool to spawn subagent running code-quality-review-all skill
222 - Pass the same topic path
223 - This will update results.json with current state
224 - Compare results before and after to identify:
225 - Issues that are now resolved (no longer appear)
226 - New issues that may have been introduced
227 - Issues that still remain despite fix attempts
228
2293. **Fix remaining issues if in scope**
230 - For each new or remaining in-scope issue:
231 - Investigate why previous fix didn't work
232 - Attempt alternative fix approach
233 - Update "fix_status" with attempt results
234 - Repeat this process until no more in-scope issues can be fixed
235
2364. **Update topic's README.md**
237 - Add any knowledge that you have discovered that will be useful in detecting or fixing topic-related issues in the future
238 - Do not remove examples of bad code or patterns that were fixed - they will be useful in future reviews and fixes of future evaluations.
239
2405. **Update SUMMARY.md**
241 - Add a "Recent Fixes" section with:
242 - Date of fix run
243 - Number of issues fixed
244 - Which evaluations were updated
245 - Keep historical data (don't remove past information)
246 - Update recommendations to reflect remaining work
247
2486. **Run markdown linters**
249 - Use `uv run pre-commit run markdownlint-fix` to fix markdown linting issues
250
251### Phase 6: Create PR Description and Present Results
252
2531. **Create/Update PR description (cumulative)**
254 - Read existing `PR_DESCRIPTION.md` if it exists (from previous runs)
255 - **Cumulative tracking**: PR description represents ALL changes from branch base, not just this run
256 - If PR_DESCRIPTION.md exists:
257 - Parse existing content to extract previous runs' data
258 - Append information from this run
259 - Update cumulative statistics
260 - If PR_DESCRIPTION.md doesn't exist (first run):
261 - Create new file
262 - Format for GitHub/GitLab pull request with:
263 - **Summary**: Brief overview of the code quality topic and total fixes (2-3 sentences)
264 - **Overall Changes** (cumulative from all runs):
265 - Total issues fixed across all runs by type
266 - Total evaluations affected
267 - Total files modified
268 - **Fix Sessions**: List each run session with:
269 - Date/time of run
270 - Issues fixed in that session
271 - Complexity level targeted (easy/medium/all)
272 - **Fixed Issues** (cumulative): Table or list with all file paths and issue types from all runs
273 - **Testing** (from latest run):
274 - Which tests were run
275 - Pass/fail status
276 - Any test issues encountered
277 - **Remaining Issues** (current state):
278 - Count of issues still open
279 - Brief note on what remains
280 - **Review Notes** (cumulative):
281 - Any complications or special considerations from any run
282 - Areas that need extra attention during review
283 - Use proper markdown formatting for PR readability
284 - **IMPORTANT**: Do NOT commit PR_DESCRIPTION.md - it's only for creating the PR
285 - Example structure:
286
287 ```markdown
288 ## Summary
289 Fix private API imports code quality issues across evaluations.
290
291 ## Overall Changes
292 - Total issues fixed: 25
293 - Evaluations affected: 8
294
295 ## Fix Sessions
296
297 ### Session 1: 2026-01-18 10:30 (Easy issues)
298 - Fixed 10 easy issues
299 - Targeted: Easy complexity, All evaluations
300
301 ### Session 2: 2026-01-18 14:15 (Medium issues)
302 - Fixed 15 medium issues
303 - Targeted: Medium complexity, Specific evaluations
304
305 ## Fixed Issues
306 [Table of all fixed issues from all sessions]
307
308 ## Testing
309 [Latest test results]
310
311 ## Remaining Issues
312 6 issues remain (4 hard, 2 require investigation)
313
314 ## Review Notes
315 - Session 1: All tests passed
316 - Session 2: One test required adjustment in fortress/scorer.py
317 ```
318
3192. **Present results to user**
320 - Show high-level summary for **this run**:
321 - X issues fixed in this session
322 - Y issues remain
323 - Z tests passed
324 - Show **cumulative progress** from PR_DESCRIPTION.md:
325 - Total issues fixed across all runs
326 - Number of fix sessions completed
327 - Show before/after statistics from SUMMARY.md
328 - List modified files from this run
329 - Display content of PR_DESCRIPTION.md for user review
330 - **Do NOT automatically commit** - let user review changes
331
3323. **Offer next steps**
333 - **Create commit and PR**: Offer to:
334 - Commit all changes (source files, results.json, SUMMARY.md)
335 - Create pull request with description from PR_DESCRIPTION.md
336 - Note: PR_DESCRIPTION.md itself is NOT committed (it's just for PR description)
337 - The PR description includes **cumulative changes from all fix sessions** on this branch
338 - **Run more fixes**: If issues remain, suggest running skill again with different filters
339 - Running again will **append** to PR_DESCRIPTION.md, creating cumulative tracking
340 - This allows iterative fixing: easy issues first, then medium, then hard
341 - **Manual review needed**: List any issues that require manual attention
342
343## Important Guidelines
344
345### Safety First
346
347- **Never batch all fixes blindly** - Validate each fix type before applying en masse
348- **Always read before editing** - Understand context before changing code
349- **Verify fixes don't break functionality** - Run tests incrementally
350- **Be conservative** - Skip fixes you're uncertain about rather than risk breaking code
351- **Get approval for large changes** - Alert user when fixes exceed 100 lines
352- **Have rollback strategy** - Be able to revert if fixes cause problems
353
354### Context is Critical
355
356- **Understand the quality issue** - Read README.md thoroughly
357- **Understand why code was written that way** - There might be good reasons
358- **Look for patterns** - Similar issues often need similar fixes
359- **Check related code** - Fixes might require updating nearby code
360- **Read existing comments** - Developers might have documented why they used certain patterns
361
362### Validation at Every Step
363
364- **Verify fix patterns from README** - Don't guess how to fix
365- **Check suggested_fix in results.json** - Use provided guidance
366- **Validate changes compile** - Ensure code parses after changes
367- **Run linters** - Catch style and import issues
368- **Run tests** - Detect regressions immediately
369- **Re-run review** - Verify fixes actually resolve issues
370
371### Communication
372
373- **Show plan before executing** - Let user see what will be fixed
374- **Alert for large changes** - Get approval for fixes >10 lines
375- **Report uncertainties** - Flag issues where fix approach is unclear
376- **Show progress** - Keep user informed during fixes
377- **Explain failures** - Document why certain issues couldn't be fixed
378- **Provide detailed reports** - Create comprehensive fix reports
379
380### What NOT to Do
381
382- **Don't assume you know how to fix** - Always consult README.md and results.json
383- **Don't remove entries from results.json** - Only add/update "fix_status" field
384- **Don't replace PR_DESCRIPTION.md** - Append to it to maintain cumulative history across runs
385- **Don't run full evaluations** - Only run unit tests (evaluations are slow)
386- **Don't commit automatically** - Let user review changes first
387- **Don't commit PR_DESCRIPTION.md** - It's only for creating the PR
388- **Don't fix issues you can't validate** - Skip rather than risk breaking
389- **Don't ignore test failures** - Investigate or rollback
390- **Don't make unrelated changes** - Only fix the specific quality issues
391- **Don't assume all issues of same type are identical** - Context matters