| name | template-ops |
| description | Apply, teardown, and validate declarative YAML templates for agents and workflows. Use when working with .agentd/ template files, deploying agent+workflow stacks, or debugging template application issues. |
Template Operations
Operational skill for working with agentd declarative YAML templates.
Template Directory Structure
.agentd/
├── agents/
│ ├── worker.yml # Agent definitions
│ ├── reviewer.yml
│ └── planner.yml
├── workflows/
│ ├── issue-worker.yml # Workflow definitions referencing agents by name
│ └── pull-request-reviewer.yml
└── templates/
└── *.yml # Reusable prompt/config templates
Applying Templates
agent apply .agentd/
agent apply .agentd/agents/worker.yml
agent apply .agentd/workflows/issue-worker.yml
agent apply .agentd/ --dry-run
agent apply .agentd/ --wait-timeout 120
Application Order
- Agent templates are created first
- System waits for each agent to reach Running status (default 60s timeout)
- Workflow templates are created, referencing agents by name
- Workflows are automatically enabled on creation
Tearing Down Templates
agent teardown .agentd/
agent teardown .agentd/agents/worker.yml
Teardown Order (reverse of apply)
- Workflows are deleted first
- Then agents are deleted (stops tmux sessions)
Agent Template Format
name: worker
working_dir: "."
shell: /bin/zsh
worktree: false
model: claude-sonnet-4-6
system_prompt: |
You are a worker agent for the project.
...instructions...
Required fields: name, working_dir, model
Optional fields: shell, worktree, system_prompt, env (map of env vars)
Workflow Template Format
name: issue-worker
agent: worker
source:
type: github_issues
owner: geoffjay
repo: agentd
labels:
- agent
state: open
poll_interval: 60
enabled: true
prompt_template: |
Work on issue #{{source_id}}: {{title}}
URL: {{url}}
Labels: {{labels}}
{{body}}
Required fields: name, agent, source, prompt_template
Optional fields: poll_interval (default 60), enabled (default true), tool_policy
Troubleshooting
Apply times out waiting for agent
- Increase timeout:
agent apply .agentd/ --wait-timeout 120
- Check orchestrator logs for agent startup errors
- Verify tmux is available:
tmux -V
- Check if agent was partially created:
agent orchestrator list-agents
Workflow references unknown agent
- The agent name in
agent: field must match a running agent's name
- If applying a directory, agents are created first — this should work automatically
- If applying a single workflow file, ensure the agent exists and is Running
Template validation errors
- Use
--dry-run to check templates before applying
- Verify YAML syntax with a linter
- Check that all required fields are present
- Ensure model names are valid (sonnet, opus, haiku, or full model IDs)
Teardown doesn't clean up everything
- Teardown only removes resources defined in the template files
- Manually check:
agent orchestrator list-agents and agent orchestrator list-workflows
- Tmux sessions should be killed when agents are deleted
Examples
The project includes example templates:
agent apply examples/agentd-project/
agent orchestrator list-agents
agent orchestrator list-workflows
agent teardown examples/agentd-project/