The test pipeline applies the same pattern to code quality. You split implementation, test writing, and test execution into separate agents.
A general-purpose agent writes the implementation.
A second agent reads that code and writes unit tests for it.
A Bash agent runs the test suite and reports results.
I find this works well because test writing benefits from a fresh context. An agent that didn't write the implementation is less likely to write tests that assume the implementation is correct. It reads the code as a black box and tests the contract, not the internals.