This document describes the repo's custom multi-agent workflow outside of the raw .agent.md files. It explains which role should run when, what each role is allowed to do, and how the hook layer enforces that contract at runtime.
The orchestration system is centered on a single coordinator:
- Supervisor: accepts the user task, picks the next worker by trigger, collects results, and decides when to continue, verify, diagnose, or stop.
The supervisor can delegate to six specialist workers:
- Researcher: find files, gather docs, and reduce ambiguity.
- Architect: validate reuse, patterns, and design boundaries.
- Builder: make code changes once the work is concrete.
- Verifier: validate changes independently.
- Diagnostician: isolate root cause when something fails.
- Vision Operator: analyze UI state, screenshots, overlay behavior, or browser-visible outcomes.
Routing is trigger-based, not a fixed sequence.
- Delegates only.
- Does not implement code directly.
- Chooses workers based on the current uncertainty or failure mode.
Trigger when:
- the code location is unknown
- supporting documentation is unclear
- a large amount of repo context must be narrowed quickly
Expected output:
Sources ExaminedKey FindingsRecommended Next Agent
Trigger when:
- reuse opportunities may already exist
- module boundaries or ownership are in question
- consistency with current patterns matters before editing code
Expected output:
Recommended ApproachFiles to ReuseConstraints and Risks
Trigger when:
- the plan is concrete
- target files are known
- the change is ready to implement
Expected output:
Changed FilesLocal ProofsUnresolved Risks
Trigger when:
- code has changed
- an independent validation pass is required
Expected output:
Verification ReportVerdictFailing Commands or Evidence
Trigger when:
- verification fails
- behavior regresses
- the root cause is not yet known
Expected output:
Root CauseEvidenceReproductionSmallest Fix
Trigger when:
- screenshots must be interpreted
- overlay behavior is involved
- browser-visible outcomes matter
- accessibility or UIA state is central to the problem
Expected output:
Observed UI StateEvidenceBlockersNext Safe Action
The hook layer is wired in .github/hooks/copilot-hooks.json.
The security hook in .github/hooks/scripts/security-check.ps1 enforces role boundaries before a tool runs.
Current policy highlights:
- Researcher and Architect are read-only and cannot execute shell tools.
- Researcher, Architect, Verifier, Diagnostician, and Vision Operator cannot mutate arbitrary repo files.
- Those same roles are allowed to overwrite only their role-scoped artifact file under
.github/hooks/artifacts/so the stop hook has deterministic evidence to inspect. - Dangerous shell patterns are denied regardless of role.
The quality gate in .github/hooks/scripts/subagent-quality-gate.ps1 validates the final worker response before the subagent is allowed to stop.
It checks each role for its required evidence sections. If a worker omits those sections, the hook can block completion and require a stronger response.
Current runtime note:
- Some VS Code
SubagentStoppayloads include only metadata and omit the worker response text. - To keep section-level enforcement meaningful, each worker now mirrors its final report to a role-specific artifact under
.github/hooks/artifacts/. - The quality gate reads those artifacts as its primary evidence source when the runtime omits inline response text.
The current enforcement path works like this:
- A worker prepares its final report in the required section format.
- Before returning, it overwrites its role-specific artifact in
.github/hooks/artifacts/. PreToolUseallows that narrow mutation even for otherwise read-only roles.SubagentStopreads the artifact and validates the expected sections.
This design exists because runtime metadata alone is not enough to enforce content quality.
The repo includes direct proof scripts for the hook path:
scripts/test-hook-artifacts.jsscripts/test-hook-artifacts.ps1
These harnesses verify three things end to end:
- artifact-path edits are allowed for read-only workers
- non-artifact edits are denied
- artifact-backed evidence is accepted by the quality gate
The typical healthy flow looks like this:
- Supervisor receives the task.
- Researcher or Architect runs first if the target or design is unclear.
- Builder implements once the plan is concrete.
- Verifier validates the change.
- Diagnostician runs only if verification fails or the issue is ambiguous.
- Vision Operator is used whenever the problem depends on what is visibly on screen.
Not every task needs every role. The point of the system is to route only to the workers that match the current problem state.
The role contract is real, but model routing still has a current platform limitation: declared model: preferences in agent frontmatter are not reliably enforced by programmatic subagent dispatch. The role split, tool restrictions, and hook checks are active today; per-agent model preferences remain future-facing until the VS Code runtime honors them for all dispatch paths.