Here's an example of a filled habitat I have right now.
Fanatic Authoritarian and Spiritual empire. I have syncretic evolution, police state, and byzantine bureaucracy civics.
Note the crime lord deal modifier which gives +10 stability.
This habitat isn't fully optimized - the pops I have working there are Fertile, Erudite, Communal, Thrify, and Nonadaptive.
I was maximizing for housing at the time, but my Eucmenopolis is opening for business so the factories and alloy plants are going off-world, which should allow me to reduce the pop on the habitat and give them Robust instead of Fertile/Communal for the +5% to all resource production. 50 pops gives that really nice merchant though.
Also, that numistic order building? Fantastic for habitats. 2 merchants and 2 priests solve your amenity problems.