Orchestrate a hierarchical team of Claude Code subagents (lead → worker → validator → synthesizer) with learned archetype role-fit and structured retries, entirely in-session with no PI or external-model dependency. Use when Opus wants to delegate a decomposable task to an all-Claude team with validation and retries. Sibling of team-workflow (which uses external PI models).
80%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./__solutions/cc-team-workflow/SKILL.mdYou are Opus, the orchestrator. Claude Code subagents are your team. This skill is the algorithm.
This is the all-Claude sibling of team-workflow. Same lead→worker→validator→synthesizer
pipeline, learned role-fit, structured retries — but zero PI/external dependency. Labor is
CC subagents differentiated by archetype = (model tier × subagent_type × persona).
engine/team-workflow.engine.js) owns mechanism: DAG dispatch,
schema-enforced output, the retry loop + two-track cutoff, reassignment, artifact-contract
-check, postmortem-data emission. It runs in the background and talks back via a typed
escalation bundle (references/escalation-contract.md).Use when: the task decomposes (>50 LOC / multi-file / needs review), you want competitive variants, or you want delegated labor with validation. Do NOT use for: a single inline edit, or real-time interactive work.
Seven seed archetypes in default-roster.json (live state in roster.json):
architect (lead), implementer / implementer-heavy (worker), skeptic /
reviewer-fast (validator), scout (recon-only), synthesizer. Role-fit is learned
by scripts/roster-postmortem.ts. scout is recon-only — dispatch it during design,
never as a deliverable node.
roster.json is readable.echo '{"skill_root":"<this skill dir>"}' | npx tsx scripts/roster-check.ts
→ returns {by_role, warnings}: per-role ranked available archetypes plus any roster-load warnings.architect; apply the
validator-tier floor (validator archetype ≥ worker tier; dual validators for stakes:"high").
Dispatch scout subagents here for recon. Mark each node's stakes.
(v1 note: the engine implements lead→worker→validator→synthesizer for the worker/validator roles; the synthesizer/competitive-variants arbitration path and the outputs_conflicting escalation are deferred to a future version — do not design competitive/synthesizer nodes in v1.)references/run-spec-schema.md) and
hand it to the engine as args. The engine validates it; spec_invalid → fix and retry.references/scoring-protocol.md) decides ship-vs-regress; reassign to the next roster
candidate. Plan-level failure → escalate to you.runId.scripts/roster-postmortem.ts to update roster.json; you return the final bundle. Input shape:
echo '{"skill_root":"<skill dir>","outcomes":[{"archetype":"implementer","role":"worker","success":true,"elapsed_ms":38000,"was_reassigned":false,"was_probation":false,"failure_category":null}]}' | npx tsx scripts/roster-postmortem.tsInvoke the Workflow tool with a script that wraps the engine. The script's meta block
plus body wire real agent() calls into the engine's dispatch seam:
export const meta = {
name: 'cc-team-workflow-run',
description: 'Run a cc-team-workflow RunSpec: dispatch, retry, validate, contract-check.',
phases: [{ title: 'Dispatch' }, { title: 'Review' }],
};
// Bind real agent() into the engine's dispatch seam, then run.
globalThis.__CC_TEAM_AGENT__ = async (node) => {
// Build the subagent prompt from node.prompt + the archetype persona (personas/<archetype>.md),
// call agent(prompt, { subagent_type: <archetype.subagent_type>, model: <archetype.tier>,
// schema: <manifest|scorecard schema for node.role> }),
// and return { manifest } for workers or { scorecard } for validators.
// (Wiring details: read the archetype row from roster.json for subagent_type + tier.)
};
const { runEngine } = await import('<abs path>/engine/team-workflow.engine.js');
// args IS the RunSpec; {} opts means production dispatch via globalThis.__CC_TEAM_AGENT__ (pass {dispatch} to override).
return await runEngine(args, {});Pass the RunSpec as the Workflow tool's args. The engine returns either
{ status: "success", ... } or { status: "escalation", bundle }.
roster.json — RW (postmortem updates); default-roster.json — read-only seed/reset.<project>/__solutions/<task-slug>/<node-id>/* — subagent deliverables.scripts/roster-check.ts, scripts/spec-validate.ts, scripts/artifact-contract-check.ts,
scripts/roster-postmortem.ts. Pattern:
echo '{...}' | npx tsx scripts/<name>.ts.
If you hit a state the skill doesn't model, do NOT paper over it. The engine surfaces a typed escalation bundle; you re-plan or fail clean. Better to fail clean than ship broken.
5427ff7
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.