Mechanical Traps: Simply select the elements you want the trap to have and add up the adjustments to the trap’s Challenge Rating that those elements require (see Table: CR Modifiers for Mechanical Traps) to arrive at the trap’s final CR. From the CR you can derive the DC of the Craft (trapmaking) checks a character must make to construct the trap.
Magic Traps: As with mechanical traps, you don’t have to do anything other than decide what elements you want and then determine the CR of the resulting trap (see Table: CR Modifiers for Magic Traps). If a player character wants to design and construct a magic trap, he must have the Craft Wondrous Item feat. In addition, he must be able to cast the spell or spells that the trap requires—or, failing that, he must be able to hire an NPC to cast the spells for him.