Template Authoring Guide¶
This guide covers how to write and register templates for the Agent Teams Module. The canonical source is templates/AUTHORING-GUIDE.md in the repository.
Placeholder Syntax¶
Two placeholder syntaxes are used. For full details, see templates/PLACEHOLDER-CONVENTIONS.md.
Auto-Resolved: {UPPER_SNAKE_CASE}¶
Filled automatically by the rendering engine from the project description and manifest.
{PROJECT_NAME} → project_name from the brief
{PRIMARY_OUTPUT_DIR} → primary_output_dir field
{AGENT_SLUG_LIST} → multi-line YAML block of all agent slugs (use without brackets)
{STYLE_REFERENCE_PATH} → style_reference field (or {MANUAL:STYLE_REFERENCE_PATH} if null)
{DIAGRAM_TOOLS} → detected diagram tool(s) e.g. "Mermaid or Graphviz/DOT"
{TOOL_DOCS_URL} → tool's docs_url from the brief
{TOOL_API_SURFACE} → tool's api_surface from the brief
{TOOL_COMMON_PATTERNS} → tool's common_patterns from the brief
Critical: When
{AGENT_SLUG_LIST}is used in YAML front matter, do NOT wrap it in brackets. Useagents:{AGENT_SLUG_LIST}— the placeholder expands to a multi-line YAML block sequence.
Manual-Required: {MANUAL:UPPER_SNAKE_CASE}¶
Cannot be auto-resolved. Collected into SETUP-REQUIRED.md for the user to fill in.
{MANUAL:REFERENCE_DB_PATH} → path to bibliography database
{MANUAL:STYLE_REFERENCE_PATH} → path to style guide (when not in brief)
{MANUAL:CONVERSION_PIPELINE} → pandoc/build command for format conversion
Required Sections Per Agent Tier¶
Every agent template must include these sections in this order:
| Tier | Required Sections |
|---|---|
| Orchestrator | YAML front matter; Invariant Core; Workflows; Authority Hierarchy; Domain Agent Routing table |
| Governance | YAML front matter; Invariant Core; Trigger conditions; Procedure; Output format |
| Domain archetype | YAML front matter; Invariant Core; Scope; Procedure (numbered); Constraints; Handoffs |
| Workstream expert | YAML front matter; Invariant Core; Component Specification; Component Brief workflow; Review-and-approve workflow |
| Tool-specific | YAML front matter; Invariant Core; Tool identification; Config management; Invocation; Verification; Cleanup |
Invariant Core¶
Every template must have:
## Invariant Core
> ⛔ **Do not modify or omit.** The rules below are the immutable contract for this agent.
Registering a New Template¶
- Create the file in the appropriate subdirectory under
templates/: universal/— governance agentsdomain/— domain archetypesbuilder/— per-framework builder agents- Root level — orchestrator and copilot-instructions
- Add the archetype trigger rule to
agentteams/analyze.py's_ARCHETYPE_TRIGGERSlist - Add the new placeholder to
templates/PLACEHOLDER-CONVENTIONS.mdif introducing a new placeholder - Add the archetype to the
selected_archetypesenum inschemas/project-description.schema.json - Update
template-library-expert.agent.mdsections count
Placeholder Rules¶
- Placeholder names must be
UPPER_SNAKE_CASE - Every auto-resolved placeholder must map to a key in
_build_placeholder_map()inagentteams/analyze.py - Never use
{UPPER_SNAKE_CASE}for a value that cannot be auto-resolved — use{MANUAL:}instead - Do not introduce new auto-resolved placeholders without adding them to
PLACEHOLDER-CONVENTIONS.mdandagentteams/analyze.py