The trouble with a murder-mystery writer switching genres to romance novels is that he may drop too many clues. He calls them “loopholes.” Throughout his career, his detective friend has helped him spot them.

In “An Act of the Imagination” — pay attention to the title — highly successful mystery writer Arthur Putnam’s wife is reading his latest manuscript, “Signs of Love,” a major departure from his literary oeuvre. Julia approves but wonders how he’s made the sex scenes — they haven’t shared intimacies lately — seem so authentic.

advertisement | advertise on newsday

“Memory,” he says, glibly.

Enter Simon, Arthur’s money-pit son. He asks Dad for 3,000 pounds to start a restaurant. Instead, Arthur dispatches him to give his editor a lift. When Holly arrives — Arthur can’t remember her name except that it evokes Christmas — she has time alone with Julia in which her praise of Arthur’s new work suggests it could only have been written by a passion-smitten male.

Bernard Slade, whose career is a reverse image of Arthur’s — he’s best known for his romantic play “Same Time, Next Year” and such TV series as “Bewitched” — wrote this deliciously, devilishly unsolvable mystery in 1987. But the greatest mystery is why it’s never received a major New York production or been adapted as a movie. This ingeniously imaginative play delights and confounds in equal measure as directed at a crisp pace by Edward Brennan for the Hampton Theatre Company.

Matthew Conlon calibrates Arthur’s befuddlement and cunning — he’s a self-distracting eccentric — into a believable package of flawed genius and rectitude. He’s also not much of a dresser, as opposed to his wife, who’s always ready to receive company (frumpy and fashionable costumes by Teresa Lebrun aboard Sean Marbury’s creature-comfort English “cottage” set, lit to melodramatic effect by Sebastian Paczynski). Rebecca Edana as Julia never tips her hand as to whether Arthur is a cheat — or worse — until, well, she does. She’s the fulcrum on which the mystery teeters. Jesse Pimpinella is the perfect spoiled-brat son as Simon while Amanda Griemsmann as Arthur’s editor carries her expository burden with a natural offhand touch. James Lotito Jr. as Arthur’s police friend, plus Cesa Pledger and Meggie Doyle as two shall we say mystery women acquit their roles with aplomb. To say more would be a crime.

And if you love a mystery, it would be a crime to miss this one.