Pre-heat oven to 425°F.
Melt butter in a skillet over medium heat, then add onions. Sautee the onions until golden brown.
Add spinach and cook until wilted and the water has evaporated. Set aside.
In a large bowl, whip cream cheese, goat cheese, spinach, caramelized onions and spinach, dill, salt, chili flakes, wine, and garlic powder.
Spread out the puff pastry sheets, then spread half the cream cheese spinach mixture evenly over both puff pastry sheets. Make sure mixture is spread to the edges, especially the top edge of the puff pastry sheet.
Sprinkle the shredded cheese all over the top of cream cheese spinach mixture, evenly.
Roll over the bottom of the puff pastry sheet and keep rolling until a log is formed.
Seal the log closed by pressing down on the seams of the puff pastry sheet.
Allow to rest in the fridge for 2 hours in order to firm up.
Once firm, remove from the cooler and using a sharp knife, slice log into 12 pieces of pinwheels.
Place pinwheels at least 2 inches apart on baking sheet lined with parchment paper. Brush the top with beaten egg.
Bake in the oven for 15 minutes or until golden brown.
Remove pinwheels from oven and let them cool for a few minutes. Serve warm.