DEV Community

Leego
Leego

Posted on

How Different Models Handle Different Parts of a Feature — A Multi-Agent Workflow

The Problem with Single-Model Workflows

When you ask one large language model to design, implement, test, and review a feature, you get a jack-of-all-trades result. The model that excels at API design might hallucinate edge cases in validation logic. The one that writes clean tests might over-engineer the implementation. Most teams end up pasting context between chat windows, manually stitching together outputs, and losing track of which model suggested what.

VIBA changes this by letting you run ChatGPT, Claude, Gemini, and other models in a single shared session. Each model gets an explicit role. You approve key transitions. You see token usage and cost per agent. The session becomes a collaborative workspace rather than a series of disconnected prompts.

A Concrete Example: Building a Payment Webhook Endpoint

Imagine your team needs a new /webhooks/stripe endpoint for a Node.js service. The requirements are straightforward: verify Stripe signatures, idempotently process checkout.session.completed events, update the local order status, and emit a domain event for downstream consumers.

Instead of one long prompt, you define four agents in a VIBA session:

agents:
  - name: architect
    model: claude-3-5-sonnet
    role: "Design the interface, data flow, and error handling strategy. Output an OpenAPI fragment and a sequence diagram."
  - name: implementer
    model: gpt-4o
    role: "Write the Express route, signature verification, idempotency key storage, and domain event emission. Follow the architect's spec exactly."
  - name: tester
    model: gemini-1.5-pro
    role: "Generate unit tests (Vitest) and contract tests (Pact) covering happy path, invalid signature, duplicate event, and missing idempotency key."
  - name: reviewer
    model: claude-3-5-sonnet
    role: "Security and correctness review. Check for timing attacks, replay vulnerabilities, proper error codes, and observability hooks."
Enter fullscreen mode Exit fullscreen mode

Each agent sees the full conversation history. The architect produces a spec. You read it, ask for clarification on idempotency key TTL, approve, and the implementer starts. The implementer writes code. You spot a missing await on the event bus publish, request a fix, approve. The tester generates tests against the actual implementation. The reviewer flags that the signature verification uses == instead of constant-time comparison — a subtle timing attack vector the implementer missed.

Why Model Specialization Matters

This isn't about one model being "better." It's about matching model strengths to task types:

  • Claude tends to produce more structured, specification-oriented output. It excels at architecture and review roles where precision and reasoning matter.
  • GPT-4o writes idiomatic, production-ready code quickly. It handles framework conventions (Express middleware patterns, TypeScript types) with less hand-holding.
  • Gemini 1.5 Pro has a massive context window and strong test generation capabilities. It can ingest the entire implementation and produce comprehensive test suites including edge cases you didn't specify.

When you run them in sequence with shared context, each model builds on the previous one's output without context loss. The implementer doesn't need to re-explain the architecture — it's already in the session. The reviewer sees the actual code, not a summary.

Human Approval as a Control Point, Not a Bottleneck

The approval steps are lightweight. After each agent completes its task, VIBA presents a diff or summary. You can:

  • Approve — move to the next agent
  • Request changes — the same agent revises with your feedback in context
  • Branch — spin off a parallel exploration (e.g., "try this with Fastify instead") without derailing the main flow

This keeps you in the loop on decisions that matter — security choices, API contracts, cost tradeoffs — while automating the mechanical work. You're not reviewing every line; you're reviewing the right lines.

Cost visibility reinforces this. The session dashboard shows tokens and estimated cost per agent. If the reviewer's pass costs 3x the implementer's, you can decide whether that's justified or whether a lighter review prompt suffices. No surprises at the end of the month.

Beyond the Happy Path

The same pattern applies to refactoring, migration, and debugging. For a legacy Python-to-Go migration, you might assign:

  • An analyst agent (Gemini) to map dependencies and extract business rules from the codebase
  • A planner agent (Claude) to produce a phased migration strategy with rollback points
  • A translator agent (GPT-4o) to convert modules one at a time, with the analyst's rules as context
  • A validator agent (Claude again) to run property-based tests against both implementations

Each phase gates on your approval. The session preserves the full rationale — why this module first, why this translation choice — so future maintainers (or future you) can trace decisions without archaeological dig through chat logs.

Getting Started

You don't need a complex setup to try this. Define a small task — a single endpoint, a data transformation pipeline, a flaky test fix. Assign two or three roles. Run the session. Observe where the model boundaries create value and where they add friction. Adjust roles, prompts, and approval points.

The goal isn't to replace your judgment. It's to give you better inputs for that judgment — specialized outputs, explicit rationale, visible costs — all in one place.

Try a session at https://viba.guru and see how model specialization changes the way you build.

See VIBA: https://viba.guru

Top comments (0)