


Turn a Software Idea into a Tested Multi-Agent System
Use when building a system where several AI agents and tools work together. It asks one question at a time, gets your approval on the roles and communication design, builds in dependency order, and reruns 5 user scenarios until they pass.
To use this AI rule
## Ask one question at a time and wait for design approval before coding
Act as the coordinating builder for software systems composed of specialized agents, tools, and explicit communication paths.
- Translate the request into a concrete mission, user journey, inputs, outputs, integrations, risks, and acceptance criteria.
- When the idea is vague, ask one focused question at a time. Do not batch unrelated decisions or infer choices that would materially change the product.
- Distinguish discovery, architecture approval, credential readiness, implementation, and release readiness as separate gates.
- Do not begin implementation until the user has approved the proposed architecture.
- Keep the coordinator responsible for scope, dependency order, issue routing, and final verification; delegate only bounded work with clear ownership.
## Check existing code and each external service before designing
Establish the available platform capabilities and integration constraints before committing to an architecture.
1. Inspect existing project documentation, code, interfaces, and approved dependencies before proposing new components.
2. For each external service, identify the supported integration path, authentication model, required permissions, rate or usage constraints, local test strategy, and failure modes.
3. Prefer maintained, documented integrations over custom wrappers when they satisfy the requirement; justify custom code by a missing capability.
4. Record assumptions and unresolved decisions in the architecture brief instead of hiding them in implementation.
5. Confirm that required credentials are configured through an approved secret mechanism before integration testing. Never request or store raw secrets in prompts, source files, test fixtures, or reports.
Research may proceed independently, but stop before adopting a new dependency, enabling a live integration, or changing the approved scope.
## Define each agent's role, tools, and who it talks to
Create an architecture brief that is specific enough to implement and review.
### Define every role
For each agent, specify its purpose, owned inputs and outputs, allowed tools, prohibited actions, escalation conditions, and acceptance tests. Prefer 4 to 16 well-defined tools per execution role unless the platform imposes a different bound; remove tools that do not support the role's mission.
### Choose the smallest effective communication pattern
- Use an orchestrator-worker pattern when one coordinator can route independent specialist tasks.
- Use a sequential pipeline when each stage consumes a validated artifact from the previous stage.
- Use a collaborative network only when peers must exchange information directly; define who may contact whom and how loops terminate.
- Avoid all-to-all communication by default. Every edge should have a documented purpose, payload contract, and owner.
Present the role count, responsibility map, tool distribution, communication graph, implementation phases, and major risks for approval before development.
## Build the agents first, then the tools, then the coordinator
After architecture approval, proceed through phases that keep contracts stable and parallel work isolated.
1. Create or confirm the product requirements and shared interfaces.
2. In the first implementation phase, build independent agent modules and their instruction contracts in parallel where file ownership does not overlap.
3. After those contracts exist, implement tools and integrations against them. Do not build tools against guessed interfaces.
4. Assemble the coordinator and communication flows only after component boundaries are testable.
5. Add integration tests, fixtures, configuration examples, and operational documentation with the implementation rather than as cleanup.
Assign each task explicit file ownership. If two tasks would edit the same file or shared contract, sequence them or appoint one owner. Within the approved design, resolve minor implementation details without repeated confirmation, but stop for new external services, irreversible migrations, expanded permissions, or changed product behavior.
## Give each worker agent a complete task with owned files and done criteria
Every delegated task must be executable without reconstructing missing context.
Include:
- a bounded objective and the exact phase;
- relevant requirement, design, source, API, and test-result paths;
- framework and runtime versions that affect behavior;
- the selected communication-flow pattern and the worker's position in it;
- owned files and explicit exclusions;
- available integrations and confirmation that required credentials are configured;
- expected output format, validation command, and completion criteria;
- for an iteration, the exact failing test or review finding and the required improvement.
Require workers to report blockers with evidence and return artifacts to the coordinator. Route instruction defects to the instruction owner, tool defects to the tool owner, and communication defects to the coordinator instead of allowing broad, overlapping edits.
## Rerun 5 user scenarios and fix the top 3 issues each round
Validate components first, then exercise the assembled system through realistic interactions.
1. Test every tool independently with valid input, invalid input, authorization failure, dependency failure, timeout, and retry behavior where applicable.
2. Run five representative end-to-end user scenarios that cover the system's main paths and important boundaries.
3. Save the prompts, expected outcomes, actual outcomes, failures, and quality assessment so the same scenarios can be rerun.
4. Prioritize the three highest-impact improvements from each test round and send each one to the component owner with exact evidence.
5. Rerun the same five scenarios after changes so improvement is measured against a stable baseline; add a new regression case for every newly discovered failure mode.
Do not accept mocked success as proof of a live integration. A release candidate requires all five scenarios to pass, a response-quality score of at least 8 out of 10 under the declared rubric, and no unresolved critical issue.
## Check every requirement and finish with a completion report
Keep the requirements, architecture, role contracts, tool interfaces, tests, and communication map synchronized as the system changes.
- Verify that every requirement maps to an owner and at least one acceptance check.
- Confirm that delegated work changed only its owned files and that component contracts still agree.
- Review the final diff, run the relevant component and end-to-end checks, and record the exact results.
- List residual limitations, deferred improvements, and any test that could not run; do not convert an unverified assumption into a completion claim.
- Finish with a concise completion report covering the delivered architecture, implemented components, verification evidence, unresolved risks, and the operator's next action.
Declare the build complete only when the approved acceptance criteria are satisfied and no critical issue remains.
