refactoring
Skill0 starsChanged 2 months agoMITView on GitHub
Change code structure while preserving observable behavior, with characterization tests and equivalence evidence.
39 other projects use a version of this.
Adopted by
Most recently taken up by
- kapadias/nonnatheir own version, first seen Oct 1, 2026
- jablonkai/skillstheir own version, first seen Oct 1, 2026
- fabiandistler/agentstheir own version, first seen Sep 30, 2026
- wormeyman/wormeyman-skillstheir own version, first seen Sep 25, 2026
- dan-the-dev/xp-developer-skillstheir own version, first seen Sep 23, 2026
- nafeeur/MaskShifttheir own version, first seen Sep 12, 2026
Used with
Projects with it also use performance, ci-cd and 10 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.
pluginagentmarketplaceSkillperformance
Optimize application performance through caching strategies, load balancing, database scaling, and monitoring. Build systems handling thousands of concurrent users.
Also in 7 projects that use this
JohnJBorenSkillci-cd
CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies
Also in 4 projects that use this
MicrosoftSkillerror-handling
统一错误处理系统。在添加 API 端点、修改错误处理、添加前端 API 调用、编写错误相关测试时使用。
Also in 6 projects that use this
CloudAI-XSkilldatabase-design
Designs database schemas, indexing strategies, query optimization, and migration patterns for SQL and NoSQL databases. Use when designing tables, optimizing queries, fixing N+1 problems, planning migrations, or when asked about database performance, normalization, ORMs, or data modeling.
Also in 5 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
AnthropicSkilldocumentation
Write and maintain technical documentation. Trigger with "write docs for", "document this", "create a README", "write a runbook", "onboarding guide", or when the user needs help with any form of technical writing — API docs, architecture docs, or operational runbooks.
Also in 8 projects that use this
Other versions39 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 39
- ciembor/agent-rules-books★ 2.9ksame name
- databrickslabs/ontobricks★ 393same name
- extra-org/extra★ 113same name
- 312362115/claude★ 107same name
- DevelopersGlobal/ai-agent-skills★ 69same name
- andreaswasita/copilot-agents-dojo★ 54same name
- dan-the-dev/xp-developer-skills★ 30same name
- nimadorostkar/Claude-Skills-collection★ 28same name
- krzysztofsurdy/code-virtuoso★ 22same name
- s-hiraoku/synapse-a2a★ 16same name
29 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 repository47 other files it gives its agents.
- AGENTS.mdAGENTS.md
- instructions/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- instructions/CLAUDE.mdCLAUDE.md
- author-skillSkill
- architectSkill
- arenaSkill
- astack-helpSkill
- astack-updateSkill
- bug-fixSkill
- claude-background-jobsSkill
- codex-background-jobsSkill
- create-verification-skillSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- grillingSkill
- handoffSkill
- harden-prSkill
- hillclimbSkill
- howSkill
- implementSkill
- improve-codebase-architectureSkill
- investigationSkill
- multi-phase-planSkill
- no-commentsSkill
- open-prSkill
- orchestrateSkill
- perf-issueSkill
- principlesSkill
- prototypeSkill
- reflectSkill
- review-prSkill
- run-jobSkill
- ship-prSkill
- show-me-your-workSkill
- t3-previewSkill
- tddSkill
- teachSkill
- technical-writingSkill
- to-specSkill
- typescript-best-practicesSkill
- unslopSkill
- wayfinderSkill
- whySkill
- wizardSkill
- worktree-cleanupSkill
- writing-for-agentsSkill
The file
Files
Refactoring
You own the contract. The structure changes. The behavior does not. Distinct from Feature, which adds behavior, and Bug fix, which corrects it.
If the cleanup reveals a missing feature or a real bug, record it as a follow-up. Changing that behavior needs its own authorized scope under implement or bug-fix. Preserve the current contract during the refactor. If a defect prevents safe delivery, report the blocker instead of shipping it.
For work spanning several PRs, use multi-phase-plan when a plan is needed. Keep an existing execution owner and shared store. For a pause or transfer, follow handoff.
- Establish the behavior contract first. Use how over the affected subsystem, reusing prior grounding. Run existing characterization tests, snapshots, or an equivalence harness against the unchanged code. Add missing coverage before moving structure, following test behavior. Include relevant outputs, errors and their timing, side effects, and cleanup order. Type check and lint alone do not establish the contract.
- Name the structure the code is missing per model the domain. Keep code whose structure is already clear and local. The reshape must remove complexity, not add indirection.
- Name the target shape. State the intended module layout, types, and call graph using foundational thinking and redesign from first principles. For an unsettled design across function boundaries, use architect before the move. Reuse a settled design. Mechanical renames need no design competition.
- Subtract before you add. Delete dead code, collapse one-caller wrappers, drop redundant validators, and remove orphan references within the agreed scope. Each deletion must preserve the recorded contract. Ship the smallest change that reaches the target shape under laziness protocol. Revert speculative cleanup that does not help.
Move in small steps, keeping characterization checks passing. For internal APIs whose callers are all in scope, migrate callers and delete the old API in the same wave. Preserve compatibility required by external consumers or a staged migration. Spot-check renames in code, strings, prose, and back-references.
Delegate mechanical edits when available with specific paths, names, and behavior to preserve. Review the diff yourself. When delegation is unavailable, make a separate review pass.
Apply no-comments to changed code and TypeScript guidance when relevant.
- Prove behavior is unchanged on the real artifact. For larger reshapes, run an equivalence check over old and new outputs or replay a recorded baseline. Include the observable effects named in step 1. Use the project's verification skill or available tools on the interface the change affects. Inspect the evidence yourself. Missing or inconclusive verification is not a pass.
- Confirm the change is worth keeping. The success measure is reduced reader load. If the diff does not lower reader load somewhere, revert only this attempt's changes, preserving unrelated work.
- Keep small ordered commits under sequence verifiable units, with each behavior-preserving slice green before the next. Preserve commits already under review. For standalone work, use review-pr in fix-and-review mode, then open-pr within the authorized delivery scope. Honor local-only requests. When used within an active execution workflow, whether inline or delegated, return verified results and follow that workflow's commit, review, and delivery instructions. Hardening, merging, and deployment require their own authorization.
Reply: the structure that changed, the preserved behavior, the equivalence evidence, what became easier to understand, and what shipped or was reverted.
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.

