Prep and preheat: Heat the oven to 400°F (200°C). Lightly oil a 9x13-inch baking dish or similar casserole.
Cook the pasta: Boil the pasta in generously salted water until just shy of al dente, about 1–2 minutes less than package directions. Reserve 1 cup of pasta water, then drain.
Season the chicken: Pat chicken dry.
Season with 1 teaspoon salt, 1/2 teaspoon black pepper, and a pinch of red pepper flakes if you like heat.
Brown the chicken: Heat 1 tablespoon olive oil in a large skillet over medium-high. Sear chicken in batches without crowding, 3–4 minutes per side, until lightly golden and nearly cooked through. Transfer to a plate.
Sauté aromatics: Lower heat to medium.
Add the remaining 1 tablespoon olive oil. Sauté onion until translucent, 3–4 minutes. Stir in garlic for 30 seconds until fragrant.
Avoid burning.
Build the sauce: Stir in the broth and scrape up browned bits. Reduce slightly, 1–2 minutes. Off heat, whisk in the pesto and cream (if using).
Taste and adjust salt and pepper. For a looser sauce, splash in pasta water.
Combine: Add the drained pasta, chicken, and any veg to the skillet. Toss gently to coat.
Sprinkle in Parmesan and a little lemon zest if you like brightness.
Assemble the bake: Spread the mixture in the baking dish. Top evenly with mozzarella. If using fresh mozzarella, tear into pieces for better coverage.
Bake: Bake uncovered for 12–15 minutes, until the cheese is melted and bubbling.
For a golden top, broil 1–2 minutes, watching closely.
Finish and serve: Rest 5 minutes. Garnish with fresh basil or a squeeze of lemon juice. Serve warm.