In 1944, Superman creators Jerry Siegel and Joe Shuster introduced Mr. Mxyzptlk, a fifth-dimensional prankster who popped up occasionally over the years to torment The Man Of Steel with all manner of goofery, exploiting Superman’s vulnerability to magic. Mr. Mxyzptlk became a regular in the various Superman titles in large part because he allowed the writers to tell stories that deviated from the usual hero/villain fare. Mr. Mxyzptlk wasn’t an unambiguous bad guy; he was more of an annoyance, like a sudden thunderstorm during a day at the beach. On the scale of “things that complicate Superman’s life,” Mr. Mxyzptlk would land closer to Red Kryptonite than to Lex Luthor.

Of course, in the incestuous world of superhero comics, success doesn’t just breed imitators, it breeds sickly, deformed imitators. In 1959, DC Comics had its other big-time hero, Batman, meet Bat-Mite, another extra-dimensional pixie who used his magical powers to make life difficult for the hero—although Bat-Mite always intended his intrusions to be helpful, since he considered himself to be the ultimate Bat-fan. In 1962, Aquaman was first pestered by Qwsp, a character that over the years split the difference between the bumbling-but-good-natured Bat-Mite and the quasi-malevolent Mxyzptlk. Green Arrow had Xeen Arrow; Green Lantern had Myrwhydden. Over in Wonder Woman, tales of “Wonder Tot” occasionally included her wish-granting playmate Mr. Genie, and from the Golden Age on, DC comics have frequently featured the genie-like Yz, the “Thunderbolt” commanded by Johnny Thunder. Even Marvel Comics, which touted itself as different from DC—“Not brand ecch,” according to the marketing department—very early on gave its flagship title Fantastic Four a playful pest, The Impossible Man, a shape-shifting, self-replicating nuisance from the planet Poppup. (Impy’s best adventures have just been collected and released in a surprisingly hefty trade paperback, in fact.)

But that’s all in the past. What future comic-book creators need to know is how to concoct your own wacky, seemingly all-powerful trickster type to plague your hero of choice. Here’s an easy template to follow:

1. Come up with a barely plausible explanation for the imp’s abilities. 
Mr. Mxyzptlk’s powers are attributable to his dimension of origin; coming from where he does, the physical laws of our dimension don’t apply, so he can conjure objects or even bend reality in our world to suit his whims. Bat-Mite, meanwhile, comes from a dimension with technology so advanced that his trickery only seems like magic, while The Impossible Man comes from a planet so fraught with danger that his people developed the ability to shape-shift, create duplicates, and share consciousness with other Poppupians. All of these origin stories are writers’ shorthand for “this crazy character can do whatever we say he can.” Because if the idea is to fill an issue with pure play, there’s no reason to inhibit the imp’s potential.

2. Design a colorful and/or crazy costume.
This spec is key, especially if the nature of the imp is to toy with the heroes’ perceptions. It’s all well and good for the tiny, pudgy Bat-Mite to run around in a loose-fitting Batman costume like a miniature comic-convention attendee, but Mr. Mxyzptlk shows a little more style with his orange-and-purple tunic-skirt and his tiny bowler hat. And The Impossible Man’s green skin and purple costume make him more identifiable when he tries to hide in the corner as a potted plant, or to take the form of a supervillain like Galactus. As with the kooky hero Plastic Man—who’s impish, if not an actual imp—the distinctive color scheme of The Impossible Man is both a signature and a tell.

3. Give the hero an out.
Even novice comic-book readers know how to send Mr. Mxyzptlk packing: Trick him into saying his name backward, which will consign him back to his own dimension for 90 days (giving the writers time to come up with another crackpot Mr. Mxyzptlk story). But not all imps have a safe-word, so their foils have to come up with craftier ways of getting shut of them. The Fantastic Four had the right idea the first time they encountered The Impossible Man: After a while, they just ignored him, until eventually he got bored and went home.

4. Don’t make the imp evil.
This one’s more of a guideline than a rule. Again, the whole purpose of introducing a pixie-ish character to a superhero comic is to have a little fun, bending the already-loose rules of comic-book storytelling. (Frequently, issues featuring Bat-Mite or The Impossible Man will become self-referential to the extreme, with jokes about the publishers’ other characters and even cameo appearances by their real-life writers and artists.) So making the imp straight-up wicked tends to violate the spirit of the exercise. Some writers have gone in that direction: When Alan Moore helped usher in mainstream comics’ “grim ’n’ gritty” era (to his eternal chagrin), one of his storylines that bid farewell to the old school was “Whatever Happened To The Man Of Tomorrow?,” in which Mr. Mxyzptlk went from merely picking on Superman to actively working to destroy the hero’s life. Later, Grant Morrison did something similar with Qwsp, having the imp mimic the darker-toned Aquaman and become an outright villain—though Morrison’s take on Qwsp can be read as a critique of the insane excesses of “grim ’n’ gritty.”

5. Don’t expect ever to get rid of the thing. Ever.
From time to time, comic-book writers, editors, and publishers have tried to reboot or revamp a character, often starting over from square one and eliminating those superfluous supporting casts and concepts that can clutter up a book over time. Usually, the first item to go is anything that smacks of frivolity: super-pets, nutty sidekicks, and imps. But the imps always come back. Even Bat-Mite—ridiculous, ridiculous Bat-Mite—keeps coming back. Maybe it’s because fans won’t let them die, or maybe it’s that these characters serve the same purpose they did half a century ago: to let tired writers re-energize by allowing them to toss out the rulebook for an issue. Want to make cotton balls fall from the sky, or conduct an intergalactic scavenger hunt, or have your hero meet Scooby Doo? Get yourself an imp. They’re like a license to be silly.