01 - Preheat oven to 400°F. Line a baking sheet with parchment paper.
02 - Heat olive oil in a skillet over medium heat. Add onion and garlic; cook until translucent, about 2 minutes.
03 - Add diced mushrooms and cook until softened and liquid has evaporated, approximately 5 minutes.
04 - Stir in chopped spinach and cook until wilted, about 2 minutes. Remove skillet from heat and let mixture cool slightly.
05 - Mix cooled vegetables with ricotta cheese, grated Parmesan, thyme, salt, and black pepper in a bowl until evenly combined.
06 - Unroll puff pastry on a lightly floured surface and cut into 8 equal squares.
07 - Place a generous spoonful of filling in the center of each pastry square. Fold each into a triangle or rectangle, pinching edges to seal securely.
08 - Arrange filled puffs on prepared baking sheet. Brush tops with beaten egg.
09 - Bake for 20 to 25 minutes until pastry is golden and puffed.
10 - Allow to cool slightly before serving warm.