Arcane University: Procedures
Procedures are the underlying elements that build an AI-Package and can be used to create your own package templates.
See the known issues section for common issues at the bottom when working with Procedures.
To get an introduction, make sure to read: Bethesda Tutorial Package Templates(Creation Kit Wiki). The article covers how to setup a template from scratch, add procedures and link the corresponding parameters.
Unfortunately there is no good way to debug procedures and you can only be linked to the general debugging of NPC Packages. If you know of any, feel free to write them down.