Cream the room temperature butter and powdered sugar together until creamy. You can use a mixer or do this by hand.
Add the egg and vanilla and beat until mostly combined. Don't worry if it looks a little curdled at this stage.
Add half of the sifted flour and mix it in slowly, then add the remaining flour and mix it until combined. Be careful not to overmix. It should be a very soft, squishy dough.
Spoon the dough into a piping bag with a star nozzle fitted. If your disposable piping bags are very thin, it may be better to use a re-usable one as they are more durable and less likely to burst. Don't fill the piping bag all the way as it is easier to control with less dough.
Pipe the dough onto a cookie sheet lined with parchment paper. You can do any shape you like, see the photos in the post above for inspiration. Make sure you leave a bit of space between them as they will spread a little.
If you want to, sprinkle with a little bit of granulated sugar. This is totally optional.
Place the piped cookies in the fridge for at least an hour. Any less than an hour and they will spread more and lose some of their definition as they bake.
Preheat the oven to 325°F / 165°C while the cookies are chilling.
Bake for 15 minutes or until they just start to turn golden brown around the edges.
Remove from the oven and let the cookies sit on the pan for 5 minutes before moving them to a wire rack to cool completely.
For best results, weigh your ingredients with a kitchen scale rather than using cups. Measuring with cups is often inaccurate and if this dough has too much flour in it it will be too stiff to pipe, or if there isn't enough flour they will spread and lose their shape. It is vital that the butter is at room temperature or it won't be soft enough to pipe. You can use salted butter or unsalted butter. If you use unsalted butter, add a pinch of salt to the dough along with the flour. I tested this recipe with a shorter chilling time of 30 minutes. They still worked and were delicious, but they lost some of their definition in the oven, so if you want super defined lines make sure you chill them for a full hour.