refactor-code
Skill0 starsChanged 2 months agoApache-2.0View on GitHub
Perform small, behavior-preserving code refactorings verified against a test baseline. Use when asked to refactor, restructure, clean up, or rename code under a defined task or Issue while keeping observable behavior unchanged, or when a debug or review step leaves related code debt. Requires a runnable test baseline before and after the change; never changes behavior, adds features, or fixes unrelated defects.
16 other projects use a version of this.
Adopted by
Most recently taken up by
- neko3cs/skillstheir own version, first seen Nov 1, 2026
- Ionate-Technologies/indium-agentkittheir own version, first seen Oct 20, 2026
- Indium-AI-Labs/indium-agentkittheir own version, first seen Oct 11, 2026
- BrOrlandi/my-claude-skillstheir own version, first seen Sep 22, 2026
- genfeedai/genfeed.aitheir own version, first seen Sep 12, 2026
- r2rka1/skillstheir own version, first seen Aug 18, 2026
Used with
Projects with it also use optimize-performance, debug-issue and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
gologo13Skilloptimize-performance
Analyze the current code for performance bottlenecks and provide optimization recommendation...; keywords: api, performance. Use only on explicit request; skip in routine implementation discussions.
Also in 3 projects that use this
NVIDIASkilldebug-issue
Use when the user asks to debug, investigate, or fix a GitHub issue or supplies a repository bug report.
Also in 3 projects that use this
SentrySkillsecurity-review
Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.
Also in 3 projects that use this
Other versions16 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 16
- igmarin/rails-agent-skills★ 26same name
- BrOrlandi/my-claude-skills★ 22same name
- Indium-AI-Labs/indium-agentkit★ 18same name
- Ionate-Technologies/indium-agentkit★ 17same name
- zbruhnke/claude-code-starter★ 16same name
- emaraschio/cursor-commands★ 9same name
- chrisetheridge/skills★ 4same name
- genfeedai/genfeed.ai★ 4same name
- igmarin/elixir-phoenix-skills★ 4same name
- adolfoaranaes12/BMAD-ENHANCED★ 2same name
6 more not listed
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 repository37 other files it gives its agents.
- AGENTS.mdAGENTS.md
- analyze-codebaseSkill
- analyze-projectSkill
- propose-improvementsSkill
- retrospect-workSkill
- triage-issuesSkill
- write-docsSkill
- debug-codeSkill
- resolve-defectSkill
- write-testsSkill
- develop-minecraft-fabricSkill
- develop-minecraft-forgeSkill
- audit-workflow-enforcementSkill
- bootstrap-projectSkill
- develop-dartSkill
- develop-goSkill
- develop-javaSkill
- develop-kotlinSkill
- develop-swiftSkill
- develop-typescriptSkill
- update-dependenciesSkill
- develop-android-composeSkill
- develop-compose-multiplatformSkill
- develop-flutterSkill
- develop-iosSkill
- develop-kotlin-multiplatformSkill
- develop-react-nativeSkill
- create-issueSkill
- create-prSkill
- deliver-changeSkill
- fix-prSkill
- implement-issueSkill
- improve-projectSkill
- merge-prSkill
- plan-issueSkill
- review-prSkill
- develop-reactSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 10 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Verify the before/after baseline results and the diff.
- Distinctive: line 17
Keep exactly one item in progress.
- Distinctive: line 21
Read repository instructions and the governing task or Issue before refactoring.
- Distinctive: line 24
Stop and report when the task lacks a scoped boundary, the baseline cannot run, or the baseline does not pass before the change.
- Distinctive: line 30
Do not expand the refactor into a larger rewrite or combine it with unrelated work.
- Distinctive: line 35
Keep each change small and reviewable.
- Distinctive: line 39
Run the project's test baseline before the change and record the result.
- Distinctive: line 40
Run the same baseline after the change and record the result.
- Distinctive: line 46
Never add features, fix defects, or open a Pull Request.
- Distinctive: line 50
Use plain, active, evidence-backed prose in the final handoff.
“Common” is measured: kept by at least 6 in 10 of the 15 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 Code
Todo List
- in progress: Resolve the refactor task, its in-scope files, and the project's test baseline command.
- Scope one small refactor and state the behavior that must be preserved.
- Make the mechanical changes on the in-scope files.
- Verify the before/after baseline results and the diff; record the evidence.
- Complete the list only when the baseline passes before and after and the handoff is reported.
Keep exactly one item in progress. Mark an item complete only after its stated evidence exists. Add or revise items when the agreed scope changes. Use the host's native Todo List when available; otherwise maintain this list as a Markdown checklist in the conversation.
Resolve and Guard
- Read repository instructions and the governing task or Issue before refactoring.
- Resolve the refactor target, its in-scope files, and the project's test command from the repository. Do not guess a target.
- Refactors only: never change behavior, add features, or fix unrelated defects. Feature work and defect fixes belong to separate governed work (
plan-issueandimplement-issue); test design belongs towrite-tests; defect fixing belongs todebug-code. - Stop and report when the task lacks a scoped boundary, the baseline cannot run, or the baseline does not pass before the change.
Scope the Refactor
- Choose a single small refactor with a stated purpose, for example extracting a function, renaming an identifier, or simplifying a structure.
- State the behavior that must be preserved and how the test baseline observes it.
- Do not expand the refactor into a larger rewrite or combine it with unrelated work.
Make Mechanical Changes
- Edit only the in-scope files and prefer the repository's existing patterns.
- Keep each change small and reviewable; prefer many small verified steps over one large change.
Verify the Baseline
- Run the project's test baseline before the change and record the result; the baseline must pass before refactoring starts.
- Run the same baseline after the change and record the result.
- Review the diff to confirm that only structure changed. A failing baseline or a behavior-changing diff stops the refactor and is reported.
Handoff
- Report the refactor target, the changed files, the before/after baseline results, and the next owner:
implement-issueintegrates the refactor into the governed change; report to the requester when the refactor is not part of a governed change. - Never add features, fix defects, or open a Pull Request; those are separate phases.
Writing quality
Use plain, active, evidence-backed prose in the final handoff. Keep headings in sentence case and name the file, command, or output behind each repository claim.
Choose the plain word over an inflated or Latinate one: write use rather
than utilize and is rather than serves as.
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.

