Cycloaddition reactions generate chemical complexity in a single step. Here we report the crystal structures of three homologous plant-derived cyclases involved in the biosynthesis of iboga and aspidosperma alkaloids. These enzymes act on the same substrate, named angryline, to generate three distinct scaffolds. Mutational analysis reveals how these highly similar enzymes control regio- and stereo-selectivity.