Preheat oven to 350 degrees F. Line an 8 inch square metal pan with foil and spray foil with cooking spray or just line it with nonstick foil.
Melt the butter in a saucepan or microwave-safe dish, then remove from heat and let cool.
Thoroughly stir together the flour, baking soda, and salt in a mixing bowl. Stir in the sugar and the oats.
Whisk the egg yolk and vanilla into the cooled melted butter, then pour into dry mixture and stir until crumbly. Reserve about 1 cup of the mixture and put it in the refrigerator to chill (it's easier to crumble evenly if it's cold). Press remaining into the pan.
Unwrap the chocolate squares and arrange them in an even layer across the dough.
Crumble the reserved dough over the top.
Bake for 20 to 22 minutes, then let cool completely at room temperature (or chill to speed things up). Sprinkle on chips or nuts if using.