“Black-ish” creator Kenya Barris was prepared to mount a PR blitz of protest after “Roseanne” star Roseanne Barr sent out a racist tweet last month. He was as surprised as he was determined to speak out against Barr’s comment when network executives told him the plan to cancel TV’s highest-rated program in response to Barr’s indefensible comment likening former Obama administration adviser Valerie Jarrett to an ape.

Barris gave a glimpse of the outrage that rained down on ABC leaders in the wake of Barr’s tweet from members of the creative community. Barris was one of five showrunners who spoke Wednesday about the importance of having diversity in TV writers’ rooms, a panel that was part of Variety‘s Path to Parity summit focusing on women in the entertainment industry.

“I was literally coming out of the show and I was like f— this. I was going to go crazy. I was going to call my agent and go on (CNN’s) Don Lemon and other shows,” Barris said. But first he called ABC Entertainment president Channing Dungey, Disney/ABC Television Group chief Ben Sherwood, and ABC Studios president Patrick Moran to warn them. “I was like, ‘I’m sorry guys’ and then I have to say, the response came in minutes.”

Dungey asked Barris to hold off a beat because they were in the process of canceling the show.

“It was amazing. Having Channing at the head and having Bob (Iger) be supportive” was significant, Barris said. He credited ABC and Disney brass with making the right decision in the moment, but he still questioned the decision to put Barr on the air at all, given her track record on social media.

Barr’s tweet amounted to “an indefensible moment but at the same time, you hired a monster and then you asked why the monster was killing villagers,” Barris said.

Barris was joined on the panel, moderated by Debra Birnbaum, Variety‘s executive editor of television, by “Transparent” creator Jill Soloway, “One Day at a Time’s” Gloria Calderon Kellett, Melissa Rosenberg of “Jessica Jones,” and “The Walking Dead’s” Glen Mazzara.

The wide-ranging conversation touched on the shortcomings of writer development programs for women and people of color, the need to open up the pipeline of writer assistant jobs beyond affluent white young adults, and the tricky balance of encouraging an open exchange in the room while keeping the environment respectful and inclusive.

The biggest problem with industry programs that encourage shows to make “diversity hires” is that many of those who are selected don’t have enough training to make the most of the opportunity.

“Writers’ rooms are terrifying,” Barris said. “You take someone whose never done this before, and this is their life’s dream that is about to happen or not about to happen — that is an amazing amount of pressure to have.” He suggested that programs be geared to helping aspiring writers land jobs as writers assistants in order to give them some exposure to what the job is like before they’re asked to step up to the plate.

“It should start with the agents introducing us to more people so we can continue to build this community in a really diverse way,” he added.

Rosenberg noted that a big part of the problem is purely financial. Writers assistants and production assistants are barely paid minimum wage, which means that the only people who can afford to take those jobs in the hopes of breaking in are those from affluent families where parents can afford to subsidize them for a few years.

“It’s something we have to do as an industry,” Rosenberg said. “We already beat the s— out of people who are assistants and PAs. It’s a hard bloody job. What we’re really going to have to do is allow more people in.”

Mazzara is active in the Writers Guild of America and its programs to open doors and provide training for promising young scribes. He and other panelists pointed to the role that talent agencies play in grooming young writers for entry-level jobs. “We need to ask showrunners what they are going to do to make sure they’re getting a full range of submissions” when staffing up their shows, Mazzara said.

Calderon Kellett noted that for all the focus on diversity issues in the past few years, the first wave of writer submissions from agencies tend to be white males. “We went to UTA and told them we would like the first batch to be anybody,” Calderon Kellett said. “The real win will be when the non-binary queer writer is writing on a black show. The first hires are really important.”

The #MeToo movement has unearthed horrifying stories of bad behavior in writers’ rooms and on the sets of movies and TV shows. Mazzara noted that for too long, there has been an attitude of “let’s just finish the show, let’s finish the movie and then we’ll correct the bad behavior.” That mentality is changing — ABC’s action on “Roseanne” is a prime example — but the industry still needs better systems of addressing problems when they arise in the high-stakes environment of production, where every minute of downtime costs money.

Soloway addressed the difficult situation she faced on “Transparent” when star Jeffrey Tambor was accused of sexual harassment and inappropriate behavior on the set, which led to his firing last year. She pointed to the response generated by a recent Q&A in the New York Times with stars of “Arrested Development,” another show featuring Tambor, in which the male cast members appeared to defend Tambor’s behavior at the expense of his female co-star Jessica Walter.

“Men are really comfortable denying (harassment claims), but they’re really willing to admit to that kind of bullying and tantrum (throwing) behavior,” Soloway said. “The men of the ‘Arrested Development’ cast were saying, ‘At work, people get to be really awful to each other.’ …That’s the centering of the status quo,” she said.

Rosenberg said policing behavior in the writers’ room isn’t actually hard to do. “Just be a grownup. You can be blue, and you can be really inappropriate at times but as long as you’re not targeting a certain person. It’s just not that hard to be a little sensitive,” she said.

Calderon Kellett joked that “One Day at a Time” has a strict rule that helps keep order. “We have a keep-your-genitals-in-your-clothing policy,” she said.

CORRECTION: An earlier version of this story incorrectly stated that “Black-ish” creator Kenya Barris planned to quit ABC after Roseanne Barr sent her racist tweet.