long-function-split
Installation
SKILL.md
Long Function Split
Refactor functions that do too many things into a cluster of smaller, well-named, single-purpose functions. The goal is code that reads like a table of contents — each function name tells you what happens; the body tells you how.
When to Apply This Skill
Trigger on any of:
- Function body ≥ 100 lines
- Multiple levels of abstraction in one body (e.g., validation + DB query + formatting + email send)
- Deep nesting (3+ levels of
if/for/try) - Comments like
// Step 1:,// Part 2:acting as section dividers — these are extraction hints - Multiple
returnpaths that each do substantial work - Hard-to-unit-test function (too many concerns to mock cleanly)