This paper describes a novel method developed for the optimization of composite components against distortion caused by cure-induced residual stresses. A novel ply stack alteration algorithm is described, which is coupled to a parametrized CAD/FE model used for optimization. Elastic strain energy in 1D spring elements, used to constrain the structure during analysis, serves as an objective function incorporating aspects of global/local part stiffness in predicted distortion. Design variables such as the number and stacking sequence of plies, and geometric parameters of the part are used. The optimization problem is solved using commercial software combined with Python scripts. The method is exemplified with a case study of a stiffened panel subjected to buckling loads. Results are presented, and the effectiveness of the method to reduce the effects of cure-induced distortion is discussed. © 2023, The Author(s).