auto-generate hooks with a template