refactor-safely
Skill2 starsChanged 3 months agoMITView on GitHub
Use when improving internal structure, readability, duplication, or maintainability without changing behavior. Keep diffs small and preserve public APIs, schemas, and user-visible behavior. Do not use when behavior, contracts, or migrations must change.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- techygarg/latticetheir own version, first seen Sep 3, 2026
- imMamdouhaboammar/get-things-donetheir own version, first seen Sep 1, 2026
- adiutama/skillstheir own version, first seen Aug 25, 2026
- leandrodslv/claude-skills-librarytheir own version, first seen Aug 14, 2026
- tirth8205/code-review-graphtheir own version, first seen Jun 10, 2026
- SerhatKumas/AI--ClaudeCodeStartertheir own version, first seen Jun 7, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- tirth8205/code-review-graph★ 32ksame name
- techygarg/lattice★ 197same name
- imMamdouhaboammar/get-things-done★ 2same name
- adiutama/skills★ 1same name
- SerhatKumas/AI--ClaudeCodeStarter★ 1same name
- leandrodslv/claude-skills-library★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-testSkill
- implement-featureSkill
- investigate-bugSkill
- update-okfSkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 10 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this Skill when:
- Distinctive: line 17
Do not use this Skill when:
- Distinctive: line 43
Run or identify baseline tests when available.
- Distinctive: line 45
Avoid mixing formatting-only changes with logic movement unless the repository already does so.
- Very specific: line 48
If a behavior change becomes necessary, stop and switch to implement-feature or ask for confirmation.
- Distinctive: line 52
Do not change behavior intentionally or accidentally.
- Distinctive: line 53
Do not change public APIs, schemas, migrations, serialized formats, or user-visible text without explicit approval.
- Distinctive: line 54
Do not perform broad cleanup outside the requested area.
- Distinctive: line 55
Do not introduce new dependencies unless explicitly justified.
- Distinctive: line 56
Do not remove tests to simplify the refactor.
- Distinctive: line 57
Do not update OKF unless architecture, boundaries, or maintainership knowledge changed.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Refactor Safely
When to use
Use this Skill when:
- Reducing duplication.
- Improving naming or structure.
- Extracting helpers or simplifying control flow.
- Preparing code for a later change while preserving behavior.
Do not use this Skill when:
- User-visible behavior must change.
- Public APIs, schemas, migrations, or data contracts must change.
- The code is not covered enough to safely refactor and no validation plan exists.
Inputs
- Target files, modules, or code smell.
- Reason for the refactor.
- Available tests or validation commands.
- Relevant OKF docs when architecture or contracts are documented.
Required context
Before editing, read:
- Existing code around the target area.
- Tests that cover the behavior.
- Relevant OKF architecture, data, or feature documents.
- Public API, schema, or integration boundaries.
Workflow
- Define the behavior that must remain unchanged.
- Identify public APIs, schemas, data contracts, and external behavior that must not move.
- Run or identify baseline tests when available.
- Make the smallest meaningful structural change.
- Avoid mixing formatting-only changes with logic movement unless the repository already does so.
- Run targeted tests.
- Compare the diff to confirm behavior was preserved.
- If a behavior change becomes necessary, stop and switch to
implement-featureor ask for confirmation.
Guardrails
- Do not change behavior intentionally or accidentally.
- Do not change public APIs, schemas, migrations, serialized formats, or user-visible text without explicit approval.
- Do not perform broad cleanup outside the requested area.
- Do not introduce new dependencies unless explicitly justified.
- Do not remove tests to simplify the refactor.
- Do not update OKF unless architecture, boundaries, or maintainership knowledge changed.
Completion checklist
- Behavior to preserve was identified.
- Public APIs and schemas were checked.
- Diff is small and scoped.
- Tests or validation were run.
- Any residual risk is stated.
Expected final response
Report:
- What was refactored.
- Why behavior should be unchanged.
- Files changed.
- Tests or checks run.
- Any risks or follow-up opportunities.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

