Melt the butter, then set it aside to cool slightly (Note 1).
In the bowl of a stand mixer fitted with a whisk attachment, beat the sugar and eggs on medium-high speed for 4–5 minutes, until the mixture is very pale yellow and thick. Add vanilla and mix briefly to combine.
Sift the flour, baking powder, and salt over the egg mixture. Using a rubber spatula, gently fold until almost combined (Note 2).
Pour in the melted, cooled butter. Fold gently until you have a smooth, uniform batter. Avoid overmixing (Note 3).
Transfer the batter to a piping bag, secure the end, and refrigerate for at least 1 hour (or overnight for best results).
When ready to bake, preheat the oven to 350°F (177°C). Lightly brush the wells of your madeleine pan with melted butter (Note 4).Snip off the end of the piping bag and pipe about 1½ tablespoons of batter into the center of each well. Do not spread—it will naturally fill the mold as it bakes. Bake for 12 minutes or until lightly golden and springy to the touch. Let the madeleines cool in the pan for a few minutes before turning them out onto a wire rack to cool completely (Note 5).
Wash and dry the pan completely. In separate microwave-safe bowls, melt the bittersweet and ruby chocolate in 20–30 second intervals, stirring each time, until smooth (Note 6).
Add a heaped teaspoon of melted chocolate into each well, spreading it evenly. Gently press a cooled madeleine on top of the chocolate.
Freeze the pan for 15 minutes to set the chocolate. Once firm, peel the madeleines from the pan. Repeat with remaining chocolate and cookies if using one pan.Serve immediately or store as directed below.