01 - Heat olive oil in a large skillet over medium heat.
02 - Add chopped onion and sauté for 2 minutes until softened.
03 - Stir in garlic and cook for 30 seconds until fragrant.
04 - Add mushrooms and sauté for 4–5 minutes until browned and their moisture is released.
05 - Add cauliflower florets. Season with salt, black pepper, and red pepper flakes if using. Sauté for 7–8 minutes, stirring occasionally, until cauliflower is just tender.
06 - Add spinach and cook, stirring, until wilted (about 1–2 minutes).
07 - Reduce heat to low. Add pesto and toss everything to coat evenly. Adjust seasoning if needed.
08 - Remove from heat. Top with grated Parmesan, pine nuts, and fresh basil before serving.