Templates are pre-configured settings for creating worktrees tailored to specific workflows. They save time by automatically setting the right AI tool, base branch, and AI instructions for common tasks.
Why Use Templates?
Instead of manually specifying options every time:
# Without templates (verbose)
owt new "Fix login bug" --ai-tool claude --base mainUse a template:
# With templates (concise)
owt new "Fix login bug" -t bugfixBenefits:
- Consistent workflows across your team
- Automatic AI tool and branch selection
- Pre-configured AI instructions for each workflow
- Faster worktree creation
Built-in Templates
Open Orchestrator includes 3 built-in templates:
feature
New feature development with planning phase.
owt new "Add user authentication" -t feature- AI Instructions: Plan mode first, then TDD, then develop
- Base Branch:
develop(or current branch) - Plan Mode: Enabled
- Best For: New features, medium-to-complex work
bugfix
Bug investigation and root cause analysis.
owt new "Fix login timeout" -t bugfix- AI Instructions: Root cause analysis first, then fix
- Base Branch:
main - Plan Mode: Disabled (direct investigation)
- Best For: Bug fixes, production issues
hotfix
Production emergency fixes with minimal changes.
owt new "Fix critical auth bypass" -t hotfix- AI Instructions: Minimal change, fix only the issue
- Base Branch:
main - Plan Mode: Disabled (immediate action)
- Best For: Production emergencies, critical bugs
Template Usage
Using Built-in Templates
# Use the feature template
owt new "Build payment module" -t feature
# Use the bugfix template
owt new "Fix cart calculation" -t bugfix
# Use the hotfix template
owt new "Patch security vulnerability" -t hotfixTemplates with AI Tool Override
You can override the AI tool even when using a template:
owt new "Build REST API" -t feature --ai-tool opencodeCustom Templates
Create custom templates in your .worktreerc file using TOML table syntax:
[templates.tdd-feature]
name = "tdd-feature"
description = "Feature development with TDD workflow"
base_branch = "develop"
ai_tool = "claude"
plan_mode = true
ai_instructions = """
Follow test-driven development:
1. Write failing test
2. Make it pass
3. Refactor
"""
[templates.security-audit]
name = "security-audit"
description = "Security review and vulnerability assessment"
base_branch = "main"
ai_tool = "claude"
plan_mode = true
ai_instructions = """
Perform a security audit:
1. Review authentication and authorization
2. Check input validation
3. Look for injection vulnerabilities
4. Review secrets handling
"""Template Options
| Option | Type | Description |
|---|---|---|
name | string | Unique template identifier |
description | string | Short description |
base_branch | string | Branch to create from (e.g., main, develop) |
ai_tool | string | AI tool: claude, opencode, droid |
plan_mode | boolean | Start AI in plan mode |
ai_instructions | string | Instructions to provide to the AI tool |
Using Custom Templates
# Use your custom template
owt new "Add OAuth login" -t tdd-feature
# Use another custom template
owt new "Review auth module" -t security-auditTeam Workflow Examples
Backend Team Template
[templates.api-feature]
name = "api-feature"
description = "Backend API feature with testing"
base_branch = "develop"
ai_tool = "claude"
plan_mode = true
ai_instructions = """
Follow these standards:
- RESTful API design
- OpenAPI documentation
- Integration tests required
- Error handling with proper status codes
"""Frontend Team Template
[templates.ui-feature]
name = "ui-feature"
description = "Frontend UI feature with component tests"
base_branch = "develop"
ai_tool = "claude"
plan_mode = true
ai_instructions = """
Follow these standards:
- Component-based architecture
- Tailwind CSS for styling
- Accessibility compliance (WCAG 2.1)
- Unit tests for components
"""Task-Type Prompt Protocols
In addition to templates, Open Orchestrator includes a prompt builder that automatically classifies tasks and applies structured protocols. When an agent session is created (via owt new), the task description is classified into one of five types:
| Task Type | Protocol |
|---|---|
| bugfix | Reproduce → Diagnose → Fix → Verify → Regression → Commit |
| feature | Orient → Explore → Implement → Test → Verify → Commit |
| refactor | Baseline → Plan → Refactor → Verify → Cleanup → Commit |
| test | Survey → Identify → Write → Run → Coverage → Commit |
| docs | Read → Draft → Review → Commit |
Each protocol includes DO / DON'T guidance and parallel execution hints based on Anthropic's prompt engineering research. Cross-cutting sections for commit safety and turn efficiency are included in all protocols.
Task Classification
Classification is deterministic and keyword-based -- no LLM call required. The prompt builder scans the task description for keywords:
- bugfix: "fix", "bug", "broken", "error", "crash", "regression"
- refactor: "refactor", "restructure", "reorganize", "clean up"
- test: "test", "coverage", "spec", "assert"
- docs: "document", "readme", "docs", "docstring"
- feature: everything else (default)
Failure Classification and Retry Context
When an agent fails, the prompt builder classifies the failure and structures a retry prompt with targeted guidance:
| Failure Type | Detection | Retry Guidance |
|---|---|---|
syntax | Parse/syntax errors | Fix the syntax error before proceeding |
test_failure | Test assertion failures | Read the failing test, understand the assertion, fix the implementation |
timeout | Exceeded time limit | Reduce scope, focus on the critical path |
dependency | Import/module errors | Check dependencies and install commands |
runtime | Runtime exceptions | Add error handling, check edge cases |
logic | Other failures | Re-read the requirements, verify approach |
This ensures retried agents receive targeted context rather than starting from scratch.
Tips
- Start with built-in templates -- They cover the most common workflows
- Create team-specific templates -- Enforce team standards automatically
- Use meaningful names --
api-featureis clearer thantemplate1 - Version control .worktreerc -- Share templates with the team
- Keep AI instructions focused -- Clear instructions produce better results