  Coherent tunneling processes of multiple Cooper pairs across a Josephson
junction give rise to higher harmonics in the current phase relation. In this
work, we propose and study Josephson junctions based on
semiconductor-superconductor-ferromagnetic insulator heterostructures to
engineer nonsinusoidal current-phase relations. The gate-tunability of charge
carriers density in the semiconductor, together with the adjustable
magnetization of the ferromagnetic insulator, provides control over the content
of the supercurrent harmonics. At finite exchange field, hybrid junctions can
undergo a 0\,--\,$\pi$ phase transition, resulting in the supercurrent
reversal. Close to the transition, single-pair tunneling is suppressed and the
current-phase relation is dominated by the second-harmonic, indicating
transport primarily by pairs of Cooper pairs. Finally, we demonstrate that
non-collinear magnetization or spin-orbit coupling in the leads and the
junction can lead to a gate-tunable Josephson diode effect with efficiencies of
up to $\sim30\%$.
