code-simplify
Skill2 starsChanged 6 days agoMITView on GitHub
Use when cleaning changed code for reuse, simplicity, efficiency, and the right abstraction level without changing behavior. Not for correctness review, broad redesign, or unbounded cleanup. Output: four-angle findings, applied/skipped changes, and baseline/final test evidence.
9 other projects use a version of this.
Adopted by
Most recently taken up by
- flavio-portela/skillstheir own version, first seen Nov 1, 2026
- arumaekawa/codex-skillstheir own version, first seen Oct 25, 2026
- msobczyk-x/agent-skillstheir own version, first seen Jul 16, 2026
- grasscaograss/AwesomeWeldoneSkillstheir own version, first seen Jun 2, 2026
- chrisetheridge/skillstheir own version, first seen May 11, 2026
- tsbhatia/coding-skills-for-agentstheir own version, first seen Apr 20, 2026
Used with
Projects with it also use skill-creator.
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.
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 3 projects that use this
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- ulpi-io/browse★ 15same name
- arumaekawa/codex-skills★ 4same name
- chrisetheridge/skills★ 4same name
- RCmerci/skills★ 4same name
- msobczyk-x/agent-skills★ 3same name
- grasscaograss/AwesomeWeldoneSkills★ 2same name
- EasyJoy-Technologies/openclaw-skills★ 1same name
- flavio-portela/skills★ 0same name
- tsbhatia/coding-skills-for-agents★ 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 repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- change-verdictSkill
- code-traceSkill
- create-prSkill
- deploy-listSkill
- doc-maintainSkill
- feature-verifySkill
- flow-driveSkill
- flow-guideSkill
- git-smart-commitSkill
- git-worktreeSkill
- harness-setupSkill
- issue-analyzeSkill
- js-static-checksSkill
- laravelSkill
- legacy-characterization-testsSkill
- library-authorSkill
- merge-prepSkill
- module-designSkill
- nextjsSkill
- openspec-artifact-guardSkill
- opsx-apply-resumeSkill
- phpSkill
- phpunitSkill
- precommitSkill
- project-auditSkill
- project-briefSkill
- proposal-analyzeSkill
- pr-summarySkill
- pythonSkill
- reactSkill
- release-creatorSkill
- repo-intakeSkill
- repo-verifySkill
- swiftSkill
- tdd-workflowSkill
- ui-ux-verifySkill
- vue-2-notesSkill
- yii1Skill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Use $ARGUMENTS when a target is explicit.
- Very specific: line 75
Close the loop: Run the exact baseline test command again.
- Distinctive: line 81
Use the following report and record the actual execution mode:
“Common” is measured: kept by at least 6 in 10 of the 9 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
Code simplification
This is a behavior-preserving quality pass over the resolved change scope.
Use $ARGUMENTS when a target is explicit; otherwise review the current
change. Keep fixes inside that scope and leave correctness verdicts to a
read-only review workflow such as $change-verdict --mode code.
When NOT to Use
- A bug, security issue, or correctness concern needs judging: use the relevant review or diagnosis workflow first.
- The requested change is a feature or architecture redesign rather than a cleanup of existing changes.
- The target cannot be resolved, has no changes, or its baseline test fails without explicit acceptance of that known failure.
Workflow
Resolve the scope. An explicit target always wins:
- Existing file/directory: review its full contents and run
git diff HEAD -- "$ARGUMENTS"; keep the path quoted after--. - Pull request number, URL, or
#number: verify it and gathergh pr diff "$ARGUMENTS". - Branch or commit ref: verify it, identify its upstream or repository
default branch, compute
git merge-base <target> <base>, then gather the target diff withgit diff <merge-base>...<target>. - Anything else is
BLOCKED; never fall back to the current branch for an invalid explicit target.
Without an explicit target, try
git diff @{upstream}...HEAD, thengit diff main...HEAD, thengit diff HEAD~1. If the worktree is dirty or the range is empty, also includegit diff HEAD. Stop withnothing to simplifywhen the resolved scope has no changes.- Existing file/directory: review its full contents and run
- Establish the baseline. Resolve the repository’s relevant test command, run it before editing, and record the exact command and result. Stop when it fails unless the caller explicitly accepts that known failure.
Review four angles. The current Host and Model review all four angles directly in one pass as the standard path. When requested and supported by the Host, optional read-only subagents may review separate angles. Complete missing angles inline and record any angle that remains unreviewed. Each finding records
file,line, a one-line summary, and its concrete cost.Angle Look for Reuse New code reimplementing an existing helper or pattern Simplification Derivable state, copy-paste variation, deep nesting, dead code Efficiency Repeated computation/I/O, sequential independent work, retained closures Altitude Symptom patches or special cases where shared infrastructure is the root fix - Apply safely. Deduplicate findings at the same line or mechanism. Apply only behavior-preserving findings inside the resolved scope. Skip findings that change intended behavior, require out-of-scope files, or are false positives, and record each reason.
- Handle heavy cleanup explicitly. A file over 800 lines, cross-file deduplication, or a multi-module dead-code sweep needs a documented scoped process. Work in small, evidence-backed batches within the current scope; defer out-of-scope design decisions with a concrete handoff to the caller.
- Close the loop. Run the exact baseline test command again. A failing
final test leaves the task incomplete and the result
BLOCKED; do not claim the cleanup is safe.
Output
Use the following report and record the actual execution mode:
## Refactoring Summary
Execution Mode: current Host/Model single-pass | optional fan-out | mixed
### Applied
- [file:line] <summary> — Cost: <concrete cost> — Fix: <change>
### Skipped
- [file:line] <summary> — Reason: <behavior change | out of scope | false positive>
## Test Results
- Baseline: PASS/FAIL — `<command>`
- Final: PASS/FAIL/NOT_RUN — `<same command>`Record the reviewed angles and any missing evidence. Single-pass execution is standard; optional fan-out supplies independent observations when used. Return control to the caller after delivering findings and verification.
Verification
- Scope resolution and fallback order are recorded; invalid explicit input did not silently become the current branch.
- Baseline and final use the exact same test command, with failures and accepted known failures stated explicitly.
- Reuse, Simplification, Efficiency, and Altitude were each reviewed, or each missing angle is named in incomplete evidence.
- Every applied change is behavior-preserving and in scope; every skipped finding has a reason.
- Heavy cleanup has a documented bounded process and deferred work is handed back to the caller.
References
references/refactor-contract.md— finding, execution, heavy-cleanup, and handoff details used when the inline workflow needs the extended contract.- Native
git,gh,rg, file reads, and the repository’s test command are the portable scope and verification tools.
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.

