The far-infrared and submillimeter portions of the electromagnetic spectrum provide a unique view of the astrophysical processes present in the early universe. Our ability to fully explore this rich spectral region has been limited, however, by the size and cost of the cryogenic spectrometers required to carry out such measurements. Micro-Spec (μ-Spec) is a high-sensitivity, direct-detection spectrometer concept working in the 450-1000 μm wavelength range which will enable a wide range of flight missions that would otherwise be challenging due to the large size of current instruments with the required spectral resolution and sensitivity. The spectrometer design utilizes two internal antenna arrays, one for transmitting and one for receiving, superconducting microstrip transmission lines for power division and phase delay, and an array of microwave kinetic inductance detectors (MKIDs) to achieve these goals. The instrument will be integrated on a ~10 cm2 silicon chip and can therefore become an important capability under the low background conditions accessible via space and high-altitude borne platforms. In this paper, an optical design methodology for μ-Spec is presented, with particular attention given to its two-dimensional diffractive region, where the light of different wavelengths is focused on the different detectors. The method is based on the maximization of the instrument resolving power and minimization of the RMS phase error on the instrument focal plane. This two-step optimization can generate geometrical configurations given specific requirements on spectrometer size, operating spectral range and performance. Two point designs with resolving power of 260 and 520 and an RMS phase error less than ~0:004 radians were developed for initial demonstration and will be the basis of future instruments with resolving power up to about 1200.