Skip to content
PapaCoder Labs

Locale en · ko

Quality Comes From Roles — Multi-Agent Engineering 101

By Harin Kim · Published 2 Aug 2026

Summary

Part 3 of Coding Is Conversation. Move past vibe coding with roles, typed handoffs, and gates—plus copy-paste Research/Implement/Review cards.

After part 2’s vibe-coded deploy, the wall shows up fast: the chat grows, the agent forgets earlier decisions, a “fix” breaks another file, and Accept All code isn’t shippable.

Takeaway: Agent engineering does not start with a longer prompt. It starts by splitting roles and fixing handoffs as contracts.

This is part 3 of Coding Is Conversation. After choosing tools and vibe coding, we step into multi-agent work.

Why one chat stops scaling

Vibe coding (one agent, little code reading) wins for prototypes. As work grows, research, implementation, and verification share one context and pollute each other.

SymptomSingle agentAfter role split
Context floodSearch logs drown the threadResearch returns a summary only
Scope creep“While we’re here…” adds auth/DBImplement honors outOfScope
Fake doneSelf-declares completeReview / fact-check gates
UnreproducibleSame prompt, different outcomesInput/output schemas pin the work

Martin Fowler’s agentic programming—LLMs may write the code, but humans still care about structure—needs an org chart for the work, not just an Agent UI.

Agent engineering = roles + contracts + gates

PapaCoder Labs defines agents as job cards, not one mega-prompt (specs/11-agent-architecture.md):

  • Goal — one responsibility
  • Inputs / Outputsstructured artifacts for the next agent
  • Prompt — versioned prompt file
  • Tools — least-privilege MCP/tools
  • Retry / Quality — failure behavior and score gates

The editorial team actually runs as a DAG: EiC → Research → Outline → Writer → Humanizer → Review → Fact Check → SEO → Publisher (draft only). Humans publish.

Rendering diagram…

The arrows matter. What you pass is the entire job of the next role.

Handoffs are contracts, not paragraphs

Loose handoff:

“Looked at login. NextAuth should be fine.”

Contract handoff:

{
  "from": "research",
  "to": "implement",
  "goal": "Add email/password admin login only",
  "decisions": [
    "Use existing Better Auth email/password",
    "No OAuth in this slice"
  ],
  "constraints": [
    "Do not touch public signup",
    "Do not add tables beyond current schema"
  ],
  "outOfScope": ["SSO", "passkeys", "mobile app"],
  "acceptance": [
    "Admin can sign in with ADMIN_EMAIL/PASSWORD",
    "Non-admin redirected to login"
  ],
  "sources": ["specs/09-api-design.md §auth"]
}

Consumer rule: if the schema is broken → STOP, do not implement. That is most of multi-agent engineering.

Drill: three-role mini newsroom

Goal: add a short technical note to the repo without one mega-chat. Use three Agent sessions (or subagents).

Role card A — Research (read-mostly)

You are ResearchAgent.
Goal: Produce ResearchBrief JSON only. Do not edit product code.
Inputs: topic string from the user.
Output schema:
{
  "topic": string,
  "keyFacts": string[],
  "sources": [{"url": string, "title": string}],
  "uncertainties": string[],
  "outOfScope": string[]
}
Rules:
- At least 2 real URLs you opened or that exist in-repo docs
- No implementation beyond naming libraries
- If sources conflict, list under uncertainties
Return JSON only.

Role card B — Implement

You are ImplementAgent.
Goal: Smallest change that meets acceptance.
Inputs: ResearchBrief JSON + Outline (section list).
Rules:
- Read ResearchBrief first; if required fields missing → STOP with what's missing
- Do not expand outOfScope
- Prefer editing existing files over new frameworks
- End with: files changed, how to verify, residual risks

Role card C — Review

You are ReviewAgent.
Goal: Gate the change. Do not implement unless asked.
Check:
1) acceptance from the brief
2) no secrets committed
3) scope creep vs outOfScope
4) claims needing citations
Output:
{
  "pass": boolean,
  "blockingIssues": string[],
  "nits": string[],
  "rewriteInstructions": string[]
}
If pass=false, Implement re-runs with rewriteInstructions only.

Run order

  1. New chat: Research card + topic (e.g. what loading.tsx does in App Router).
  2. Save JSON (research-brief.json).
  3. New chat: Implement + attach JSON.
  4. New chat: Review + attach diff/summary.
  5. On pass=false, re-run Implement only—do not remix Research.

The first time I tried “multi-agent” in one thread, I swapped role prompts mid-chat and Research started editing files. Since then I split chats or lock tools to read-only for that role first.

Tool notes (as of 2026-08-02)

Claude Code subagents

Official docs: subagents run in an isolated context and return a summary to the main session. Built-ins include Explore (read), Plan, and general-purpose; custom agents live as Markdown+YAML under .claude/agents/ (Subagents). The “don’t flood the main thread with search logs” guidance matches this post’s Research split.

Cursor

Cursor Task/subagents or separate chats can isolate roles. The durable part is writing contracts to disk (research-brief.json, review.json). PapaCoder versions cards under agents/editorial/*.md and prompts under packages/agents/prompts/—that pattern compounds.

Failure modes (multi-agent specific)

FailureSymptomMitigation
No contractNext agent gets prose onlyForce JSON/schema
Role pollutionResearch edits codeTool allowlists / new chat
No gateMerge without Reviewpass field + human check
Infinite ping-pongReview↔Implement foreverMax 2 retries, then human
Parallel clashTwo agents edit one filePartition file ownership
Hallucinated sourcesFake URLsFact-check role / link verify

When to escalate to harnesses (part 4)

Roles and handoffs already help. You’ll want harness engineering when:

  • Sandbox, network, and secrets must be enforced by runtime, not prose
  • Tests/lints must be proven by CI, not “I ran them”
  • You score repeated runs

Loops and graphs (parts 5–6) sit above that control plane.

Do this in Cursor today

  1. Save the three role cards
  2. Run one topic across three chats
  3. Force one intentional pass=false
  4. Commit JSON artifacts only if your team allows (no secrets)

Series roadmap — Coding Is Conversation

  1. Tools & pricing
  2. Vibe coding → deploy
  3. This post — multi-agent
  4. Harness engineering
  5. Loop engineering
  6. Graph engineering
  7. PapaCoder field notes

FAQ

Q. More agents = better?
A. No. Split only where responsibilities diverge. Three roles are enough to learn.

Q. Do we abandon vibe coding?
A. We place it. Throwaways vibe; kept code gets roles and gates.

Q. Does PapaCoder actually do this?
A. Yes—editorial and development use agent cards and pipelines. Humans keep high-risk gates like Publish.

Sources

Closing

Multi-agent work is not “turn on more AIs.” It is cloning a tiny org: roles, contracts, gates. Put that on top of part 2’s vibe rhythm and quality can compound.

Soon the hard question won’t be which model—it will be who is allowed to stop the line. Part 4 puts that authority in the harness, outside the prompt.

Related posts

More in Tutorials

Comments

Checking sign-in…

No comments yet.