http://wiki.blender.org/index.php/Dev:2.4/Doc/How_to/Add_A_Node
I’ve been searching high and low for documentation on how to add a node to Cycles. I might missed something, but I’m pretty sure nothing is there. Actually I must say I am pretty amazed how sparse Blender code is documented both in wiki and inline. Basically most of the time you are better going through the code to find out how stuff works.