What if some authors only have one good book in them?

So wonders one of the characters from “The Silkworm,” a new mystery novel by Robert Galbraith, and therein lies the heart of the story. Maybe some authors only have one blockbuster idea, but maybe not. Robert Galbraith, as many now know, is a pseudonym for J.K. Rowling. And “The Silkworm” is about as close to an autobiography as we will likely ever get from the tight-lipped Rowling.

Cormoran Strike, Rowling’s massive, gruff, quietly brilliant detective protagonist is, subtly, Rowling herself. In the first book to feature Strike — “The Cuckoo’s Calling” — the reader encountered Strike living in a state of depression and near-homelessness, barely scraping by. The sorry detective took on a case that seemed far from promising — the brother of a fashion model who apparently killed herself wants Strike to prove that the model was actually murdered. A few hundred delightful pages later, Strike catches the elusive killer and, because of the model’s fame and the high-profile nature the case has taken on, he skyrockets to sudden stardom.

Rowling, the one-time teacher who has spoken publicly — if infrequently — of her own depression and near-homelessness, also found herself an unlikely star: the first author in the history of the world to become a billionaire just by being an author. Hundreds of millions — probably billions — of children and adults worldwide read her famed “Harry Potter” series, and Rowling developed one of the world’s most loyal cult followings. (When a rival author gave “The Casual Vacancy,” Rowling’s first post-Potter novel, a bad review a year ago even after admitting she hadn’t read the book, hundreds of loyal Potter fans took to Amazon, giving the author a slew of one-star reviews and vowing to ruin her career.)

Rowling and Strike were both determined to move on. Desperate to show she was more than a one-trick pony, Rowling wrote “The Casual Vacancy,” a dark and complex story of poverty and acrimony. “The Casual Vacancy” received mixed reviews but still sold more than a million copies worldwide. Rowling gave interviews in which she expressed a desire for the book to be judged by its merits, rather than her fame. The literary world rolled its eyes — sure, good luck with that.

Strike, on the other hand, received more attention than he desired after solving the case of the model’s mysterious murder. As with Rowling, this brought him fame and some degree of fortune — at least he had more paying clients for his detective agency. But he too seeks to prove himself, even if this desire remains bubbling beneath his coarse exterior.

Enter Robert Galbraith, Rowling’s pseudonym and Strike’s creator. Through Galbraith, Rowling was able to enjoy a sort of rebirth — with “The Cuckoo’s Calling,” she recreated herself as a solid mystery writer, one who received glowing reviews and middling sales. (That is, until the wife of a professional acquaintance spilled Galbraith’s true identity to the world media, placing “The Cuckoo’s Calling” atop worldwide best seller lists and instigating a lawsuit from an irate Rowling.) Galbraith, though, clearly loves his craft and his new character, so Strike continued his detective work. In “The Silkworm,” he finds his next grand adventure in the form of a frumpy English housewife complaining that her husband has gone missing. Let the second great act of two lives begin!

The husband is Owen Quine, a B-list novelist struggling to remain relevant. Everyone from his agent to his wife thinks that he has merely run away — perhaps to garner attention for his new novel, “Bombyx Mori” (Latin for “The Silkworm”). But after Strike finds Quine’s gruesomely mutilated corpse, many are forced to reconsider their preconceptions of Quine. Strike, along with his beautiful, spunky sidekick Robin — why don’t they see they are meant for each other? — will scour the gritty streets of London in search of answers.

The mystery rolls along, pleasantly, grotesquely, grippingly. It is, again, an excellent book, in many ways a classic British mystery — evoking the smiling ghost of Sir Arthur Conan Doyle. But the true joy of “The Silkworm” is its commentary on publishing.

“Bombyx Mori,” the novel within the novel, was essentially a hit piece on everyone Quine knew, painting vicious parodies of authors, publishers, editors and even his own wife. “Writers are different,” explains one editor. “You cannot imagine the crap I am sent,” remarks the editor’s boss.

“The Silkworm” thus doubles as Rowling’s comeback, part two, and also her own not-so-subtle jab at the world of publishing. Editors are drunken blowhards, publishers are egomaniacal manipulators and agents are cynical has-beens. “If you want a lifetime of temporary alliances with peers who will glory in your every failure, write novels,” says one character.

Even Quine, a novelist dismissed as amateurish by many critics, a one-hit-wonder desperate to prove he can write a good book again, can be seen as Rowling in disguise. But that would be, in my opinion, an incorrect reading. Quine used those around him and descended into the dark world of self-pity. Rowling is his polar opposite. Rowling has never stooped so low.

Nor will she. “The Silkworm” continues to prove that J.K. Rowling is one of the best and most important authors in the world. We have only just begun to watch her second act.