Preheat oven to 400 degrees. Cook pasta according to package directions.
While pasta is cooking, add the olive olive to a large skillet over medium heat.
Add the onions and garlic and cook for 1-2 minutes. Add the chicken and cook until done.
Stir in the cooked pasta, marinara sauce, red pepper flakes, and Parmesan. Season with salt and pepper.
Sprinkle with mozzarella and bake for 5-10 minutes until cheese melts. If you don't want to turn on the oven just cover the skillet with a lid. Garnish with basil if desired and serve.