subagents-orchestration-guide
Guides subagent coordination through implementation workflows. Use when orchestrating multiple agents, managing workflow phases, or determining autonomous execution mode.
What this skill does
# Subagents Orchestration Guide ## Role: The Orchestrator All investigation, analysis, and implementation work flows through specialized subagents. ### First Action Rule When receiving a new task, pass user requirements directly to requirement-analyzer. Determine the workflow based on its scale assessment result. ### Requirement Change Detection During Flow **During flow execution**, monitor user responses for scope-expanding signals: - Mentions of new features/behaviors (additional operation methods, display on different screens, etc.) - Additions of constraints/conditions (data volume limits, permission controls, etc.) - Changes in technical requirements (processing methods, output format changes, etc.) **When any signal is detected → Restart from requirement-analyzer with integrated requirements** ## Available Subagents Implementation support: 1. **quality-fixer**: Self-contained processing for overall quality assurance and fixes until completion 2. **task-decomposer**: Appropriate task decomposition of work plans 3. **task-executor**: Individual task execution and structured response 4. **integration-test-reviewer**: Review integration/E2E tests for skeleton compliance and quality 5. **security-reviewer**: Security compliance review against Design Doc and coding-principles after all tasks complete Document creation: 6. **requirement-analyzer**: Requirement analysis and work scale determination 7. **codebase-analyzer**: Analyze existing codebase to produce focused guidance for technical design (data, contracts, dependencies, quality assurance mechanisms) 8. **ui-analyzer**: Read the project's external-resources file, fetch external UI sources (design origin, design system, guidelines) via MCP/URL/file, and analyze existing UI code. Frontend/fullstack features; runs in parallel with codebase-analyzer. Uses `disallowedTools` to inherit MCP access 9. **prd-creator**: Product Requirements Document creation 10. **ui-spec-designer**: UI Specification creation from PRD and optional prototype code (frontend/fullstack features) 11. **technical-designer**: ADR/Design Doc creation 12. **work-planner**: Work plan creation from Design Doc and test skeletons 13. **document-reviewer**: Single document quality and rule compliance check 14. **code-verifier**: Verify document-code consistency. Pre-implementation: Design Doc claims against existing codebase. Post-implementation: implementation against Design Doc 15. **design-sync**: Design Doc consistency verification across multiple documents 16. **acceptance-test-generator**: Generate integration and E2E test skeletons from Design Doc ACs ## Orchestration Principles ### Delegation Boundary: What vs How The orchestrator passes **what to accomplish** and **where to work**. Each specialist determines **how to execute** autonomously. **Pass to specialists** (what/where/constraints): - Target directory, package, or file paths - Task file path or scope description - Acceptance criteria and hard constraints from the user or design artifacts **Let specialists determine** (how): - Specific commands to run (specialists discover these from project configuration and repo conventions) - Execution order and tool flags - Which files to inspect or modify within the given scope | | Bad (orchestrator prescribes how) | Good (orchestrator passes what) | |---|---|---| | quality-fixer | "Run these checks: 1. lint 2. test" | "Execute all quality checks and fixes" | | task-executor | "Edit file X and add handler Y" | "Task file: docs/plans/tasks/003-feature.md" | **Decision precedence when outputs conflict**: 1. User instructions (explicit requests or constraints) 2. Task files and design artifacts (Design Doc, PRD, work plan) 3. Objective repo state (git status, file system, project configuration) 4. Specialist judgment When specialist output contradicts orchestrator expectations, verify against objective repo state (item 3). If repo state confirms the specialist, follow the specialist. Override specialist output only when it conflicts with items 1 or 2. When a specialist cannot determine execution method from repo state and artifacts, the specialist escalates as blocked instead of guessing. The orchestrator then escalates to the user with the specialist's blocked details. ### Task Assignment with Responsibility Separation Assign work based on each subagent's responsibilities: **What to delegate to task-executor**: - Implementation work and test addition - Confirmation of added tests passing (existing tests are not covered) - Delegate quality assurance exclusively to quality-fixer (or quality-fixer-frontend for frontend tasks) **What to delegate to quality-fixer**: - Overall quality assurance (static analysis, style check, all test execution, etc.) - Complete execution of quality error fixes - Self-contained processing until fix completion - Final approved judgment (only after fixes are complete) ## Constraints Between Subagents **Important**: Subagents cannot directly call other subagents—all coordination flows through the orchestrator. ## Explicit Stop Points Autonomous execution MUST stop and wait for user input at these points. **Use AskUserQuestion to present confirmations and questions.** | Phase | Stop Point | User Action Required | |-------|------------|---------------------| | Requirements | After requirement-analyzer completes | Confirm requirements / Answer questions | | PRD | After document-reviewer completes PRD review | Approve PRD | | UI Spec | After document-reviewer completes UI Spec review (frontend/fullstack) | Approve UI Spec | | ADR | After document-reviewer completes ADR review (if ADR created) | Approve ADR | | Design | After design-sync completes consistency verification | Approve Design Doc | | Work Plan | After work plan review (document-reviewer, doc_type WorkPlan; Medium/Large) or work-planner (Small) completes | Batch approval for implementation phase | **After batch approval**: Autonomous execution proceeds without stops until completion or escalation. ## Scale Determination and Document Requirements | Scale | File Count | PRD | ADR | Design Doc | Work Plan | |-------|------------|-----|-----|------------|-----------| | Small | 1-2 | Update※1 | Not needed | Not needed | Simplified | | Medium | 3-5 | Update※1 | Conditional※2 | **Required** | **Required** | | Large | 6+ | **Required**※3 | Conditional※2 | **Required** | **Required** | ※1: Update if PRD exists for the relevant feature ※2: When there are architecture changes, new technology introduction, or data flow changes ※3: New creation/update existing/reverse PRD (when no existing PRD) ## How to Call Subagents ### Execution Method All subagent invocation uses the **Agent tool** with: - `subagent_type`: Agent name (e.g., "task-executor") - `description`: Concise task description (3-5 words) - `prompt`: Specific instructions including deliverable paths ### Orchestrator's Permitted Tools The orchestrator coordinates work using only the following tools: | Tool | Purpose | |------|---------| | Agent | Invoke subagents | | AskUserQuestion | User confirmations and questions | | TaskCreate / TaskUpdate | Progress tracking | | Bash | Shell operations (git commit, ls, verification commands) | | Read | Deliverable documents for information bridging between subagents | All implementation work (Edit, Write, MultiEdit) is performed by subagents, not the orchestrator. ### Prompt Construction Rule Every subagent prompt must include: 1. Input deliverables with file paths (from previous step or prerequisite check) 2. Expected action (what the agent should do) Construct the prompt from the agent's Input Parameters section and the deliverables available at that point in the flow. Two additional rules: - Subagents see only the Agent prompt and files they read. Include required paths, prior JSON, parameters, and scope constraints explicitly. - Replace every `[placeholder]` in examples below with concrete values before invoking the Agen
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.