refactor

Installation
SKILL.md

Refactor

Refactor what the user told you (e.g. PR, function, or file). By default, refactor what you're currently working on. If it isn't clear, ask the user.

Simplify

  • Do you see logic implemented twice? Is everything DRY?
  • Can logic be simplified?
  • Question & first-principle thinking: break everything down to ground truth — any previous assumptions might be false
  • Don't rubber-stamp what's already there
    • Code comments that justify a design ("X lives here rather than Y so that…") are claims to audit, not constraints to respect. For each, construct the alternative it argues against and compare — don't assume the documented choice is optimal.
  • Can boilerplate be removed? Do you see frivolous indirections?
  • Can frivolous tests be removed? Tests should verify behavior that isn't obvious from reading the code, not just reproduce its logic.

Clean abstractions

  • Pinnacle architectural split
  • Does each file and each function represent a sensible abstraction that is easy to understand?
  • Rate the seams, not just the boxes: for each call site, ask whether the responsibility sits on the right side of the boundary — should a caller's wrapper move down into the callee (or vice versa)? A function can be perfect in isolation yet still be in the wrong place.
Installs
1
Repository
brillout/skills
GitHub Stars
1
First Seen
10 days ago