Preheat the oven to 200°C/390°F (180°C fan-forced).
Mix the egg, garlic, salt, and pepper, then stir in the spinach, ricotta, cheddar, and parmesan.
Cut each puff pastry sheet into 9 equal squares, making 18 squares total.
Generously oil 18 holes in two standard muffin tins.
Press the pastry squares lightly into the muffin tin holes and divide the filling among them.
Bring the four corners toward the center and pinch to seal, leaving some spinach visible between the folds.
Lightly brush the tops with egg yolk, avoiding the sides.
Bake for about 25 minutes, until deep golden and crisp; the less-full tin may need about 5 extra minutes.
Rest for 5 minutes, then remove and serve warm or at room temperature.