agentleFS
Rune-kitRune-kit/rune/skills/team/SKILL.md

team

Skill96 starsChanged 7 months agoMITView on GitHub

Multi-agent meta-orchestrator. Use when task spans 5+ files or 3+ modules, or when user says 'parallel', 'split this up', 'do all of these'. Decomposes large tasks into parallel workstreams, assigns to isolated cook instances, coordinates merging.

  • Deletes or force-pushes

56 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use community-led-growth, ph-community-outreach and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • nicepkgSkill

    community-led-growth

    Expert in community-led growth (CLG) - leveraging user communities to drive acquisition, retention, and expansion. Covers building developer communities, user groups, ambassador programs, and turning customers into advocates. Knows the difference between community as a feature vs community as a growth engine, and how to measure community ROI. Use when "community-led, CLG, ambassador program, champion program, user community, developer community, word of mouth, user group, " mentioned.

    Also in 5 projects that use this

  • nicepkgSkill

    ph-community-outreach

    Engage Reddit, Indie Hackers, Hacker News and other communities for Product Hunt launches. Use this skill to identify relevant communities, craft appropriate posts, and drive cross-platform engagement without appearing spammy.

    Also in 5 projects that use this

  • Jurel89Skill

    ultraqa

    QA cycling loop — build/lint/test, fix, retry up to 5 cycles

    Also in 5 projects that use this

  • ibahgatSkill

    ralplan

    Create a strict, quality-first execution plan with explicit gates and rollback-ready sequencing.

    Also in 9 projects that use this

  • mastepanoskiSkill

    ux-audit-rethink

    Comprehensive UX audit using IxDF's 7 factors, 5 usability characteristics, and 5 interaction dimensions. Holistic evaluation with redesign proposals based on user-centered design principles.

    Also in 5 projects that use this

  • ncklrsSkill

    seo-content-strategist

    Expert SEO content strategy for SaaS and B2B sites. Use when doing keyword research, planning content clusters, creating pillar pages, optimizing on-page SEO, fixing technical SEO issues, building links, refreshing content, implementing programmatic SEO, mapping search intent, optimizing for SERP features, or measuring content performance. Use for SEO audits, content gap analysis, and organic growth strategy.

    Also in 5 projects that use this

  • +6 more from nicepkg

The file

Show its rules and text

We split this skill into the rules it gives an agent

