Preheat the oven to 200°C or gas mark 6.
Pour the oil into a saucepan and gently cook the beef on a medium heat until it is brown. Remove and set aside.
In the same pot cook the onions for about 3 minutes. Add the garlic and cook for a further minute.
Put the beef back into the pot and sprinkle the flour over it. Cook for a further 3 minutes.
Pour in the Guinness and stock and bring the mixture to the boil.
Reduce the heat and leave to simmer for 90 minutes. Remove from the heat once the meat is tender and you have a thick pie filling consistency.
Divide the pie filling between four ramekins.
Cut the puff pastry into four squares and place over the top of each pie dish. Secure it firmly around the ramekins and stab the middle of the pie with a fork.
Brush the pastry with egg and bake for 18-22 minutes until the pastry is puffed and golden brown.
Make a double batch and freeze the leftovers for another day.