Line a baking tray with baking parchment and roll half the pastry on a floured surface to 25x25cm.
Cut a 23cm circle from the pastry, place it on the tray, and cover with cling film.
Repeat the process with the second half of the pastry and chill both circles.
Beat softened butter until creamy, then add caster sugar and beat until pale and fluffy.
Gradually beat the egg and egg yolk into the butter mixture one tablespoon at a time.
Stir in the ground almonds, flaked almonds, and almond extract, then chill for 15-20 minutes.
Spoon the filling onto one pastry circle leaving a 2cm border, brush with egg, and seal with the second circle.
Scallop the edges at 2cm intervals, brush the top with egg, and chill for 30 minutes.
Preheat the oven to 220°C.
Brush with egg again, score a pattern on top, make steam holes, and bake for 25-30 minutes.