Lead on script constraints

Has anyone done any scripting for the ‘script-constraint’? Looking to create some custom constraints but I don’t know where/how to start. I’d appreciate some direction … links to resources, samples, documentation very welcome.