agentleFS
naman10parikhnaman10parikh/turbo/.claude/skills/fractal-delegation/SKILL.md

fractal-delegation

Skill0 starsChanged 28 days agoMITView on GitHub

Every task with 2+ independent workstreams, or any task that would take >15 minutes as solo work. Also triggered by chairman voice dumps with multiple requirements. For EVERY task, answer these questions: Launch 3-5 sub-agents in background for research while you implement. When: Need information, not code changes. Protects your context window. Each agent works in an isolated git worktree. Changes merge back. When: Code changes in non-overlapping files. For large features spanning multiple packages. When: Features spanning 3+ packages…

  • Reads credentials

4 other projects use a version of this, 2 of them edited.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 14 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈14

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every task with 2+ independent workstreams, or any task that would take >15 minutes as solo work.

    line 5
  2. Distinctive:

    When done: signals PARENT's signal dir

    line 136
  3. Distinctive:

    Decision: Use Pattern E when you'd naturally say "this VP is really a CEO of its own team."

    line 145
  4. Very specific:

    All terminals share tasks via CLAUDE_CODE_TASK_LIST_ID=energy-main.

    line 163
  5. Distinctive:

    Use TaskCreate/TaskUpdate across terminals

    line 165
  6. Distinctive:

    Check TaskList before starting work — another terminal may have claimed it

    line 167
  7. Distinctive:

    VP mediate: If worker fails, the team lead reviews and redirects

    line 174
  8. Distinctive:

    CEO escalate: If VP can't resolve, CEO takes over (or escalates to chairman)

    line 175
  9. Distinctive:

    Don't delegate then do the same work yourself (duplicate effort)

    line 188
  10. Distinctive:

    Don't use worktrees for read-only research (unnecessary overhead)

    line 189
  11. Distinctive:

    Don't spawn agents for tasks that take <2 minutes solo

    line 190
  12. Distinctive:

    Don't create teams of 1 (that's just a sub-agent)

    line 191
  13. Distinctive:

    Don't delegate architecture decisions — make them yourself, delegate implementation

    line 192
  14. Distinctive:

    Don't let agents run unmonitored >30 min — check progress via TaskList

    line 193
  15. Distinctive:

    Don't skip the research phase — always gather context before implementation

    line 194

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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.

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

Skill: Fractal Delegation (The CEO Operating System)

Trigger

Every task with 2+ independent workstreams, or any task that would take >15 minutes as solo work. Also triggered by chairman voice dumps with multiple requirements.

The Organizational Hierarchy

CHAIRMAN (Naman) — Vision, capital, objective function
    │
CEO (You — Opus) — Decompose, route, delegate, monitor, integrate
    │
    ├── VP Research (Agent Team / Sub-agents)
    ├── VP Frontend (Agent Team with worktree)
    ├── VP Backend (Agent Team with worktree)
    └── VP Quality (Sub-agents for review/test)
         │
         └── Workers (Sub-agents within each VP)
              - Research workers (Haiku)
              - Code workers (Sonnet)
              - Review workers (Sonnet)

The Decision Matrix

For EVERY task, answer these questions:

1. Can work be parallelized?

  • NO → Do it yourself (sequential dependency)
  • YES → Continue to #2

2. Does it modify code files?

  • NO (research, reading, analysis) → Sub-agents (parallel, no isolation needed)
  • YES → Continue to #3

3. Do the code changes overlap (same files)?

  • YES → Sub-agents for research, YOU implement (avoid merge conflicts)
  • NO (different files/packages) → Agent Teams with worktree isolation

4. Is this a complex multi-domain task?

  • YES → Full swarm: Agent Teams + sub-agents within each team (Pattern D)
  • NO → Single agent with worktree (Pattern B)

Delegation Patterns

Pattern A: Research Swarm (most common)

Launch 3-5 sub-agents in background for research while you implement.

Agent(research-1, background, haiku) → "Find all instances of X in codebase"
Agent(research-2, background, haiku) → "Read competitor docs for pattern Y"
Agent(research-3, background, haiku) → "Check if library Z supports feature W"
YOU → Start implementing based on what you already know

When: Need information, not code changes. Protects your context window.

Pattern B: Worktree Agents (for multi-file features)

Each agent works in an isolated git worktree. Changes merge back.

Agent(frontend, worktree, sonnet) → "Build UI component in packages/web/"
Agent(backend, worktree, sonnet) → "Build API route in packages/web/src/app/api/"
Agent(tests, worktree, sonnet) → "Write tests for the feature"
YOU → Orchestrate, review, merge, resolve conflicts

When: Code changes in non-overlapping files.

