The developer guidelines provides the specifications for writing a Nagios plugin.
This is a document in DocBook format that is held in the Nagios Plugin subversion repository.