“The Wire” creator David Simon is known for depicting gritty realities of the urban street. But lately he’s saved his harsh words for another subject: the agents who usher his work to the screen.

“Where … have the agents been to argue on behalf of their clients for a different pay structure?” he asked, using an obscenity, in an elaborate entry on his website this week, pointing to the “changing reality” of Hollywood.

“I’ll tell you where they’ve been,” he answered. “They’ve been in another room, counting cash.”

It’s not idle talk. On Wednesday night, Simon and some 15,000 members of the Writers Guild of America (WGA) branches in Los Angeles and New York began voting on whether to adopt a new strict business “code of conduct” for their agents. Simon and the others have encouraged members to vote yes.

At stake is nothing less than the health and future of Hollywood. If the writers vote to support adoption of the code, it could mean the end of a long-standing deal between agents and writers and the mass firing of agents as soon as next week, casting the entertainment business into uncharted waters.

The debate goes heavily to the role of agents, the glass-officed intermediaries who specialize in knowing what’s happening at all the studios and network offices and then aligning them with the right writers and projects. To the writers and their supporters, populism is on the line, a kind of Hollywood version of an American political discourse in which workers are discontented with an economic system they say is rigged against them. In an unprecedentedly lucrative content market, the writers say, they are not cut in on the riches, the money taken from them by elites through unethical and potentially even illegal practices.

The group representing the agencies, the Association of Talent Agents (ATA), warns of “chaos” and even legal challenges if the WGA goes ahead with its plan. But guild leaders say they have no choice.

“This system of conflicted representation is no longer acceptable,” the WGA announced in a paper outlining alleged breaches.

At issue in particular are packaging fees, the practice that has agencies — especially the “Big Four” of WME, CAA, ICM and UTA — collecting fees from studios for bringing multiple clients together for a television series or movie. The fees are a cornerstone of 21st-century agency revenue.

Writers say the system is set up to actively take money from their pockets. They say the long-established process, which they allege has in many instances been initiated without their knowledge, means that agents are incentivized to fight for packaging fees at the expense of commissions — working to maximize fees from the writers’ employers instead of payment for their clients. This creates a clear conflict of interest, they argue.

“The current packaging practices of the big agencies are out of control and the agents that work there have been told to protect them the way they’re supposed to protect us,” Mike Scully, a former “Simpsons” showrunner, tweeted this week, joining an outspoken writers group that also includes figures such as “Cold Case” creator Meredith Stiehm and “Star Wars” and“Star Trek” impresario J.J. Abrams. Scully also called the agencies’ arguments “insulting and offensive.”

The ATA says that packaging fees creates wealth for all parties. The group said they incentivize agents to put together projects in the most comprehensive ways possible, creating work that’s more likely to sell.

A long-standing deal between the agents and writers that governs how they work together, known as the franchise agreement, is set to expire on April 6. The parties have met seven times since tensions flared up, with little progress and a lot of grandstanding. “There is no real exchange of ideas — there are no answers to our questions,” ATA Executive Director Karen Stuart said in a memo Wednesday.

There are no new talks scheduled.

WGA members will vote online through Sunday morning on whether to adopt the code, which bans packaging fees as well as a newer practices of agents starting spinoff production companies, as a condition of a new franchise agreement. If the code is adopted by the WGA and then not signed by agencies — it almost certainly won’t be in its current form — the WGA will probably call for writers to fire their agents by the hundreds when the deal expires next Friday. The big agencies will make a decision as a group; individual agents and agencies are extremely unlikely to break ranks.

The guild members have an important but not final say. According to WGA bylaws, the East Coast and West Coast boards will decide on the code after hearing recommendations from a negotiating committee that is monitoring the vote. The committee is likely to recommend the code only if member support well exceeds 50 percent.

A spokesman for the WGA did not comment for this report. An ATA spokeswoman would also not comment.

The Washington Post obtained a copy of the code of conduct. It takes a hard line on packaging fees.

