Preheat oven to 350°F.
Cook pasta shells according to package directions until al dente. Drain and set aside to cool slightly.
Heat oil in a pan add minced garlic and chopped onion until golden brown.
Add chopped spinach and stir fry until wilted and all moisture evaporated.
Switch off the flame, mix together ricotta cheese, red pepper flakes, Italian seasoning, ½ cup cheddar, ½ cup mozzarella, Parmesan, salt, and pepper until well combined.
Spread marinara sauce evenly over bottom of prepared baking dish. Sprinkle half of chopped basil.
Stuff each cooked pasta shell with a generous spoonful of the cheese-spinach mixture. Place/arrange stuffed shells stuffing-side up in baking dish.
Sprinkle remaining cheddar-mozzarella cheese and chopped basil over top. Cover the dish with aluminum foil.
Bake for 30 minutes until hot and bubbly. Let cool 5 minutes before serving.