Creates and registers templates for agents, skills, workflows, hooks, and code patterns. Handles post-creation catalog updates, consuming skill integration, and README registration. Use when creating new template types or standardizing patterns.
Creates and registers templates for agents, skills, workflows, hooks, and code patterns. Handles post-creation catalog updates, consuming skill integration, and README registration. Use when creating new template types or standardizing patterns.
version
2.2.0
category
creator
model
sonnet
invoked_by
both
user_invocable
true
tools
["Read","Write","Edit","Bash","Glob","Grep"]
assigned_agents
["planner","architect","developer"]
triggers
["create template","new template","template for"]
dependencies
["research-synthesis"]
output_paths
[".claude/templates/"]
best_practices
["Include all required fields with placeholders","Add documentation comments in templates","Version templates for tracking changes","Include validation examples","Use consistent placeholder format","Update template-catalog.md after every creation","Sanitize spawn template placeholders"]
error_handling
graceful
streaming
supported
output_location
.claude/templates/
verified
true
lastVerifiedAt
2026-02-28
source
builtin
trust_score
100
provenance_sha
2464fc762fb36f07
Mode: Cognitive/Prompt-Driven -- No standalone utility script; use via agent context.
Template Creator Skill
Creates, validates, and registers templates for the multi-agent orchestration framework.
+==============================================================+
| MANDATORY: Research-Synthesis MUST be invoked BEFORE |
| this skill. Invoke: Skill({ skill: "research-synthesis" }) |
| FAILURE TO RESEARCH = UNINFORMED TEMPLATE = REJECTED |
+==============================================================+
| |
| DO NOT WRITE TEMPLATE FILES DIRECTLY! |
| |
| This includes: |
| - Copying archived templates |
| - Restoring from _archive/ backup |
| - "Quick" manual creation |
| |
| WHY: Direct writes bypass MANDATORY post-creation steps: |
| 1. Template catalog update (template NOT discoverable) |
| 2. README.md update (template INVISIBLE to consumers) |
| 3. Consuming skill update (template NEVER used) |
| 4. CLAUDE.md update (if user-invocable) |
| |
| RESULT: Template EXISTS in filesystem but is NEVER USED. |
| |
| ENFORCEMENT: unified-creator-guard.cjs blocks direct |
| template writes. Override: CREATOR_GUARD=off (DANGEROUS) |
| |
| ALWAYS invoke this skill properly: |
| Skill({ skill: "template-creator" }) |
| |
+==============================================================+
General documents - ADRs, specs, checklists, and other framework documents
Core principle: Templates are the DNA of the system. Consistent templates produce consistent, predictable agents and skills.
When to Use
Always:
Creating a new type of artifact that will be replicated
Standardizing an existing pattern across the codebase
Adding a new template category
Improving existing templates with better patterns
Exceptions:
One-off files that will never be replicated
Temporary/throwaway code
Template Types
Type
Location
Count
Purpose
Key Consumers
Spawn
.claude/templates/spawn/
4
Agent spawn prompt templates
router, spawn-prompt-assembler
Agent
.claude/templates/agents/
2
Agent definition boilerplate
agent-creator
Skill
.claude/templates/skills/
1
Skill definition boilerplate
skill-creator
Workflow
.claude/templates/workflows/
1
Workflow definition boilerplate
workflow-creator
Report
.claude/templates/reports/
5
Report document templates
qa, developer, researcher
Code Style
.claude/templates/code-styles/
3
Language style guides
developer, code-reviewer
Document
.claude/templates/ (root)
8+
General document templates (ADR, spec)
planner, architect, qa
Cross-Reference: See .claude/context/artifacts/catalogs/template-catalog.md for the complete inventory (28 active templates). For spawn template resolution logic, see .claude/lib/spawn/spawn-template-resolver.cjs.
Template Security Compliance
Critical Security Requirements:
No Secrets (SEC-TC-007): Templates MUST NOT include secrets, credentials, tokens, or API keys
Path Safety: All template references MUST use relative paths (.claude/templates/...), never absolute paths
No Sensitive Metadata: Templates MUST NOT expose internal system paths or user directories
No Windows Reserved Names: Template names MUST NOT use nul, con, prn, aux, com1-com9, lpt1-lpt9
Retention Mandates (SEC-TMPL-006): Templates flagged by SEC-TMPL-006 MUST remain at designated locations
Spawn Template Placeholder Safety (SEC-TC-001): Spawn templates with {{PLACEHOLDER}} tokens in prompt: fields MUST reference sanitizeSubstitutionValue() from prompt-factory.cjs for value sanitization. Unsanitized placeholders in spawn prompts create a prompt injection surface. Do NOT place {{PLACEHOLDER}} tokens where user-provided input is directly substituted without sanitization.
No Eval/Exec: Templates MUST NOT contain eval(), exec(), Function(), or other code execution patterns
Enforcement:unified-creator-guard.cjs hook blocks direct template writes (default: block mode).
The Iron Law
NO TEMPLATE WITHOUT PLACEHOLDER DOCUMENTATION
Every {{PLACEHOLDER}} must have a corresponding comment explaining:
What value should replace it
Valid options/formats
Example value
No exceptions:
Every placeholder is documented
Every required field is marked
Every optional field has a default
Workflow Steps
Step 0: Research-Synthesis (MANDATORY - BLOCKING)
Per CLAUDE.md Section 3 requirement, invoke research-synthesis BEFORE template creation:
Where <category> is one of: spawn/, agents/, skills/, workflows/, reports/, code-styles/, or root level (no category subdirectory).
Validate the resolved path:
Path MUST start with .claude/templates/
Path MUST NOT contain .. segments after normalization
Path MUST end with .md
Step 5: Content Design
Design the template content following these standards:
Placeholder Format Standard
Placeholder Type
Format
Example
Required field
{{FIELD_NAME}}
{{AGENT_NAME}}
Optional field
{{FIELD_NAME:default}}
{{MODEL:sonnet}}
Multi-line
{{FIELD_NAME_BLOCK}}
{{DESCRIPTION_BLOCK}}
List item
{{ITEM_N}}
{{TOOL_1}}, {{TOOL_2}}
Template Structure
---
# YAML Frontmatter with all required fields
name: { { NAME } }
description: { { DESCRIPTION } }
# ... other fields with documentation comments
---
# {{DISPLAY_NAME}}
## POST-CREATION CHECKLIST (BLOCKING - DO NOT SKIP)
<!-- Always include blocking checklist -->
## Overview
{{OVERVIEW_DESCRIPTION}}## Sections
<!-- Domain-specific sections -->
## Memory Protocol (MANDATORY)
<!-- Always include memory protocol -->
Security Checklist for Spawn Templates (SEC-TC-001)
If creating a SPAWN template, you MUST also verify:
No {{PLACEHOLDER}} tokens inside prompt: fields that accept unsanitized user input
Reference to sanitizeSubstitutionValue() from prompt-factory.cjs included in documentation
TaskUpdate protocol is present in the spawn prompt body
allowed_tools array does not grant Task tool to non-orchestrator agents
No prompt override patterns (IGNORE PREVIOUS, SYSTEM:, etc.) in template body
Template size under 50KB
Documentation Comments
Add inline documentation for each placeholder:
---
# [REQUIRED] Unique identifier, lowercase-with-hyphens
name: { { AGENT_NAME } }
# [REQUIRED] Single line, describes what it does AND when to use it
# Example: "Reviews mobile app UX against Apple HIG. Use for iOS UX audits."
description: { { DESCRIPTION } }
# [OPTIONAL] Default: sonnet. Options: haiku, sonnet, opus
model: { { MODEL:sonnet } }
---
Step 6: Write Template File
Write to the validated output path determined in Step 4:
Before proceeding to registration, verify ALL requirements:
Structural Validation:
[ ] YAML frontmatter is valid syntax
[ ] All required fields have placeholders
[ ] All placeholders follow {{UPPER_CASE}} naming convention
[ ] All placeholders have documentation comments
[ ] POST-CREATION CHECKLIST section present
[ ] Memory Protocol section present
[ ] Verification commands included
[ ] Example values provided where helpful
Security Validation (SEC-TC-007):
[ ] No secrets, credentials, or API keys in template content
[ ] No absolute file paths (use relative from PROJECT_ROOT)
[ ] No eval(), exec(), Function() or code execution patterns
[ ] No prompt override patterns ("IGNORE PREVIOUS", "SYSTEM:", etc.)
[ ] Template size under 50KB
Verification Commands:
# Check no unresolved placeholders from template-creator itself
grep "{{" <created-file> | head -5 # Should show only intended placeholders# Check YAML frontmatter is presenthead -50 <file> | grep -E "^---$" | wc -l # Should be 2# Check required sections present
grep -E "^## Memory Protocol" <file> || echo"ERROR: Missing Memory Protocol!"
BLOCKING: Template must pass ALL validation checks before proceeding.
grep "<template-name>" .claude/context/artifacts/catalogs/template-catalog.md || echo"ERROR: CATALOG NOT UPDATED!"
Important: Use JSON.stringify() when constructing any JSON registry entries (SEC-TC-004). Never manually concatenate strings to build JSON. The location field MUST be validated to start with .claude/templates/ and contain no .. segments.
BLOCKING: Template must appear in catalog. Uncataloged templates are invisible.
Missing README entry -> Add to .claude/templates/README.md
Missing catalog entry -> Add to template-catalog.md
Missing memory update -> Update learnings.md
Re-run validation until exit code is 0
Only proceed when validation passes
This step is BLOCKING. Do NOT mark task complete until validation passes.
Why this matters: The Party Mode incident showed that fully-implemented artifacts can be invisible to the Router if integration steps are missed. This validation ensures no "invisible artifact" pattern.
All items MUST pass before template creation is complete:
[ ] Research-synthesis skill invoked (Step 0)
[ ] Existence check passed (no duplicate template)
[ ] Template name validates against /^[a-z0-9][a-z0-9-]*[a-z0-9]$/ (Step 3)
[ ] Template file created at .claude/templates/<category>/<name>.md
[ ] All placeholders use {{PLACEHOLDER_NAME}} format
[ ] All placeholders have documentation comments
[ ] POST-CREATION CHECKLIST section present in template
[ ] Memory Protocol section present in template
[ ] No hardcoded values (all configurable via placeholders)
[ ] No secrets, credentials, or absolute paths in template (SEC-TC-007)
[ ] No eval() or code execution patterns in template
[ ] template-catalog.md updated with structured entry (Step 8)
[ ] .claude/templates/README.md updated with template entry (Step 9)
[ ] CLAUDE.md updated if template is framework-significant (Step 10)
[ ] At least one consuming skill/agent references the template (Step 11)
[ ] Integration verification passed (Step 12)
[ ] Template tested with at least one real usage
[ ] Memory files updated (learnings.md)
BLOCKING: If ANY item fails, template creation is INCOMPLETE. Fix all issues before proceeding.
Templates MUST NOT include hardcoded secrets, credentials, or API keys
Templates MUST use relative paths (.claude/templates/...), never absolute paths
Templates MUST NOT expose internal system paths or user directories
Retention mandates: security-design-checklist.md and error-recovery-template.md must remain at designated locations
Spawn template placeholder sanitization: reference sanitizeSubstitutionValue() in prompt-factory.cjs
Recent ADRs
ADR-075: Router Config-Aware Model Selection
ADR-076: File Placement Architecture Redesign
ADR-077: Shell Command Security Architecture
ADR-085: Template System Overhaul (spawn resolver + dead template cleanup)
ADR-086: Template-Creator Overhaul to v2.1 Creator Standard
Iron Laws of Template Creation
These rules are INVIOLABLE. Breaking them causes inconsistency across the framework.
1. NO TEMPLATE WITHOUT PLACEHOLDER DOCUMENTATION
- Every {{PLACEHOLDER}} must have an inline comment
- Comments explain valid values and examples
2. NO TEMPLATE WITHOUT POST-CREATION CHECKLIST
- Users must know what to do after using template
- Blocking steps prevent incomplete artifacts
3. NO TEMPLATE WITHOUT MEMORY PROTOCOL
- All templates must include Memory Protocol section
- Ensures artifacts created from template follow memory rules
4. NO TEMPLATE WITHOUT README UPDATE
- Templates README must document new template
- Undocumented templates are invisible
5. NO PLACEHOLDER WITHOUT NAMING CONVENTION
- Use {{UPPER_CASE_WITH_UNDERSCORES}}
- Never use lowercase or mixed case
6. NO OPTIONAL FIELD WITHOUT DEFAULT
- Format: {{FIELD:default_value}}
- Makes templates usable without full customization
7. NO TEMPLATE WITHOUT VERIFICATION COMMANDS
- Include commands to validate created artifacts
- Users can verify their work is correct
8. NO AGENT TEMPLATE WITHOUT ALIGNMENT SECTIONS
- Agent templates MUST include {{ENFORCEMENT_HOOKS}} placeholder section
- Agent templates MUST include {{RELATED_WORKFLOWS}} placeholder section
- Agent templates MUST include Output Standards block referencing workspace-conventions
- Reference: @HOOK_AGENT_MAP.md and @WORKFLOW_AGENT_MAP.md for archetype sets
9. NO TEMPLATE WITHOUT CATALOG ENTRY
- Every template MUST be registered in template-catalog.md
- Uncataloged templates are invisible to the system
- Verify: grep "<template-name>" .claude/context/artifacts/catalogs/template-catalog.md
10. NO TEMPLATE WITHOUT CONSUMING SKILL/AGENT
- Every template MUST be referenced by at least one consuming skill or agent
- Templates without consumers are dead on arrival
- Verify: grep -r "<template-name>" .claude/skills/ .claude/agents/
11. NO CREATION WITHOUT RESEARCH-SYNTHESIS
- Per CLAUDE.md Section 3, research-synthesis MUST be invoked before any creator
- Template creation is no exception
- Invoke: Skill({ skill: 'research-synthesis' })
Reference Template
Use .claude/templates/spawn/universal-agent-spawn.md as the canonical reference template.
Before finalizing any template, compare:
Has clear placeholder documentation
Placeholders are UPPERCASE with underscores
Has usage examples section
Has integration notes
Has POST-CREATION CHECKLIST
Has Memory Protocol
Template Best Practices
Placeholder Standards
Practice
Good
Bad
Naming
{{AGENT_NAME}}
{{name}}, {AGENT_NAME}
Required fields
Always present
Sometimes omitted
Optional fields
{{FIELD:default}}
No default indicator
Documentation
Inline comments
Separate docs file
Examples
In comments
None provided
Structure Standards
YAML Frontmatter First
All machine-readable metadata
Comments explaining each field
POST-CREATION CHECKLIST Second
Blocking steps after using template
Verification commands
Content Sections
Follow existing pattern for type
Include all required sections
Memory Protocol Last
Standard format across all templates
Always present
Validation Examples
Include validation examples in templates:
## Validation
After replacing placeholders, validate:
```bash
# Check YAML is valid
head -50 <file> | grep -E "^---$" | wc -l # Should be 2
# Check no unresolved placeholders
grep "{{" <file> && echo "ERROR: Unresolved placeholders!"
# Check required sections present
grep -E "^## Memory Protocol" <file> || echo "ERROR: Missing Memory Protocol!"
```
System Impact Analysis (MANDATORY)
After creating a template, complete this 7-point analysis:
[TEMPLATE-CREATOR] System Impact Analysis for: <template-name>
1. README UPDATE (MANDATORY - Step 9)
- Added to .claude/templates/README.md
- Usage instructions documented
- Quick Reference table updated
2. CATALOG UPDATE (MANDATORY - Step 8)
- Added to .claude/context/artifacts/catalogs/template-catalog.md
- Category, status, agents, skills documented
- Purpose clearly stated
3. CLAUDE.MD UPDATE (CONDITIONAL - Step 10)
- Is template framework-significant? If yes, add to CLAUDE.md
- Spawn templates -> Section 2
- Creator templates -> relevant creator section
- User-invocable -> Section 8.5
4. CONSUMER ASSIGNMENT (MANDATORY - Step 11)
- Which skills/agents consume this template?
- Is template reference added to consuming creator skill?
- Verify with grep across skills/ and agents/
5. RELATED TEMPLATES CHECK
- Does this template supersede an existing one?
- Are there related templates that need cross-references?
- Should archived templates be updated or removed?
6. SECURITY COMPLIANCE (SEC-TMPL-006, SEC-TC-001, SEC-TC-007)
- No secrets, credentials, or absolute paths
- Relative paths only
- Retention mandates respected
- Spawn template placeholders sanitized
7. MEMORY UPDATE
- Record creation in learnings.md
- Document any decisions in decisions.md
Workflow Integration
This skill is part of the unified artifact lifecycle. For complete multi-agent orchestration:
Programmatic template selection for spawn operations
Template scoring and fallback logic
Cross-Reference: Creator Ecosystem
This skill is part of the Creator Ecosystem. Use companion creators when needed:
Gap Discovered
Required Artifact
Creator to Invoke
When
Domain knowledge needs a reusable skill
skill
Skill({ skill: 'skill-creator' })
Gap is a full skill domain
Existing skill has incomplete coverage
skill update
Skill({ skill: 'skill-updater' })
Close skill exists but incomplete
Capability needs a dedicated agent
agent
Skill({ skill: 'agent-creator' })
Agent to own the capability
Existing agent needs capability update
agent update
Skill({ skill: 'agent-updater' })
Close agent exists but incomplete
Domain needs code/project scaffolding
template
Skill({ skill: 'template-creator' })
Reusable code patterns needed
Behavior needs pre/post execution guards
hook
Skill({ skill: 'hook-creator' })
Enforcement behavior required
Process needs multi-phase orchestration
workflow
Skill({ skill: 'workflow-creator' })
Multi-step coordination needed
Artifact needs structured I/O validation
schema
Skill({ skill: 'schema-creator' })
JSON schema for artifact I/O
User interaction needs a slash command
command
Skill({ skill: 'command-creator' })
User-facing shortcut needed
Repeated logic needs a reusable CLI tool
tool
Skill({ skill: 'tool-creator' })
CLI utility needed
Narrow/single-artifact capability only
inline
Document within this artifact only
Too specific to generalize
Integration Workflow
After creating a template that needs additional artifacts:
// 1. Template created for new hook type// 2. Need to create example hook using templateSkill({ skill: 'hook-creator' });
// 3. Template created for new agent category// 4. Need to update agent-creator to recognize new category// Edit .claude/skills/agent-creator/SKILL.md to add category
Post-Creation Checklist for Ecosystem Integration
After template is fully created and validated:
[ ] Does template need a companion skill? -> Use skill-creator
[ ] Does template need a companion workflow? -> Use workflow-creator
[ ] Does template supersede an existing template? -> Archive old one
[ ] Should template be part of enterprise workflows? -> Update Section 8.6
[ ] Does template interact with spawn-template-resolver? -> Update resolver config
Search arXiv for academic research (mandatory for AI/ML, agents, evaluation, orchestration, memory/RAG, security):
Via Exa: mcp__Exa__web_search_exa({ query: 'site:arxiv.org <topic> 2024 2025' })
Direct API: WebFetch({ url: 'https://arxiv.org/search/?query=<topic>&searchtype=all&start=0' })
Record decisions, constraints, and non-goals in artifact references/docs.
Keep updates minimal and avoid overengineering.
arXiv is mandatory (not fallback) when topic involves: AI agents, LLM evaluation, orchestration, memory/RAG, security, static analysis, or any emerging methodology.
Regression-Safe Delivery
Follow strict RED -> GREEN -> REFACTOR for behavior changes.
Run targeted tests for changed modules.
Run lint/format on changed files.
Keep commits scoped by concern (logic/docs/generated artifacts).
Optional: Evaluation Quality Gate
Run the shared evaluation framework to verify template quality: