Delegation

From ai-ecoverse/slicc · View interactive version

Delegation is an AI agent skill from the GitHub repository ai-ecoverse/slicc. Use this when deciding whether to do work yourself or delegate to a scoop, when fanning out parallel scoops, or when picking models for sub-agents. Covers scoop lifecycle (when to drop), parallel orchestration (`scoop_mute`, `scoop_unmute`, `scoop_wait`), one-shot ephemeral sub-agents via the `agent

How to use this skill

Skill file

Delegation

Scoops do the heavy lifting; the cone orchestrates and synthesizes. This skill is about choosing how to delegate, not about administering scoops.

When to delegate

Default to delegation. Parallel scoops almost always finish faster, and the cone's job is synthesis.

Delegate when:

Do it yourself when:

Brief for authority, not for execution

The most common delegation failure is the cone doing too much pre-work before delegating. The cone researches the topic, makes the design decisions, picks the approach, and then hands the scoop a pre-cooked plan to type out. This is bad on three axes:

Heuristic: if the cone reads files, runs commands, or makes decisions before delegating, that should have been part of the scoop's brief. Hand the scoop the question, the constraints, and the access — let it decide.

| Bad (cone over-prepares) | Good (scoop decides) |

| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |

| Cone reads 5 files, picks an approach, tells scoop "implement approach X in file Y." | Scoop is told "the user wants Z; the relevant code is under /workspace/src/. Pick an approach and implement it." |

| Cone scrapes 3 docs, summarizes, then asks scoop to "write a comparison based on this summary." | Scoop is told "compare libraries A, B, C for this use case. Their docs are at <urls>. Decide and write the comparison." |

| Cone debugs a failure, isolates the bug, then asks scoop to "fix the off-by-one in line 42." | Scoop is told "this command fails with <output>. Find and fix the bug." (Even better: a one-shot agent for cheap, deterministic bug-fixes.) |

Two carve-outs where pre-work IS the cone's job:

  1. Routing decisions. Picking which scoop gets which slice of a fan-out is orchestration, not pre-cooking.
  2. Synthesis after the fact. Reading scoop outputs to combine them is the cone's whole point.

If a scoop comes back with a wrong call, drop it and re-spawn with a better brief — don't feed a correction. Corrections compound the autonomy problem.

Scoop lifecycle

Drop scoops when done — but NEVER drop a scoop that owns a sprinkle.

Drop when:

Never drop when:

Three delegation primitives

| Primitive | Conversation | Sprinkle ownership | Auto-cleanup | When to use |

| ---------------------------- | ------------------------ | ------------------ | ----------------- | ----------------------------------------------------------- |

| scoop_scoop + feed_scoop | Persistent (multi-turn) | Yes | No (drop_scoop) | Long-lived work; sprinkle owners; conversational follow-ups |

| scoop_wait / scoop_mute | Persistent (multi-turn) | Yes | No | Parallel fan-out where you want one synthesis turn |

| agent (shell command) | One-shot (single prompt) | No | Yes (on exit) | Cheap, predictable, composable; no cone follow-up needed |

`agent` — one-shot ephemeral sub-agents

agent is a shell command that spawns a one-shot sub-scoop, feeds it a prompt, blocks until the agent loop completes, and prints the final message on stdout. Runs from any bash context (terminal, feed_scoop prompt, .jsh script, dip lick handler, sprinkle button handler).

agent <cwd> <allowed-commands> <prompt> [--model <id>] [--workspace-mode <mode>] [--read-only <paths>] [--background-after <s>] [--image <path>]... [--no-escalate] [--minimal] [--system-prompt <text>] [--tools auto|full|output] [--session <id>] [--resume <id>] [--usage]

Identical one-shots share a cache-stable system prompt: the scratch folder is named in the user message, and the seeded per-scoop memory file (folder and creation time) stays out of the prefix. cost --json lists each assistant turn under calls.

Critical property: no handoff. Ephemeral scoops do NOT notify the cone on completion. Running agent from a non-cone shell does not trigger an unsolicited cone turn. The caller gets the result on stdout, nothing else. This makes agent the right choice for cheap, predictable interactions inside dips and sprinkles where you don't want the cone or owning scoop woken up.

# Parallel, collected to one file. No cone turns spawned.
for url in site-a site-b site-c; do
  agent "$TMPDIR" "curl,jq" "Fetch https://$url/api, return the top-level title field." >> "$TMPDIR/titles.txt" &
done
wait

# Focused refactor with a restricted allow-list.
agent /workspace/src "rg,sed,node" "Rename getCwd to getCurrentWorkingDirectory across *.ts"

# Cheap one-shot from a faster model.
agent . '*' 'Summarize the README in one sentence.' --model claude-haiku-4-5

For dip and sprinkle interaction patterns built on agent, see /workspace/skills/dips/SKILL.md and /workspace/skills/sprinkles/SKILL.md.

Shaping the scoop's sandbox: `workspaceMode`, `visiblePaths`, `writablePaths`, `allowedCommands`

scoop_scoop accepts a named isolation mode plus three sandbox-shaping parameters. They are how you give a scoop authority — by widening or narrowing what it can read, write, and run. A scoop that can't reach the files it needs has no autonomy; pre-cooking the brief is what you do to compensate. Get the sandbox right and the brief gets shorter.

A rarely used argument — canCreateChildren: true — is an explicit nested-delegation grant. The new scoop may then scoop_scoop / feed_scoop / drop_scoop its own children. Omit it (the default) so the scoop stays a leaf. A scoop that was not itself granted this cannot pass it on.

| Param | What it controls | Default | Pure replace? |

| ------------------- | --------------------------------------- | -------------------------------------------------------------------------------------- | ------------- |

| workspaceMode | Sharing policy for the parent workspace | "shared-readonly" (today's scoop). "private" isolates. | Yes |

| visiblePaths | Read-only VFS paths the scoop can SEE | shared-readonly: ["/workspace/"]; private: [] | Yes |

| writablePaths | VFS paths the scoop can READ AND WRITE | shared-readonly: ["/scoops/<folder>/", "/shared/"]; private: ["/scoops/<folder>/"] | Yes |

| allowedCommands | Shell command allow-list | unrestricted (every built-in + .jsh) | Yes |

| canCreateChildren | Nested-delegation grant | false (leaf scoop) | Yes |

"Pure replace" means what you set is what you get — the value isn't merged with the default. Pass [] to drop it entirely. Trailing slashes recommended on path entries (e.g. /shared/data/).

Subtleties:

How to choose

Ask three questions, in order:

  1. What does the scoop need to read? Files it must consume — source tree, docs, mounted data — go in visiblePaths. Default /workspace/ is fine for most "do something in the project" briefs. Add specific paths (/shared/data/, /mnt/da/) for narrower scopes.
  2. What is it allowed to change? Output dirs, the file it's editing, the sprinkle path it owns. Default writable scratch (/scoops/<folder>/) plus /shared/ is fine for scoops producing artifacts. Tighten this when the scoop should not modify production code — e.g. a research scoop with writablePaths: ["/scoops/<folder>/"] only.
  3. What commands does it need? Default unrestricted is right when the scoop will figure out its own toolchain. Tighten only when narrowing to a known set of tools improves reliability or safety — e.g. a scraper with ["curl","jq"], or a refactor scoop with ["rg","sed","node"].

Patterns

# Default sandbox (shared-readonly): full project, own scratch dir, all commands.
# Right for most "do this in the project" briefs.
scoop_scoop({ name: "fix-bug", prompt: "..." })

# Isolated sandbox. Cannot see the parent workspace or mounts.
scoop_scoop({ name: "scratch-only", workspaceMode: "private", prompt: "..." })

# Read-only research scoop. Can read everything, can't change anything,
# can use whatever commands it needs to investigate.
scoop_scoop({
  name: "auth-research",
  visiblePaths: ["/workspace/", "/shared/"],
  writablePaths: ["/scoops/auth-research/"],
  prompt: "Map the auth flow across the codebase and write findings to /scoops/auth-research/notes.md."
})

# Sprinkle-owning scoop. Needs write access to its sprinkle path.
scoop_scoop({
  name: "giro-winners",
  writablePaths: ["/scoops/giro-winners/", "/shared/sprinkles/giro-winners/"],
  prompt: "..."
})

# Tight scraper. Only sees public docs, only runs network/json tools,
# writes to its own scratch.
scoop_scoop({
  name: "scraper",
  visiblePaths: [],
  writablePaths: ["/scoops/scraper/"],
  allowedCommands: ["curl", "jq", "rg"],
  prompt: "Fetch <urls>, extract the price field from each, write a CSV to /scoops/scraper/out.csv."
})

# Mount-only scoop. Sees just the DA mount, can write back to it.
# Under shared-readonly, mounts stay readable even with visiblePaths: [].
# Under private, name the mount in writablePaths (or visiblePaths) or it is hidden.
scoop_scoop({
  name: "da-editor",
  writablePaths: ["/mnt/da/", "/scoops/da-editor/"],
  prompt: "Edit /mnt/da/index.html to ..."
})

Don't

`background_after` — bounding a scoop's slow commands

scoop_scoop({ background_after: <seconds> }) sets how long that scoop's bash

tool waits for a command before detaching it and continuing the turn (default

600). This is a resilience knob, not a sandbox one: a scoop's turn cannot be

cancelled by anyone, so a command that never returns would hang the scoop (and,

for a blocking agent call, its caller) indefinitely. When a detached command

finishes, that scoop receives a Background Command lick with the exit code, a

preview, and the path to the full output.

# A scoop whose commands must never stall it for more than a minute.
scoop_scoop({ name: "flaky-net", background_after: 60, allowedCommands: ["curl", "jq"], prompt: "..." })

The scoop can also override the budget per call (bash({ command, background_after, timeout })). Each run is a real pid: ps lists a detached job and kill <pid> stops it, so timeout is a kill rather than just a detach.

Filesystem work limits

Scoop shell commands that use the upstream limits stop at 100,000 traversal entries,

256 levels, 32 MiB input, or 64 MiB of tracked live buffers. Split large trees or

inputs across calls when a command reports a limit. Environment variables cannot

raise these limits. They are not an OPFS quota and do not cover custom tar,

unzip, JavaScript, Python, Git, or browser command implementations. Existing

timeout and background_after controls still apply independently.

Parallel orchestration: `scoop_mute` / `scoop_unmute` / `scoop_wait`

By default, every non-ephemeral scoop completion fires a scoop-notify event that wakes the cone for a fresh turn. Fanning out N scoops in parallel produces N extra cone turns whose only job is to acknowledge "scoop X finished" — expensive in tokens, disruptive to orchestration.

These three cone-only tools collapse the fan-out into a single follow-up turn:

When to use which

Every scoop name you pass to feed_scoop, drop_scoop, scoop_mute, scoop_unmute or scoop_wait is resolved against what list_scoops shows you. Another cone's identically named scoop is never matched by a bare name; the call errors instead (#2360).

If you are the LEADING cone, list_scoops also shows scoops you do not own, tagged [INHERITED] (their owning cone is gone) or [FOREIGN: <cone>] (another cone owns them). You can feed, wait on, mute and drop those — but only by passing cross_cone: true in the same call. Omitting it is an error, not a no-op, so you never touch another cone's work by accident. Two things to know before you do: a cross-cone feed_scoop sends its completion notice to the scoop's OWN owner, so use scoop_wait ({ …, cross_cone: true }) if you need the result yourself; and a batch call refuses the whole batch when any listed scoop needs the flag.

Examples

# Fan-out + synthesize:
feed_scoop({ scoop_name: "writer-a", prompt: "Draft intro" })
feed_scoop({ scoop_name: "writer-b", prompt: "Draft outro" })
scoop_wait({ scoop_names: ["writer-a", "writer-b"], timeout_ms: 600000 })
# Returns immediately. Cone keeps working. When both finish (or 10 min), a single
# `scoop-wait` lick wakes the cone with both summaries; the next turn synthesizes.

# Background, poll non-blockingly:
scoop_mute({ scoop_names: ["scraper"] })
feed_scoop({ scoop_name: "scraper", prompt: "Collect URLs from the sitemap" })
# ... do other work ...
scoop_unmute({ scoop_names: ["scraper"] })
# Tool result has the stashed summary or "No stashed completions".

Liveness: a quiet fan-out is not a finished fan-out

"Files look stable and the scoops are still processing" does NOT mean the work

is done or progressing. A common stall mode: one or more scoops are blocked on

a pending approval (sudo_request) that never reached you, and the whole

fan-out sits idle while you wait for a scoop-wait lick that can't arrive.

When a fan-out goes quiet — no completions, no file changes, no progress

messages — run list_sudo_requests before concluding anything. Resolve or

deny each pending request, then keep waiting. Only treat a fan-out as

complete when every scoop has actually reported completion (via scoop_wait

lick or scoop_unmute summaries), not because output files stopped changing.

When you deny one, pass reason to lick_dismiss. The scoop sees the

subject of its own request and your verdict; without a reason it cannot tell a

refusal from a misunderstanding, so it retries the same thing or invents a

workaround. Say what would make it acceptable, if anything would.

Notes

Inspecting delegation cost

Run cost to inspect spend for the cone and currently live scoops. The table labels each row's source, and --json returns the same live-only scope for scripts as {"budget": <window|null>, "scoops": [ ... ]} — read the rows from .scoops. Each row's calls array is one entry per assistant turn (input, output, cacheRead, cacheWrite, cost), including folded agent children, so a one-decision call and a resumed session are visible per turn. The Model column (JSON model) is the model that unit is running now — its provider-qualified pin, the id half of models' "Currently using" line (a provider-less legacy pin yields to the latest turn when they differ) — not whichever model took the most turns. JSON models lists each distinct model once: a bare id and a region- or version-qualified id of the same model are one entry (a suffixed variant such as -fast is not), and the entry for the model in use now keeps that current spelling. Each JSON row also carries escalations: { asked, allowed, denied } — the sudo requests that unit raised (folded agent children included); allowed > 0 means the unit leaned on an approval.

On a provider billing against a rolling allowance (rather than per token), cost leads with that budget: percent USED of the window and when it resets. That number, not the dollar total, is what says whether long runs will finish — the allowance is shared, so it can be most of the way gone before this session has cost a cent.

Use cost --all only when you need the historical picture: it adds dropped scoops from the current runtime and frozen sessions recorded in /sessions/index.json. Combine it with --json for structured historical output. Legacy frozen sessions that predate cost persistence are retained with unknown cost rather than reported as zero.

Model selection for scoops

Always run models to verify available models before specifying one. Model availability depends on the configured provider and API key. model accepts an exact id, a shorthand (haiku, sonnet, claude-haiku-4-5), or the provider:model form models prints (openrouter:openai/gpt-5.6-terra-pro). A bare id resolves against the selected provider first, then against any other configured provider that offers it; matching several is an error listing the qualified ids. The scoop runs on the provider the model resolved from. An id that cannot be resolved is rejected outright — it never silently falls back to the cone's model. Cross-provider models also need an /etc/models allow entry (see Model access policy).

Use models --json to compare. Intelligence, speed, and cost are independent dimensions:

# 1. Verify available models.
models

# 2. Create scoops with verified IDs.
scoop_scoop({ name: "fix-typos", model: "claude-haiku-4-5", prompt: "Fix all typos in /workspace/docs/" })
scoop_scoop({ name: "architect", model: "claude-opus-4-6", prompt: "Design the new plugin system..." })

Error handling: scoops retry up to 3 times with exponential backoff for transient errors (rate limits, server errors). Non-retryable errors (invalid model, auth failures) fail immediately and notify the cone, bypassing any scoop_mute settings.

Browser tabs

Browser-tab handling rules (track your IDs, never close tabs you didn't open, handle "tab not found" gracefully) live in /workspace/skills/playwright-cli/SKILL.md under "Multi-Agent Tab Behavior". Read that skill before delegating browser work.

Browser-driving scoops: one tab per scoop

All scoops share ONE browser, but playwright-cli locks per tab: commands

on different tabs run in parallel, and commands on the same tab serialize. One

scoop's slow or hung navigation stalls only its own tab. Fan-out across tabs

genuinely multiplies browser throughput.

for correctness.** Browser scoops fan out like any other work, and commands

on distinct tabs really do run side by side.

hand it to one scoop rather than splitting it.

detaches every sibling's commands past background_after.

lock wait + queue depth, and whether the wait was on this tab or

bridge-wide), that is back-off guidance: instruct the scoop to stagger or

move to its own tab, never to re-run the command — it already ran; it was

just slow to get the lock. A bridge-wide wait points at the few genuinely

global operations (tab-select, --foreground, attaching to a tab), not at

your tab.

freely, as before.

Model access policy

/etc/models decides which provider:model combinations you may spawn against. It

is keyed by the selected provider:

[adobe]              # while `adobe` is selected…
openrouter:*         # …any openrouter model may be targeted
-adobe:claude-opus-5 # …but never adobe's own Opus 5

boundary: the user may keep separate work and personal accounts.

is not automatically one you may spawn against; the rejection names the exact

line to add.

Do not edit /etc/models to unblock yourself — the write requires a human approval

(Write /etc/models in /etc/sudoers). Ask the user instead, quoting the line.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.