Multi-Agent Delegation &
Lab Playbook 6
Directing specialized AI subordinates to build and test concurrently
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.
Role Mapping & Boundary Definition (QE Setup)
To orchestrate multiple subagents, we must define clear boundary guidelines, tool access levels, and specific system roles.
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.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')
Task Partitioning (QE Instruction)
Next, the coordinator must partition the backlog into isolated scripts so subagents do not collide.
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.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.
Subagent Spawning (QE Setup)
Instruct the coordinator to spin up the subagents. In agent SDKs, this matches invoking background tasks.
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.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.
Synthesis & Reporting
Finally, the coordinator gathers output logs from both subordinates and compiles a single consolidated report.
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.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.
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.