Multi-Agent Collaborative Development: A Practical Guide to Building a Development Crew

    This article explains how to move from single-agent coding assistance to a multi-agent architecture that can run overnight and deliver working results. It covers the four-layer design of an orchestrator, specialist agents, a message bus, and infrastructure; role and prompt design with clear acceptance criteria; a unified message envelope for routing and replay; a scheduled competitor-price monitoring example; scheduling, fault tolerance, and cost control; observability metrics and human-in-the-loop gates; and a staged adoption roadmap. The approach is tool-agnostic and can be reproduced with any general-purpose LLM that supports function calling and long context.

    1. From Single-Point Productivity to “Crew-Style” Collaboration: Why Multi-Agent

    Over the past two years, AI coding assistants have evolved from “completing code snippets” to “understanding requirements and producing runnable projects.” But as task complexity grows, a single agent hits three hard constraints: a limited context window, mixed role objectives, and loss of focus across long workflows. A multi-agent architecture is the engineering answer to these three problems—it breaks a macro goal into several independently verifiable sub-goals, assigns them to dedicated agents that work in parallel, and lets an orchestrator agent handle coordination and convergence.

    Note that this article is not tied to any specific product or tool. It discusses the general multi-agent orchestration pattern used across the industry. You can use any general-purpose LLM with function calling and long-context capabilities as the “brain,” and any message middleware or lightweight queue as the “nerves” to reproduce it.

    2. Overall Architecture: Orchestrator, Specialists, and Bus

    A development crew that can run stably overnight and deliver results typically has four layers:

    1. Orchestration layer (orchestrator agent): parses natural-language requirements, generates a task tree, assigns roles, arbitrates conflicts, and aggregates deliverables.
    2. Specialist layer (dedicated agents): one each for market research, product requirements, architecture design, coding implementation, and quality testing; they do not share context with one another.
    3. Communication layer (message bus): passes tasks, artifacts, and status via publish/subscribe or point-to-point messaging.
    4. Infrastructure layer: scheduled dispatch, object storage (for intermediate artifacts), logging, and monitoring/alerting.

    The key design principle is “context isolation + artifact sharing.” Each agent keeps only its own role’s system prompt and recent conversation; cross-role information is passed exclusively through structured artifacts (JSON/Markdown) to avoid context pollution and the accumulation of hallucinations.

    3. Role and Prompt Design

    Role definitions should follow “single responsibility + explicit acceptance criteria.” For example:

    1. AGENTS = {
    2. "researcher": "You are only responsible for market research; output a competitor list and price ranges in JSON. Do not write code.",
    3. "pm": "You are only responsible for turning research conclusions into a PRD, including user stories and acceptance conditions.",
    4. "architect": "You are only responsible for technology selection and module partitioning; output interface contracts (OpenAPI style).",
    5. "developer": "You only implement code according to the interface contracts, and must include unit tests.",
    6. "tester": "You only run tests and output defect reports; do not modify business code."
    7. }

    Writing acceptance criteria into prompts is the prerequisite for letting the crew run “unattended overnight”: each agent knows when it is done, so the orchestrator can reliably advance the state machine.

    4. Communication Protocol: Making Agents “Speak the Same Language”

    A unified message envelope is recommended, with fixed fields that are easy to route and replay:

    1. {
    2. "task_id": "T-20260805-001",
    3. "from": "researcher",
    4. "to": "pm",
    5. "type": "artifact",
    6. "payload": {"path": "s3://agent-artifacts/001/competitors.json"},
    7. "trace_id": "run-7f3a"
    8. }

    There are three engineering points: first, artifacts are not inlined—only a reference address is passed—to keep message size under control; second, trace_id is propagated through the entire chain, making it easy to pinpoint which step went wrong during next-day review; third, messages are idempotent, and consumers deduplicate by task_id plus a version number to avoid duplicate deliveries caused by retries.

    5. Scheduled Collection and Monitoring Alerts: A Competitor-Price System Example

    The deliverable in the original text is a system that periodically collects competitor prices, original prices, discounts, and stock status, draws trend charts, flags abnormal fluctuations, pushes alerts when prices are low or items are out of stock, and supports table export. Implemented as a crew, it can be split into:

    • Collection agent: fetches target pages on the dispatch cycle, performs field extraction and cleaning, and stores raw snapshots.
    • Analysis agent: computes price differentials, volatility, and stock-status transitions, and outputs anomaly events.
    • Visualization agent: generates trend data and chart configurations.
    • Notification agent: pushes alerts to the team’s usual collaboration tool according to threshold rules.
    • Export agent: generates table files on schedule and archives them to object storage.

    For threshold judgment, a dual channel of “rules + statistics” is recommended: the rule channel handles hard conditions such as absolute low prices and out-of-stock; the statistical channel uses the mean and standard deviation of a rolling window to identify sharp fluctuations, reducing false positives from fixed thresholds.

    1. def is_anomaly(price, window):
    2. mu, sigma = mean(window), stdev(window)
    3. return sigma > 0 and abs(price - mu) / sigma > 3

    6. Scheduling, Fault Tolerance, and Cost Control

    For 24/7 operation, “failure” must be designed for as the norm: when a single agent fails, the orchestrator retries a limited number of times; if it still fails, the task is degraded to “skip this sub-task and note it in the daily report.” Long tasks get timeouts and checkpoint resume; all intermediate artifacts are written to object storage so that any stage can recover from the latest checkpoint after a restart. On cost, use smaller models for non-critical roles, invoke stronger models only in high-value steps such as architecture review and defect localization, and significantly cut repeated overhead by caching results for identical inputs.

    7. Observability and Human Gates

    Before going live, be sure to instrument three metrics: task success rate, average per-stage latency, and manual rework rate. Also keep human-in-the-loop gates in the workflow: the three nodes of requirement confirmation, architecture sign-off, and release must be clicked through by a person. This both controls risk and makes the crew more trusted in real business.

    8. Adoption Roadmap

    Step one: implement only the two roles of “research + PRD” to validate the message and artifact conventions. Step two: add coding and testing, and run an internal small tool end to end. Step three: connect scheduled dispatch and alerting to form an unattended closed loop. Step four: scale out the number of roles horizontally. Avoid stacking seven or eight agents from the start—orchestration complexity will quickly overwhelm the benefits. If you use general cloud capabilities, a fairly reliable industry combination is a container platform hosting the agent runtime, a message queue hosting the bus, object storage hosting artifacts, and logging plus monitoring/alerting services hosting observability.