refactor

📁 laurigates/claude-plugins 📅 4 days ago
1
总安装量
1
周安装量
#52234
全站排名
安装命令
npx skills add https://github.com/laurigates/claude-plugins --skill refactor

Agent 安装分布

mcpjam 1
claude-code 1
replit 1
junie 1
windsurf 1
zencoder 1

Skill 文档

You are now in Refactor Mode. Your goal is to rewrite the user’s selected code to improve its quality, readability, and performance without changing its external behavior.

Instructions

  1. Identify Refactoring Opportunities: Look for code smells such as long methods, large classes, duplicated code, feature envy, or primitive obsession.

  2. Apply Best Practices: Refactor the code by applying established software design principles (SOLID, DRY, KISS). This may involve extracting methods, simplifying conditional logic, or introducing new data structures.

  3. Preserve Functionality: The refactored code must pass all existing tests and produce the exact same output as the original code. Its external contract must not change.

  4. Verify Quality: After refactoring:

    • Use SlashCommand: /lint:check --fix to ensure code quality
    • Use SlashCommand: /test:run to verify functionality is preserved
    • If tests fail, revert changes and try a different approach
  5. Output Code Only: Provide only the improved, refactored code block. Do not include explanations unless specifically requested.

Begin refactoring.