We describe a unified synthetic strategy for efficient assembly of four new heterocyclic libraries. The synthesis began by creating a range of structurally diverse pyrrolidinones or piperidinones. Such compounds were obtained in a simple one-flask operation starting with readily available amines, ketoesters, and unsaturated anhydrides. The use of tetrahydropyran-containing ketoesters, which were rapidly assembled by our Prins cyclization protocol, enabled efficient fusion of pyran and piperidinone cores. A newly developed Au(I)-catalyzed cycloisomerization of alkyne-containing enamides further expanded heterocyclic diversity by providing rapid entry into a wide range of bicyclic and tricyclic dienamides. The final stage of the process entailed diversification of each of the initially produced carboxylic acids using a fully automated platform for amide synthesis, which delivered 1872 compounds in high diastereomeric and chemical purity.