Boil the pasta: Bring a large pot of salted water to a boil. Cook pasta until just shy of al dente.
Reserve 1 cup of pasta water before draining.
Sauté aromatics: In a large skillet, warm 1–2 tablespoons olive oil over medium heat. Add the chopped shallot and a pinch of salt. Cook until softened, 2–3 minutes.
Stir in the garlic and cook 30 seconds, just until fragrant.
Cook the chicken: Add ground chicken, season with salt and black pepper, and break it into small crumbles with a spatula. Cook until no longer pink and lightly browned in spots, about 5–7 minutes. If using red pepper flakes, add a pinch now.
Deglaze lightly (optional): Splash in a few tablespoons of pasta water to lift any browned bits from the pan.
This adds flavor to the sauce.
Add tomatoes and greens: Stir in cherry tomatoes and cook 1–2 minutes until they start to soften. Add spinach or arugula and toss until just wilted.
Combine with pasta: Add drained pasta to the skillet. Reduce heat to low.
Stir in pesto: Add 1/2 cup pesto and a splash of pasta water.
Toss until the pasta is coated and glossy. Add more pesto and water as needed to reach a silky consistency.
Finish the sauce: Add lemon zest and a squeeze of lemon juice. Sprinkle in a generous handful of Parmesan and a drizzle of olive oil.
Toss again. Taste and adjust salt, pepper, or lemon.
Serve: Plate with extra Parmesan and a twist of black pepper. If you like heat, finish with more red pepper flakes.