Nxivm leader Keith Raniere planned to market his alleged sex cult — and was even in the process of writing a handbook about his twisted obsession, a former member said.

DOS slave Lauren Salzman testified Monday she was helping Raniere edit his misogynistic manifesto, which she said he’d planned to install in sorority houses across the country after the secret master-slave group’s popularity took off.

“A good slave actively seeks to give her Master a competitive advantage over all other people,” the document reads. “Ever see a hungry dog, someone walks in the room with food? That dog sees nothing else. That is how you should be. You should be a hungry dog for your Master.”

Raniere, who is facing trial on sex trafficking charges, is accused of running a secret sorority in which women were branded with his initials and ordered to have sex with him.

The book was meant to help DOS slaves better serve their masters, Salzman said, but also includes some of the misogyny present in Raniere’s more mainstream teachings.

“Women, in particular, are miraculous excuse finders,” one passage reads. “Why? Because it works!”

Salzman testified Monday that Raniere likened the book to something that might have been written by a well-known yoga guru — but that it would be kept under lock and key and accessible only to his devoted followers.

“The book would be very pretty, and people would go study it,” she told jurors. “The book would be maybe chained to the wall someplace.”

Salzman testified the 120-page tome was just one of many DOS projects — including building a dungeon filled with BDSM paraphernalia in the basement of their sorority house.

While jurors heard about the dungeon, they were spared portions of Raniere’s DOS writings pertaining to bestiality and social norms.

“You having sex with a dog. What’s wrong with it? There are people who do that,” the document says. “You believe certain things are good and bad and that constrains, that circumscribes your life. And they are just not true. None of those things are true.”