Start by heating olive oil in a skillet over medium heat until shimmering. Add the chicken breasts and cook until they are golden and no longer pink in the middle. Be careful not to overcook; dry chicken is a common mistake.
While the chicken is cooking, boil water in a separate pot and season it with salt. Toss in the uncooked spaghetti, cooking it just until al dente. This will keep your pasta from becoming mushy during baking.
Once the chicken is done, set it aside and add diced onions to the skillet. Sauté until they are softened and translucent. Add minced garlic and let it become aromatic.
Sprinkle flour over the sautéed onion mixture. Stir for 2-3 minutes until it is lightly golden to eliminate any raw flour taste.
Gradually pour in the chicken broth and heavy cream, stirring continuously until the mixture is smooth and slightly thickened.
Mix in salt, black pepper, Italian seasoning, and the diced tomatoes. Taste and adjust seasonings as desired.
Add the cooked spaghetti to the skillet and stir until every noodle is coated with the creamy sauce.
Transfer half of the pasta mixture to a baking dish and sprinkle half of both cheese types on top.
Spread the rest of the spaghetti mixture over the first layer and top with the remaining cheddar and mozzarella.
Slip the baking dish into a preheated oven and bake until the top is golden and the cheese is bubbling.