Preheat your oven to 375°F (190°C). Bring a large pot of salted water to a boil and cook the pasta according to package directions until al dente. Drain and set aside.
While the pasta cooks, heat olive oil in a large skillet over medium heat. Add minced garlic and sauté for about 30 seconds until fragrant. Add the chopped spinach and cook until wilted, about 2-3 minutes. Remove from heat.
In a large mixing bowl, combine softened cream cheese, sour cream, garlic-spinach mixture, chopped artichoke hearts, onion powder, salt, pepper, and red pepper flakes if using. Stir until smooth and well combined.
Add the cooked pasta and diced chicken to the creamy mixture. Stir to coat everything evenly. Transfer the pasta mixture to the prepared baking dish, spreading it into an even layer.
Sprinkle shredded mozzarella and grated Parmesan evenly over the top. Bake uncovered for 20-25 minutes, or until the cheese is bubbly and golden brown on top.
Remove from the oven and let the bake cool for 5 minutes before serving. This pause helps the sauce thicken slightly, making it easier to plate. Enjoy this comforting dish with a crisp green salad or garlic bread for a complete meal.