Overview
AIOX uses Handlebars templates to generate consistent files across the framework. Templates are stored in.aiox-core/development/templates/ and used by agents to create documentation, code, and configuration files.
.aiox-core/development/templates/Handlebars.js with custom helpers
.md, .yaml, .js, .json (various)Template Categories
Documentation Templates
Standard AIOX documentation templatePurpose: Create consistent documentation structureVariables:
{{TITLE}}- Document title{{VERSION}}- Document version{{DATE}}- Last updated date{{STATUS}}- Document status (Active, Draft, Deprecated)
Deep research prompt generator for agent creationPurpose: Generate structured research prompts for specialist-based agentsVariables:
{{specialist_name}}- Human expert name{{specialist_slug}}- Slug format identifier{{activity}}- Specific activity area{{domain}}- Domain expertise{{agent_purpose}}- Agent’s primary purpose{{scope_items}}- Research scope areas (array){{sources}}- Recommended sources (array){{deliverables}}- Expected outputs (array)
Workflow Templates
Agent handoff workflow templatePurpose: Structure handoff between agents in workflow chainsSchema:Used by: Workflow chain system for agent coordination
Subagent execution step templatePurpose: Structure prompts for multi-step agent workflowsVariables:
{{step_number}}- Current step number{{total_steps}}- Total workflow steps{{step_description}}- Step description{{inputs}}- Required inputs{{outputs}}- Expected outputs{{validation}}- Validation criteria
Service Templates
Complete service scaffolding templatePurpose: Generate new service modules with consistent structureStructure:Service Types:
api-integration- External API client serviceutility- Utility/helper serviceagent-tool- MCP tool integration service
Pattern Templates
Code intelligence integration patternPurpose: Document pattern for integrating code analysis toolsSections:
- Pattern overview
- Integration points
- Configuration requirements
- Usage examples
- Error handling
Quality Gate Templates
PTC (Pre-Task Check) entity validation templatePurpose: Validate entity definitions before task executionValidates:
- Schema compliance
- Required fields
- Relationship integrity
- Naming conventions
Quality gate checkpoint templatePurpose: Define quality gates for workflow stagesStructure:
Research aggregation templatePurpose: Aggregate research findings into structured formatSections:
- Research summary
- Key findings
- Patterns identified
- Recommendations
- Source attribution
Template Variables
Templates use Handlebars syntax for variable substitution:Basic Variables
Simple string substitutionExample:
{{agent_name}} → "Dex"Conditional rendering
Array iteration
Custom Helpers
AIOX extends Handlebars with custom helpers:Generate ISO 8601 timestamp
Convert string to slug format
Convert to uppercase
Generate markdown table from array
Template Usage Patterns
Creating from Template
Agents use templates via commands:Template Resolution
Templates are resolved from multiple locations:- Project templates -
.aiox-core/development/templates/ - Framework templates - Core template library
- Custom templates - User-defined in
templates/
Template Overrides
Override default template behavior in
project-config.yamlSquad Templates
Agent squad template directoryPurpose: Create multi-agent squads for complex workflowsStructure:
Full squad scaffolding with examplesIncludes:
- Agent definitions
- Workflow chains
- Task definitions
- Integration patterns
- Documentation templates
Template Best Practices
Template Design
Template Design
- Use clear, descriptive variable names
- Provide default values where appropriate
- Document required vs. optional variables
- Include usage examples in template comments
- Use consistent formatting and structure
Variable Naming
Variable Naming
- Use
snake_casefor template variables - Prefix boolean variables with
has_,is_,should_ - Use plural names for arrays (
items,commands,agents) - Be explicit about data types in documentation
Template Organization
Template Organization
- Group related templates in subdirectories
- Use clear, descriptive file names
- Include README.md for complex template sets
- Version templates when making breaking changes
- Maintain backward compatibility when possible
Documentation
Documentation
- Document all template variables
- Provide usage examples
- Explain when to use each template
- Include sample output
- Note any dependencies or requirements
Template Validation
Location:
.aiox-core/utils/template-validator.jsValidates:- Handlebars syntax correctness
- Required variables present
- Helper function availability
- Output format correctness
Creating Custom Templates
Create project-specific templates:-
Create template file:
-
Define template structure:
-
Register with agent:
-
Use in command:
Related Documentation
Reference:
.aiox-core/development/templates/