The rules of writing (academic, fiction, & even music) are simple: write the rules, keep to the rules.
In academic writing it's called your methodology. And once you've nailed it down, everything - everything - you write has to fit neatly within it. You build your argument, you investigate possibilities. If its within the rules set in your methodology, you're good. Beginning, middle, end. Good to go.
In writing fiction (especially speculative fiction: science fiction/fantasy) it's all about the world you create. The world can have aliens and starships, or vampires and ancient beasts of evil, or dragons and barbarian heroes - but everything you write has got to be consistent with the rules of the world as you envision it.
This doesn't mean there can't be surprises. There are a number of ways to keep everything fresh and new and even surprising. The first is just set the boundaries wide from the outset (magic can be pretty limitless in this sense - or the possibility of alien technology is boundless by definition).
Another trick can be to gradually unlock the rules of the world only as the characters themselves discover them.
I see it as world building. I close my eyes, think about it all, and make sure it fits in a swirling, chaotic but consistent form - kind of like a world.
Music can be more problematic, especially when writing for a band, the members of which like to write their own fantastic parts into the songs. But again, seeing the music as a world which has to make sense with itself helps. The parts will either fit right in, or be clunky and have to be changed. If it's a neat fit, go with it!
Happy writing!
Image courtesy of pixabay.com

Stay tuned for an exciting @drwom # steemofconsciousness initiative.
See also https://steemit.com/writing/@drwom/steemofconsciousness-filling-steemit-with-beatniks-and-steemniks