22 rules. 0 are common, 20 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 41 edited versions we read keep these.

  • 20

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No merge without conflict resolution complete (Phase 3 clean).

    line 26
  2. Distinctive:

    Before decomposing, classify the task into a complexity tier.

    line 54
  3. Distinctive:

    Merge queue: When multiple streams complete at different times, use dependency order for merging.

    line 70
  4. Very specific:

    If a stream discovers the contract is insufficient → status = NEEDS_CONTEXT, not silent modification.

    line 175
  5. Distinctive:

    Before dispatching streams, include in each NEXUS Handoff: "Before starting, ask up to 3 clarifying questions if anything is unclear about …

    line 183
  6. Distinctive:

    If a cook agent returns questions instead of starting work → answer them, then re-dispatch

    line 185
  7. Distinctive:

    If a cook agent starts work without questions → proceed normally (questions are invited, not required)

    line 186
  8. Distinctive:

    After each stream completes (before collecting final report):

    line 263
  9. Distinctive:

    Wait for all Task calls to return.

    line 278
  10. Very specific:

    3a-pre. Oracle reattach sweep: Before merge coordination, glob .rune/oracle-pending/*.json.

    line 298
  11. Distinctive:

    If overlapping files detected between completed worktrees:

    line 306
  12. Distinctive:

    No unresolved TODOs or sentinel CRITICAL flags

    line 327
  13. Distinctive:

    MUST NOT launch more than 3 parallel agents — batch if more streams exist

    line 430
  14. Distinctive:

    MUST define clear scope boundaries per agent before dispatch — no overlapping file ownership

    line 431
  15. Distinctive:

    MUST resolve all merge conflicts before declaring completion — no "fix later"

    line 432
  16. Distinctive:

    MUST NOT let agents modify the same file — split by file ownership

    line 433
  17. Distinctive:

    MUST collect and review all agent outputs before merging — no blind merge

    line 434
  18. Distinctive:

    MUST NOT skip the integration verification after merge

    line 435
  19. Distinctive:

    All cook agents completed and returned reports

    line 489
  20. Distinctive:

    All merge conflicts resolved (zero unresolved before merge commit)

    line 490
  21. Distinctive:

    All worktrees cleaned up

    line 492
  22. Distinctive:

    Scope guardrail: Do not invoke launch, rescue, or scaffold autonomously unless explicitly delegated by the parent agent.

    line 499

“Common” is measured: kept by at least 6 in 10 of the 41 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

team

Purpose

Meta-orchestrator for complex tasks requiring parallel workstreams. Team decomposes large features into independent subtasks, assigns each to an isolated cook instance (using git worktrees), coordinates progress, and merges results. Uses opus for strategic decomposition and conflict resolution.

<HARD-GATE> - MAX 3 PARALLEL AGENTS: Never launch more than 3 Task calls simultaneously. If more than 3 streams exist, batch them. - No merge without conflict resolution complete (Phase 3 clean). - Full integration tests MUST run before reporting success. </HARD-GATE>

Triggers

  • /rune team <task> — manual invocation for large features
  • Auto-trigger: when task affects 5+ files or spans 3+ modules

Mode Selection (Auto-Detect)

IF streams ≤ 2 AND total files ≤ 5:
  → LITE MODE (lightweight parallel, no worktrees)
ELSE:
  → FULL MODE (worktree isolation, opus coordination)

Lite Mode

Full detail moved to references/lite-mode.md (progressive disclosure). Read that file before executing this section.

Full Mode

Standard team workflow with worktree isolation (Phases 1-5 as documented below).

Complexity Tiers (DAG Stage Selection)

Before decomposing, classify the task into a complexity tier. Each tier defines a different DAG (directed acyclic graph) of stages, ensuring the right amount of process for the task's complexity.

TierSignalsDAG StagesContext Windows
Trivial≤3 files, single module, no shared contractsimpl → test1 (single cook)
Medium4-10 files, 2-3 modules, shared interfacesresearch → plan → impl → test → review → fix3 (plan, impl+test, review+fix)
Large10+ files, 3+ modules, breaking changes or RFCresearch → plan → impl → test → review₁ → fix → review₂ → final merge4+ (plan, impl+test, review₁+fix, review₂+merge)

Key principle — reviewer isolation: The agent that writes code MUST NOT review its own code. Each review stage uses a separate context window (separate Task invocation) that has never seen the implementation reasoning. This prevents author bias from contaminating the review.

Stage → Context Window mapping:

  • research + plan = Context Window 1 (opus — architectural reasoning)
  • impl + test = Context Window 2 (sonnet — code writing)
  • review₁ + fix = Context Window 3 (sonnet — fresh eyes, no impl context)
  • review₂ + merge = Context Window 4 (sonnet — final verification, Large tier only)

Merge queue: When multiple streams complete at different times, use dependency order for merging. If a later stream's merge creates conflicts with an already-merged stream, provide the conflicting stream's cook report as conflict context to the resolution agent — never resolve blindly.

Calls (outbound)

  • plan (L2): high-level task decomposition into independent workstreams
  • scout (L2): understand full project scope and module boundaries

Exception: L1→L1 meta-orchestration (team is the only L1 that calls other L1s)

  • cook (L1): delegate feature tasks to parallel instances (worktree isolation)
  • launch (L1): delegate deployment/marketing when build is complete
  • rescue (L1): delegate legacy refactoring when rescue work detected
  • integrity-check (L3): verify cook report integrity before merge
  • completion-gate (L3): validate workstream completion claims against evidence
  • constraint-check (L3): audit HARD-GATE compliance across parallel streams
  • scope-guard (L3): pre-merge scope verification — validate each stream's actual file changes against declared ownership
  • worktree (L3): create isolated worktrees for parallel cook instances
  • context-pack (L3): create structured handoff briefings before spawning subagents
  • L4 extension packs: domain-specific patterns when context matches (e.g., @rune/mobile when porting web to mobile)

Called By (inbound)

  • scaffold (L1): decompose scaffolding into parallel workstreams
  • User: /rune team <task> direct invocation only

Execution

Step 0 — Initialize TodoWrite

TodoWrite([
  { content: "DECOMPOSE: Scout modules and plan workstreams", status: "pending", activeForm: "Decomposing task into workstreams" },
  { content: "ASSIGN: Launch parallel cook agents in worktrees", status: "pending", activeForm: "Assigning streams to cook agents" },
  { content: "COORDINATE: Monitor streams, resolve conflicts", status: "pending", activeForm: "Coordinating parallel streams" },
  { content: "MERGE: Merge worktrees back to main", status: "pending", activeForm: "Merging worktrees to main" },
  { content: "VERIFY: Run integration tests on merged result", status: "pending", activeForm: "Verifying integration" }
])

Phase 1 — DECOMPOSE

Mark todo[0] in_progress.

1a. Map module boundaries.

REQUIRED SUB-SKILL: rune:scout
→ Invoke `scout` with the full task description.
→ Scout returns: module list, file ownership map, dependency graph.
→ Capture: which modules are independent vs. coupled.

1b. Break into workstreams.

REQUIRED SUB-SKILL: rune:plan
→ Invoke `plan` with scout output + task description.
→ Plan returns: ordered list of workstreams, each with:
    - stream_id: "A" | "B" | "C" (max 3)
    - task: specific sub-task description
    - files: list of files this stream owns
    - depends_on: [] | ["B"] (empty = parallel-safe)

1c. Validate decomposition.

GATE CHECK — before proceeding:
  [ ] Each stream owns disjoint file sets (no overlap)
  [ ] No coupled modules across streams:
      → Use Grep to find import/require statements in each stream's owned files
      → If stream A files import from stream B files → flag as COUPLED
      → COUPLED modules MUST be moved to same stream OR stream B added to A's depends_on
  [ ] Dependent streams have explicit depends_on declared
  [ ] Total streams ≤ 3
  [ ] Change Stacking check: no file appears in touches[] of 2+ parallel streams
  [ ] Every stream's requires[] is satisfied by a prior stream's provides[] or existing code
  [ ] Shared Contract Gate: if 2+ parallel streams consume the same interface/type/API, the contract MUST be defined before any stream starts (see below)

If any check fails → re-invoke plan with conflict notes.

**Shared Contract Gate:**

When parallel streams both depend on a shared interface (types, API contract, database schema), that contract must be locked before streams start. Otherwise two agents may independently define incompatible versions.

Detection: → Grep each stream's file list for shared imports (types, interfaces, API clients) → If stream A and stream B both import from the same module: EITHER: move that module to a dependency stream (depends_on: []) OR: define the contract inline in the NEXUS Handoff as "Code Contracts" section

Contract format in NEXUS Handoff:

Code Contracts (locked — do not modify)

// Shared interface — both streams consume this, neither owns it
interface OrderResult {
  orderId: string;
  status: 'pending' | 'filled' | 'cancelled';
  filledAt?: Date;
}

Streams may consume this contract but MUST NOT modify it. If a stream discovers the contract is insufficient → status = NEEDS_CONTEXT, not silent modification.

1d. Question Gate (non-trivial tasks only).

Subagents that start work without asking questions frequently produce the wrong thing.

Before dispatching streams, include in each NEXUS Handoff: "Before starting, ask up to 3 clarifying questions if anything is unclear about scope, conventions, or expected output."

  • If a cook agent returns questions instead of starting work → answer them, then re-dispatch
  • If a cook agent starts work without questions → proceed normally (questions are invited, not required)
  • Skip if: Lite mode (2 streams, ≤5 files) — overhead exceeds value

Mark todo[0] completed.


Phase 2 — ASSIGN

Mark todo[1] in_progress.

2a. Launch parallel streams.

Launch independent streams (depends_on: []) in parallel using Task tool with worktree isolation.

Structured handoff docs prevent the most common multi-agent failure: context loss between agents.

Each stream receives a NEXUS Handoff Template — not a bare prompt:

For each stream where depends_on == []:
  Task(
    subagent_type: "general-purpose",
    model: "sonnet",
    isolation: "worktree",
    prompt: <NEXUS Handoff below>
  )

NEXUS Handoff Template (sent to each cook instance):

## NEXUS Handoff: Stream [id]

### Metadata
- Stream: [id] of [total]
- Depends on: [none | stream ids]
- File ownership: [list — ONLY these files may be modified]
- Model: sonnet

### Context
- Project: [project name and type]
- Overall goal: [1-line feature description]
- This stream's goal: [specific sub-task]
- Conventions: [key patterns from scout — naming, file structure, test framework]

### Deliverable
- [ ] [specific outcome 1 — e.g., "AuthService with login/register/reset methods"]
- [ ] [specific outcome 2 — e.g., "Unit tests covering happy path + 3 error cases"]
- [ ] [specific outcome 3 — e.g., "Types exported for Phase 2 consumers"]

### Quality Expectations
- Tests: must pass with evidence (stdout captured)
- Types: no `any`, strict mode
- Security: no hardcoded secrets, parameterized queries
- Conventions: [project-specific — from scout output]

### Evidence Required
Return a Cook Report with:
- Exact files modified (git diff --stat)
- Test output (stdout — not just "tests pass")
- Any CONCERNS discovered during implementation

2b. Launch dependent streams sequentially.

For each stream where depends_on != []:
  WAIT for all depends_on streams to complete.
  Then launch with NEXUS Handoff that includes:
  - Completed stream's deliverables as "Available Context"
  - Exported interfaces/types from prior streams in "Code Contracts" section
  - Any CONCERNS from prior streams in "Known Issues" section

2b.5. Pre-merge scope verification.

After each stream completes (before collecting final report):

Bash: git diff --name-only main...[worktree-branch]
→ Compare actual modified files vs stream's planned file ownership list.
→ If agent modified files OUTSIDE its declared scope:
    FLAG: "Stream [id] modified [file] outside its scope."
    Present to user for approval before proceeding to merge.
→ If all files within scope: proceed normally.

This catches scope creep BEFORE merge — much cheaper to fix than after.

2c. Collect cook reports.

Wait for all Task calls to return. Store each cook report keyed by stream_id.

Error recovery:
  If a Task fails or returns error report:
    → Log failure: "Stream [id] failed: [error]"
    → If stream is non-blocking: continue with other streams
    → If stream is blocking (others depend on it): STOP, report to user with partial results

Mark todo[1] completed.


Phase 3 — COORDINATE

Mark todo[2] in_progress.

3a-pre0. Output density honoring. During Phase 2 dispatch, any worker that hits context ORANGE / RED has emitted output.density.set with mode=caveman, scope=workstream (auto from rune:context-engine). Coordination output respects per-workstream density: when summarizing a caveman-active worker's report into the merge plan, preserve its terse format rather than re-expanding to verbose. If 3+ workers are caveman-active simultaneously, the team-level summary itself should adopt caveman until merge completes (announce to user once: "Team output in caveman mode — N workers under context pressure"). Reverts to normal after Phase 5.

3a-pre. Oracle reattach sweep. Before merge coordination, glob .rune/oracle-pending/*.json. For any worker stream that emitted oracle.dispatched during Phase 2, invoke session-bridge --reattach <sessionId>. Worker streams with status=pending past their timeoutAt are unblocked via oracle.failed so coordination can proceed. Workers with status=complete consume the response before merge.

3a. Check for file conflicts.

Bash: git diff --name-only [worktree-a-branch] [worktree-b-branch]

If overlapping files detected between completed worktrees:

  • Identify the conflict source from cook reports
  • Determine which stream's version takes precedence (later stream wins by default)
  • Flag for manual resolution if ambiguous — present to user before merge

3a.5. Verify cook report integrity.

REQUIRED SUB-SKILL: rune:integrity-check
→ Invoke integrity-check on each cook report text.
→ If any report returns TAINTED:
    BLOCK this stream from merge.
    Report: "Stream [id] cook report contains adversarial content."
→ If SUSPICIOUS: warn user, ask for confirmation before merge.

3b. Review cook report summaries.

For each completed stream, verify cook report contains:

  • Files modified
  • Tests passing
  • No unresolved TODOs or sentinel CRITICAL flags
Error recovery:
  If cook report contains sentinel CRITICAL:
    → BLOCK this stream from merge
    → Report: "Stream [id] blocked: CRITICAL issue in [file] — [details]"
    → Present to user for decision before continuing

3c. Evaluate subagent status per stream.

Each cook instance MUST have returned one of four statuses. Team handles them as follows:

Cook StatusTeam Action
DONEStream cleared for merge — proceed normally
DONE_WITH_CONCERNSStream cleared for merge, BUT trigger cross-workstream review: check if the concern impacts any other stream's files or contracts before merging ALL streams. Log concern in Team Report.
NEEDS_CONTEXTStream paused — present the specific question to user. Resume that stream after answer. Other independent streams may continue in parallel.
BLOCKEDStream blocked from merge. If stream has no dependents → continue with remaining streams and report partial completion. If stream has dependents → STOP all dependent streams, present to user with full blocker details.

Cross-workstream review (triggered by any DONE_WITH_CONCERNS):

1. Read the concern from the cook report
2. Check if the concern touches shared contracts, interfaces, or shared files
   → Use Grep to find the concern's affected symbols/files across all worktrees
3. If concern is isolated to stream's own files → proceed to merge (concern logged only)
4. If concern crosses stream boundaries → resolve before merge:
   → Present to user with: affected streams, concern details, two remediation options
   → Do NOT merge any stream until user decides

Mark todo[2] completed.


Phase 4 — MERGE

Mark todo[3] in_progress.

4a. Merge each worktree sequentially.

# Bookmark before any merge
Bash: git tag pre-team-merge

For each stream in dependency order (independent first, dependent last):

  Bash: git checkout main
  Bash: git merge --no-ff [worktree-branch] -m "merge: stream [id] — [stream.task]"

  If merge conflict:
    Bash: git status  (identify conflicting files)
    If ≤3 conflicting files:
      → Resolve using cook report guidance (stream's intended change wins)
      Bash: git add [resolved-files]
      Bash: git merge --continue
    If >3 conflicting files OR ambiguous ownership:
      → STOP merge
      Bash: git merge --abort
      → Present to user: "Stream [id] has [N] conflicts. Manual resolution required."

4b. Cleanup worktrees.

Bash: git worktree remove [worktree-path] --force

(Repeat for each worktree after its branch is merged.)

Mark todo[3] completed.


Phase 5 — VERIFY

Mark todo[4] in_progress.

REQUIRED SUB-SKILL: rune:verification
→ Invoke `verification` on the merged main branch.
→ verification runs: type check, lint, unit tests, integration tests.
→ Capture: passed count, failed count, coverage %.
Error recovery:
  If verification fails after merge:
    → Rollback all merges:
    Bash: git reset --hard pre-team-merge
    Bash: git tag -d pre-team-merge
    Report: "Integration tests failed. All merges reverted to pre-team-merge state."
    → Present fix options to user

Mark todo[4] completed.


Constraints

  1. MUST NOT launch more than 3 parallel agents — batch if more streams exist
  2. MUST define clear scope boundaries per agent before dispatch — no overlapping file ownership
  3. MUST resolve all merge conflicts before declaring completion — no "fix later"
  4. MUST NOT let agents modify the same file — split by file ownership
  5. MUST collect and review all agent outputs before merging — no blind merge
  6. MUST NOT skip the integration verification after merge

Mesh Gates

Full detail moved to references/contracts.md (progressive disclosure). Read that file before executing this section.

Output Format

Full detail moved to references/contracts.md (progressive disclosure). Read that file before executing this section.

Parallel Execution Rules

Full detail moved to references/contracts.md (progressive disclosure). Read that file before executing this section.

Returns

Full detail moved to references/contracts.md (progressive disclosure). Read that file before executing this section.

Document Ownership

Full detail moved to references/contracts.md (progressive disclosure). Read that file before executing this section.

Monorepo Awareness

Full detail moved to references/monorepo.md (progressive disclosure). Read that file before executing this section.

Anti-Patterns

Full detail moved to references/contracts.md (progressive disclosure). Read that file before executing this section.

Sharp Edges

Known failure modes for this skill. Check these before declaring done.

Failure ModeSeverityMitigation
Launching more than 3 parallel agents (full mode) / 2 (lite mode)CRITICALHARD-GATE blocks this — batch into ≤3 streams (full) or ≤2 (lite)
Using full mode with worktrees for ≤2 streams, ≤5 filesMEDIUMAuto-detect triggers lite mode — saves opus cost and worktree overhead
Agents with overlapping file ownershipHIGHScope Gate: define disjoint file sets before dispatch — never leave overlap unresolved
Merging without running integration testsHIGHVerification Gate: integration tests on merged result are mandatory
Ignoring sentinel CRITICAL flag in agent cook reportHIGHStream blocked from merge — present to user before any merge action
Launching dependent streams before their dependencies completeMEDIUMRespect depends_on ordering — sequential after parallel, not parallel throughout
Coupled modules split across streamsHIGHDependency graph check in Phase 1c — move coupled files to same stream or add depends_on
Agent modified files outside declared scopeHIGHPre-merge scope verification in Phase 2b.5 — flag before merge, not after
Merge failure with no rollback pathHIGHpre-team-merge tag created before merges — git reset --hard on failure
Poisoned cook report merged blindlyHIGHPhase 3a.5 integrity-check on all cook reports before merge
Bare prompt to cook instance — no context, conventions, or scope boundaryHIGHNEXUS Handoff Template: structured handoff with metadata, deliverables, quality expectations, and evidence requirements
Cook returns "done" with no acceptance criteria trackingMEDIUMTeam Report includes Acceptance Criteria table with per-criterion evidence and PASS/FAIL/UNVERIFIED verdict
Subagent builds wrong thing due to ambiguous scopeHIGHQuestion Gate (Step 1d): invite questions before work starts. Cost of answering 3 questions << cost of rebuilding 500 LOC
Parallel streams touch same files causing merge conflictsHIGHChange Stacking check in Step 1c: validate disjoint touches[] across all parallel streams

Done When

  • Task decomposed into ≤3 workstreams each with disjoint file ownership
  • All cook agents completed and returned reports
  • All merge conflicts resolved (zero unresolved before merge commit)
  • Integration tests pass on merged main branch
  • All worktrees cleaned up
  • Team Report emitted with stream statuses and integration results

Cost Profile

~$0.20-0.50 per session. Opus for coordination. Most expensive orchestrator but handles largest tasks.

Scope guardrail: Do not invoke launch, rescue, or scaffold autonomously unless explicitly delegated by the parent agent.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.