Skip to content

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:

bash
# Without templates (verbose)
owt new "Fix login bug" --ai-tool claude --base main

Use a template:

bash
# With templates (concise)
owt new "Fix login bug" -t bugfix

Benefits:

  • 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.

bash
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.

bash
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.

bash
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 ​

bash
# 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 hotfix

Templates with AI Tool Override ​

You can override the AI tool even when using a template:

bash
owt new "Build REST API" -t feature --ai-tool opencode

Custom Templates ​

Create custom templates in your .worktreerc file using TOML table syntax:

toml
[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 ​

OptionTypeDescription
namestringUnique template identifier
descriptionstringShort description
base_branchstringBranch to create from (e.g., main, develop)
ai_toolstringAI tool: claude, opencode, droid
plan_modebooleanStart AI in plan mode
ai_instructionsstringInstructions to provide to the AI tool

Using Custom Templates ​

bash
# Use your custom template
owt new "Add OAuth login" -t tdd-feature

# Use another custom template
owt new "Review auth module" -t security-audit

Team Workflow Examples ​

Backend Team Template ​

toml
[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 ​

toml
[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 TypeProtocol
bugfixReproduce → Diagnose → Fix → Verify → Regression → Commit
featureOrient → Explore → Implement → Test → Verify → Commit
refactorBaseline → Plan → Refactor → Verify → Cleanup → Commit
testSurvey → Identify → Write → Run → Coverage → Commit
docsRead → 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 TypeDetectionRetry Guidance
syntaxParse/syntax errorsFix the syntax error before proceeding
test_failureTest assertion failuresRead the failing test, understand the assertion, fix the implementation
timeoutExceeded time limitReduce scope, focus on the critical path
dependencyImport/module errorsCheck dependencies and install commands
runtimeRuntime exceptionsAdd error handling, check edge cases
logicOther failuresRe-read the requirements, verify approach

This ensures retried agents receive targeted context rather than starting from scratch.

Tips ​

  1. Start with built-in templates -- They cover the most common workflows
  2. Create team-specific templates -- Enforce team standards automatically
  3. Use meaningful names -- api-feature is clearer than template1
  4. Version control .worktreerc -- Share templates with the team
  5. Keep AI instructions focused -- Clear instructions produce better results

Next Steps ​