The whole Q op, and the take down of the Cabal, is all Trumps baby.
He knows all the bad actors and what they've been doing.
It would take a mastermind with yuge cojones of gold to conceive of and implement such a beautiful plan.
He has help in MI but he's been planning it all out at least since Jr. "died".