We present a judicious design approach for optimizing semiconductor nanocavities, starting from single photonic atoms to build photonic molecules functioning as high-performance nanocavities. This design approach is based on exact analytical solutions to the Maxwell equations for collective Mie resonances. Conceptually, we distinguish different concepts of cavity modes including Mie mode, collective Mie mode, photonic-crystal (PC) band-edge mode, and Feshbach-type bound states in the continuum (BIC) mode. Using the design approach, we present a unique structure of nanocavity supporting the Feshbach-type BIC mode, capable of enhancing the emission rate of a dipolar emitter by orders of magnitude. This high-performance nanocavity suppresses radiative loss channels strongly via destructive interference and consequently channels the emission light efficiently into an in-plane bi-directional beam with a divergence angle of 10°. Engineering the geometrical parameters of the nanocavity for near-infrared frequency applications requires a fabrication tolerance of ±5 nm. This high accuracy is challenging for the mass production of devices. The fabrication accuracy can be relaxed greatly for mid-infrared frequency devices. As a showcase, we analyze and optimize the well-known PC L3 defect nanocavity for mid-infrared frequency applications in the framework of Feshbach resonance. We show that the optimal structure of this defect nanocavity requires a fabrication tolerance of ±50 nm. Our nanocavity design approach may be useful for near- and mid-infrared frequency applications.