Preheat the oven to 400°F (200°C). Line a baking sheet with parchment paper and set aside.
If your frozen spinach is not fully thawed, thaw it and press it in a fine-mesh strainer or squeeze it in a clean kitchen towel or paper towels to remove as much liquid as possible. Set the drained spinach aside.
Dice ½ medium onion and mince 4 cloves garlic.
Heat 1 tablespoon butter in a skillet over medium heat. Add the diced onion and cook, stirring occasionally, until softened, about 3–4 minutes.
Add the minced garlic to the skillet and cook, stirring, for about 1 minute. Add the drained spinach to the skillet, season with salt and pepper to taste, and cook until any remaining moisture has mostly evaporated, 2–4 minutes more. Remove from heat.
Transfer the spinach mixture to a large bowl. Add 2 tablespoons chopped parsley or dill, ½ cup crumbled feta cheese, ½ cup shredded mozzarella or parmesan cheese, and 4 oz cream cheese (softened or at room temperature). Gently mix until the cheeses and herbs are evenly incorporated. Adjust salt and pepper if needed (remember feta is salty).
Thaw the 2 sheets puff pastry according to package instructions. Lightly flour your work surface and roll each sheet briefly to smooth any seams (if desired). Cut each sheet into rectangles or squares approximately 4 × 6 inches.
Place a portion of the filling in the center of each pastry rectangle, leaving about a ½-inch border around the edges. (Alternatively, you can spread the filling over one full sheet, place the second sheet on top, and cut into rectangles or small squares.)
Fold each pastry over the filling (fold in half or bring the top piece over the bottom) and press the edges to seal. Crimp the edges with a fork. Cut a few small slits in the tops to allow steam to escape.
Transfer the sealed pastries to the prepared baking sheet. Brush the tops with the beaten egg.
Bake in the preheated oven for 20–25 minutes, or until the pastries are puffed and golden brown. Let cool a few minutes before serving.