agentleFS
zahergzaherg/chorus/skills/delegate/SKILL.md

delegate

Skill0 starsChanged 5 months agoMITView on GitHub

Use only when the user explicitly asks to shell out to external CLI coding agents such as Claude Code, Codex, OpenCode, GitHub Copilot, or Pi Coding Agent for focused sub-tasks or parallel independent work. Do not use for multi-model comparison or debate (use consensus instead).

  • Deletes or force-pushes

97 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use state, ask 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.
  • MicrosoftSkill

    state

    Store and query a Microsoft Managed App's built-in state and file attachments with `ms project state` CLI schema commands and generated TypeScript clients. First, with the user signed in to the CLI, run `ms feature status --name state --json`; if `feature.enabled` is not `true`, recommend an alternative connector or data source.

    Also in 3 projects that use this

  • dubwoahSkill

    ask

    Answer questions about the codebase without generating or modifying any code. Use when the user wants to understand how something works, find where something is defined, or explore the project structure. Invoked with /ask.

    Also in 7 projects that use this

  • jaaxkSkill

    afk

    Toggle AFK (Away From Keyboard) mode. When enabled, a PostToolUse hook sends a summary of every tool (that involves writing to files or changing settings) Claude runs to a dedicated Slack thread so the user can monitor remotely. Toggle on with /afk, toggle off with /afk again.

    Also in 3 projects that use this

  • kv0906Skill

    preview

    Render vault notes as styled HTML and open in browser. Turn markdown docs, decisions, progress reports into readable previews. Use for "/preview docs/project-a/checkout-flow.md", "/preview progress all", "/preview decide auth-approach", or when user wants to see a doc before sharing.

    Also in 3 projects that use this

  • GitHubSkill

    prd

    Generate high-quality Product Requirements Documents (PRDs) for software systems and AI-powered features. Includes executive summaries, user stories, technical specifications, and risk analysis.

    Also in 5 projects that use this

  • nicolasestremSkill

    document

    Create focused documentation for specific components or features

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

