skills/en/tao-refactoring/SKILL.md
Safe refactoring methodology with code smell detection, step-by-step transformation, and regression prevention. Use when refactoring code, reducing technical debt, or improving code structure.
npx skillsauth add andretauan/tao tao-refactoringInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use when refactoring code, reducing technical debt, or restructuring modules.
Before ANY refactoring:
Fix: Extract Method
Fix: Guard Clauses / Early Returns
// Before:
if (user) {
if (user.active) {
if (user.hasPermission) {
doWork();
}
}
}
// After:
if (!user) return;
if (!user.active) return;
if (!user.hasPermission) return;
doWork();
Fix: Extract shared logic into a single function Only extract when logic is IDENTICAL — similar ≠ duplicate
Fix: Create value objects or enums
// Before: email is a raw string everywhere
// After: Email class with validation
Fix: Split into focused classes with single responsibility
Fix: Move method to the class that owns the data
testing
Estratégia de pirâmide de testes com análise de cobertura, identificação de edge cases e planejamento de testes. Use ao planejar testes, melhorar cobertura, identificar edge cases ou escrever especificações de teste.
development
Auditoria de segurança alinhada ao OWASP Top 10 com checklist para injection, XSS, autenticação, autorização, gestão de secrets e vulnerabilidades comuns. Use ao auditar segurança, revisar código de auth ou hardening de aplicação.
development
Metodologia de refatoração segura com detecção de code smells, transformação passo-a-passo e prevenção de regressão. Use ao refatorar código, reduzir dívida técnica ou melhorar estrutura.
testing
Decomposição expert de tarefas para criar PLAN.md no TAO. Quebra features em fases e tarefas com critérios de aceite, estimativas e dependências. Use ao planejar trabalho, criar fases ou decompor features.