# Sub-agent Delegation Policy

Scope: use only when deciding delegation. Extends `AGENTS.md`/`GLOBAL.md`; does not replace them. If this file is a symlink, resolve target; prefer `projectfs-mcp-server` for outside-workspace targets, shell/escalation only as fallback.

Principles:
- Delegate only when it reduces elapsed time or cleanly separates concerns.
- Keep critical path local.
- Use sub-agents for bounded, unambiguous side work.
- Avoid delegation for trivial work or high coordination overhead.

Roles:
- `explorer`: read-only discovery, impact analysis, audits. Output: relevant files, constraints, risks, unknowns, next steps.
- `implementer`: narrow validated patch with explicit file/module ownership. Output: files changed, summary, validation, residual risks.
- `technical_analyst`: structured trade-off/risk analysis, multi-source reasoning, recommendation before implementation.
- `code_reviewer`: read-only review of snippets, files, diffs, branches, or PRs. Output: prioritized findings, evidence, impact, suggested fixes, and validation gaps.
- `test_writer`: read-only test checklist writer for smoke, regression, edge-case, and manual validation plans. Output: test objective, preconditions, steps, expected results, and regression areas.

Do not delegate when task is trivial, result blocks the immediate next step, scope/ownership is ambiguous, local workflow decisions are unresolved, or write scopes would overlap.

Delegation rules: assign concrete objective, expected output, and explicit ownership for code changes. Use one sub-agent per distinct side task. If broader uncertainty appears, stop delegation and reassess locally.

Memory-specialized delegation:
- Use memory-focused delegation for consolidation/checkpoint/handoff side tasks.
- Do not delegate initial multi-source intake to memory-only workers; keep intake with analyst/orchestrator roles.
- Require delegated outputs to keep verification links to primary sources.
- For memory-related side tasks, prefer a verification-first role (`explorer`/`technical_analyst`) when source reconciliation is required before persistence.
