Sometimes I’m asked…
Most of the time I stumble across something when I’m working on some experimentation with harmony and finding different ways to change key, or trying to get some weird scale under my fingers. An idea will pop up which I’ll mess around with to see if it’s got any legs. Thoughts of form and structure come a bit later. Thoughts on lyrics come a lot later after I’ve worked out most of the guitar part and often will arise seemingly unbid from the rhythm and mood of the music. I’ll often mumble some “scat” while I’m finding a song melody over the guitar part. I never “hear” a tune in my head – I envy those who do.
Some way along the line I’ll begin to sense if the thing needs a guitar intro and break in the middle, in which case I’ll improvise up something. I’ve got a bad habit of making things up for breaks that are beyond my technical ability to play at tempo which inevitably involves me in lot of practice before I’m comfortable playing it in public or recording the piece. Even then, I’ll sometimes make a hash of it.
If it needs a coda, I’ll make it up at the end. Suprisingly.
I guess all that falls under the heading of “noodling” during which a bottle of Chianti to accompany these processes is always optional. Preferred, but optional.