# Multi-agent crew (/docs/getting-started/multi-agent-crew)



The [Software Engineering Crew](https://github.com/shashikanth-gs/a2a-wrapper/tree/main/examples/software-engineering-crew) example builds on the [quick start](/docs/getting-started/quickstart): instead of one agent, several agents cooperate.

<img src="/media/crew-demo.gif" alt="Recording: a planner delegates a feature to an implementer agent, then a tester agent" width="900" />

## How it works [#how-it-works]

```
feature request ─▶ Planner (planner.mjs)
                     ├─ 1. implement ─▶ a2a-claude (Claude) :3030
                     └─ 2. test & review ─▶ a2a-codex (Codex)     :3020
                                 both work in the same git workspace
```

1. The **planner** takes a feature request and sends it to Claude through `a2a-claude`.
2. Claude implements it in the shared workspace and returns a summary as an A2A artifact.
3. The planner hands that summary to Codex through `a2a-codex`, which writes tests, runs them and fixes what it finds.
4. The planner prints the combined result.

The planner is about 100 lines of dependency-free Node that speaks plain A2A JSON-RPC. It could be any A2A-capable orchestrator. The point is that the two coding agents are interchangeable A2A peers.

## Try it without API keys [#try-it-without-api-keys]

```bash
git clone https://github.com/shashikanth-gs/a2a-wrapper.git
cd a2a-wrapper/examples/software-engineering-crew
node planner.mjs --mock "Add a slugify(text) helper"
```

`--mock` starts two in-process stand-in agents so you can see the flow. They make no model calls and change no files.

## Run it for real [#run-it-for-real]

You need an `ANTHROPIC_API_KEY` and an `OPENAI_API_KEY` (or `codex login` plus `CODEX_MODEL`).

<Callout type="warn">
  These agents can edit files and run commands in `WORKSPACE_DIR`. Use a scratch repository, not one you care about. See the [security guide](/docs/guides/security).
</Callout>

<Steps>
  <Step>
    ### Install and build [#install-and-build]

    From the repository root:

    ```bash
    npm install
    npx turbo run build
    ```
  </Step>

  <Step>
    ### Create a shared scratch repository [#create-a-shared-scratch-repository]

    Codex requires a Git repository.

    ```bash
    export WORKSPACE_DIR=$(mktemp -d)
    git -C "$WORKSPACE_DIR" init && git -C "$WORKSPACE_DIR" commit --allow-empty -m init
    ```
  </Step>

  <Step>
    ### Start the implementer (Claude) [#start-the-implementer-claude]

    ```bash
    export ANTHROPIC_API_KEY=sk-ant-...
    cd a2a-claude && npm run dev -- --config agents/example/config.json
    ```
  </Step>

  <Step>
    ### Start the tester (Codex) [#start-the-tester-codex]

    ```bash
    export OPENAI_API_KEY=sk-...   # same WORKSPACE_DIR as above
    cd a2a-codex && npm run dev -- --config agents/example/config.json
    ```
  </Step>

  <Step>
    ### Run the crew [#run-the-crew]

    ```bash
    cd examples/software-engineering-crew
    node planner.mjs "Add a slugify(text) helper to src/slugify.js that lowercases and hyphenates"
    ```
  </Step>
</Steps>

Use `IMPLEMENTER_URL` and `TESTER_URL` if your agents run on other ports or hosts.

## What the planner does [#what-the-planner-does]

* **Discovery**: fetches `/.well-known/agent-card.json` from each agent first.
* **Delegation**: sends `message/send` with `configuration.blocking: true`.
* **Artifacts**: reads the text parts of each agent's returned artifacts.
* **Sessions**: shares one `contextId` across both calls so each agent can keep multi-turn history.

## Ideas to extend it [#ideas-to-extend-it]

* Add a third agent (`a2a-copilot` or `a2a-opencode`) as a reviewer.
* Loop until the tester reports passing tests.
* Replace the planner with LangGraph, Google ADK or any other A2A client.
* For the variant where sub-agents are exposed as MCP tools, see [sub-agents](/docs/concepts/sub-agents).

<Callout type="info" title="Status">
  The `--mock` path runs with no external services. The real path depends on live model APIs and is not covered by CI, so treat it as a working reference.
</Callout>
