Preheat the oven to 375°F (190°C). Lightly grease a 9x13-inch baking dish.
Cook pasta according to package instructions. Drain and set aside.
In a large skillet, heat olive oil over medium heat. Sauté onion until soft, then add garlic and cook for 1 more minute.
Add shredded chicken, buffalo sauce, ranch dressing, sour cream, and half the cheddar cheese. Stir to combine.
Fold in the cooked pasta and mix until everything is well coated.
Pour the mixture into the baking dish. Top with remaining cheddar and mozzarella cheese.
Bake uncovered for 20–25 minutes until bubbly and golden.
Garnish with chopped green onions if desired, then serve hot.