Sieve together the flour, salt and cayenne pepper, then add the chili flakes.
Grate the butter into your dry ingredients, then knead it all together along with the mashed potato. You want to form a moist but relatively stiff dough. Add a splash of milk to bring it together, if necessary.
Roll the dough out on a floured surface into a rectangle, roughly 24cm x 40cm. You want relatively even edges, so fold and roll them in if necessary.
Brush the pastry with the beaten egg, then scatter over the grated cheese.
Roll your pastry so that it’s reasonably tight. It should be roughly the diameter of a sausage roll.
Cut your roll into 1cm slices, then place on a greased baking sheet.