Dave Shiflett once was responsible for developing the manifesto of a Donald Trump presidency. Hired in 1999 to ghostwrite “The America We Deserve,” Shiflett spent days with the real estate magnate, channeling his voice and temperament into the pages of a manuscript.

The draft alarmed Trump’s aides. They demanded Shiflett come to Trump Tower for a meeting, where he said they told him to “turn the temperature down a few notches” by making the businessman sound less strident and more “inclusive.” The result was a relatively restrained and wonky book, with chapters on Social Security and foreign policy.

Trump ultimately withdrew his prospective 2000 candidacy and promptly returned to the unfiltered person whose inflammatory statements have defined his image ever since — endearing him this year to many Republican presidential primary voters but emerging in the general election campaign as a focal point for critics, including Democrat Hillary Clinton, who say he is temperamentally unfit for the White House.

On Sunday, when he faces off for the second time in a debate against Clinton, a major question will be which version of Trump shows up: the unfiltered provocateur Americans have come to know, or a carefully managed candidate whose words were once delivered to the electorate with a ghostwriter’s gloss.

Trump has declared that he has a “winning temperament.” He argued in the first debate that “my strongest asset, maybe by far, is my temperament.”

Republican presidential nominee Donald Trump went on the attack during a town hall-style event in Sandown, N.H., on Oct. 6. From the Commission on Presidential Debates and their microphone to CNN's John King, here's a look at what he lashed out against. (Jenny Starrs/The Washington Post)

Surveys, though, suggest it is one of his biggest political weaknesses. A Fox News poll taken after the first debate, for instance, found that just 37 percent of likely voters believe Trump has the right temperament to be president, compared to 67 percent for Clinton.

Moreover, Trump’s behavior, including his recent Twitter tirades against a former Miss Universe, has stoked concerns among those who have worked closely in the past with presidents from both parties and are having trouble envisioning Trump as a commander in chief with access to the nuclear codes.

“What you need is a good temperament . . . not character alone, but a sense of balance, perspective and judgment, and that has a lot to do with history, a perspective of where the world is,” said David Gergen, who has been a counselor to presidents Nixon, Ford, Reagan and Clinton.

Trump has long embraced many of his personal attributes that worry his critics, according to a review of his writings and statements.

He has acknowledged that he has fired those who disagree with him and has argued that shallowness is a virtue because it helps him make quick decisions.

“The day I realized it can be smart to be shallow was, for me, a deep experience,” he wrote in “Think Like a Billionaire,” his 2004 book.

Trump also wrote that it is crucial to be curious, writing in the same book that “you have to be alive to your surroundings and hungry to understand your immediate world.”

At a rally in Reno, Nev., Oct. 5, Republican presidential nominee Donald Trump told his supporters that he was a reflection of them as he concluded his speech. (The Washington Post)

Trump said in an interview with The Washington Post earlier this year that he has never read a biography of a president and has little patience for detailed reports or briefings. He said he makes decisions “with very little knowledge other than the knowledge I [already] had, plus the words ‘common sense,’ because I have a lot of common sense and I have a lot of business ability.”

While a president has to deal with countless issues, relying on advisers and the ability to absorb and distill vast quantities of information, often from competing interests, Trump has prided himself on being a “one-man army.”

“You’re not only the commander in chief, you’re the soldier as well. You must plan and execute your plan alone,” he wrote in “Think Like a Billionaire.”

Trump has cited Ronald Reagan as his political role model. He noted in “Think Like a Billionaire” that rivals often underestimated Reagan, who suffered “years of insults about his lack of intelligence and political experience.”

Trump has faced similar criticism.

Ken Duberstein, Reagan’s former chief of staff, said that a president has “to be willing to surround themselves with smart people and be willing to listen to them. That doesn’t mean they always have to agree, but they have to listen to them. Reagan said, ‘That’s why God gave us one mouth and two ears.’ ”

Duberstein, who has not said which candidate he will support in this election, said Reagan understood the necessity of compromise. “Part of governing is you have to say no to some of your strongest supporters and yes to some of your adversaries. That is how you build coalitions.”

Different types of individuals can adapt to the presidency, Duberstein said. Trump increased his fame through a reality show, not unlike how Reagan rose as a B-film actor, television host and pitchman.

“People used to criticize Reagan, saying, ‘How can an actor be president?’ ” Duberstein said. “His answer was, ‘How can you be president and not be an actor?’ ”

Clues to Trump’s approach to the presidency can be found in his many books. As he explored a run for the presidency on the Reform Party ticket in 2000, Trump suggested that as president he would attack North Korea to destroy its nuclear weapon capability. “Am I the only one who thinks it might make more sense to disarm the North Korean nuclear threat before it shows up in downtown Seattle or Los Angeles?” Trump wrote.

Yet Trump’s changeability on the issues makes him hard to predict. He favored abortion rights before he opposed them. In 2012, Trump said Mitt Romney’s plan for illegal immigrants to “self-deport” was “crazy” and “maniacal,” and he complained it cost Romney the Hispanic vote. Today, Trump wants forced deportation of illegal immigrants.

In recent weeks, Clinton and her allies have chided Trump for being easily drawn into feuds in a way that suggests a lack of fitness for the presidency — a job that requires an even keel and the ability to endure public criticism.

William Cohen, a Republican who served as President Clinton’s secretary of defense, said a commander in chief must choose his words carefully. “There has to be a filter between his thoughts and words, and one hopes his thoughts are deeply anchored,” said Cohen, who has endorsed Hillary Clinton. What I see is [Trump] just shoots whatever is in his mind.”

Leon Panetta, a Democrat who served as President Clinton’s chief of staff and President Obama’s secretary of defense and CIA director, said a president must be able to “remain calm and to have control of your emotions.” Panetta said he is concerned that Trump would be “so easily provoked that he thinks more about himself and the consequences to his name and image.”

Similar concerns have been cited by other former national security officials, Democrats and Republicans alike, in their decision to oppose Trump’s candidacy. In August, a group of officials that included Michael Chertoff, who led the Whitewater investigation into Clinton dealings and became President George W. Bush’s secretary of homeland security, wrote a letter saying that Trump “lacks the temperament to be president . . . lacks self-control and acts impetuously.” Chertoff has endorsed Clinton.

Trump has waved off the attacks, referring to such critics as “political hacks.” His campaign last month countered with a letter signed by 88 retired military generals and admirals endorsing the Republican nominee and criticizing Clinton, pointing to Trump’s “commitment to rebuild our military, to secure our borders, to defeat our Islamic supremacist adversaries and restore law and order.”

Shiflett, the ghost writer, recalled that when he went to talk to Trump to gather material for “The America We Deserve,” the businessman was surrounded by beautiful women and by three men in pinstripe suits, who expressed agreement with whatever Trump said. Shiflett began to refer to them as the “Amen Charlies.”

As president, however, Trump would need to solicit disagreement and consider whether he is wrong, something that he has often disdained.

Shiflett said he won’t vote for Trump, having observed how the real estate mogul — without a ghost writer or reality television show script — has talked like he is in “a frat house.” But he said another aspect of Trump’s character might help him modulate his behavior.

“My whole view of Trump is Trump wants to be successful,” Shiflett said. “He doesn’t want to be a loser.”