01 - Boil pasta in a large pot with salted water until al dente; reserve 1/2 cup pasta water, then drain and set aside.
02 - Heat olive oil in a large skillet over medium heat. Add finely chopped onion and sauté for 3 to 4 minutes until translucent. Add minced garlic and cook for 1 minute.
03 - Stir in chopped artichoke hearts and spinach. Cook for 2 to 3 minutes, allowing spinach to wilt or heat through.
04 - Reduce heat to low and add cream cheese and sour cream. Stir until melted and incorporated with the vegetables. Slowly pour in whole milk, stirring continuously to form a smooth sauce.
05 - Add mozzarella and Parmesan cheese, stirring until blended and smooth. Season with salt, black pepper, and red pepper flakes if using.
06 - Add drained pasta to the skillet and toss to evenly coat with sauce. If the sauce appears too thick, incorporate a little reserved pasta water until desired consistency is reached.
07 - Taste and adjust seasoning as needed. Serve immediately, garnished with additional Parmesan if desired.