Cook the pasta as directed, reserving ½ cup pasta water before draining, and setting aside.
While the pasta cooks, sprinkle the chicken with ½ teaspoon salt, ¼ teaspoon pepper, ½ teaspoon garlic powder, and ½ teaspoon onion powder. Toss to coat evenly.
Heat the oil in a large, high-sided skillet or Dutch oven over medium-high heat. Once the oil is hot, add the chicken in a single layer. Cook the chicken pieces for 2 to 3 minutes per side until each side until browned. Cook in batches if your skillet isn't large enough so the chicken browns instead of steaming.
Add the beans, sun-dried tomatoes, and garlic to the skillet. Season with the remaining salt, pepper, garlic powder, and onion powder and stir together. Let the mixture cook for another 2 to 3 minutes, or until the chicken pieces are completely cooked through and have an internal temperature of 165℉.
Reduce the heat to low. Add ¼ cup of the reserved pasta water, pesto, Parmesan cheese, and cream cheese. Stir together until the cream cheese has completely melted into the mixture. If mixture is too thick, add in the remaining pasta water.
Add the spinach and cooked pasta. Stir together and let the spinach wilt down in the heat.
Remove the skillet from the heat and stir in the lemon juice. Taste and season with additional salt and pepper, if needed. Top with the mozzarella cheese, cover and let the cheese melt for a few minutes. If you are using an oven safe skillet, place it under the broiler to melt the cheese...watching it closely.
Serve topped with chopped fresh basil, if desired. Let leftovers cool before storing in an air-tight container in the fridge for up to 3 days.