We consider the optimal shape design of polymer distributors used for industrial fiber spinning. In this laminar flow problem the residence time, the volume-averaged age distribution of the fluid particles, has to be controlled to avoid material degradation. The residence time is modelled by an advection-diffusion-reaction equation with the fluid velocity being the transport field. This approach is more suitable for PDE-constrained shape optimization than the Lagrangian particle-tracking approach, where the observable is a finite set of trajectories. In order to develop an efficient shape optimization algorithm we derive the shape gradient of a tracking-type cost functional by introducing the adjoint state.