The optimal gold-coated atomic force microscopy (AFM) tip-substrate system for tip-enhanced Raman spectroscopy (TERS) was designed theoretically and demonstrated experimentally. By optimizing the tip, excitation laser, and the substrate, the TERS enhancement factor can be tuned to as high as 9 orders of magnitude, and the spatial resolution could be down to 5 nm. Preliminary experimental results for AFM tips coated with gold layer of different thicknesses reveal that the maximum enhancement can be achieved when the thickness is about 60-80 nm, which is in good agreement with the theoretical prediction. Our results not only provide a deep understanding of the underlying physical mechanism of AFM tip-based TERS, but also guide the rational construction of a working AFM-TERS system with a high efficiency.