expert-code-refactoring

Installation
SKILL.md

Refactoring Skill

This skill guides the agent in refactoring codebases by identifying technical debt and applying industry-standard patterns tailored to the specific technology stack.

General Refactoring Workflow

  1. Analyze Context: Read the file and its associated tests. Identify dependencies and usage patterns.
  2. Verify Tests: Before any changes, run existing tests to ensure a stable baseline.
  3. Identify Smells: Look for long methods, deep nesting, duplicate code, or tight coupling.
  4. Incremental Changes: Apply transformations in small, verifiable steps.
  5. Re-verify: Run tests after each significant change.

Architecture & Clean Code (Global)

  • Naming: Rename variables, functions, and classes to be descriptive and reveal intent. Avoid abbreviations.
  • AHA Programming: Avoid Hasty Abstractions. Only abstract code when the duplication is clear and the abstraction doesn't make the code harder to follow.
  • Functions: Keep functions small. Aim for a low number of parameters (prefer objects/records for many parameters).
  • Cognitive Load: Reduce nesting levels (aim for max 2-3 deep). Use early returns to keep the "happy path" aligned to the left.
Installs
7
GitHub Stars
15
First Seen
Jan 30, 2026
expert-code-refactoring — grishaangelovgh/gemini-cli-agent-skills