Today's world faces multiple challenges, including climate change, biodiversity loss, and food security. In addition, in the post-pandemic era, there is an urgent need to re-design urban habitats to reduce the epidemic's enduring impacts and reconnect citizens with healthy community activities. As a city with the top population density level in the world, Hong Kong is home to many high-rise communities. This article took the architectural design competition “Green Tower Hong Kong” as an entry point to discuss the technical feasibility and design strategies of integrating high-rise residential buildings with urban agriculture to improve urban food security, enhance on-site solar energy utilization, and develop a sustainable residential environment conducive to low-carbon living and working. The issue of how to improve the dietary structure of Hong Kong residents and reconnect them through space design was focused. Finally, taking the site of Kwun Tong Center as the case study, a resilient residential high-rise building integrated with shared gardens and greenhouses was proposed with a technical-oriented methodology and optimization framework. The final design of mixed-use buildings can provide apartments for 2500 individuals, produce 340,750 kg of vegetables with 156 % self-sufficiency, and generate electricity of 1,080,000 kWh annually. This paper examines strategies for integrating urban agriculture into high-rise residential buildings in high-density urban environments. It proposes a technology-based design optimization method, offering a reference for future explorations of low-carbon, resilient communities.