Following in the footsteps of Roald Dahl’s Matilda, the book is to be adapted by the Royal Shakespeare Company

David Walliams’ journey from comedian to one of the most popular children’s authors of his generation is to continue, with a musical version of his first book destined for the main stage of the Royal Shakespeare Company.

On Monday, the company announced details of a stage version of his bestselling 2008 novel The Boy in the Dress, which tells the story of a schoolboy who cross-dresses to help him cope with the death of his mother.

Six years in development, it will be the RSC’s big Christmas show, playing in Stratford-upon-Avon for 18 weeks with the possibility of a West End transfer.

Robbie Williams and his songwriting partner Guy Chambers are supplying music and lyrics and playwright Mark Ravenhill has written the book.

Walliams said the show was “a dream collaboration” and he had always imagined the book as a musical. “It’s now 10 years since The Boy in the Dress was first published, and we’ve come a long way in that time,” he said. “Ultimately, I wanted to write a story that encouraged people to recognise that difference can be celebrated, that it’s OK to be yourself.”

Five days, 110,000 books sold: how does David Walliams do it? Read more

The Boy in the Dress tells the story of 12-year-old Dennis, who loves football and daytime TV, especially Trisha, and misses his mum. It was a book, Walliams acknowledged, deeply indebted to Roald Dahl. It was warmly reviewed in the Guardian by the writer Philip Ardagh, who wrote: “I hope Walliams writes more for children.”

He did, achieving colossal sales figures with books such as Mr Stink, Gangsta Granny and Grandpa’s Great Escape. He came top of an annual author’s rich list last year and in 2017, when his books made more than £16m. JK Rowling was in second place both years.

Ravenhill, the playwright who first burst on to scene with his play Shopping and Fucking, said he came across The Boy in the Dress when he was the RSC’s playwright in residence in 2012.

“I remember thinking that it was such a gripping, entertaining and life-affirming story with all the ingredients of a great stage show,” he said. “The RSC has a fantastic track record of producing family shows, so when David suggested making his novel into a musical, I thought, let’s go for it!”

The London production of Les Misérables, a collaboration between the RSC and Cameron Mackintosh, is entering its 34th year, while Matilda the Musical, adapted for the RSC by Dennis Kelly with music and lyrics by Tim Minchin, has been staged for seven years in the West End.

The company’s 1988 musical adaptation of Stephen King’s Carrie was considerably less successful. Some audience members applauded, some recall being scarred for life. The Guardian’s Nicholas de Jongh called the show “a resounding mistake”, a view shared by Broadway, where it was transferred before closing after 16 previews and five performances.

Much more favourable reactions will be expected for The Boy in the Dress, to be directed by the RSC’s artistic director Gregory Doran.

Williams and Chambers said they were “beyond excited” and “genuinely delighted” to be working with the RSC and Walliams, adding: “There’s a real freshness, cheekiness and heart to David’s writing which we’ve worked really hard to capture in the music.”

The show was announced as part of the RSC’s winter season which will include a production of Shakespeare’s King John, directed by Eleanor Rhode, and two new plays which shine light on British imperial history: A Museum in Baghdad by Hannah Khalil, and The Whip by Juliet Gilkes Romero.