Preheat the oven to 400 degrees Fahrenheit.
Season the chicken with salt and ground black pepper. Set aside.
In a large pot of salted water, cook the pasta until just al dente. The pasta will cook in the oven after it is mixed with the rest of the ingredients so make sure it doesn’t overcook.
While the pasta cooks, heat the oil in an oven safe skillet over medium heat.
Add the onions and cook, stirring frequently, for about 4 minutes or until the onions become translucent.
Stir in the chicken and cook for about 4-6 minutes or until cooked through. Stir in the garlic and the Italian seasoning and cook for about a minute. Pour in the marinara and red pepper flakes and lower the heat.
Drain the pasta and reserve about ¼ cup of the pasta cooking water.
Add the drained pasta to the skillet and half of the Parmesan cheese. Stir to combine. If the mixture seems a bit dry, stir in the reserved pasta water.
Top the pasta with the Mozzarella cheese and the remaining Parmesan cheese. Bake for 10 to 15 minutes or until the cheese has melted. If you don't have an oven-safe skillet, coat a 9"x13" baking pan with cooking spray.
Remove from the oven and serve garnish with chopped basil or parsley.