ag-refatorar-codigo

Refactor code incrementally with commits and passing tests.

19|4|Updated Mar 7, 2026
One-click install
npx skills add https://github.com/andregusman-raiz/a-gusman-claude --skill ag-refatorar-codigo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ag-refatorar-codigo
Source: https://github.com/andregusman-raiz/a-gusman-claude/tree/main/skills/ag-refatorar-codigo
Command: npx skills add https://github.com/andregusman-raiz/a-gusman-claude --skill ag-refatorar-codigo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Realiza a refatoração de código sem alterar o comportamento externo, garantindo que o sistema continue funcionando durante todo o processo, com commits incrementais para cada passo.

Core Features & Use Cases

  • Refatoração incremental: divide o trabalho em etapas curtas, cada uma gerando um commit que pode ser revertido.
  • Conservação de comportamento: valida que os testes existentes permanecem verde antes de avançar.
  • Isolamento de mudanças: utiliza worktree e controles para evitar impactos em branches de trabalho.

Quick Start

Inicie o agente de refatoração com o protocolo incremental descrito e siga os passos garantindo que os testes continuem passando.

Frequently Asked Questions about ag-refatorar-codigo

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

FAQPage Schema
How do I refactor code incrementally without changing its external behavior?

Incremental code refactoring without changing external behavior is achieved by dividing changes into small steps, isolating modifications in a worktree, and generating a commit for each step. This approach ensures the system continues functioning throughout the process.

What is the best way to ensure tests stay green during a code refactor?

To ensure tests stay green during a code refactor, enforce preconditions that validate all existing tests are passing before advancing to the next step. This guarantees external behavior remains unchanged throughout the incremental process.

Can I use a git worktree to isolate refactoring changes from my main working branch?

Yes, you can use a git worktree to isolate refactoring changes from your main working branch. Worktree isolation prevents impacts on active branches while applying incremental structural modifications to specified modules or patterns.

What are the prerequisites for starting an automated code refactoring process?

The prerequisites for starting an automated code refactoring process include having a passing test suite to validate behavior conservation and specifying the target modules or patterns to modify, ensuring a safe baseline before isolating changes.

Why should I generate a commit for each step when refactoring code structure?

Generating a commit for each step when refactoring code structure allows you to easily revert specific changes if a test fails. This incremental commit strategy maintains system stability by ensuring only verified modifications advance.