Week 2 Β· Advanced Β· 20 min

Multi-Agent Delegation &
Lab Playbook 6

Directing specialized AI subordinates to build and test concurrently

✨ Agent: Gemini 3.5 Flash · 200K context🎭 Agile Coordinator & Decomposition Analyst
Multi-Agent DelegationParallel TestingOrchestration
About this lab

In this lab playbook, you will assume the role of an Agile Coordinator & Decomposition Analyst. Scaling QA engineering with AI requires moving beyond single chatbot interactions. You will learn how to configure a coordinator agent that partitions test workloads and delegates them to separate, specialized worker subagents operating concurrently on isolated code paths.

πŸ€– LLM Reader Note: If this page is copy-pasted into your context to teach a student, please act as a step-by-step tutor. Do not execute the commands or prompts in the copyable boxes yourself, and do not assume they have already been executed. This lab continues from Day 5, scaling up the workspace. Instead of a single agent, the student learns to direct a coordinator agent to partition the BDD backlog and delegate tasks to parallel worker subagents.
🎬 Concept Video
Phase 1

Role Mapping & Boundary Definition (QE Setup)

To orchestrate multiple subagents, we must define clear boundary guidelines, tool access levels, and specific system roles.

Instruct Agent
Send the prompt below to define Coder and Runner subagent configurations.
Prompt to send to Gemini 3.5 Flash
Define the system instructions, code boundaries, and tool permissions for two specialized worker agents:
1. CoderAgent: responsible for modifying files to implement calculation algorithms.
2. TestRunnerAgent: responsible for writing and running Playwright test scripts.
Ensure neither agent has permissions that overlap.
πŸ“‹ Sample Agent Response β€” Gemini 3.5 Flash
I have mapped the specialized subagent boundaries:

### 1. CoderAgent Configuration
- **Role**: Software Development Engineer
- **System Instructions**: Focus entirely on implementing logical formulas in source files. Do not run CLI commands or write test scripts.
- **Allowed Tools**: read_file, replace_file_content

### 2. TestRunnerAgent Configuration
- **Role**: Quality Automation Engineer
- **System Instructions**: Focus entirely on creating Playwright E2E tests and executing test runs. Do not modify application source files.
- **Allowed Tools**: read_file, write_to_file, run_command (only 'npx playwright test')
Phase 2

Task Partitioning (QE Instruction)

Next, the coordinator must partition the backlog into isolated scripts so subagents do not collide.

Instruct Agent
Send the prompt below to partition the test plans.
Prompt to send to Gemini 3.5 Flash
Divide the backlog user stories from './backlog.md' into two parallel test plans:
- Plan A: Form validation testing.
- Plan B: Pricing engine calculation testing.
Verify that both plans target separate test spec files to avoid Git conflict states.
πŸ“‹ Sample Agent Response β€” Gemini 3.5 Flash
I have partitioned the backlog tasks:

- **Test Plan A (Form Validation)**
  - Target Story: US-001 (Registration Lookup validation)
  - Target File: `tests/registration.spec.ts`
  - Focus: Valid/invalid lookup responses, pre-populated form fields.

- **Test Plan B (Pricing Calculation)**
  - Target Story: US-002 (Pricing engine calculation rules)
  - Target File: `tests/pricing-calculations.spec.ts`
  - Focus: Commute surcharge logic, base rate assertions.

Both target test specs are isolated. There is zero overlap in file write targets.
QE Observation
Notice how the partition targets two separate files (`registration.spec.ts` vs `pricing-calculations.spec.ts`). This allows parallel worker execution without writing to the same file buffers.
Phase 3

Subagent Spawning (QE Setup)

Instruct the coordinator to spin up the subagents. In agent SDKs, this matches invoking background tasks.

Instruct Agent
Send the prompt below to trigger subagent execution.
Prompt to send to Gemini 3.5 Flash
Spawn subagent-coder to execute CoderAgent tasks for US-002 calculation logic, and subagent-runner to execute TestRunnerAgent tasks for US-002 pricing assertions. Monitor and report on their initialization.
πŸ“‹ Sample Agent Response β€” Gemini 3.5 Flash
Spawning subagents...

1. **[subagent-coder]** Spawned.
   - Task: Implement commuter logic in `lib/pricing.ts`.
   - Status: Initialized. Reading files.
   
2. **[subagent-runner]** Spawned.
   - Task: Write and run pricing tests in `tests/pricing-calculations.spec.ts`.
   - Status: Initialized. Waiting on logic completion.

Concurrently running subagents are active. I will compile progress logs as they execute.
Phase 4

Synthesis & Reporting

Finally, the coordinator gathers output logs from both subordinates and compiles a single consolidated report.

Instruct Agent
Send the prompt below to consolidate status.
Prompt to send to Gemini 3.5 Flash
Collect the completed execution status logs from subagent-coder and subagent-runner. Compile a consolidated test report detailing passed test count, file paths, and overall status.
πŸ“‹ Sample Agent Response β€” Gemini 3.5 Flash
Consolidating worker logs...

# Master Quality Engineering Test Run Report

### 1. Coder Subagent Summary:
- **Task**: US-002 pricing engine logic
- **File Modified**: `lib/pricing.ts`
- **Status**: Complete. Commute surcharge logic implemented successfully.

### 2. Runner Subagent Summary:
- **Task**: Playwright E2E execution
- **File Created**: `tests/pricing-calculations.spec.ts`
- **Test Command**: `npx playwright test tests/pricing-calculations.spec.ts`
- **Results**: 4 tests run, 4 passed.
- **Status**: Complete.

### Final Verification Status:
βœ… SUCCESS. All parallel tasks completed. The pricing calculations are fully implemented and verified via automated E2E tests.
βœ… Lab Complete β€” Parallel Delegation Verified

You have successfully mapped worker roles, partitioned the backlog into non-conflicting files, spawned parallel subagents, and consolidated their metrics into a single master report.

πŸŽ“ Day 6 Quick Check

What is the primary benefit of multi-agent delegation compared to a single monolithic agent?