refactoring
Skill0 starsChanged 4 months agoMITView on GitHub
Improves structure without behavior changes, using tests and focused slices; not for features unless behavior change is explicit.
We split this skill into the rules it gives an agent
9 rules. 0 are common, 9 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 47 edited versions we read keep these.
9
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 16
Prefer small mechanical steps.
- Distinctive: line 17
Keep tests green between steps when possible.
- Distinctive: line 18
Do not mix broad refactoring with feature changes unless necessary.
- Distinctive: line 19
Do not rename public APIs casually.
- Distinctive: line 20
Do not move code across architectural boundaries without understanding dependencies.
- Distinctive: line 44
Keep imports and dependency direction sane.
- Distinctive: line 47
Do not split files mechanically by line count.
- Distinctive: line 55
avoid circular imports/dependencies.
- Distinctive: line 56
keep private helpers private.
“Common” is measured: kept by at least 6 in 10 of the 47 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
Skill: refactoring
Purpose
Improve structure without changing behavior unless behavior change is explicitly requested.
Refactoring Rules
- Refactor only when it serves the task.
- Identify behavior that must remain unchanged.
- Prefer small mechanical steps.
- Keep tests green between steps when possible.
- Do not mix broad refactoring with feature changes unless necessary.
- Do not rename public APIs casually.
- Do not move code across architectural boundaries without understanding dependencies.
When Refactoring Is Justified
Refactoring is justified when it improves:
- correctness;
- maintainability;
- cohesion;
- boundary clarity;
- testability;
- safety;
- removal of duplication of knowledge;
- reduction of large/god files;
- isolation of infrastructure details.
Large File Refactoring
For large files:
- Identify responsibilities.
- Identify public API surface.
- Identify tests or behavior contracts.
- Extract cohesive units.
- Keep imports and dependency direction sane.
- Validate after each meaningful slice.
Do not split files mechanically by line count. Split by responsibility.
Safe Extraction Checklist
Before extraction:
- know callers;
- preserve public names or provide compatibility where required;
- avoid circular imports/dependencies;
- keep private helpers private;
- move tests or add tests for extracted behavior;
- preserve errors and logging behavior unless intentionally changed.
Reporting
Report:
- behavior preserved;
- responsibilities extracted;
- files moved/changed;
- validation;
- risks.
Extended References
For deeper refactoring work, read:
../../engineering/07_complexity_budget.md../../engineering/08_engineering_smells.md../../engineering/11_refactoring_catalog.md
Other versions52 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 52
- handsontable/handsontable★ 22ksame name
- ciembor/agent-rules-books★ 2.8ksame name
- hitobito/hitobito★ 484same name
- databrickslabs/ontobricks★ 457same name
- DevelopersGlobal/ai-agent-skills★ 216same name
- extra-org/extra★ 118same name
- tmcfarlane/team-avatar★ 111same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- dan-the-dev/xp-developer-skills★ 31same name
- s-hiraoku/synapse-a2a★ 17same name
42 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.
Used alongsideProjects with it also use ci-cd, multi-agent-orchestration and 8 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.
JohnJBorenSkillci-cd
CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies
Also in 5 projects that use this
javalenciacaiSkillmulti-agent-orchestration
Design and coordinate multi-agent systems where specialized agents work together to solve complex problems. Covers agent communication, task delegation, workflow orchestration, and result aggregation. Use when building coordinated agent teams, complex workflows, or systems requiring specialized expertise across domains.
Also in 3 projects that use this
OpenAISkillobservability
Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.
Also in 7 projects that use this
AWSSkillplanning
Discovers user intent and generates a structured, step-by-step plan for model customization workflows. This skill must always be activated alongside any other skill when the user's request relates to model customization — including fine-tuning, training, building, customizing, reviewing data, or getting advice on approach, regardless of domain. Do not skip this skill even if the immediate ask is narrow (e.g., reviewing data format or a single workflow step), because planning discovers the full scope of work needed. Also activate when the user wants to resume, continue, or modify an existing plan.
Also in 6 projects that use this
MicrosoftSkillerror-handling
统一错误处理系统。在添加 API 端点、修改错误处理、添加前端 API 调用、编写错误相关测试时使用。
Also in 6 projects that use this
MicrosoftSkillapi-design
Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
Also in 14 projects that use this
In this repository62 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibility-ui-reviewSkill
- agent-retrospectiveSkill
- agents-md-retrospectiveSkill
- agent-squadSkill
- architecture-mapSkill
- architecture-normalizerSkill
- architecture-principlesSkill
- authz-boundary-reviewSkill
- c-cppSkill
- code-qualitySkill
- code-reviewSkill
- code-to-figmaSkill
- code-wiki-ruSkill
- context-packSkill
- core-engineeringSkill
- debuggingSkill
- dependency-advisory-auditSkill
- deserialization-parser-reviewSkill
- design-system-extractorSkill
- documentationSkill
- engineering-standardsSkill
- esp32Skill
- esphomeSkill
- external-agent-pack-auditSkill
- fastSkill
- figma-to-codeSkill
- fix-security-findingSkill
- goSkill
- homeassistantSkill
- mcp-tool-routerSkill
- migration-plannerSkill
- mobile-qaSkill
- multi-agent-pr-reviewSkill
- performanceSkill
- playwright-visual-qaSkill
- pythonSkill
- quality-gatesSkill
- responsive-breakpoint-checkSkill
- review-routerSkill
- rustSkill
- secrets-and-config-reviewSkill
- security-diff-reviewSkill
- security-routerSkill
- securitySkill
- session-memorySkill
- specialist-dispatchSkill
- subagent-result-mergeSkill
- supply-chain-reviewSkill
- tdd-guardSkill
- testing-tddSkill
- threat-modelSkill
- typescriptSkill
- ui-buildSkill
- ui-business-appsSkill
- ui-concept-firstSkill
- ui-figmaSkill
- ui-qaSkill
- ui-researchSkill
- ui-routerSkill
- The first 60 shown.
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.

