Time for housecleaning in the intelligence community.

Director of National Intelligence Dan Coats, who has sometimes been at odds with President Trump, is stepping down Aug. 15, the president announced in a tweet Sunday. Trump wants to replace Coats with Rep. John Ratcliffe, R-Texas, a fierce Trump defender and loyalist.

The appointment of Ratcliffe will require confirmation by the Republican-controlled Senate.

DAN COATS TO RESIGN AS DIRECTOR OF NATIONAL INTELLIGENCE; TRUMP SELECTS REP. JOHN RATCLIFFE AS REPLACEMENT

Coats, a former Republican senator representing Indiana, sent a classy resignation letter to Trump. According to Coats, his departure had been previously discussed. The outgoing director of national intelligence (DNI) will certainly be missed on Capitol Hill, but he was ready to leave after two years in the demanding job.

Why a weekend Twitter announcement?

“The president doesn’t like to be scooped on personnel moves,” surmised reporter Jeff Mason of Reuters in a Fox News interview.

The much more intriguing question is: Why does Trump want Ratcliffe to be his next DNI?

The DNI post was established by Congress in 2004, after reviews of the intelligence failures that led to the September 11, 2001 terrorist attacks.

"It’s clear that Rep. Ratcliffe was selected because he exhibited blind loyalty to President Trump with his demagogic questioning of former Special Counsel Robert Mueller," Senate Minority Leader Chuck Schumer, D-N.Y., said Sunday. "If Senate Republicans elevate such a partisan player to a position that requires intelligence expertise and non-partisanship, it would be a big mistake."

On paper the DNI has basically an intelligence integration job, with a direct line to the president. The DNI coordinates tasking and budget for 17 – yes, 17 – intelligence agencies, including the CIA and the intelligence operations of the military.

But these are unusual times. If confirmed as DNI, Ratcliffe will have a special mission no one foresaw back in 2004: ensuring trust. President Trump wants someone he can trust.

Ratcliffe’s name was in play to become the next DNI before last week. But his stock soared with Trump Wednesday when former Special Counsel Robert Mueller testified about his investigation of Russian interference in the 2016 U.S. presidential election and obstruction of justice allegations against Trump.

Ratcliffe acted like a Trump defense attorney at the hearings when he sharply questioned Mueller.

As a former federal prosecutor, Ratcliffe could not stand the way the Mueller report said Trump was not exonerated. Ratcliffe pounded Mueller for violating “the most sacred of traditions,” where prosecutors do not speculate on potential crimes when they file no charges.

Even on a day filled with rhetoric, Ratcliffe’s tight-packed emotion stood out. “The bedrock principle of our justice system is a presumption of innocence. It exists for everyone,” Ratcliffe said, “including sitting presidents.”

Ratcliffe went on to say that “Donald Trump is not above the law. He’s not. But he damn sure shouldn’t be below the law, which is where this report puts him.”

The congressman sounded like Patrick Henry going after King George III.

Ratcliffe talks like he’s the new sheriff in town. Trump wants and needs that bluntness right now. He wants a DNI at his side who will help get to the bottom of the counterintelligence snarl that touched off the Mueller probe.

But that’s not all. If confirmed by the Senate, Ratcliffe will have other huge tasks ahead. Here are four.

2020 Election Security

Earlier this month, Coats designated a new election security overseer and tasked the other intelligence agencies to follow suit by choosing officials to coordinate election security.

President Trump has an enormous responsibility to make sure the 2020 elections are secure. That includes guarding against foreign intrusion. But it also, apparently, means making sure there isn’t a repeat of the counterintelligence gone wild that led to the agonies of the Mueller investigation.

Transforming the Intelligence Community

The digital world has had cataclysmic impacts on America’s intelligence community. The sheer amount of data is pushing the intelligence community to embrace artificial intelligence and machine learning.

Coats and Principal Deputy Sue Gordon enacted a National Intelligence Strategy to improve collection and analysis. Ratcliffe will have to pick up the ball on efforts to work more with Silicon Valley and other transformation projects.

Twitter users have already mocked Ratcliff’s eight years as mayor of Heath, Texas, a small community in the Dallas-Fort Worth area. But the skill set he developed as mayor may actually serve Ratcliffe well as he becomes the sheriff of the spymasters.

Cyber threat intelligence

Malicious cyber activity goes far, far beyond election-related hacking. Ratcliffe will lead efforts to keep up with foreign cyber capabilities.

Luckily, Ratcliffe has expertise here, from his work as a U.S. attorney and from sponsoring House legislation on cyber forensics and other cyber requirements.

China

And then there is the big threat. As FBI Director Christopher Wray has testified, the intelligence community is only beginning to uncover the complexities of China’s influence and infiltration in the U.S. and around the world.

Ratcliffe may ride in on a Russia wave but his success as DNI will rest on helping America understand the China threat.

CLICK HERE TO GET THE FOX NEWS APP

We can expect a contentious Senate confirmation hearing for Ratcliffe.

It’s clear that Rep. Ratcliffe was selected because he exhibited blind loyalty to President Trump with his demagogic questioning of former Special Counsel Robert Mueller," Senate Minority Leader Chuck Schumer, D-N.Y., said Sunday. "If Senate Republicans elevate such a partisan player to a position that requires intelligence expertise and non-partisanship, it would be a big mistake."