agentleFS
sampleXbrosampleXbro/agentsmesh/.agents/skills/am-agent-code-refactor/SKILL.md

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.

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
  1. Distinctive:

    Test-driven refactoring with comprehensive coverage

    line 22

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Comprehensive test suite creation before changes
  2. Small, incremental changes with continuous validation
  3. Automated refactoring tools utilization when possible
  4. Code metrics tracking for improvement measurement
  5. Risk assessment and rollback strategy planning
  6. Team communication and change documentation
  7. Performance benchmarking before and after changes
  8. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.