Tutorial 3: Working with Templates
Templates in Orchestre are more than just boilerplate - they're complete knowledge systems that understand their domain. In this tutorial, you'll learn how to leverage template intelligence for rapid, high-quality development.
Learning Objectives
By the end of this tutorial, you'll:
- ✅ Understand templates as knowledge packs
- ✅ Use template-specific commands effectively
- ✅ Leverage domain expertise in templates
- ✅ Customize templates for your needs
- ✅ Choose the right template for your project
Prerequisites
- Completed previous beginner tutorials
- Basic web development knowledge
- 45 minutes of time
Templates as Knowledge Systems
Each Orchestre template includes:
template/
├── Code Structure # Optimized for the domain
├── Commands # Domain-specific prompts
├── Patterns # Best practices built-in
├── Memory Templates # Documentation structure
└── Domain Knowledge # Deep understandingExperiment 1: Create a SaaS Project
Let's explore the MakerKit template's intelligence:
/create my-saas makerkit-nextjsExplore the Structure
cd my-saas
/statusNotice how the template includes:
- Multi-tenant architecture
- Authentication system
- Subscription management
- Team collaboration
- Admin capabilities
This isn't just code - it's encoded SaaS expertise!
Experiment 2: Template-Specific Commands
MakerKit includes specialized commands that understand SaaS patterns:
/orchestrate "I want to add a project management feature where teams can create and manage projects"Observe the SaaS Intelligence
The response will include:
- Multi-tenant considerations
- Team permission patterns
- Subscription plan limits
- SaaS-specific UI patterns
Compare this to a generic approach - the template understands your domain!
Experiment 3: Domain Expertise in Action
Let's add a SaaS feature:
/add-subscription-plan "Professional plan with 10 team members and advanced features"What the Template Knows
The command automatically:
- Updates Stripe products
- Adds plan limits
- Creates upgrade flows
- Implements feature gates
- Updates billing logic
This expertise is built into the template!
Template Deep Dive
MakerKit (SaaS)
Expertise Areas:
- Multi-tenancy patterns
- Subscription billing
- Team collaboration
- Enterprise features
- SaaS metrics
Try This:
/add-team-feature "Project sharing between teams"The template knows about:
- Permission boundaries
- Security implications
- UI patterns for sharing
- Notification requirements
Cloudflare (Edge APIs)
Expertise Areas:
- Edge computing patterns
- Global distribution
- Performance optimization
- Serverless patterns
- Real-time features
Try This:
/add-edge-function "Geolocation-based content"The template understands:
- Edge-specific constraints
- Cloudflare APIs
- Performance implications
- Global distribution patterns
React Native (Mobile)
Expertise Areas:
- Cross-platform development
- Native feature integration
- Mobile UX patterns
- Offline-first design
- App store requirements
Try This:
/add-native-feature "Biometric authentication"The template handles:
- Platform differences
- Permission flows
- Fallback strategies
- Security best practices
Experiment 4: Template Patterns
Each template enforces its domain's best practices:
In MakerKit:
/execute-task "Add a public API for external integrations"Automatically includes:
- API key management
- Rate limiting per plan
- Usage tracking
- Webhook system
- OpenAPI documentation
In Cloudflare:
/execute-task "Add request caching"Automatically considers:
- Edge caching strategies
- Cache invalidation
- Regional variations
- Performance metrics
Customizing Templates
1. Adding Your Patterns
Create custom commands:
mkdir -p .orchestre/commandsCreate .orchestre/commands/add-custom-feature.md:
# /add-custom-feature
Discover the current patterns in this MakerKit project and add a custom feature that follows our specific conventions...
## Context to Consider
- Our custom validation library
- Our specific API patterns
- Our UI component library2. Extending Template Knowledge
Add to .orchestre/patterns/custom-patterns.md:
# Custom Patterns
## API Response Format
All APIs return:
{
"data": {},
"meta": {
"timestamp": "",
"version": ""
}
}3. Memory Templates
Create .orchestre/memory-templates/feature.md:
# Feature: {name}
## Business Requirements
...
## Technical Decisions
...
## SaaS Considerations
- Plan limitations:
- Permission model:
- Team features:Choosing the Right Template
Decision Framework
Template Comparison
| Feature | MakerKit | Cloudflare | React Native |
|---|---|---|---|
| Best For | SaaS, B2B | APIs, Edge | Mobile Apps |
| Hosting | Traditional | Edge/Serverless | App Stores |
| Database | PostgreSQL | D1/KV | API + Local |
| Auth | Full System | JWT/Tokens | Biometric |
| Scaling | Vertical | Horizontal | Device |
Advanced Template Usage
1. Cross-Template Integration
Building a full system:
# Backend API
/create api cloudflare-hono
# Web App
/create web makerkit-nextjs
# Mobile App
/create mobile react-native-expoThen in mobile:
/setup-shared-backend "http://localhost:8787"2. Template Migration
Moving between templates:
/orchestrate "Migrate this Express API to Cloudflare Workers"The command understands both paradigms!
3. Template Composition
Mixing template patterns:
/compose-prompt "Add Cloudflare's edge caching to this MakerKit app"Practice Exercise
Build a Multi-Platform System
Create the API:
bash/create todo-api cloudflare-hono /add-api-route "CRUD operations for todos"Create the Web App:
bash/create todo-web makerkit-nextjs /execute-task "Create todo management interface"Add Mobile:
bash/create todo-mobile react-native-expo /setup-shared-backend "Connect to todo-api"Integrate Features:
bash# In web app /add-team-feature "Shared todo lists" # In mobile /add-offline-sync "Todo synchronization" # In API /add-websocket "Real-time updates"
Template Best Practices
1. Trust the Template
Templates encode years of domain expertise. Don't fight their patterns - understand and extend them.
2. Use Template Commands
Prefer template-specific commands over generic ones:
# Good - uses SaaS knowledge
/add-subscription-plan "Enterprise"
# Less optimal - generic
/execute-task "Add enterprise plan"3. Document Customizations
When you diverge from template patterns:
<!-- CLAUDE.md -->
## Custom Patterns
We modified the standard auth flow because...4. Leverage Template Memory
Use template-provided memory structures for consistency.
Common Pitfalls
1. Wrong Template Choice
Choosing MakerKit for a simple API leads to unnecessary complexity.
2. Fighting Template Patterns
Trying to make Cloudflare Workers stateful defeats the template's purpose.
3. Ignoring Domain Knowledge
Not using template commands misses valuable expertise.
4. Over-customization
Too many modifications lose template benefits.
Troubleshooting
Template Not Meeting Needs?
- Reconsider if it's the right template
- Check template documentation
- Use
/orchestrateto explore alternatives - Consider template composition
Conflicts with Requirements?
- Document why you need to diverge
- Create custom commands
- Update memory templates
- Consider contributing back
What You've Learned
✅ Templates are complete knowledge systems ✅ Each template has domain expertise ✅ Template commands understand context ✅ Customization preserves template benefits ✅ Choosing the right template matters
Next Steps
You now understand how templates provide domain-specific intelligence. This knowledge will help you build better applications faster.
Continue to: Basic Orchestration →
Explore further:
- Browse template commands in
/reference/commands/ - Read template guides in
/guide/templates/ - Try mixing templates for complex systems
Remember: Templates aren't just starting points - they're expert partners in your domain!
