⚡AgentSkills
🧰 Engineering Essentials · Code Quality

Refactor without breaking behavior (Elixir)

Characterization tests, small mechanical steps, and clean-cut commits keeping refactors boring.

intermediate~35 minAll Software Engineers

Steps

  1. 1Pin current behavior with characterization tests where gaps exist
  2. 2Plan steps each leaving tests green; commit per step
  3. 3Prefer mechanical moves (extract, inline, rename) over clever rewrites
  4. 4Keep behavior changes in separate PRs from structure moves
  5. 5Measure complexity delta honestly; stop when readability peaks
  6. 6Leave the campsite cleaner but don't rebuild the forest
  7. 7Inspect supervision trees and mailbox depths via :observer
  8. 8Benchmark with Benchee; watch BEAM scheduler reductions

Common Pitfalls

  • ▲Big-bang rewrites losing hidden behaviors
  • ▲'While I'm here' feature creep inside refactor PRs

Commands

Install with skills CLI
$ npx skills add aniruddhaadak80/skills --skill code-quality-refactor-safely-elixir
Install globally
$ npx skills add aniruddhaadak80/skills --skill code-quality-refactor-safely-elixir -g

Tags

#refactoring#legacy-code#engineering-essentials#code-quality

Related skills

Review order, comment quality, and scope discipline making PRs fast and kind.

🧰 Engineering Essentials·~25m

Review order, comment quality, and scope discipline making PRs fast and kind.

🧰 Engineering Essentials·~25m

Review order, comment quality, and scope discipline making PRs fast and kind.

🧰 Engineering Essentials·~25m