Refactoring process with test safety. Invoke immediately when user or document mentions refactoring, or proactively when code gets too complex or messy.
64
76%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./tiles/crafter/skills/refactor/SKILL.mdWork autonomously as much as possible. Start with the simplest thing or file and proceed to the more complex ones.
Do not change test code during refactoring, except:
Never change test assertions, test data, or test logic.
REFACTORING_SUMMARY.md in the project root with the following initial content:
# Refactoring Summary
## Baseline
- Files in scope: {list of files}
- Test result: {PASS/FAIL with test count}
## StepsPrefer self-explanatory, readable code over comments.
For each refactor:
REFACTORING_SUMMARY.md:
### Step {N}: {refactoring description}
- Commit: `- r {message}`
- Test result: {PASS with test count}
- Files changed: {list}When you see no more obvious refactoring opportunities, say "Entering final evaluation."
Shift focus: you've been implementing. Now become a critic. Your job is to find problems, not produce code.
Re-read Code Style guidelines. Look at each file in scope. Consider blind spots - what improvements haven't we even considered that would make the code better, easier, more maintainable?
For each file, find ONE thing that could be better. If you find something:
Repeat until you find nothing more to improve.
Provide a high-level summary of the refactoring:
Append a final section to REFACTORING_SUMMARY.md:
## Final
- Total steps: {N}
- Files touched: {list of all files changed}
- All commits: {list of commit messages}
- Final test result: {PASS with test count}2a98cc1
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.