i'm not sure if its the best way to do this, but i created site templates for share by:
1. creating a custom site type by modifing: create-site.get.js and presets.xml
2. creating a new space "site-template" in the data dictionary using the alfresco explorer with the template folders and files
3. creating a custom behavior on "onCreateNode", check if the created node is my custom site (check the node property SiteModel.PROP_SITE_PRESET)
4. creating the documentLibraray folder in the site space, as it will not be present at this point
5. copy the content of the "site-template" space in the newly created folder (documentLibrary)
hth
steffen