Whisk the flour, cocoa, baking powder, salt, cinnamon, allspice, black pepper, and cayenne in a medium bowl until well mixed.
Beat the softened butter and sugar in a large bowl with an electric mixer on medium speed for 2 to 3 minutes, until light and creamy.
Beat in the egg and vanilla until smooth.
Add the flour mixture on low speed and mix just until a soft dough forms. Do not overmix.
Divide the dough in half. Roll each half into a log about 2 inches across and 6 inches long. Wrap each log in plastic wrap.
Refrigerate the logs for 30 minutes, then freeze for 1 hour, until firm enough to slice cleanly.
Heat the oven to 375°F and line two baking sheets with parchment paper. Cut each log into 12 slices, about 1/2 inch thick, and place 2 inches apart on the sheets.
Bake for 9 to 11 minutes, until the edges look set and the centers still look a little soft. Cool on the sheets for 10 minutes, then move to a wire rack to cool completely.