Contingency is an evocation spell that lets one set a trigger for another spell.
You can place another spell upon your person so that the latter spell comes into effect under some condition you dictate when casting contingency. The companion spell and the spell it is to bring into effect are cast at the same time. The 10-minute casting time is the minimum total for both castings; if the companion spell has a casting time longer than 10 minutes, use that casting time instead.
The spell to be brought into effect by the contingency must be one that affects your person (feather fall, levitate, fly, teleport, and so forth) and be of a spell level no higher than one-third your caster level (rounded down, maximum 6th level).
The conditions needed to bring the spell into effect must be clear, although they can be general. For example, a contingency cast with water breathing might prescribe that any time you are plunged into or otherwise engulfed in water or similar liquid, the water breathing spell instantly comes into effect. Or a contingency could bring a feather fall spell into effect any time you fall more than 4 feet. In all cases, the contingency immediately brings into effect the second spell, the latter being "cast" instantaneously when the prescribed circumstances occur. Note that if complicated or convoluted conditions are prescribed, the whole spell combination (contingency and the companion magic) may fail when called on. The companion spell occurs based solely on the stated conditions, regardless of whether you want it to.
You can use only one contingency spell at a time; if a second is cast, the first one (if still active) is dispelled.
Those of the companion spell, plus quicksilver and an eyelash of an ogre mage, ki-rin, or similar spell-using creature.
A statuette of you carved from elephant ivory and decorated with gems (worth at least 1,500 gp). You must carry the focus for the contingency to work.