In the Kennedy assassinating, the CIA did what the CIA does so well (or used to at least.)
They found corrupt elements in the country who had the ability and motivation to remove and replace the person the CIA wanted eliminated and they helped them do it.
In this case, my guess is the CIA provided the shooters from their friends in organized crime. Maybe they used Cubans. Maybe they used Corsicans. It doesn't really matter. Guys who can make a shot like that are not that hard to find. Militaries around the world have trained thousands of them.
The CIA knew they had a friend in Johnson who would deliver them what they wanted in return for his seat in the Presidential Palace (or in this case the White House. )
The CIA got to survive intact and they and their friends in the Pentagon got their war.
The endless cat-chasing-its-tail questions: Did the CIA do it? Did Johnson do it? Did the Mob do it? etc. are nothing but a time-wasting distraction. They all were involved and the historical record shows these groups especially the CIA and the Mob worked together frequently.