Preheat oven to 350F and grease a 9” tart pan with non-stick spray and set aside (you can use a springform pan if needed).
In a mixing bowl, whisk your dry goods: all-purpose flour, sea salt, baking soda and baking powder and set aside for later.
In the bowl of a stand mixer cream together butter and sugars for 2 minutes on medium speed (with the paddle attachment); it should be fluffy. Scrape down the sides of the bowl to ensure everything is mixed well.
Run again medium speed for about 30 seconds with the egg and vanilla extract, then add in dry ingredients. Mix on low for about a minute.
If using any chocolate chips or chopped melts, add them in now and run to combine (you can do this by hand, but I find I get a better mix with the machine).
By hand mix in the M&Ms (if you do this in two batches you can spread them easier).
Place the dough in the pan and spread evenly using an offset spatula or your hands. It will spread and rise slightly, so it doesn’t need to be perfect.
Push in a couple more M&Ms to the top if desired and bake for about 15 minutes or until it starts to get a golden-brown color along the edges (you can place it on a baking sheet to ensure any butter does not melt through the bottom).
Let cool completely, this ensures it will be solid to remove without breaking (about 15 minutes or so).
When the cookie cake is cooled, make icing by adding everything into a bowl and mix with a hand mixer (you can use a stand mixer, but it is smaller amount of icing, so you will want to stop and ensure everything mixes well a couple of times).
If needed, add small amounts of milk until you get the desired consistency. Pipe the edges and add any sprinkles if desired.