Preheat oven to 350 degrees F.
Sift together flour, cocoa, salt, allspice and cayenne pepper. Set aside.
In a medium bowl, beat together butter and icing sugar until light and fluffy. Add the egg yolks one at a time. Beat well after each egg yolk. Add the vanilla and sifted dry ingredients. Beat just until blended.
Pat dough into a disc. Wrap dough in plastic and refrigerate for at least 30 minutes. Remove dough from fridge.
Cover a baking sheet with parchment paper. Put desired tip into piping bag and pipe cookies onto baking sheet. Alternately, fill cookie press and press cookies onto baking sheet. Bake for 8 to 12 minutes until cookie bottoms are golden and firm. Cool on wire rack.