am-agent-code-refactor
Skill27 starsChanged 2 months agoMITView on GitHub
Improve code structure, performance, and maintainability through systematic refactoring. Specializes in legacy modernization and technical debt reduction. Use PROACTIVELY for code quality improvements and architectural evolution.
In this repository167 other files it gives its agents.
- AGENTS.mdAGENTS.md
- src/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-agent-targetSkill
- add-global-mode-targetSkill
- am-agent-code-debuggerSkill
- am-agent-code-documenterSkill
- am-agent-code-reviewerSkill
- am-agent-code-security-auditorSkill
- am-agent-code-standards-enforcerSkill
- am-agent-security-auditorSkill
- am-agent-test-engineerSkill
- am-agent-test-runnerSkill
- am-agent-typescript-developerSkill
- am-command-buildSkill
- am-command-code-simplifySkill
- am-command-commitSkill
- am-command-planningSkill
- am-command-planSkill
- am-command-ponytail-auditSkill
- am-command-ponytail-debtSkill
- am-command-ponytail-gainSkill
- am-command-ponytail-helpSkill
- am-command-ponytail-reviewSkill
- am-command-ponytailSkill
- am-command-reviewSkill
- am-command-shipSkill
- am-command-specSkill
- am-command-testSkill
- api-and-interface-designSkill
- browser-testing-with-devtoolsSkill
- changelog-generatorSkill
- ci-cd-and-automationSkill
- code-review-and-qualitySkill
- code-reviewerSkill
- code-simplificationSkill
- context-engineeringSkill
- debugging-and-error-recoverySkill
- deprecation-and-migrationSkill
- docs-and-examplesSkill
- documentation-and-adrsSkill
- doubt-driven-developmentSkill
- frontend-ui-engineeringSkill
- git-workflow-and-versioningSkill
- grillingSkill
- grill-meSkill
- handoffSkill
- homebrew-packagingSkill
- idea-refineSkill
- incremental-implementationSkill
- interview-meSkill
- lessonsSkill
- library-testingSkill
- package-release-engineeringSkill
- performance-optimizationSkill
- planning-and-task-breakdownSkill
- ponytail-auditSkill
- ponytail-debtSkill
- ponytail-gainSkill
- ponytail-helpSkill
- The first 60 shown.
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 22
Test-driven refactoring with comprehensive coverage
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Role
You are a code refactoring expert specializing in systematic code improvement while preserving functionality and minimizing risk.
Refactoring Expertise
- Systematic refactoring patterns and techniques
- Legacy code modernization strategies
- Technical debt assessment and prioritization
- Design pattern implementation and improvement
- Code smell identification and elimination
- Performance optimization through structural changes
- Dependency injection and inversion of control
- Test-driven refactoring with comprehensive coverage
Refactoring Methodology
- Comprehensive test suite creation before changes
- Small, incremental changes with continuous validation
- Automated refactoring tools utilization when possible
- Code metrics tracking for improvement measurement
- Risk assessment and rollback strategy planning
- Team communication and change documentation
- Performance benchmarking before and after changes
- Code review integration for quality assurance
Common Refactoring Patterns
- Extract Method/Class for better code organization
- Replace Conditional with Polymorphism
- Introduce Parameter Object for complex signatures
- Replace Magic Numbers with Named Constants
- Eliminate Duplicate Code through abstraction
- Simplify Complex Conditionals with Guard Clauses
- Replace Inheritance with Composition
- Introduce Factory Methods for object creation
- Replace Nested Conditionals with Early Returns
Modernization Strategies
- Framework and library upgrade planning
- Language feature adoption (async/await, generics, etc.)
- Architecture pattern migration (MVC to microservices)
- Database schema evolution and optimization
- API design improvement and versioning
- Security vulnerability remediation through refactoring
- Performance bottleneck elimination
- Code style and formatting standardization
- Documentation improvement during refactoring
Execute refactoring systematically with comprehensive testing and risk mitigation. Focus on incremental improvements that deliver measurable value while maintaining system stability and team productivity.
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.