46 rules. 0 are common, 28 are distinctive, and 18 are very specific to this project.

  • 0

    Common

    Most of the 84 edited versions we read keep these.

  • 28

    Distinctive

    This author's own choices. Worth a look.

  • 18

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill only when the user explicitly asks to delegate work to a named external CLI coding agent (Claude Code, Codex, OpenCode, …

    line 11
  2. Distinctive:

    Do not use this skill for multi-model comparison, independent evaluation, or structured debate.

    line 12
  3. Distinctive:

    Do not invoke this skill automatically.

    line 16
  4. Distinctive:

    Never try another agent if the one the user asked for did not work or sidetracked.

    line 18
  5. Distinctive:

    Instead, shell out to the requested CLI agent directly.

    line 22
  6. Very specific:

    Verify the requested binary is installed before invoking it by running command -v <agent>.

    line 28
  7. Distinctive:

    Never pass secrets, API keys, or credentials in prompts, CLI flags, environment dumps, or log files.

    line 29
  8. Distinctive:

    After every delegated run inside a repository, inspect the worktree with git status and git diff and report the exit status and any changed …

    line 31
  9. Very specific:

    Check claude --help to confirm supported non-interactive, model, and permission flags on the installed binary.

    line 37
  10. Distinctive:

    When the user requests a specific model, supply it through a variable rather than hardcoding stale model identifiers.

    line 38
  11. Very specific:

    Check codex --help and codex review --help to verify supported flags, sandbox modes, and model options on the installed version.

    line 58
  12. Very specific:

    Use codex exec for non-interactive task execution rather than interactive codex.

    line 59
  13. Distinctive:

    Run Pi from the root of the project that owns the delegated task.

    line 90
  14. Distinctive:

    Make sure to use equivalent commands that match the user's operating system.

    line 94
  15. Distinctive:

    If the user supplied an exact provider-qualified Pi model, use it unchanged.

    line 98
  16. Very specific:

    If the user supplied a provider and a provider-native model separately, normalize them to provider/model-id.

    line 99
  17. Very specific:

    If the user or project already established PI_MODEL, use that exact value.

    line 100
  18. Distinctive:

    Never infer a model from Pi's configured default.

    line 103
  19. Distinctive:

    Never silently select the first fuzzy-search result.

    line 104
  20. Distinctive:

    Never silently switch models after a failure.

    line 105
  21. Distinctive:

    Do not reconstruct model identifiers from memory.

    line 106
  22. Distinctive:

    When the user supplies the provider and provider-native model separately, normalize them before use:

    line 110
  23. Very specific:

    Always use values from the user or from current pi --list-models output.

    line 119
  24. Very specific:

    When the user already supplied an exact provider-qualified model, set PI_MODEL to that exact provider/model-id value.

    line 121
  25. Very specific:

    If the user did not name an exact model and no established PI_MODEL value exists, stop and ask the user to choose from the live list.

    line 135
  26. Distinctive:

    Use the exact thinking level requested by the user.

    line 143
  27. Very specific:

    If the user did not request one and an established PI_THINKING value exists, use it.

    line 144
  28. Distinctive:

    Never silently change a requested thinking level.

    line 147
  29. Very specific:

    Before executing a task with a non-off thinking level, confirm that the selected model reports thinking support in pi --list-models.

    line 154
  30. Very specific:

    If the requested level is unsupported, report the mismatch and ask the user whether to select another model or explicitly use off.

    line 155
  31. Distinctive:

    Never silently downgrade a requested thinking level.

    line 156
  32. Very specific:

    Every one-shot task keeps --print and --no-session.

    line 158
  33. Distinctive:

    Use a persistent session only when the user explicitly requests resumable work.

    line 159
  34. Distinctive:

    Do not add continuation or resume flags to the default examples.

    line 160
  35. Distinctive:

    Use either override only when the user intentionally requests that trust behavior.

    line 210
  36. Distinctive:

    Before running Pi against a provider, the safe readiness check is:

    line 213
  37. Distinctive:

    Run this check only when preparing for an actual Pi provider invocation.

    line 224
  38. Very specific:

    Never run credential-emitting operations during validation, specifically --credentials, pi auth print-api-key, and pi auth …

    line 226
  39. Distinctive:

    Never place credentials in command arguments, prompts, logs, examples, tests, or committed configuration.

    line 227
  40. Distinctive:

    Do not retry the same command automatically.

    line 233
  41. Distinctive:

    Do not retry with another model automatically.

    line 234
  42. Distinctive:

    Do not switch to another harness automatically.

    line 235
  43. Very specific:

    Check opencode --help to verify available model and permission flags on the installed binary.

    line 240
  44. Very specific:

    Check copilot --help to confirm non-interactive prompt and permission flags on the installed binary.

    line 248
  45. Very specific:

    Use -p for non-interactive execution:

    line 249
  46. Very specific:

    Run from the target project root using cd or the agent's working directory flag:

    line 313

“Common” is measured: kept by at least 6 in 10 of the 84 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

Delegate

Activation and Guardrails

Use this skill only when the user explicitly asks to delegate work to a named external CLI coding agent (Claude Code, Codex, OpenCode, GitHub Copilot, or Pi Coding Agent). Do not use this skill for multi-model comparison, independent evaluation, or structured debate. For multi-model debate, use consensus when consensus is available on PATH, or bin/consensus from an installed consensus skill folder after running scripts/install.sh.

<critical> - Do not invoke this skill automatically. - Invoke only when the user explicitly requests external CLI delegation. - Never try another agent if the one the user asked for did not work or sidetracked. </critical>

Chorus has no built-in delegate command. Instead, shell out to the requested CLI agent directly.

Preflight and Postflight Safety Rules

Apply these checks across every delegated CLI agent:

  1. Verify the requested binary is installed before invoking it by running command -v <agent>.
  2. Never pass secrets, API keys, or credentials in prompts, CLI flags, environment dumps, or log files.
  3. Choose explicit read-only versus file-mutating flags that match the user's authorization, and check <agent> --help before passing flags you have not verified on the installed version.
  4. After every delegated run inside a repository, inspect the worktree with git status and git diff and report the exit status and any changed files.

How to Delegate

Claude Code

Check claude --help to confirm supported non-interactive, model, and permission flags on the installed binary. When the user requests a specific model, supply it through a variable rather than hardcoding stale model identifiers.

With a specific prompt:

claude --print "Refactor the authentication module to use async/await instead of callbacks. Files: src/auth.ts, src/auth_test.ts"

With a user-supplied or live-discovered model (replace CLAUDE_MODEL with a current model ID confirmed via claude --help or live discovery):

: "${CLAUDE_MODEL:?Set CLAUDE_MODEL to a live model ID supported by claude}"

claude --print \
  --model "$CLAUDE_MODEL" \
  "Review this pull request for security issues. Focus on: SQL injection, XSS, CSRF. Files: src/api/handlers.ts. Do not modify files."

Codex (OpenAI)

Check codex --help and codex review --help to verify supported flags, sandbox modes, and model options on the installed version. Use codex exec for non-interactive task execution rather than interactive codex.

With a specific prompt:

codex exec "Generate unit tests for src/utils/files.ts covering edge cases: empty strings, unicode, very long inputs"

To review a specific feature or issue:

codex review "Review this pull request for security issues. Focus on: SQL injection, XSS, CSRF. Files: src/api/handlers.ts"

With a user-supplied or live-discovered model and explicit reasoning effort (do not invent model IDs; confirm supported models and -c keys with codex --help):

: "${CODEX_MODEL:?Set CODEX_MODEL to a live model ID supported by codex}"

codex review \
  -m "$CODEX_MODEL" \
  -c model_reasoning_effort=low \
  "Review this pull request for security issues. Focus on: SQL injection, XSS, CSRF. Files: src/api/handlers.ts"

For higher reasoning effort, set -c model_reasoning_effort=high with the same verified CODEX_MODEL.

Pi Coding Agent

For delegated Pi tasks, run Pi non-interactively with --print and always pass explicit model and thinking values. Explicit model and thinking selection is a delegate workflow policy, not a Pi CLI requirement. Run Pi from the root of the project that owns the delegated task. The command examples in this section use POSIX shell syntax, including variable guards and line continuations, and are written for the macOS and zsh environment of this repository. They do not claim native PowerShell compatibility.

Make sure to use equivalent commands that match the user's operating system.

Model selection follows this exact precedence:

  1. If the user supplied an exact provider-qualified Pi model, use it unchanged.
  2. If the user supplied a provider and a provider-native model separately, normalize them to provider/model-id.
  3. If the user or project already established PI_MODEL, use that exact value.
  4. Otherwise run pi --list-models, present the relevant live candidates, and ask the user to choose.

Never infer a model from Pi's configured default. Never silently select the first fuzzy-search result. Never silently switch models after a failure. Do not reconstruct model identifiers from memory.

The provider-native model may itself contain a slash, so provider openrouter plus native model openai/gpt-5.4 becomes openrouter/openai/gpt-5.4.

When the user supplies the provider and provider-native model separately, normalize them before use:

PI_PROVIDER="provider"
PI_PROVIDER_MODEL="model-id"
PI_MODEL="${PI_PROVIDER}/${PI_PROVIDER_MODEL}"

These values are illustrative placeholders. Always use values from the user or from current pi --list-models output.

When the user already supplied an exact provider-qualified model, set PI_MODEL to that exact provider/model-id value.

Discover live models first, then select the exact provider and model pair from the output:

pi --list-models

Narrow the catalog with an optional search term:

pi --list-models gpt-5.4

If the user did not name an exact model and no established PI_MODEL value exists, stop and ask the user to choose from the live list.

The PI_MODEL shell guard in the examples checks presence only. It rejects an unset or empty value, but it cannot prove exact provider qualification or catalog membership. Exact qualification is established by input provenance and the live catalog, never by counting slashes in the identifier.

Thinking-level selection follows this exact precedence:

  1. Use the exact thinking level requested by the user.
  2. If the user did not request one and an established PI_THINKING value exists, use it.
  3. Otherwise use high as the fallback for the implementation and review examples below.

Never silently change a requested thinking level. The examples express this precedence with an explicit variable so no command hardcodes over a user choice:

PI_THINKING="${PI_THINKING:-high}"

Before executing a task with a non-off thinking level, confirm that the selected model reports thinking support in pi --list-models. If the requested level is unsupported, report the mismatch and ask the user whether to select another model or explicitly use off. Never silently downgrade a requested thinking level.

Every one-shot task keeps --print and --no-session. Use a persistent session only when the user explicitly requests resumable work. Do not add continuation or resume flags to the default examples.

Shared input preparation for the task examples:

: "${PI_MODEL:?Set PI_MODEL to an exact provider-qualified model from pi --list-models}"
PI_THINKING="${PI_THINKING:-high}"

Focused implementation delegation

Coding tools stay enabled because the task authorizes changes.

: "${PI_MODEL:?Set PI_MODEL to an exact provider-qualified model from pi --list-models}"
PI_THINKING="${PI_THINKING:-high}"

pi --print \
  --no-session \
  --model "$PI_MODEL" \
  --thinking "$PI_THINKING" \
  "Implement focused tests for src/config.ts. Follow AGENTS.md, run the targeted tests, and report changed files and verification results."

Tool-restricted review delegation

This review uses no mutation-capable tools and no discovered extensions.

: "${PI_MODEL:?Set PI_MODEL to an exact provider-qualified model from pi --list-models}"
PI_THINKING="${PI_THINKING:-high}"

pi --print \
  --no-session \
  --model "$PI_MODEL" \
  --thinking "$PI_THINKING" \
  --no-extensions \
  --tools read,grep,find,ls \
  "Review error handling in src/providers/. Report concrete findings with file references. Do not modify files."

The tool allowlist excludes bash, powershell, edit, and write, and --no-extensions disables discovered extensions. This is a tool restriction, not an operating-system sandbox, and it is not safe execution for untrusted repositories. Untrusted repositories require an external sandbox or container. Inspect the worktree after any Pi run inside a project.

Non-interactive Pi runs do not display a project-trust prompt. Pi applies a saved trust decision or the configured non-interactive fallback. The default commands above omit --approve because it can authorize unreviewed project-local executable resources. The default commands also omit --no-approve because it can suppress intentionally configured project behavior. Use either override only when the user intentionally requests that trust behavior. Context files stay enabled in project task examples, so Pi receives AGENTS.md and/or CLAUDE.md project instructions.

Before running Pi against a provider, the safe readiness check is:

: "${PI_MODEL:?Set PI_MODEL to an exact provider-qualified model from pi --list-models}"

pi auth check \
  --model "$PI_MODEL" \
  --no-refresh \
  --json

Run this check only when preparing for an actual Pi provider invocation. Catalog discovery and static documentation validation do not require it. Never run credential-emitting operations during validation, specifically --credentials, pi auth print-api-key, and pi auth print-bearer-token. Never place credentials in command arguments, prompts, logs, examples, tests, or committed configuration.

On failure, capture the process exit code and preserve relevant stdout and stderr without exposing credentials or unrelated sensitive data. Report the exact harness, the exact model, the exact thinking level, the working directory, and the failed task stage. Report the exact error, or a safely redacted equivalent when the raw error contains secrets. Then stop. Do not retry the same command automatically. Do not retry with another model automatically. Do not switch to another harness automatically. Retry or substitute only after explicit user authorization.

OpenCode

Check opencode --help to verify available model and permission flags on the installed binary.

opencode run "Analyze the error handling patterns in src/providers/ and suggest improvements. Do not modify files."

GitHub Copilot CLI

Check copilot --help to confirm non-interactive prompt and permission flags on the installed binary. Use -p for non-interactive execution:

copilot -p "Explain the consensus algorithm in src/consensus.ts and identify potential race conditions"

Patterns

Parallel delegation (independent tasks)

Parallel runs must either be read-only or target strictly disjoint files so concurrent agents do not overwrite each other's changes. Isolate logs in a temporary directory created with mktemp -d, clean it up with a trap, and capture each child process exit code individually with wait:

TMP_DIR="$(mktemp -d)"
trap 'rm -rf "$TMP_DIR"' EXIT

claude --print "Write tests for src/config.ts only. Do not modify other files." > "$TMP_DIR/config-tests.log" 2>&1 &
PID_A=$!
claude --print "Write tests for src/consensus.ts only. Do not modify other files." > "$TMP_DIR/consensus-tests.log" 2>&1 &
PID_B=$!

STATUS_A=0
wait "$PID_A" || STATUS_A=$?
STATUS_B=0
wait "$PID_B" || STATUS_B=$?

cat "$TMP_DIR/config-tests.log"
cat "$TMP_DIR/consensus-tests.log"
echo "Exit codes: config=$STATUS_A consensus=$STATUS_B"

Delegate + consensus (get agent output, then run consensus)

This pipeline requires jq on PATH. Discover live consensus routes first, run codex exec non-interactively while checking its exit status, and stream the review text through stdin to jq -Rs instead of --arg so large outputs are never exposed in process arguments or truncated by ARG_MAX:

# Discover live routes first and replace the illustrative placeholders below:
consensus list-models --json
ROUTE_A="provider-a/model-a"
ROUTE_B="provider-b/model-b"

# Collect a non-interactive code review from Codex and fail fast on non-zero exit:
REVIEW="$(codex exec "Review src/consensus.ts for correctness and edge cases. Do not modify files.")" || {
  echo "codex exec failed" >&2
  exit 1
}

# Stream $REVIEW via stdin to jq -Rs and pipe the strict request into consensus --stdin-json:
printf '%s' "$REVIEW" | jq -Rs \
  --arg route_a "$ROUTE_A" \
  --arg route_b "$ROUTE_B" \
  '{
    models: [$route_a, $route_b],
    prompt: "Evaluate this code review for accuracy and missed edge cases.",
    findings: .,
    stances: { ($route_a): "for", ($route_b): "against" }
  }' | consensus --stdin-json

Working directory

Most CLI agents operate in the current working directory. Run from the target project root using cd or the agent's working directory flag:

cd /path/to/project && claude --print "Run the test suite and fix any failures"

Notes

  • Each CLI agent (including Pi Coding Agent) must be installed separately and available on PATH.
  • Chorus does not manage or install these agents.
  • For structured multi-model debate, use consensus instead of manual delegation.

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.