Begin by bringing a large pot of salted water to a boil. Add the spaghetti and cook according to the package instructions until al dente. Remember to reserve about 1 cup of the pasta water before draining!
In a large mixing bowl, combine the cooked chicken, pesto sauce, heavy cream, ricotta cheese, garlic powder, and half of the mozzarella and parmesan cheeses. Mix everything together until well combined.
Once the spaghetti is cooked and drained, add it to the bowl with the cheesy chicken mixture. Toss everything together, adding a little reserved pasta water if necessary to loosen the sauce.
Preheat your oven to 350°F (175°C). Pour the pasta mixture into a greased baking dish, spreading it out evenly. Top with the remaining mozzarella and parmesan cheese.
Bake in the preheated oven for about 20-25 minutes, or until the cheese is bubbly and golden brown. The aroma will fill your kitchen and have everyone eager to dig in!