workflow-refactor
Skill7 starsChanged 47 days agoMITView on GitHub
Workflow for behavior-preserving restructuring, from local cleanup through complex refactors.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- kensaurus/cursor-kenjitheir own version, first seen Nov 17, 2026
- kensaurus/skillstheir own version, first seen Nov 17, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- kensaurus/cursor-kenji★ 10same name
- kensaurus/skills★ 10same 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 repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- find-skillsSkill
- git-conventional-commitSkill
- skill-creatorSkill
- code-reviewSkill
- define-conventionsSkill
- diagnoseSkill
- feature-specificationSkill
- git-conventional-commitSkill
- implementSkill
- lean-grill-with-docsSkill
- maintain-changelogSkill
- planSkill
- setup-lean-coding-agentSkill
- workflow-bug-fixingSkill
- workflow-feature-developmentSkill
- workflow-planningSkill
- workflow-reviewSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
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 9
Use this workflow for clear, small, localized refactors and complex behavior-preserving restructuring.
≈ “Common” is an estimate: at least 1 in 5 of the 383,637 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code Refactoring Workflow
Use this workflow for clear, small, localized refactors and complex behavior-preserving restructuring. The approved plan records the behavior and contracts to preserve, scope, risks, documentation impact, and verification needed for the work. Every run produces the standard durable plan, implementation report, and review pass artifacts.
The main agent orchestrates this workflow and owns user communication and closeout. Follow the shared scaffolding in AGENTS.md — Workflow Delegation, Standard Artifacts, and Shared Stop Conditions.
Steps
- Plan and approve. Spawn
plannerwith the request and this workflow's planning requirements. The plan records current behavior and contracts to preserve, boundaries, baseline and post-refactor verification, behavior-drift and rollback risks, and documentation impact. The main agent obtains explicit user approval before implementation. If the work reveals behavior change, stop and request user direction; do not switch workflows automatically. - Establish the baseline and refactor in green steps. After plan approval, spawn
implementerwith the approved plan. Apply$refactorand the test-strategy guidance from$tdd. Run focused tests before restructuring; add characterization tests when behavior to preserve is uncovered. Make one small behavior-preserving change at a time and rerun focused tests after each meaningful step. The implementer records its TDD, baseline, documentation, and verification evidence in.agents/implementation-reports/implementation_YYYYMMDD_<name>.md. - Review independently. Spawn
code-reviewerwith the approved plan, implementation report, touched files, tests, and verification evidence. The reviewer checks behavior drift, scope creep, missed tests, unnecessary abstraction, code smells, and documentation staleness. Missing or stale required documentation is aBLOCK. Each review pass is recorded under.agents/code-reviews/review_YYYYMMDD_<name>_pass_N.md. - Resolve and verify. On
BLOCK, send only the concrete findings back toimplementer, preserve the approved plan, rerun focused checks, and repeat review untilAPPROVEor a Shared Stop Condition triggers. TreatWARNINGas actionable when tied to the plan, behavior drift, or a meaningful test gap. Run broader final verification whenever shared behavior, API contracts, persistence, auth, security, or user-facing workflows are touched.
In the final response, identify the artifact paths, independent reviewer verdict, and main-agent closeout review. Report the preserved behavior, structural improvement, exact verification results, residual risks, and omissions.
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.

