  Semiconductor spin qubits demonstrated single-qubit gates with fidelities up
to $99.9\%$ benchmarked in the single-qubit subspace. However, tomographic
characterizations reveals non-negligible crosstalk errors in a larger space.
Additionally, it was long thought that the two-qubit gate performance is
limited by charge noise which couples to the qubits via the exchange
interaction. Here, we show that coherent error sources such as a limited
bandwidth of the control signals, diabaticity errors, microwave crosstalk, and
non-linear transfer functions can equally limit the fidelity. We report a
simple theoretical framework for pulse optimization that relates erroneous
dynamics to spectral concentration problems and allows for the reuse of
existing signal shaping methods on a larger set of gate operations. We apply
this framework to common gate operations for spin qubits and show that simple
pulse shaping techniques can significantly improve the performance of these
gate operations in the presence of such coherent error sources. The methods
presented in the paper were used to demonstrate two-qubit gate fidelities with
$F>99.5\%$ in Ref.~[Xue et al, Nature 601, 343]. We also find that single and
two-qubit gates can be optimized using the same pulse shape. We use analytic
derivations and numerical simulations to arrive at predicted gate fidelities
greater than $99.9\%$ with duration less than $4/(\Delta f)$ where $\Delta f$
is the difference in qubit frequencies.
