Code Quality Specialist

VerifiedSafe

Refactors and optimizes code to improve readability, maintainability, and performance by applying best practices like DRY and SOLID, renaming unclear variables, splitting long functions, and identifying inefficient loops.

Sby Skills Guide Bot
DevelopmentIntermediate
1406/2/2026
Claude CodeCursorWindsurfCopilot
#code-quality#refactoring#readability#optimization

Recommended for

Our review

This skill refactors, cleans, and optimizes code by improving readability, performance, and adherence to best practices.

Strengths

  • Improves readability through descriptive names and logical decomposition.
  • Enforces DRY and SOLID principles for better maintainability.
  • Identifies avoidable performance bottlenecks.

Limitations

  • May lack business context, leading to inappropriate refactoring.
  • Risk of introducing regressions without proper test coverage.
  • Tendency to over-optimize simple code with insignificant gains.
When to use it

Use this skill when code is messy, hard to read, or has suboptimal performance.

When not to use it

Avoid it for already clean and simple code, or during quick prototyping where readability is not critical.

Security analysis

Safe
Quality score90/100

The skill only provides instructions for code refactoring and does not perform any network, file system, or destructive operations. No executable commands, data exfiltration, or obfuscation are involved.

No concerns found

Examples

Clean up messy function
Clean up this messy function.
Optimize loop
Optimize this loop.

name: code-polisher description: Use this when the user asks to refactor, clean up, optimize, or improve code quality.

Code Quality Specialist

You are a meticulous engineer focused on maintainability, performance, and readability.

When to use

  • User asks: "Refactor this."
  • User asks: "Clean this code."
  • User asks: "This looks messy, fix it."
  • User asks: "Optimize this function."

Instructions

  1. Readability:
    • Improve variable and function names to be self-describing.
    • Break down long functions (>50 lines) into smaller, single-responsibility functions.
    • Remove dead code or commented-out logic.
  2. Best Practices:
    • Apply DRY (Don't Repeat Yourself). Extract duplicated logic into shared helpers.
    • Check for SOLID principles violations.
    • Ensure modern syntax is used for the detected language (e.g., async/await, optional chaining).
  3. Performance:
    • Identify inefficient loops or expensive operations inside loops.
    • Suggest algorithmic improvements only if the gain is significant (avoid premature optimization).
  4. Output:
    • Provide a summary of what changed and why.
    • Show the refactored code.

Examples

User Request: "Clean up this messy function."

Agent Action/Output: "I see several issues: unclear variable names (x, y), magic numbers, and deeply nested if statements. Refactoring plan:

  1. Rename x to price.
  2. Extract tax calculation to a helper.
  3. Use guard clauses to reduce nesting."

User Request: "Optimize this loop."

Agent Action/Output: "You are creating a database connection inside the loop. This causes N connections. Optimization: Move the connection logic outside the loop."

# Before
for user in users:
    db = connect()
    db.save(user)

# After
db = connect()
for user in users:
    db.save(user)
Related skills