Preheat the oven to 375°F (190°C).
Prepare the zucchini by cutting them in half lengthwise and scooping out the flesh, leaving about 1/4 inch of the shell intact. Chop the scooped-out flesh and set aside.
Heat olive oil in a pan over medium heat. Add the minced garlic and chopped onion, cooking until softened (about 2-3 minutes).
Add the chopped zucchini flesh, mushrooms, and spinach, cooking for another 5 minutes until tender. Remove from heat and let cool slightly.
In a mixing bowl, combine the cooked vegetables, ricotta cheese, Parmesan cheese, red pepper flakes, salt, and pepper. Stir until well combined.
Fill each zucchini half with the prepared mixture and place them on a baking sheet lined with parchment paper.
Bake for 20-25 minutes until the zucchini is tender and the filling is golden brown.
Garnish with fresh basil and serve warm.