Preheat the oven to 325 with the rack in the middle. Line 2 baking sheets with parchment paper or a silpat.
Whisk flour, cocoa, baking powder, cayenne, ground ancho chile, baking soda and salt together in a bowl.
Whisk brown sugar, eggs and vanilla together in a large bowl. Combine chocolate and butter in a bowl and microwave at 50 percent power, stirring occasionally until melted, about 2-3 minutes.
Whisk chocolate mixture into egg mixture until combined. Fold in flour mixture until there are no dry streaks. Let the dough sit at room temperature for 10 minutes.
Place granulated sugar and confectioners’ sugar in separate shallow dishes. Working with 2 tablespoons of dough at a time, roll into balls. Drop dough balls directly into the granulated sugar and roll to coat. Then roll in confectioners’ sugar evenly to coat. Evenly space dough onto the baking sheets.
Bake cookies, 1 sheet at a time, until puffed and cracked and edges have begun to set but centers are soft, about 12 minutes, rotating the sheet halfway through baking. Let cool completely on a sheet before serving.