一键导入
agent-team-protocol
Multi-agent delegation rules, three-phase workflow (Plan/Build/Review), model selection, collaboration gates, and Ralph Loop integration.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Multi-agent delegation rules, three-phase workflow (Plan/Build/Review), model selection, collaboration gates, and Ralph Loop integration.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Autonomous build driver after SDD spec approval: phase-scoped headless build sessions, driver-owned commits, cross-provider review gates, milestone pauses, and fail-closed escalation — under explicit opt-in autonomy profiles.
When and how to ask clarifying questions before implementing. Data model review gate and ambiguity resolution rules.
Quality gates, prohibited patterns, verification discipline, and self-audit rules for all code generation and review sessions.
Cross-copilot portable conventions: read before write, minimal changes, git discipline, project structure, and priority rules.
Copyright header rules for generated source files. Applies the company name from providers.toml to new files.
Derive a unique, domain-fit design direction and enforce design-token + anti-slop discipline. Read/author DESIGN.md before building any UI; override framework defaults so output is bespoke by construction, not generic.
| name | agent-team-protocol |
| description | Multi-agent delegation rules, three-phase workflow (Plan/Build/Review), model selection, collaboration gates, and Ralph Loop integration. |
Note on naming. This document uses "team" to mean a group of subagents working within a single session, coordinated by a Team Lead via the copilot's delegation tool. Some tools also offer experimental multi-session coordination features (see § "Multi-Session Coordination" at the bottom of this document). The two are different things.
Rules governing multi-agent delegation, phased workflows, and model selection.
Every non-trivial task follows three phases with distinct behaviors:
xhigh (Opus 4.7) / high (other models)clarification-protocol.md for the full protocol and data model review gate.)Between Phase 1 (Plan) and Phase 2 (Build), a spec gate applies:
specs/<feature-id>/plan.md with spec_mode frontmatter.full or lightweight: Plan also writes spec.md. User approves both before Build.none: User approves plan.md only. Build proceeds without a spec gate.[NEEDS CLARIFICATION] markers in spec.md must be resolved before Build starts.See spec-workflow.md for risk classification and required sections.
When collaboration_mode: dual in plan.md frontmatter OR the environment variable CCT_PEER_REVIEW_ENABLED is true:
/review-submit once (advisory). A FAIL is logged as plan-consult.md but does not block Build entry. Proceed to /phase-complete regardless of verdict./review-submit to start the agent-driven review loop. On FAIL, address findings and resubmit. On PASS, proceed to /phase-complete. The build-review.md artifact must exist with verdict: PASS or approved bypass before the session can end.See review-loop.md for the full protocol.
highscripts/check-origin-alignment.sh <feature-id>. Exit 0 or 1 proceeds. Exit ≥ 2 halts before delegation and surfaces the three-resolution escalation (rescope / restart / document divergence) — no sub-agent work starts until the user picks A/B/C. See origin-confirmation.md.specs/<id>/plan.md frontmatter to determine spec_mode gating behavior.phase-workflow.md § Pre-Build Verification.)xhigh (Opus 4.7) / high (other models)collaboration_mode: dual: verify collaboration artifacts exist with verdict: PASS and blocking_findings_open: 0.At session start after a cycle has shipped — or right after /cooldown writes its report — the Team Lead must lead with the recommended next bet, not an open-ended "What's next?" prompt. The cooldown-report agent already emits the actionable command pair (/bet <id> → /cycle-start <id>); surface it verbatim. Ask only when there is genuine ambiguity (multiple shaped pitches with no clear ordering, or none at all). Full procedure: team-lead-efficiency.md § "Cycle-Transition Handoff (Recommend, Don't Ask)" (issue #25).
Sub-agents only see fragments (one file, one module). Planning requires a holistic view of the entire system: how modules interact, where the boundaries are, what the risk surface looks like. Delegating planning produces fragmented, conflicting plans. Keep planning in one mind.
team-lead-efficiency.md.)Start a fresh session (/clear or new terminal) at these natural boundaries:
/context shows high usage. If the visual grid is mostly full, compress with /compact or start fresh.| Metric | Target | Maximum |
|---|---|---|
| User messages | 15-20 | 30 |
| Tool calls | 50-100 | 200 |
| Files changed | 10-20 | 40 |
| Duration | 1-2 hours | 4 hours |
These are guidelines, not hard rules. The point is: if you're approaching these limits, you should be asking "is it time for a fresh session?"
/rename "phase-2-auth-and-services" — makes it easy to find later.doc_internal/TODO.md or an MVP gap document)."remember that we chose magic link auth over password-based".git log -1 --oneline to orient yourself.From real projects, these are the most common causes of context exhaustion:
| Cause | Sessions Affected | Prevention |
|---|---|---|
| Running 4 phases in one session | Mega-sessions (4+ hours) | One phase per session |
| Extended debugging cycles | Auth failures, config issues | Cap at 10 exchanges; fresh session with clean problem description |
| Pasting large error outputs | Console dumps, stack traces | Paste only the relevant error line, not the full output |
| Repeatedly reading the same files | Agent re-reading files after each message | Use /compact to summarize; reference by path |
| Large file rewrites | Agent regenerating entire files | Use targeted edits (diff-over-rewrite) |
1. Orient (2 min) — read CLAUDE.md, check git status, state objective
2. Plan (5-10 min) — review or create plan for this phase
3. Build (30-90 min) — execute the plan, delegate if needed
4. Verify (5-10 min) — type check, lint, build, smoke test
5. Commit (2 min) — commit with descriptive message
6. Close (1 min) — rename session, document pending work
Total: 45 minutes to 2 hours. If it's taking longer, consider splitting.
/compact at task boundaries to reclaim context space./clear between task switches when changing focus entirely.An alternative to team delegation during Build. A single agent runs in a loop: read plan → implement next item → test → commit if passing → repeat.
When to use instead of team delegation:
When to use team delegation instead:
The Team Lead can also use hybrid mode: delegate a Ralph Loop sub-agent for one bounded task during Build while handling other tasks directly.
See ralph-loop.md for the full pattern, PRD format, and safety guards.
Fully unattended alternative (auto-build loop): after the Plan Approval
Gate, scripts/auto-build-loop.sh can drive the whole Build phase outside any
copilot session — fresh headless session per phase, driver-owned commits,
gating cross-provider review per phase, milestone pauses for batched human
sign-off, fail-closed parking on breakers. Opt-in via
specs/<feature-id>/automation.json autonomy profiles; see
auto-build-loop.md and phase-workflow.md § Autonomy Profiles.
Effort levels assume Opus 4.7 for the Plan/Review tier. xhigh is Opus 4.7 only — on Opus 4.6 and Sonnet 4.6 it falls back to high. high, medium, and low are supported across all current models.
| Phase | Model Tier | Effort | Delegation |
|---|---|---|---|
| Plan | Highest (Opus) | xhigh | None |
| Build | Fast (Sonnet) | high | Yes |
| Build (loop) | Fast (Sonnet) | high | None — single agent loops |
| Review | Highest (Opus) | xhigh | None |
| Quick fix | Fastest (Haiku) | low | None |
Opus 4.7 calibration note: Opus 4.7 spawns fewer subagents by default and calibrates response length to task complexity — it prefers concise, inline work over verbose, sprawling delegation. If your task genuinely benefits from parallel subagents or a verbose written analysis, spell that out explicitly in the delegation prompt (e.g., "use subagents to investigate X and Y in parallel" or "produce a detailed written analysis with code examples"). Do not assume it will infer the same defaults Opus 4.6 used.
Some copilots offer experimental multi-session coordination beyond the single-session pattern above (e.g., Claude Code's Agent Teams, Cursor's Cloud Agents, Codex's Subagents SDK). These are tool-specific mechanisms that are not wire-compatible with each other. The single-session principles in this document — non-overlapping file ownership, bounded tasks, lead integration — apply regardless of mechanism. See your tool's documentation for multi-session details.