Locomotion is a complex motor task generated by spinal circuits driving motoneurons in a precise sequence to control the timing and vigor of movements, but the underlying circuit logic remains to be understood. Here we reveal, in adult zebrafish, how the diversity and selective distribution of two V2a interneuron types within the locomotor network transform commands into an appropriate, task-dependent circuit organization. Bursting-type V2a interneurons with unidirectional axons predominantly target distal dendrites of slow motoneurons to provide potent, non-linear excitation involving NMDA-dependent potentiation. A second type, non-bursting V2a interneurons with bidirectional axons, predominantly target somata of fast motoneurons, providing weaker, non-potentiating excitation. Together, this ensures the rapid, first-order recruitment of the slow circuit, while reserving the fast circuit for highly salient stimuli involving synchronous inputs. Our results thus identify how interneuron diversity is captured and transformed into a parsimonious task-specific circuit design controlling the vigor of locomotion.