In a microwave-safe mug (at least 12-ounce capacity), whisk together the flour, sugar, baking powder, and salt with a fork until no lumps remain.
Lightly crush the lavender buds between your fingers or with the back of a spoon to release their oils, then add to the dry ingredients and stir to distribute evenly.
Add the milk, oil, vanilla extract, and egg yolk to the mug. Whisk vigorously with the fork for 20-30 seconds until the batter is completely smooth and no flour streaks remain.
Let the batter rest for 30 seconds to allow the lavender to infuse and the flour to hydrate fully.
Microwave on high power for 60-90 seconds, watching through the window. The cake is done when the top looks just set with a slight jiggle in the center. Start checking at 60 seconds to avoid overcooking.
Carefully remove the mug using oven mitts (it will be hot) and let cool for 1-2 minutes before serving. The cake will firm up slightly as it sits.