senior-refactoring
Skill2 starsChanged 5 days agoMITView on GitHub
Use when restructuring, cleaning up, simplifying, or modernizing existing code without changing behavior, including extracting functions or modules, removing duplication or dead code, reducing coupling, renaming, upgrading legacy patterns, or paying down technical debt in small safe steps.
In this repository50 other files it gives its agents.
- angular-standardSkill
- business-analyst-standardSkill
- execute-browser-verifySkill
- execute-build-testSkill
- execute-debug-evidenceSkill
- execute-implementationSkill
- jira-ba-dev-test-flowSkill
- nestjs-standardSkill
- professional-slidesSkill
- python-standardSkill
- senior-angularSkill
- senior-api-designSkill
- senior-backend-engineerSkill
- senior-business-analystSkill
- senior-cicdSkill
- senior-cloud-serverSkill
- senior-code-reviewSkill
- senior-delivery-orchestratorSkill
- senior-designSkill
- senior-dockerSkill
- senior-dotnetSkill
- senior-flutterSkill
- senior-frontend-engineerSkill
- senior-git-workflowSkill
- senior-goSkill
- senior-java-springSkill
- senior-kubernetesSkill
- senior-manual-testingSkill
- senior-mongodbSkill
- senior-mysqlSkill
- senior-nestjsSkill
- senior-nextjsSkill
- senior-nodejsSkill
- senior-observabilitySkill
- senior-performanceSkill
- senior-postgresqlSkill
- senior-python-backendSkill
- senior-react-nativeSkill
- senior-reactSkill
- senior-redisSkill
- senior-securitySkill
- senior-sql-serverSkill
- senior-tech-leadSkill
- senior-technical-writingSkill
- senior-terraformSkill
- senior-test-automationSkill
- senior-test-engineerSkill
- senior-vueSkill
- solution-architect-standardSkill
- tester-standardSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
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 16
Ensure tests cover current behavior.
- Distinctive: line 20
Never mix refactoring with behavior changes or bug fixes in the same step.
- Distinctive: line 22
Keep public APIs, serialized formats, database schemas, and event contracts stable unless the change explicitly includes a migration path.
- Distinctive: line 23
Remove dead code only after proving it is unused (search, logs, feature flags).
- Distinctive: line 24
Do not introduce abstractions for hypothetical future needs.
- Distinctive: line 29
Run the full relevant test suite, linters, and type checks before and after.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
Senior Refactoring
Role
Improve structure while preserving behavior exactly, in small verified steps that are easy to review and revert.
Before Editing
- Define the goal of the refactor (readability, testability, removing duplication, enabling a feature) and the boundary of code in scope.
- Find all callers and usages, including reflection, dynamic imports, configuration, templates, and public API consumers.
- Ensure tests cover current behavior. If they do not, add characterization tests first that pin today's outputs, including odd ones.
Refactoring Rules
- Never mix refactoring with behavior changes or bug fixes in the same step; note discovered bugs separately.
- Move in small steps (rename, extract, inline, move, replace conditional) and run tests after each. Prefer IDE or tool-assisted refactors for renames and moves.
- Keep public APIs, serialized formats, database schemas, and event contracts stable unless the change explicitly includes a migration path.
- Remove dead code only after proving it is unused (search, logs, feature flags). Delete rather than comment out.
- Do not introduce abstractions for hypothetical future needs; the result should be simpler than the start.
- Preserve formatting and conventions of the codebase; avoid large formatting-only diffs mixed with logic moves.
Testing and Verification
Run the full relevant test suite, linters, and type checks before and after. Compare behavior on representative inputs when tests are thin. Keep commits small so each can be reviewed and reverted on its own.
Review Checklist
- Is behavior provably unchanged (tests green before and after, no contract changes)?
- Is the result simpler and easier to change?
- Were all usages updated, including dynamic and external ones?
- Is the diff reviewable, with no unrelated changes?
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.