Agents’ commissions, it said, “shall be limited to ten percent of [a] writer’s gross compensation,” adding that “no agent shall accept any money or thing of value from the employer of a Writer,” effectively banning packaging fees, which come from studios.

It also said that “no agent shall have an ownership or other financial interest in” a company that produces or distributes movies, which would require the divestment of the agencies’ spinoff production companies.

The ATA has returned a list of counterproposals that seek to leave packaging fees as they are but give more choice to writers on whether to opt out. Agents are “required to inform the client in writing … and receive his/her consent to proceed,” said the proposal, which was viewed by The Post.

Those remain fundamentally opposite positions, with the WGA wanting bans and systemic changes and the ATA arguing for a status quo with more transparency.

The standoff is a peculiar labor fight that sees not workers and management at odds, as was the case in the 2007-2008 Hollywood writers strike, but a civil war between two parties ostensibly on the same side.

Running under their tensions are questions of class. The writers feel that the agents are wealthy one-percenters and they the disenfranchised. A prosperous economy has not, they say, benefited everyone equally. In a time of Netflix, Apple and deep-pocketed buyers, the riches too often flow to the middlemen instead of to them, they argue.

“The entertainment industry is enjoying unprecedented prosperity. But TV-writer weekly pay has fallen. Mid-level writers have shown the greatest drop in income,” the WGA said in a video posted this week. “… Not only can [agents] potentially out-earn the creator — they can expect to make more when she makes less.”

WGA members have even framed the question as one of exploitation.

“Packaging is a lie. It is theft. It is fraud,” Simon said in his post.

The WGA says that an internal study found that writers’ median weekly earnings dropped 23 percent between 2014 and 2016. Simon noted that entry-level salaries for staff writers and story editors in TV have been essentially flat compared with a decade ago. With no public auditing process, it is difficult to independently verify writer salary figures.

The agents argue that any drop in salaries, if they exist, is primarily due to shorter-run television series that have disrupted the traditional broadcast-network orders of 20 or more episodes per season, not their fees.

Support has been growing among the writers. High-profile figures such as Alfonso Cuarón (“Roma”), Greg Berlanti (“Riverdale”), Tina Fey (“30 Rock”), Aaron Sorkin (“The Social Network”) and Norman Lear were among the more than 750 writers who this week publicly signed a letter saying they would vote yes on the new code of conduct.

A number of prominent creators, including Abrams, Dick Wolf (“Law & Order”), Chuck Lorre (“The Big Bang Theory”), Ava DuVernay (“Selma”) and Ryan Murphy (“American Horror Story”) did not sign. But on Wednesday, Abrams appeared to reverse course. “Last week I missed my opportunity to sign the [letter],” he said in a new letter to members Wednesday. “I’m not going to miss my chance to vote. Please do the same. Please vote. And if you agree with me that it’s finally time to end agencies’ conflicted practices, I urge you to join me and vote yes.””

It remains hard to determine how many rank-and-file members support the initiative.

What effect a firing would have on consumers is also an open question. In the near term, nearly everyone agrees the consequences won’t be felt by viewers, because the writers would continue working for their existing shows.

But without agents to broker new deals, it could result in fresh shows coming together more slowly — or not at all — affecting the pace of output in the longer term.

The WGA says to avoid this it will set up systems in which showrunners can put forward the names of writers to other showrunners, preventing an interruption in the staffing of shows.

And it said lawyers and managers can temporarily handle deals, particularly for creators. While many say they like their individual agents, they feel that a stand must be taken and that work will get done in other ways in the interim.

ATA leaders have questioned the legality of bringing in lawyers and managers, who are not registered as agents and officially limited in the negotiations they can handle. And they wonder about the efficacy of using showrunners in negotiations.

They say the writers are generally undervaluing agents and their role in the writers’ success.

“Writers count on agents to get them their next job and thoughtfully guide their career trajectory,” the group said in a memo Wednesday. “A website cannot do this.”