  Geometric quantum gates are performed by using the geometric phase, making
them particularly robust to the pulse amplitude error due to the intrinsic
global property. However, in many systems, such as the silicon-based spin
qubits, the off-resonance error is the dominant noise, which can cause
dephasing and is always difficult to deal with for a geometric gate. Thus how
to deal with the off-resonance error is very significant for the application of
the geometric gates. A recent work in \emph{Phy. Rev. Appl. 16, 044005 (2021)}
reveals that by inserting two $\pi$-pulse dynamically corrected sequences into
the evolution paths, the holonomic quantum gate is effective to suppress the
pulse amplitude error, however it is still useless for combating the
off-resonance error. Inspired by this work, we combine using the techniques of
dynamical correction and path design. Surprisingly, we find that by picking up
a specific evolution path inserted by only a $\pi$-pulse dynamically corrected
sequence, the obtained optimized geometric gate is robust to the off-resonance
error, assuming the noise is static. Further, by calculating the filter
function considering the realistic $1/f$-type noise in silicon, the related
results show that the performance of the optimized geometric gate can also
surpass both the conventional geometric gate and the naive dynamical gate
constructed without using the geometric phase. Our results indicate dynamical
correction is an powerful tool to improve the geometric gate.
