CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

cc-team-workflow

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).

Quality

80%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

Fix and improve this skill with Tessl

tessl review fix ./__solutions/cc-team-workflow/SKILL.md
SKILL.md
Quality
Evals
Security

cc-team-workflow

You 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).

Substrate: hybrid

  • You (Opus, in-session) own judgment: triage, decomposition, role-graph design, roster selection, retry/arbitration decisions, final synthesis.
  • The Workflow engine (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).

When to invoke

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.

The archetypes

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.

The 12 phases (O = you, W = the Workflow engine)

  • Phase 1 — Triage (O): classify (code/non-code/hybrid), scope (small/medium/large/competitive), tests_posture (one of four).
  • Phase 2 — Preflight (O): confirm the Workflow tool is available and roster.json is readable.
  • Phase 3 — Roster check (O): 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.
  • Phase 4 — Team design (O): design the node graph. Route lead→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.)
  • Phase 5 — Render + validate spec (O→W): build the RunSpec (references/run-spec-schema.md) and hand it to the engine as args. The engine validates it; spec_invalid → fix and retry.
  • Phase 6 — Dispatch loop (W): the engine computes the frontier and fans out subagents, enforcing the manifest + scorecard schemas per node.
  • Phase 7 — Retry / bounce (W): N=2 retries with feedback; the two-track cutoff (references/scoring-protocol.md) decides ship-vs-regress; reassign to the next roster candidate. Plan-level failure → escalate to you.
  • Phase 8 — Mid-run observation (O): on an escalation bundle, decide: re-plan subtree / swap archetype / add a test-writer node / abort. Relaunch the engine reusing runId.
  • Phase 9 — Finalize (W): the engine assembles results.
  • Phase 10 — Final review (W): artifact-contract-check (exists + non-empty + allowlist + worktree
    • no-stale) then test/lint/typecheck per tests_posture. Decision matrix → ship / bounce / halt.
  • Phase 11 — Postmortem + bundle (W→O): the engine emits per-archetype outcomes; run 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.ts
  • Phase 12 — Git post-processing: stubbed; not built in v1. Ship local-only.

Running the engine as a Workflow

Invoke 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 }.

State you own

  • roster.json — RW (postmortem updates); default-roster.json — read-only seed/reset.
  • <project>/__solutions/<task-slug>/<node-id>/* — subagent deliverables.

Helper scripts (JSON in, JSON out)

scripts/roster-check.ts, scripts/spec-validate.ts, scripts/artifact-contract-check.ts, scripts/roster-postmortem.ts. Pattern: echo '{...}' | npx tsx scripts/<name>.ts.

Error escalation

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.

Repository

KennethJefferson/ccg_ccSkill_CCTeamWorkflow

Path

__solutions/cc-team-workflow/SKILL.md

Last updated
First committed

Is this your skill?

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.