/template-engine
Load, validate, and populate templates consistently across frameworks
$ npx -y skills add jmagly/aiwg --skill template-engine --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/template-engine
Context preview
The summary Claude sees to decide when to auto-load this skill.
Load, validate, and populate templates consistently across frameworks
SKILL.md
template-engine.SKILL.mdnamespace: aiwg
name: template-engine
platforms: [all]
description: Load, validate, and populate templates consistently across frameworks
template-engine
Load, validate, and populate templates consistently across frameworks.
Triggers
Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):
- "fill template" → template instantiation
- "scaffold from template" → template-driven generation
Purpose
This skill provides a unified template instantiation engine that:
- Locates templates across project, framework, and installation locations
- Parses template structure and placeholders
- Gathers required inputs from context or prompts
- Populates and validates instantiated artifacts
- Integrates with artifact-metadata for tracking
Behavior
When triggered, this skill:
1. **Locates template**:
- Search project templates first (`.aiwg/templates/`)
- Search active framework templates
- Search AIWG installation templates
- Return first match or list similar templates
2. **Parses template**:
- Extract placeholders (`{{variable}}`, `{variable}`)
- Identify required vs optional sections
- Detect conditional blocks
- Build input requirements list
3. **Gathers inputs**:
- Check context for matching values
- Prompt for missing required values
- Apply defaults for optional values
4. **Instantiates template**:
- Replace all placeholders
- Evaluate conditional sections
- Process loops/repeating sections
- Format output
5. **Validates output**:
- Check all placeholders replaced
- Validate structure
- Create metadata (via artifact-metadata skill)
6. **Saves artifact**:
- Write to appropriate location
- Update artifact index
Template Discovery Order
1. .aiwg/templates/{template-name}.md
2. .aiwg/templates/{category}/{template-name}.md
3. {framework}/templates/{category}/{template-name}.md
4. ~/.local/share/ai-writing-guide/.../{template-name}.mdTemplate Syntax
Basic Placeholders
# {{project_name}} Architecture Document
**Author**: {{author}}
**Date**: {{date}}
**Version**: {{version|default:0.1.0}}Conditional Sections
{{#if has_database}}
## Database Design
{{database_description}}
{{/if}}Loops/Repeating Sections
## Components
{{#each components}}
### {{name}}
{{description}}
- **Owner**: {{owner}}
- **Dependencies**: {{dependencies}}
{{/each}}Includes
{{> common/header.md}}
## Content
{{> partials/component-table.md}}Computed Values
**Generated**: {{now|format:YYYY-MM-DD}}
**ID**: {{artifact_type}}-{{sequence|pad:3}}Configuration
Template Metadata
Each template can have a `.meta.yaml` file:
name: software-architecture-document
description: Template for Software Architecture Documents
category: architecture
version: 1.0.0
variables:
- name: project_name
required: true
description: Name of the project
- name: author
required: true
description: Document author
- name: version
required: false
default: "0.1.0"
description: Document version
- name: components
required: false
type: array
description: List of system components
sections:
- name: overview
required: true
- name: database
required: false
condition: has_database
output:
location: .aiwg/architecture/
filename: "{{project_name|kebab}}-sad.md"Usage Examples
Basic Template Instantiation
User: "Create SAD from template"
Skill executes:
1. Find: sdlc-complete/templates/analysis-design/software-architecture-doc-template.md
2. Parse: Extract placeholders (project_name, author, etc.)
3. Gather: Prompt for required values
4. Instantiate: Replace placeholders
5. Save: .aiwg/architecture/myproject-sad.md
6. Metadata: Create .aiwg/architecture/myproject-sad.metadata.json
With Context
User: "New test plan from template for authentication module"
Context provides:
- project_name: "MyProject"
- module: "authentication"
- author: from git config
Skill uses context values, prompts for remaining.
List Available Templates
User: "What templates are available?"
Skill returns:
Architecture:
- software-architecture-doc-template
- adr-template
- api-contract-template
Requirements:
- use-case-spec-template
- user-story-template
- supplementary-spec-template
Testing:
- test-plan-template
- test-case-template
- test-strategy-template
Template with Components
User: "Create component diagram from template with 3 components"
Skill prompts:
- Component 1 name? "API Gateway"
- Component 1 description? "External API interface"
- Component 2 name? "Auth Service"
...
Output includes all components in repeating section.
CLI Usage
# Instantiate template
python template_engine.py --template software-architecture-doc-template
# With variables
python template_engine.py --template sad \
--var project_name="MyProject" \
--var author="John Doe"
# Interactive mode
python template_engine.py --template test-plan --interactive
# List templates
python template_engine.py --list
python template_engine.py --list --category architecture
# Validate template
python template_engine.py --validate --template custom-template.md
# Preview without saving
python template_engine.py --template sad --preview
# Specify output location
python template_engine.py --template sad --output .aiwg/architecture/custom-name.md
Template Categories
SDLC Framework Templates
| Category | Templates | |----------|-----------| | requirements | use-case-spec, user-story, supplementary-spec, srs, glossary | | architecture | sad, adr, api-contract, data-flow, database-design | | testing | test-strategy, test-plan, test-cases, defect-card | | security | threat-model, security-requirements, vulnerability-plan | | deployment | deployme
Read more
namespace: aiwg name: template-engine platforms: [all] description: Load, validate, and populate templates consistently across frameworks
template-engine
Load, validate, and populate templates consistently across frameworks.
Triggers
Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):
- "fill template" → template instantiation
- "scaffold from template" → template-driven generation
Purpose
This skill provides a unified template instantiation engine that:
- Locates templates across project, framework, and installation locations
- Parses template structure and placeholders
- Gathers required inputs from context or prompts
- Populates and validates instantiated artifacts
- Integrates with artifact-metadata for tracking
Behavior
When triggered, this skill:
1. **Locates template**:
- Search project templates first (`.aiwg/templates/`)
- Search active framework templates
- Search AIWG installation templates
- Return first match or list similar templates
2. **Parses template**:
- Extract placeholders (`{{variable}}`, `{variable}`)
- Identify required vs optional sections
- Detect conditional blocks
- Build input requirements list
3. **Gathers inputs**:
- Check context for matching values
- Prompt for missing required values
- Apply defaults for optional values
4. **Instantiates template**:
- Replace all placeholders
- Evaluate conditional sections
- Process loops/repeating sections
- Format output
5. **Validates output**:
- Check all placeholders replaced
- Validate structure
- Create metadata (via artifact-metadata skill)
6. **Saves artifact**:
- Write to appropriate location
- Update artifact index
Template Discovery Order
1. .aiwg/templates/{template-name}.md
2. .aiwg/templates/{category}/{template-name}.md
3. {framework}/templates/{category}/{template-name}.md
4. ~/.local/share/ai-writing-guide/.../{template-name}.mdTemplate Syntax
Basic Placeholders
# {{project_name}} Architecture Document
**Author**: {{author}}
**Date**: {{date}}
**Version**: {{version|default:0.1.0}}Conditional Sections
{{#if has_database}}
## Database Design
{{database_description}}
{{/if}}Loops/Repeating Sections
## Components
{{#each components}}
### {{name}}
{{description}}
- **Owner**: {{owner}}
- **Dependencies**: {{dependencies}}
{{/each}}Includes
{{> common/header.md}}
## Content
{{> partials/component-table.md}}Computed Values
**Generated**: {{now|format:YYYY-MM-DD}}
**ID**: {{artifact_type}}-{{sequence|pad:3}}Configuration
Template Metadata
Each template can have a `.meta.yaml` file:
name: software-architecture-document
description: Template for Software Architecture Documents
category: architecture
version: 1.0.0
variables:
- name: project_name
required: true
description: Name of the project
- name: author
required: true
description: Document author
- name: version
required: false
default: "0.1.0"
description: Document version
- name: components
required: false
type: array
description: List of system components
sections:
- name: overview
required: true
- name: database
required: false
condition: has_database
output:
location: .aiwg/architecture/
filename: "{{project_name|kebab}}-sad.md"Usage Examples
Basic Template Instantiation
User: "Create SAD from template" Skill executes: 1. Find: sdlc-complete/templates/analysis-design/software-architecture-doc-template.md 2. Parse: Extract placeholders (project_name, author, etc.) 3. Gather: Prompt for required values 4. Instantiate: Replace placeholders 5. Save: .aiwg/architecture/myproject-sad.md 6. Metadata: Create .aiwg/architecture/myproject-sad.metadata.json
With Context
User: "New test plan from template for authentication module" Context provides: - project_name: "MyProject" - module: "authentication" - author: from git config Skill uses context values, prompts for remaining.
List Available Templates
User: "What templates are available?" Skill returns: Architecture: - software-architecture-doc-template - adr-template - api-contract-template Requirements: - use-case-spec-template - user-story-template - supplementary-spec-template Testing: - test-plan-template - test-case-template - test-strategy-template
Template with Components
User: "Create component diagram from template with 3 components" Skill prompts: - Component 1 name? "API Gateway" - Component 1 description? "External API interface" - Component 2 name? "Auth Service" ... Output includes all components in repeating section.
CLI Usage
# Instantiate template python template_engine.py --template software-architecture-doc-template # With variables python template_engine.py --template sad \ --var project_name="MyProject" \ --var author="John Doe" # Interactive mode python template_engine.py --template test-plan --interactive # List templates python template_engine.py --list python template_engine.py --list --category architecture # Validate template python template_engine.py --validate --template custom-template.md # Preview without saving python template_engine.py --template sad --preview # Specify output location python template_engine.py --template sad --output .aiwg/architecture/custom-name.md
Template Categories
SDLC Framework Templates
| Category | Templates | |----------|-----------| | requirements | use-case-spec, user-story, supplementary-spec, srs, glossary | | architecture | sad, adr, api-contract, data-flow, database-design | | testing | test-strategy, test-plan, test-cases, defect-card | | security | threat-model, security-requirements, vulnerability-plan | | deployment | deployme
Multi-agent AI framework for Claude Code, Copilot, Cursor, Warp, and 6 more platforms 200+ agents, 109+ CLI commands, 400+ deployable agent/skill/command/rule artifacts, 8 core frameworks, 32 addons, and a 40-plugin Claude Code marketplace.
Repo: jmagly/aiwg
Other skills on aiwg.
- /agent-loop-ext
Crash-resilient external agent loop with state persistence and CI/CD integration
Open skill - /agent-loop
Detect requests for iterative autonomous agent loops and route to the appropriate loop executor
Open skill - /auto-test-execution
Automatically execute tests when code-generating agents modify source files, enforcing the execute-before-return pattern
Open skill - /cross-task-learner
Enable agent loops to learn from similar past tasks and share patterns across loops
Open skill - /debug-memory
Query and manage the executable feedback debug memory
Open skill - /execute-feedback
Execute tests on generated code and iterate until passing
Open skill

