By now I almost hear our friend @Erich_L saying: "But but @xyz, every construction engineer knows that you should start raising a building from its defining feature - the windows!"
Fear not, here they come - the windows.
I introduced 3 additional parameters to the system to describe the window pattern: margin, size and spacing. This is in practice actually 6 parameters because we need them for 2 dimensions. Here's a sketch I made earlier:

Looks like windows are also boxes. However, it'd be borderline insane to instantiate a flattened cube for each and every window. The only reasonable option is drawing them from a pixel shader. It's almost like I knew having 0-1 UV space on each side of the magic cube would eventually come in handy.
There's a problem though; we need to send 6 custom floats per instance to the shader but we only have 4, and all 4 are already taken by the roof parameters. It gets even worse. It would be visually really nice to have alternating window pattern between adjacent building sides. So in total that would be 16 parameters per instance. In utter desperation, I made a function that packs 4 floats into a single float. And, of course, its unpacking counterpart on the shader side. I'm putting it here as a comic relief:
func pack4(a, b, c, d):
return float(int(d*100)*1000000 + int(c*100) * 10000 + int(b*100) * 100 + int(a*100))
Don't show this to anyone with a CS degree. If you must show it, don't mention my name, just say GPT 2 beta wrote it.
We can now send 16 normalized floats with 2 decimal places of precision. Possible precision glitches won't be noticeable because the window pattern is completely static.
After some shenanigans with that irksome thing they call Math, the shader finally started doing its job. It accepts window parameters in world space and tries to nudge the desired window size to uniformly fill the available wall space.

Since window parameters are specified in world space, the shader automatically adapts to any size/proportion of the box, keeping the window size as close as possible to input values.

To use the immortal words of a well known contemporary prophet: It just works! [cue that Fleetwood Mac hit song from the 80s]