agentleFS
julismanjulisman/virtual-worker/skills/delegate-agent/SKILL.md

delegate-agent

Skill0 starsChanged 29 days agoApache-2.0View on GitHub

Spawn, discover, monitor, steer, cancel, and resume durable background CLI coding agents through a backend-neutral interface. Use when delegating repository work to Codex today or when implementing another backend such as Claude Code, while retaining model selection, progress inspection, mailbox steering, concurrent isolated runs, and follow-up turns without a daemon.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 0 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use scripts/agent.py. Both the Codex and Claude Code backends are implemented.

    line 8
  2. Very specific:

    Never assume a backend is installed or usable.

    line 18
  3. Very specific:

    Every spawn belongs to a group.

    line 28
  4. Very specific:

    Prefer supervise <group-id> --after <cursor> --timeout 30 for multiple workers.

    line 32
  5. Very specific:

    Use --until action,failed,warning,complete to select wake conditions.

    line 33
  6. Very specific:

    Use group status <group-id> for aggregate state and group list for discovery.

    line 35
  7. Very specific:

    Treat next_cursor as durable caller state.

    line 47
  8. Very specific:

    Add --interrupt only for an urgent direction change.

    line 62
  9. Very specific:

    Use separate worktrees for parallel write-capable agents.

    line 68

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

Delegate Agent

Use scripts/agent.py. Both the Codex and Claude Code backends are implemented; each reports usable: true when its CLI is installed. Always confirm with backends before spawning.

Discover

python3 <skill-dir>/scripts/agent.py backends
python3 <skill-dir>/scripts/agent.py backend codex
python3 <skill-dir>/scripts/agent.py models --backend codex

Never assume a backend is installed or usable. Pass --backend explicitly when spawning.

Spawn

python3 <skill-dir>/scripts/agent.py spawn --backend codex --cwd <repo> --role <role> --complexity <level> --prompt "<task>"

Retain the returned agent_id. Use workspace-write for implementation and read-only for inspection. Full access requires explicit authorization and DELEGATE_AGENT_ALLOW_DANGER=1.

Every spawn belongs to a group. Omit --group to create one automatically, or pass a group returned by group create --name "<workflow>". Use the same group for related Codex and Claude workers. Workers retain private mailboxes; the group stores aggregate events and coordinator routing metadata.

Supervise

  • Prefer supervise <group-id> --after <cursor> --timeout 30 for multiple workers. By default it wakes for parent action, worker failure/interruption, supervision warnings, or group completion; inspect reason, timed_out, truncated, and next_cursor.
  • Use --until action,failed,warning,complete to select wake conditions. Use --follow to wait without a timeout when the caller can keep one shell command attached. When truncated, call again with the returned cursor so no events are skipped.
  • Inspect action_required and answer questions with group respond <group-id> <request-id> "<answer>".
  • Use group status <group-id> for aggregate state and group list for discovery.
  • wait <agent-id> --timeout 30
  • events <agent-id> --after <cursor>
  • status <agent-id>
  • respond <agent-id> <request-id> "<answer>" when pending_request is present

A group is complete only when every worker is terminal and no coordinator response is pending. Direct worker-to-worker communication is intentionally unsupported; the caller forwards findings using steer.

Message semantics

  • input.requested is worker-to-coordinator communication that requires a response. It wakes supervision with reason: action_required; read the request from coordinator_inbox, then use group respond.
  • agent.message is informational output, and progress.reported is a milestone. Both appear in events but do not wake supervision by themselves. A final agent.message normally arrives with worker completion, which wakes with reason: complete.
  • Treat next_cursor as durable caller state. Start with --after 0, process every returned event, save next_cursor, and pass it to the next call. If truncated: true, call again immediately with that cursor before waiting for new activity.

Typical coordinator loop:

supervise GROUP --after CURSOR --follow
process events and save next_cursor
if reason == action_required: group respond GROUP REQUEST_ID ANSWER
if reason is complete or worker_failed: inspect result/status
otherwise: supervise again using the saved cursor

Steer and Continue

  • steer <agent-id> "<instruction>" queues checkpoint steering.
  • Add --interrupt only for an urgent direction change.
  • Steering a terminal worker returns delivery: next_resume; the instruction is durable but will not run until resume. Interrupting a terminal worker is rejected.
  • resume <agent-id> --prompt "<follow-up>" continues the originating backend session.
  • cancel <agent-id> stops active work.
  • result <agent-id> returns the final captured message.

Use separate worktrees for parallel write-capable agents. Load references/protocol.md when implementing a new backend or diagnosing lifecycle behavior.

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.