What problem does it solve?
Codebases naturally accumulate "code smells" like duplication, complex functions, and poor naming, leading to reduced maintainability and increased technical debt. This skill provides patterns and tools to systematically identify and address these issues.
Core Features & Use Cases
- Code Smell Detection: Includes scripts (
detect-duplicates.sh, complexity-check.sh) to automatically identify duplicate code, measure function complexity, and analyze naming quality.
- Refactoring Pattern Guidance: Offers detailed instructions and examples for common refactoring patterns like Extract Method, Extract Class, Simplify Conditionals, and Remove Duplication.
- Structural Improvement Techniques: Guides on improving module organization, dependency management, and separation of concerns, enhancing overall code architecture.
- Refactoring Checklist: Provides a checklist to ensure refactorings preserve functionality, maintain backward compatibility, and are covered by tests.
- Use Case: A developer is tasked with improving the maintainability of a legacy module. This skill can analyze the code to detect duplicate sections and highly complex functions, then provide guidance and examples for applying refactoring patterns like "Extract Method" to simplify the codebase.
Quick Start
Analyze the 'src/utils.js' file for code complexity and detect any duplicate code patterns within the 'src/' directory.