In what part of the design process do you make a style guide?

For me I usually design a bunch of high fidelity mockups to see what looks best and then start adapting the components to a style guide. Are there people here who actually design the system beforehand? I'm curious to hear about how you guys handle this process.