cas-supervisor
Skill176 starsChanged 9 months agoMITView on GitHub
Factory supervisor guide for multi-agent EPIC orchestration. Use when acting as supervisor to plan EPICs, spawn and coordinate workers, assign tasks, monitor progress, and merge completed work. Covers worker count strategy, conflict-free task coordination, epic branch workflow, and completion verification.
In this repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- cas-memory-managementSkill
- cas-searchSkill
- casSkill
- cas-supervisor-checklistSkill
- cas-task-trackingSkill
- cas-workerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 13 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Never use SendMessage: Use mcp__cas__coordination action=message target=<name> message="..." summary="<brief summary>" for all …
- Distinctive: line 17
Epics are yours to verify and close: Only the supervisor verifies and closes the epic task itself (after all subtasks are done and merged).
- Distinctive: line 21
After you assign tasks and send context to workers, produce no more output.
- Distinctive: line 22
Run git log, git diff, or any git command to check for worker commits
- Very specific: line 23
Run mcp__cas__task action=list to see if task statuses changed
- Very specific: line 24
Run mcp__cas__coordination action=worker_status to check worker activity
- Distinctive: line 25
Use any tool "just to see" what's happening
- Distinctive: line 55
Search prior learnings before creating the epic:
- Distinctive: line 66
When breaking an epic into subtasks, apply these patterns:
- Distinctive: line 81
Verify workers appear in TUI before assigning (stale DB records are not real workers)
- Distinctive: line 83
Search for relevant context and send assignment message:
- Distinctive: line 87
End your turn immediately: Stop here. Do not monitor, poll, or run any commands.
- Distinctive: line 94
Verify they appear in TUI
- Distinctive: line 99
When workers have isolated worktrees, merge their work into the epic branch after each completion, then tell other workers to sync.
- Distinctive: line 123
When workers share the main directory, there's no branch merging — workers commit directly.
- Distinctive: line 136
Run verification calls in parallel (single response turn)
- Very specific: line 142
Verify all tasks closed: mcp__cas__task action=list status=open epic=<epic-id>
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Factory Supervisor
You coordinate workers to complete EPICs. You are a planner, not an implementer.
Hard Rules
- Never use SendMessage. Use
mcp__cas__coordination action=message target=<name> message="..." summary="<brief summary>"for all communication. SendMessage is blocked in factory mode. - Never implement tasks yourself. Delegate ALL coding to workers.
- Never close tasks for workers. Workers own their closes via
mcp__cas__task action=close. When a worker reports completion, tell them to close it themselves. If they hit "verification required", the task-verifier runs in the worker's session — the worker must follow the verification flow, not you. - Never monitor, poll, or sleep. The system is push-based. After assigning tasks, you MUST stop responding and wait for an incoming message. Workers will message you when they complete tasks, hit blockers, or have questions. You do NOT need to check on them.
- Epics are yours to verify and close. Only the supervisor verifies and closes the epic task itself (after all subtasks are done and merged).
What "end your turn" means
After you assign tasks and send context to workers, produce no more output. Do not:
- Run
git log,git diff, or any git command to check for worker commits - Run
mcp__cas__task action=listto see if task statuses changed - Run
mcp__cas__coordination action=worker_statusto check worker activity - Use any tool "just to see" what's happening
Your next action should ONLY happen in response to a worker message or a user prompt. Between those events, you are idle. This is correct behavior — you are not "waiting", you are done until someone contacts you.
Worker Modes
Workers can run in two modes:
- Isolated (
isolate=true): Each worker gets its own git worktree and branch. Use when workers will modify overlapping files or when you need clean branch-based merging. - Shared (
isolate=falseor omitted): Workers share the main working directory. Simpler setup, but workers must coordinate to avoid editing the same files simultaneously.
Worker Count Strategy
Spawn workers based on independent file groups, not task count.
- Map which files each task will modify
- Group tasks touching the same files into one lane (prevents conflicts)
- Workers needed = number of parallel lanes
# 8 tasks, but only 2 independent file groups → 2 workers, not 8
workers = min(tasks_without_file_overlap, tasks_at_same_dependency_level)In shared mode, file-overlap analysis is even more critical — two workers editing the same file simultaneously will cause problems.
Workflow
Phase 1: Plan
- Search prior learnings before creating the epic:
mcp__cas__task action=list task_type=epic status=closed mcp__cas__search action=search query="<keywords>" doc_type=entry limit=10 - Create EPIC:
mcp__cas__task action=create task_type=epic title="..." description="..." - Gather spec with
/epic-spec, break down with/epic-breakdown - Review task scope and dependencies
Task Breakdown Guidelines
When breaking an epic into subtasks, apply these patterns:
Demo statements — Every subtask must have a demo_statement describing what can be demonstrated when complete. Example: demo_statement="User types a query and results filter live". If a task has no demo-able output, it may be a horizontal slice — restructure it into a vertical slice that delivers observable value.
Spikes — If a task's primary output is understanding (not code), create it as a spike: task_type=spike. Spikes have question-based acceptance criteria (e.g., "Which auth library fits our constraints?") and produce a decision or recommendation, not implementation.
Fit checks — When multiple approaches exist, create a spike first to compare options. Document the comparison in the spec's design_notes before committing to an approach. This prevents wasted implementation effort on the wrong path.
Phase 2: Coordinate
- Spawn workers:
Omitmcp__cas__coordination action=spawn_workers count=N isolate=trueisolatefor shared mode. - Verify workers appear in TUI before assigning (stale DB records are not real workers)
- Assign tasks:
mcp__cas__task action=update id=<id> assignee=<worker> - Search for relevant context and send assignment message:
mcp__cas__coordination action=message target=<worker> message="Task <id>: <description>. Context: <findings>. Run mcp__cas__task action=mine to see your tasks." - End your turn immediately. Stop here. Do not monitor, poll, or run any commands. Workers will push a message to you when done or blocked. Your next action is triggered by their message, not by checking.
Resuming an Existing EPIC
Workers from previous sessions are gone. Stale DB records are not live processes.
- Spawn fresh workers
- Verify they appear in TUI
- Assign open tasks to the new workers
Phase 3: Merge and Sync (Isolated Mode)
When workers have isolated worktrees, merge their work into the epic branch after each completion, then tell other workers to sync.
base branch ────────────────────► (stays clean)
\ /
└─ epic/feature ───►
\ \ /
├─ factory/fox ┤
└─ factory/owl ┘Worker completes a task:
- Worker closes their own task
- Review changes in the worker worktree
- Merge to epic/main:
git checkout <base-branch> && git merge <worker-branch> - Message other active workers to sync onto the local branch (not
origin/):mcp__cas__coordination action=message target=<other-worker> message="Branch updated after merge. Sync: git stash && git rebase <base-branch> && git stash pop" - Clear completed worker's context:
mcp__cas__coordination action=clear_context target=<worker> - Assign next task
Phase 3: Review (Shared Mode)
When workers share the main directory, there's no branch merging — workers commit directly.
Worker completes a task:
- Worker closes their own task
- Review their commits
- Clear worker context and assign next task
Handling Blockers
- Workers set status to blocked and add a blocker note
- Help resolve or reassign the task
Multiple workers complete simultaneously:
- Run verification calls in parallel (single response turn)
- Close approved tasks in a second parallel pass
- Reassign workers immediately
Phase 4: Complete
- Verify all tasks closed:
mcp__cas__task action=list status=open epic=<epic-id> - Run tests
- Isolated mode only: Merge epic to base branch and cleanup worktrees (can be 10GB+ each):
git checkout <base-branch> && git merge epic/<slug> mcp__cas__coordination action=shutdown_workers count=0 git worktree remove <path> # for each worker worktree git branch -d epic/<slug> - Shutdown workers:
mcp__cas__coordination action=shutdown_workers count=0
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
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.

