SPQR: The best composition is in fact the historical line-up

1x Velites (Leves in Camillan times)
1x Accensi (or better local missile)
2x Hastati
2x Principes
1x Triarii (2x in Camillan times)
1x Cavalry or additional FM
1x General

Double this for a full consular army.

Succesor: Should be phalanx heavy:

4x Phalanx (keep together on the field)
2x Flankers (Peltastai, Thureophoroi or better)
1x Missilie or other Aux. (enemies are often other good armoured Greek, so no need to spam missile)
1x General
2x Cavalry (1 light/medium and 1 heavy best)

A full stack should not simply double this but raise the proportion of flankers and other auxiliar.

Can also be used for a late or "European" Carthagian army; may be with only 2 or 3 phalanx and more missile or light cavalry depending on the enemy.

Greek: Basicaly the same but replace phalanx with Classical Hoplites or a Thureophoroi/Peltastai mix. Can also be used for a early or "African" Carthagian army with variations when either fighting Numidians or Ptolemaians.

Eastern: Pontos, Armenia, and to lesser extend Parthia and Baktria. Can also be used with the Seleukids to fight these people

2x FMs or real heavy cavalry (no Asiatikoi Hippeis and the like)
2x Light Cavalry (preferable horse archers)
2x Foot Archers (top would be Syrians or Skythians)
2x Spear (might be phalanx, but doesn't really fit this style of combat; Pantodapoi can do as well)
2x Flankers (sword or axe)

Barbarian: The best the better. Barbarian units usually don't have special roles like phalanx or horse-archers can all replace each other.

That is save for missile and cavalry. Cavalry is not so usefull because your (Barbarian) enemies will use spears in huge numbers and even the best Barbarian cavalry, Brithentin, aren't really battle-tanks.

Archers are very usefull because your enemies will not be well armoured. So have 2 of them in each half stack. Otherwise you should prefer swords over spears because of the boni.

Fighting Romans with them is a different story, because Romans are perfectly equipped to fight Celts and the like....