A criminal project
He has been helping them compose short stories which are destined to be brought together in a single volume.
The group of half a dozen S1-3 pupils embarked on the project, with the help of English teacher Derek Wagner, as part of BBC Radio Scotland's Write Here, Right Now project, which encourages people to write a novel in a month. This year, the scheme has a crime theme.
During his visit, Mr Brookmyre outlined the ingredients required for the perfect crime story: "Intrigue, mystery, usually some kind of suspense, violence and, in my case, usually something totally inappropriate."
The Baldragon Academy pupils, who have also had visits from children's writers Catherine Forde and Catherine MacPhail, and publishers Barrington Stoke, hope to have their book of short stories out by the end of May.