In war, an army is only as good as its leader, a strong commander can use a sub-par militia to its fullest and break even the most professional armies in his path, and the uttermost excellent hosts of war can be, in the same manner, brought to its knees by a much weaker foe if it's poorly led.
A particular country finds itself in troubling position, it's located on a strategically important region of a continent stricken by constant warfare, because of that, it has become highly militaristic, and its soldiers are tremendously masterful in the art of war, far better than any of their contemporaries, and the nation can also invest a large budget on its forces due to its wealth (they're filthy rich).
The problem however, is that the country has a very small population, and sometimes its skillful army can't compensate for its vast numerical disadvantage, a victory too costly can prove Pyrrhic, and a defeat too decisive can prove ruinous. Its manpower shortage can also bring tremendous effects to the country's economy and future if portions of it are lost in a single engagement, an entire generation can vanish in a single day.
As you can imagine then, one inadequate commander leading the main army once can usher shattering effects. In the light of that, I ask what would be the best way to prevent bad leaders from ruining armies, or better yet, avoid having bad leaders become part of the army high command.
I thought first of heavily investing in meritocracy, then of building dozens of military schools across the country, and separating the army from the nation's politics as much as possible (I can't have incompetent sons of nobles becoming generals for political influence), then, I added a larger and more independent chain of command, so even the lower rank and file officers can act decisively and prudently, but I'm afraid that won't be enough.
"No amount of excellent soldiery can compensate for sh*tty leaders"
- Some guy I saw on a Battle of Carrhae Youtube video