Also see:
https://github.com/rapid7/metasploit-framework/wiki/How-to-write-a-check()-method