A command class whose execute() method does everything in one shot — fields and methods exist but no real sub-step structure justifies the class.
A command object whose execute() does everything in one shot collapses back to a plain function.
Before the refactoring
class ChargeCalculator {constructor(c, o) { this.c = c; this.o = o; }execute() { return this.c.base + this.o.tax; }}new ChargeCalculator(c, o).execute();
After the refactoring
function charge(c, o) { return c.base + o.tax; }charge(c, o);
Callers go through build-then-execute ceremony for what could be one function call; the class adds file count and indirection without internal decomposition benefit.
If the command holds genuinely useful intermediate state, flattening to a function regrows the temps it eliminated — confirm there's no real reuse first.
Fewer files, fewer constructors, less indirection — the caller sees one function instead of build-then-execute.
Collapsing a command that holds genuinely useful intermediate state — flattening it forces the agent to regrow the temps the command eliminated and re-thread them through helper params.