After watching a dinosaur show at an arena in Springfield, Lisa discovers one of her favorite authors, T. R. Francis, working there in a dinosaur costume. The woman reveals to a shocked Lisa that she is just an actress the book publishing company used for the jacket photos, and that T. R. Francis is a complete fabrication. She further reveals that all popular young-adult book series were never each written by a single author with any inspiration, they are conceived by book publishing executives through market research and the use of multiple ghostwriters, just to make more money. When Homer finds out about this, he decides to get rich by group-writing a fantasy novel. He recruits a team consisting of Bart, Principal Skinner, Patty Bouvier, Moe Szyslak, and Professor Frink, all of whom have personal attributes or experiences that will help with writing the book: Skinner knows what teens like, Patty is a fantasy fiction fan, Moe has already published some children's books, and Frink has a computer. Lisa is shocked to find that they are group-writing a book, as she knows the only reason one would do that is to gain money. To show that what they are doing is wrong, she decides to write a novel on her own with a personal story that readers will connect with.
For their novel, the group members decide to take the typical elements from already popular young-adult series. Homer initially suggest that they write about vampires, but Patty notes the fact that there are already so many popular novels out there in that genre. They therefore decide to write about an orphan troll who goes to a magic school located under the Brooklyn Bridge. Fantasy author Neil Gaiman overhears the team talking and offers his help writing the novel; although they allow him to join, he is only given the task of bringing food for them while they are writing. The group members quickly finish the novel, which they name The Troll Twins of Underbridge Academy, and meet up with a book publishing executive for TweenLit Inc. at a book fair. Although he likes the novel, he dismisses it because it lacks a fake author with an inspirational back story. Meanwhile, Lisa is having a hard time making progress on her book because of constant distractions and quickly becomes saddened after realizing that she will never have her name on a novel. However, Homer approaches her and offers her to be the fake author of The Troll Twins of Underbridge Academy. Lisa admits defeat and takes the offer. They and the rest of the crew then approach the book publishing executive again, and he decides to buy the novel for a million dollars. As the team is celebrating at Moe's Tavern, they receive an advance copy. They are shocked to discover that the publisher has replaced the troll-aspects of the story with vampires, renaming the novel The Vampire Twins of Transylvania Prep, because market testing showed that vampires are more popular than trolls.
The team breaks into TweenLit Inc.'s headquarters, planning to replace the new novel with their old version before the mass printing begins. However, when they reach the printing room, the book publishing executive shows up with a group of armed men. He reveals that someone tipped him off about their plan, just as Lisa appears letting them know it was her because she wants her name on a book that will actually be popular. The executive types in the password in the printing machine and gives Lisa the honor of inserting the USB flash drive with the novel on it. Later, when the saddened members of the group-writing team are walking away from the headquarters, they pass a book store and discover that The Troll Twins of Underbridge Academy is being put on the stands. Lisa shows up again, letting them know that she only pretended to betray them so that the publisher would type in the password. When Lisa gave Bart a hug, she replaced the executive's flash drive with Bart's flash drive that contained the troll novel. As a result, she was able to put the original version into print. Lisa is happy to know that her name is finally on a book; however, when she opens a copy, she discovers that Gaiman is listed as the author, not her. It turns out that there were three flash drives and that Gaiman heisted his way to the best-seller list "once again" despite being illiterate. During the credits, it is revealed that Moe was aware of Gaiman's scheme, and was in fact allied with him from the start. The two celebrate with a toast at Shelbyville Beach, but Gaiman double-crosses Moe and poisons his drink.