Preheat the oven to 350 °F (180 °C).
Cook the ziti pasta in boiling water according to package instructions until al dente; drain and set aside.
Heat olive oil in a large skillet over medium heat.
Add diced chicken to the skillet and season with salt, pepper, garlic powder, and Italian seasoning.
Cook the chicken until browned and cooked through; remove and set aside.
In the same skillet, add more oil if needed and sauté the chopped onion until translucent.
Add minced garlic and cook for about 1 minute, stirring frequently.
Pour in the marinara sauce and bring to a simmer.
Return the cooked chicken to the skillet and stir to combine with the sauce.
In a large bowl or baking dish, mix the cooked pasta with the chicken sauce until evenly coated.
Transfer the mixture to a baking dish and evenly sprinkle shredded mozzarella and grated Parmesan cheese on top.
Bake for 20 to 25 minutes until the cheese is melted, bubbly, and golden brown.
Let cool slightly, garnish with fresh basil or parsley if desired, and serve warm.