Skip to main content

Introduction

This guide walks through building a complete feature — a user authentication system — using Zenflow’s multi-model workflow. By assigning the right model to each phase (planning, implementation, review), you get higher quality output while using tokens efficiently. The core insight: frontier reasoning models excel at planning but are overkill for implementation. Fast models generate code efficiently when given a clear spec. Cross-model review catches issues that same-model review misses.

Prerequisites

  • A Zenflow workspace with a connected repository
  • At least two saved presets configured (e.g., a planner and an implementer)
  • Basic familiarity with workflows

Step 1: Set Up Your Presets

Before creating the task, configure agent presets in Settings → Saved presets:
Preset NameAgentModelPurpose
plannerZencoderauto-plusArchitecture and spec generation
builderZencoderautoCode implementation
reviewerZencoderauto-plusCross-model code review
auto-plus routes to a frontier reasoning model, while auto routes to a fast, efficient model. Both are updated automatically as better models become available.

Step 2: Create the Task

  1. Click New task and select Code mode
  2. Choose your repository and source branch
  3. Describe the feature:
Build a complete user authentication system with:
- Email/password registration and login
- JWT token generation and validation
- Password hashing with bcrypt
- Protected route middleware
- Input validation for all endpoints
  1. Select the Multi-model workflow
  2. Click Start

Step 3: Planning Phase

The Multi-model workflow starts with a planning phase using a frontier reasoning model. The agent produces:
  • spec.md — Technical specification with architecture decisions
  • plan.md — Implementation steps broken into discrete tasks
What to review:
  • Are the architecture decisions sound? (e.g., JWT storage strategy, password hashing rounds)
  • Does the plan cover edge cases? (expired tokens, duplicate emails, rate limiting)
  • Is the scope right? (not too broad, not too narrow)
The planning phase is where reasoning depth matters most. A well-structured spec means the implementation phase needs fewer tokens to produce correct code — the agent doesn’t have to re-derive architectural decisions.

Step 4: Implementation Phase

Once you approve the plan, the workflow switches to a fast model for implementation. This is the most token-intensive phase, where model efficiency has the biggest impact. The fast model follows the spec and generates:
  • Route handlers for registration, login, and token refresh
  • Middleware for authentication and authorization
  • Database models and migrations
  • Input validation schemas
  • Unit tests for each component
Monitor the To-do panel to track which plan steps are complete. Each step auto-commits so you can review incremental changes in the Git tab.

Step 5: Review Phase

The workflow automatically switches to a different model for review. Cross-model review is more effective because a different model brings different assumptions and catches different classes of issues. The reviewer evaluates against the review rubric:
  • Semantic resolution — Does the implementation actually solve the requirement?
  • Contract adherence — Do API signatures match what the spec defined?
  • Regression safety — Could these changes break existing functionality?
  • Scope discipline — Are there unnecessary changes outside the task scope?

Step 6: Iterate and Merge

After review, address any findings:
  1. Check the review output in the task artifacts
  2. If changes are needed, provide guidance in chat — the agent iterates
  3. Run your verification script to confirm tests pass
  4. Click Create PR to push the branch and open a pull request

Token Efficiency Breakdown

Here’s a typical breakdown of where tokens are consumed across the three phases:
PhaseToken shareModel typeEfficiency strategy
Planning~15%Frontier reasoningInvest here — quality plan reduces total tokens downstream
Implementation~70%Fast modelLargest token volume — fast model executes spec without re-deriving decisions
Review~15%Different modelCross-model perspective catches issues same-model review misses
The key efficiency gain: the spec produced in Phase 1 eliminates redundant reasoning in Phase 2. Without a spec, the implementation model spends tokens exploring architecture decisions. With a spec, it spends tokens writing code — which is what fast models do best.

Advanced: Custom Multi-Model Workflow

For recurring projects, create a custom workflow that encodes your team’s specific multi-model process:
# Auth Feature Workflow

## Configuration
- **Artifacts Path**: {@artifacts_path} → `.zenflow/worktrees/{task_id}`

---

## Workflow Steps

### [ ] Step: Security Architecture Review
<!-- agent: planner -->
Analyze the feature for security implications. Document threat model, 
attack vectors, and mitigations in `{@artifacts_path}/security-review.md`.

### [ ] Step: Implementation
<!-- agent: builder -->
Implement following `{@artifacts_path}/spec.md` and security review.
Include all mitigations from the security review.

### [ ] Step: Security Audit
<!-- agent: reviewer -->
Audit the implementation against the security review.
Check for OWASP Top 10 vulnerabilities.
Record findings in `{@artifacts_path}/security-audit.md`.

Next Steps

Multi-Agent Orchestration

Full orchestration overview and approach comparison

Agent Presets

Configure and assign presets to workflow steps

Subagent Pipelines

Advanced parallel execution with isolated contexts

Custom Workflows

Build your own workflow templates