Preheat your oven to 400°F (200°C) and line a baking sheet with parchment paper.
In a mixing bowl, combine the cooked spinach, diced ham, shredded cheddar cheese, cream cheese, garlic powder, onion powder, salt, and pepper. Mix until well combined.
Roll out the puff pastry on a lightly floured surface to smooth out any creases. Cut the pastry into squares, approximately 4 inches by 4 inches.
Place a spoonful of the filling in the center of each pastry square. Be careful not to overfill.
Fold the corners of the pastry over the filling to form a triangle or rectangle, depending on your preference. Press the edges to seal and use a fork to crimp the edges for a decorative touch.
Brush the tops of the puffs with the beaten egg to give them a golden color when baked.
Bake in the preheated oven for 15-20 minutes, or until the puffs are golden brown and flaky.
Remove from the oven and let cool slightly before serving.