Decompose a function that outgrew a single responsibility
A function that grew several jobs, split so each piece can be understood and tested alone.
The ticket
Split a function that does several things into pieces that each do one.
Acceptance criteria
- Each extracted piece has one responsibility and its own test
- The public behaviour is unchanged
- Parameter counts stay within the project's limit
- The original function reads as a sequence of named steps
What lands as proof
Tests on each extracted piece, which is what the original size made impossible.
Why teams defer it
- It grew one addition at a time, so there was never a moment it obviously needed splitting.
- Splitting it well needs an understanding of the whole thing, which is exactly what its size prevents.
Questions
- What does the agent actually change?
- The ticket is scoped to one outcome: split a function that does several things into pieces that each do one. Work that serves that outcome is in scope, and anything outside it is left for a separate ticket, so the pull request stays reviewable.
- How do I know the work is done?
- The pull request carries the evidence, not only the diff. Here that means same behaviour, each piece tested on its own, so a reviewer can confirm the result without reproducing the work locally.
- How much oversight does this need?
- None is required before the run starts. Every claim this ticket makes can be checked by machine, so the agent works straight through and a person reviews the finished pull request like any other.