Traditionally, the way to avoid Peter's Corollary has been to operate a society with one or multiple glass ceilings, ensuring that in principle[1] the middle ranks of an organisation wind up filled by experienced competent people who pose no threat of advancement.
"every Bertie his Jeeves"
[1] others have other theories: https://www.youtube.com/watch?v=5mVF6GZ8v1A (not to mention the alimentary habits of the Morlocks)