04 — Code Quality & Refactoring

Refactor existing codebases by fixing code smells and improving naming and function design.

Updated Feb 15, 2026
One-click install
npx skills add https://github.com/ftnilsson/agent-cli --skill 04-code-quality-refactoring
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 04 — Code Quality & Refactoring
Source: https://github.com/ftnilsson/agent-cli/tree/main/development/skills/04-code-quality-and-refactoring
Command: npx skills add https://github.com/ftnilsson/agent-cli --skill 04-code-quality-refactoring

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write code that is easy to understand, maintain, and change, and provides systematic methods for improving existing code without altering its behavior.

Core Features & Use Cases

  • Readability & Maintainability: Focuses on clear naming, concise functions, and identifying/fixing code smells.
  • Refactoring Techniques: Provides recipes for common refactoring tasks like Extract Method and Replace Conditional with Polymorphism.
  • Use Case: When reviewing a pull request, use this Skill to identify areas of code that are hard to understand or change, and apply refactoring techniques to improve their quality before merging.

Quick Start

Apply the principles of good code quality and refactoring to the current codebase.

Frequently Asked Questions about 04 — Code Quality & Refactoring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are common code smells and how do I identify them?

Code smells are structures in source code that indicate potential design issues, such as poor naming or overly long functions. You can identify them during pull request reviews to find areas that are hard to understand or change.

How do I refactor existing code without altering its behavior?

You can refactor code safely by applying systematic recipes like Extract Method or Replace Conditional with Polymorphism. These techniques improve readability and maintainability while preserving the original external behavior.

What's the best way to improve code readability and maintainability?

Improving code readability involves applying best practices for clear naming and concise function design. This makes the codebase easier to understand, maintain, and less prone to errors during future changes.

Can I use refactoring techniques during a pull request review?

Yes, you can use refactoring techniques during pull request reviews to identify hard-to-understand code. Apply systematic recipes to improve code quality and maintainability before merging the changes.

When should I use Replace Conditional with Polymorphism?

Use Replace Conditional with Polymorphism when refactoring complex conditional logic to improve software design. This technique enhances code maintainability and readability by delegating behavior to specific object types.