Andy Coulson, David Cameron's spin doctor who quit during the furore over phone hacking, has broken a two-year silence after alleging that Boris Johnson wants to see the Prime Minister “fail miserably” so that the London Mayor can inherit his job.

Coulson, the former No 10 Director of Communications, who is due to stand trial later this year over allegations related to phone hacking, has penned a ten-point “masterplan” for rescuing Mr Cameron's premiership.

The advice, published in the style magazine GQ, ranges from tackling Ed Miliband to the best way to utilise Samantha Cameron at the 2015 General Election.

Download the new Independent Premium app Sharing the full story, not just the headlines

Coulson's surprise return to the political fray should give Downing Street a boost. The ex-News of the World editor was credited with focusing Mr Cameron on the everyday concerns of “Essex Tories”.

Since losing Coulson's counsel in January 2011, the Prime Minister has surrounded himself with advisors from a narrow social background and faced accusations that he has lost touch with ordinary voters.

Coulson quit, saying the wave of allegations over phone hacking at News of the World made it impossible for him to continue in his job. Last November, he was charged over an alleged conspiracy to bribe public officials for information.

In his GQ “masterplan”, Coulson tells Mr Cameron how best to deal with the threat from his rival, Johnson. “Boris Johnson desperately wants to be prime minister and David has known that fact longer than most,” Coulson writes.

“When Boris asked me to pass on the message that he was keen to stand as mayor of London, David responded 'Well, if he wins, he'll want my job next'.”

Coulson argues: “Stabbing David, or anyone else for that matter, in the back would be distinctly off brand - just not very Boris.

”He would much prefer to see David fail miserably in the election and ride in on his bike to save party and country.“

Inside Politics newsletter The latest news on Brexit, politics and beyond direct to your inbox Enter your email address Continue Continue Please enter an email address Email address is invalid Fill out this field Email address is invalid Email already exists. Log in to update your newsletter preferences Register with your social account or click here to log in I would like to receive updates on politics every morning by email Update newsletter preferences

The former spin doctor advises Downing Street to support Mr Johnson's ”good ideas, advise privately on the bad ones, but only engage publicly if absolutely necessary - and celebrate Boris's considerable successes“.

Mr Cameron immediately sensed that Johnson would be a ”bloody brilliant (Mayoral) candidate for us“, a sign that, during his early period as Conservative leader, he was a man ”untroubled by self-doubt,“ Coulson writes.

The Tories' strategy for beating Labour should involve exposing leader Ed Miliband's strategy of ”keeping his head down“.

Mr Cameron should ”challenge him to take a view on the tricky issues opposition politicians love to duck.“ Coulson doesn't believe that Miliband's ”detached“ front bench team ”rate him very much“.

The prime minister should ”pray Ed Balls remains shadow chancellor until the election,“ Coulson wrote.

Likening the shadow Chancellor's relationship with Miliband to the ”shamefully dysfunctional“ Tony Blair and Gordon Brown partnership when Labour was in power, Coulson writes: ”Appointing him (Balls) as George's opposite number was the Miliband gift that will keep on giving.“

Mr Coulson writes: ”Labour's Two Eds dislike each other and each thinks he is smarter than the other.

“The Conservatives should imagine in some detail how it would work if they actually won...and share that vision with the British public.”

Other factors discussed by Coulson include the importance of live television debates in the election campaign, Baroness Thatcher, the role of Samantha Cameron, Sir Jeremy Heywood, the all-powerful Cabinet Secretary, immigration, countering the UKIP threat and William Hague.

Coulson, 45, is due to stand trial in September. He is accused of requesting and authorising payments to public officials in exchange for information, including contact details of the royal family. He has maintained his innocence.

Although Coulson's “masterplan” is intended to assist his former boss, Mr Cameron will be wary that details of their private conversations have now been revealed by his former spin doctor, whose return to journalism could prompt further revelations.

The full ten-point plan appears in the July issue of GQ, published on Thursday.