I'm trying to learn about writing extensions in Spock testing framework.
I've come across 2 different types of extensions:
Annotation driven extensions have a smaller scope and usually only affect a single test method (or a group of methods)
Global extensions have a larger scope and allow you to affect how Spock does things in an broader area (e.g. reporting)
My suggestion would be for you to start with an annotation extension and see if you can accomplish what you want in the smallest scope possible.