This guide explains how to create new recipe templates for the ICP Recipes repository.
Recipes are Handlebars templates that generate YAML build configurations for IC canisters. They provide a standardized way to build different types of canisters while allowing customization through template variables.
All recipe templates follow this basic structure:
build:
steps:
- type: [build-step-type]
[step-specific-configuration]
# Optional sync section for recipes that need asset synchronization
sync:
steps:
- type: [sync-step-type]
[sync-configuration]icp-cli support the default helpers, see: handlebars documentation
In addition, it provides the following helpers:
{{replace "search" "replace" string}}- String replacement
More helpers might be added in the future.
recipes/[recipe-name]/
├── recipe.hbs # Handlebars template
└── README.md # Documentation following template
- Keep it simple: Start with minimal required functionality
- Make it configurable: Use template variables for customization
- Handle edge cases: Use conditionals for optional features
- Follow conventions: Use established patterns from existing recipes
- Use
snake_casefor parameter names - Choose descriptive, unambiguous names
- Group related parameters logically
- Provide sensible defaults when possible
- Validate required tools are available
- Provide clear error messages
- Fail fast if prerequisites aren't met
- Include troubleshooting in documentation
- Document all parameters clearly
- Provide working examples
- Explain prerequisites and setup
- Include common troubleshooting scenarios
- Create recipe directory with template and README
- Test thoroughly with real projects
- Follow documentation standards using the README template
- Submit pull request with clear description
- Address review feedback promptly
See CONTRIBUTING.md for detailed submission guidelines.