Skip to content

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 understanding

Experiment 1: Create a SaaS Project

Let's explore the MakerKit template's intelligence:

bash
/create my-saas makerkit-nextjs

Explore the Structure

bash
cd my-saas
/status

Notice 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:

bash
/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:

bash
/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:

bash
/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:

bash
/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:

bash
/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:

bash
/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:

bash
/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:

bash
mkdir -p .orchestre/commands

Create .orchestre/commands/add-custom-feature.md:

markdown
# /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 library

2. Extending Template Knowledge

Add to .orchestre/patterns/custom-patterns.md:

markdown
# Custom Patterns

## API Response Format
All APIs return:
{
  "data": {},
  "meta": {
    "timestamp": "",
    "version": ""
  }
}

3. Memory Templates

Create .orchestre/memory-templates/feature.md:

markdown
# Feature: {name}

## Business Requirements
...

## Technical Decisions
...

## SaaS Considerations
- Plan limitations:
- Permission model:
- Team features:

Choosing the Right Template

Decision Framework

Template Comparison

FeatureMakerKitCloudflareReact Native
Best ForSaaS, B2BAPIs, EdgeMobile Apps
HostingTraditionalEdge/ServerlessApp Stores
DatabasePostgreSQLD1/KVAPI + Local
AuthFull SystemJWT/TokensBiometric
ScalingVerticalHorizontalDevice

Advanced Template Usage

1. Cross-Template Integration

Building a full system:

bash
# Backend API
/create api cloudflare-hono

# Web App
/create web makerkit-nextjs

# Mobile App
/create mobile react-native-expo

Then in mobile:

bash
/setup-shared-backend "http://localhost:8787"

2. Template Migration

Moving between templates:

bash
/orchestrate "Migrate this Express API to Cloudflare Workers"

The command understands both paradigms!

3. Template Composition

Mixing template patterns:

bash
/compose-prompt "Add Cloudflare's edge caching to this MakerKit app"

Practice Exercise

Build a Multi-Platform System

  1. Create the API:

    bash
    /create todo-api cloudflare-hono
    /add-api-route "CRUD operations for todos"
  2. Create the Web App:

    bash
    /create todo-web makerkit-nextjs
    /execute-task "Create todo management interface"
  3. Add Mobile:

    bash
    /create todo-mobile react-native-expo
    /setup-shared-backend "Connect to todo-api"
  4. 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:

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

markdown
<!-- 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?

  1. Reconsider if it's the right template
  2. Check template documentation
  3. Use /orchestrate to explore alternatives
  4. Consider template composition

Conflicts with Requirements?

  1. Document why you need to diverge
  2. Create custom commands
  3. Update memory templates
  4. 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!

Built with ❤️ for the AI Coding community, by Praney Behl