Zeolitic imidazolate frameworks (ZIFs) are commonly used to create complex hollow structures for energy applications. This study presents a simple method to produce a novel hollow nanoprism Co@C hierarchical composite from ZIF-67 through high-temperature treatment at 800 °C. This composite serves as a platform for Ru nanoparticle deposition, forming RuCo@C hollow nanoprism (RuCo@C HNP). As an electrocatalyst in 1 M KOH, RuCo@C HNP exhibits excellent hydrogen evolution reaction (HER) performance, with a low overpotential of 32 mV to reach 10 mA cm-2, a Tafel slope of 39.67 mV dec-1, a high turnover frequency (TOF) of 3.83 s-1 at ƞ200, and stable performance over 50 h. It also achieves a low ƞ10 of 266 mV for the oxygen evolution reaction (OER) with a Tafel slope of 45.22 mV dec-1. Density functional theory (DFT) calculations reveal that Ru doping in Ni/Co maintains a low water dissociation barrier, reduces the energy barrier for the OER rate-determining step, and creates active sites for H*, enhancing adsorption/desorption abilities. These results are attributed to the synergy between Co and Ru and the hollow prism structure's increased surface area. This method for synthesizing hollow structures using ZIF composites shows promise for applications in the energy sector.