Brian Truitt

USA TODAY

S.H.I.E.L.D. agent Phil Coulson is about to have a very bad day.

Captain America: The Winter Soldier, released in theaters over the weekend, reveals that the secret government agency has been infiltrated to its core by sleeper agents of Hydra, an evil organization bent on world domination.

And in a bit of movie-to-TV synergy, the film's events will prompt a major retooling of ABC's Marvel's Agents of S.H.I.E.L.D. for its first season's final six new episodes, beginning Tuesday (8 ET/PT).

"It's an extremely unique experience that doesn't exist anywhere else out there in the entertainment business," says Jeph Loeb, executive producer and head of Marvel TV.

The show's group of agents led by Coulson (Clark Gregg), introduced in the Marvel movies, are faced with not only trust issues among themselves but a civil war within the entire S.H.I.E.L.D. organization, where no one knows who's actually a Hydra operative.

Upcoming episodes feature at least one major betrayal, and what's left of Coulson's team is forced to deal on their own with the dismantling of their whole world as well as the new Hydra threat.

"Survival is a huge part of it," says executive producer Maurissa Tancharoen. "There is no more tapping into big S.H.I.E.L.D. through the holo-comm. The guns you have on the plane are the guns you have. They're basically left with the bare minimum."

Coulson's team — agents May (Ming-Na Wen), Ward (Brett Dalton), Fitz (Iain De Caestecker), Simmons (Elizabeth Henstridge) and Skye (Chloe Bennet) — were established as new characters in Marvel lore finding their identity in "the most massive organization ever created by man," adds executive producer Jed Whedon. "Now they really are a ragtag bunch scraping things together."

Agents of S.H.I.E.L.D. has had bigger problems than Hydra its first season. Viewership has been disappointing — it premiered in September with an impressive 12 million viewers, but ranked behind The Voice and NCIS with 5.71 million last week, though it is expected to return next fall.

And the hardcore fanboy contingent has decried its lack of characters from the comics, though that will be addressed with the Hydra element, which the show couldn't mention until now in order to avoid spoiling Winter Soldier, Whedon says. Instead, the series spent time building external threats — the big bad mystery man the Clairvoyant, the mad scientists of Centipede, the cyborg operative Deathlok (J. August Richards) — for the heroes to deal with that would then connect back to Hydra later.

"Hopefully people who've had mixed feelings about the show will now understand it was all part of a big plan," Tancharoen says.

Coulson himself has been struggling with how and why he was brought back from the dead after being "killed" in The Avengers, and he's thought something was rotten in S.H.I.E.L.D. for a while, Gregg says.

Much of the show is "about a company man who finds out that everything he's dedicated his life to is not what he thought it was. To have everything dissolve around him to the point that S.H.I.E.L.D. itself is in smoking ruins (and have) that crisis of faith is such an amazing thing to explore," he says.

Coulson and his team are forced to deal with more secrets coming to the fore plus some new characters: Patton Oswalt guest-stars as S.H.I.E.L.D. agent Eric Koenig, Adrian Pasdar is Col. Glenn Talbot and Amy Acker plays a cello-playing love interest for Coulson mentioned in passing in The Avengers.

The main cast was left mostly speechless after they learned of the series' turn following the movie — "The girls were a bit shocked, but Iain was like, 'Yeah, that's really cool,' " Tancharoen says — yet Gregg believes everybody's been energized by the influx of treason, drama and continued surprises leading to the season finale.

"I'm a little old for it, but I'm the one texting, 'OMG! OMG! Oh no, you traitor!' It's kind of hilarious," he says. "People are racing to their car to read the new scripts and find out what new Hydra betrayal is going to be revealed."