Enantioselective iridium-catalyzed allylic substitutions were used to prepare N-allyl hydroxamic acid derivatives that were suitable for ring-closing metathesis, giving N-methoxylactams. Reactions of these derivatives with Grignard or organolithium compounds gave hemiaminals, which could be reduced diastereoselectively via acyliminium intermediates to give cis-piperidines or cis-pyrrolidines with substituents in the 2,6- or 2,5-positions, respectively. In addition, compounds with a quaternary carbon center could be synthesized by corresponding reactions with potassium cyanide/AcOH. The procedures were applied in the syntheses of alkaloids (-)-209D and (+)-prosophylline.