The construction of dams has brought many benefits to human society. However, it has also altered the natural hydrological regime, affected aquatic organisms' habitat conditions and decreased important fishery resources. In the post-dam construction era, it has become crucial to evaluate the ecological flow requirements for all stages of fish life and ensure the provision of dynamic flow pulsation, particularly during the spawning stage. Here, we proposed a Reservoir Operation Model for Fish Habitat across Life Stages (ROM-FHLS) to reconcile the apparent contradiction between fish habitat preservation and hydropower generation in the Yangtze River Basin. Compared with the conventional outflow conditions, our model demonstrated significant improvements in power generation and suitable habitat area during the migration, spawning and incubation, and juvenile periods. Specifically, we observed average increases of 15.2%, 13.1%, and 6.7% in power generation, and enhancements of 16.5%, 17.3%, and 1.8% in suitable habitat area, respectively. Our approach advocates for the comprehensive protection of fish throughout their entire life cycle while highlighting the feasibility of enhancing fish habitats without compromising power generation. Furthermore, we proposed an outflow scheme that incorporates pulsation patterns into reservoir operations to effectively stimulate fish spawning activities. This study presents a fresh perspective on comprehending the intricate interplay among dam-controlled hydrological processes, river hydrodynamic environment, and fish behavior. The findings have the potential to enhance fish spontaneous reproduction and aid in the recovery of aquatic populations in large dammed rivers.