Spectroscopy plays a key role in astronomical observations, serving as one of the most important tools in this field. The forthcoming generation of space and ground-based telescopes will incorporate optical and near-infrared spectrographs, providing powerful tools to explore frontier areas like cosmology and exoplanets. However, the use of traditional spectrographs based on diffraction gratings in large ground-based telescopes presents significant challenges related to size, weight, thermal and mechanical stability, as well as cost. To address these challenges, a new generation of ultra-compact optical spectrograph has been designed and developed, utilizing a planar waveguide chip for accurate wavefront modulation. This optical chip, known as the waveguide spectral lens (WSL), achieves simultaneous spectral dispersion and image focusing onto the detector plane at designed distance. The spectrograph comprises a WSL and a cylindrical grism lens, resulting in the creation of an ultra-compact astronomical optical spectrograph. Despite its compact size (similar to 43 cm x16 cm x 13 cm), the instrument maintains high optical throughput and provides a wide range of spectral resolution (R similar to 200 - 2000 at 600-950 nm). Once the full performance of this novel spectrograph is achieved in space or ground-based telescopes equipped with adaptive optics, it will revolutionize spectroscopy and find applications in various fields such as astronomy, remote sensing, physics, chemistry, and materials sciences.