Pattern C: Fractal (agents containing sub-agents)

For large features spanning multiple packages.

Agent(infra-team, worktree, sonnet) → {
  This agent internally spawns sub-agents for:
  - Database schema design (haiku)
  - API route scaffolding (sonnet)
  - Type definitions (haiku)
}
Agent(ui-team, worktree, sonnet) → {
  This agent internally spawns sub-agents for:
  - Component research (haiku)
  - Component implementation (sonnet)
  - Visual test (sonnet)
}
YOU → Architecture decisions, final integration, production deploy

When: Features spanning 3+ packages or requiring 5+ agents.

Pattern D: Chairman Directive Swarm (for voice dumps)

Full decomposition of a complex chairman directive.

1. CEO parses directive → extracts EVERY requirement
2. CEO creates TaskList with all tasks + dependencies
3. For each independent workstream:
   a. Launch background research agent (haiku) for context gathering
   b. Wait for research results
   c. Launch implementation agent (worktree, sonnet) with research context
4. CEO monitors via TaskList, integrates results
5. CEO commits stable checkpoint, updates handoff

When: Chairman sends a multi-requirement voice dump.

Pattern E: Grid-Based Recursion (CEO-of-CEOs)

Physical tmux grid nesting. A VP spawns its own agent grid in a separate window, becoming a sub-CEO with its own workers. Enables unlimited parallel compute.

Root CEO (depth 0) → agentgrid 2x3 in window "company"
  ├── VP-Mercury (SUB_CEO=true) → creates window "company-mercury"
  │     └── agentgrid 1x3: Trader, Analyst, Risk
  ├── VP-Saturn (SUB_CEO=true) → creates window "company-saturn"
  │     └── agentgrid 2x2: Designer, Developer, Marketer, QA
  ├── VP-Dashboard (flat worker, no sub-grid)
  └── ANVIL-QA (flat worker, waits for all sub-CEOs)

Each sub-CEO:

  1. Reads mission brief (includes CEO_DEPTH, COMPANY_ID, PARENT_COMPANY_ID)
  2. Creates its own tmux window + agentgrid
  3. Writes sub-missions, injects into its workers
  4. Monitors via CronCreate on its own signal dir
  5. When done: signals PARENT's signal dir

When:

  • 10+ tasks across multiple domains
  • Each domain needs its own research → build → test cycle
  • Chairman says "recursive", "CEO of CEOs", or "sub-grids"
  • Overnight runs where maximizing parallelism matters

Decision: Use Pattern E when you'd naturally say "this VP is really a CEO of its own team."

See .claude/rules/recursive-grid.md for the full protocol.

Model Routing Per Role

RoleModelCost/MTokWhy
CEO (orchestrator)Opus$15/$75Delegation decisions need deep reasoning
VP / Team leadSonnet$3/$15Multi-file code changes, integration
Research workerHaiku$0.80/$4Fast, cheap — just reading/searching
Code workerSonnet$3/$15Balanced speed + quality
Review workerSonnet$3/$15Code review, security scan
Architecture workerOpus$15/$75Design trade-offs, deep analysis
Tier 0 (no model)—$0Formatting, linting, git ops, tests

Cross-Terminal Coordination

All terminals share tasks via CLAUDE_CODE_TASK_LIST_ID=energy-main.

  • Use TaskCreate/TaskUpdate across terminals
  • Tasks tagged with terminal context (earning, content, spark, platform)
  • Check TaskList before starting work — another terminal may have claimed it

Escalation Protocol (3-Tier)

Borrowed from Agent Orchestrator (Composio):

  1. Worker self-heal: Agent retries on failure up to 3x with different approaches
  2. VP mediate: If worker fails, the team lead reviews and redirects
  3. CEO escalate: If VP can't resolve, CEO takes over (or escalates to chairman)

When NOT to Delegate

  • Single-file edits < 20 lines
  • Bug fixes where you already know the cause
  • Configuration changes (.env, package.json)
  • Commits, deploys, git operations
  • Anything requiring YOUR conversation context (user preferences, prior decisions)
  • Architecture decisions — make them yourself, delegate implementation

Anti-Patterns

  • Don't delegate then do the same work yourself (duplicate effort)
  • Don't use worktrees for read-only research (unnecessary overhead)
  • Don't spawn agents for tasks that take <2 minutes solo
  • Don't create teams of 1 (that's just a sub-agent)
  • Don't delegate architecture decisions — make them yourself, delegate implementation
  • Don't let agents run unmonitored >30 min — check progress via TaskList
  • Don't skip the research phase — always gather context before implementation

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.