agentleFS
OrionArchitektonOrionArchitekton/orion-skills/skills/delegate/SKILL.md

delegate

Skill2 starsChanged 11 days agoMITView on GitHub

Use when your Claude Code orchestrator should hand a scoped subagent, workflow, or background task to a NON-Anthropic model to keep it off the Anthropic budget - GPT via Codex (ChatGPT subscription), Grok (metered xAI key), or a free local model via Ollama. Triggers - "delegate this to codex/grok/gemma", "run this off-budget", "hand this to a cheaper model", "/delegate". NOT a router-proxy under ANTHROPIC_BASE_URL (that corrupts tool calls); this shells out to each vendor's own headless CLI so tool-calling stays native.

  • Reads credentials

78 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use state, preview and 8 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

  • 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

  • anombyte93Skill

    discover

    Phase 1 of the prd-taskmaster pipeline: brainstorm-driven discovery. Delegates to superpowers:brainstorming in Interactive Mode (one adaptive question at a time), or self-brainstorms in Autonomous Mode when no user is present. Intercepts before the brainstorming chain hands off to writing-plans — this skill owns the exit. Extracts constraints, calibrates scale (Solo / Team / Enterprise), and advances the pipeline to GENERATE.

    Also in 3 projects that use this

  • Microsoft AzureSkill

    skill-authoring

    Write Agent Skills that comply with the agentskills.io specification. WHEN: "create a skill", "new skill", "write a skill", "skill template", "skill structure", "review skill", "skill PR", "skill compliance", "SKILL.md format", "skill frontmatter", "skill best practices". DO NOT USE FOR: general documentation. INVOKES: vally CLI.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 68 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep your Claude model orchestrating.

    line 8
  2. Very specific:

    Call should_delegate(task) (pure fn in scripts/delegate.py) or apply its rule directly:

    line 18
  3. Distinctive:

    Only delegate genuinely separable, well-scoped work.

    line 27
  4. Very specific:

    NEVER emits a sandbox-bypass flag (--dangerously-*, -y, --yolo, ...).

    line 58
  5. Very specific:

    Verify a target is live before trusting it: python3 scripts/delegate.py codex "Reply with exactly: PONG" should return ok:true, …

    line 113

“Common” is measured: kept by at least 6 in 10 of the 68 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 - off-Anthropic subagent delegation

Keep your Claude model orchestrating; push scoped subagent, bulk, or background work to a non-Anthropic model CLI so it runs off the Anthropic budget with that vendor's native tool calling. The mechanism is a headless-CLI subprocess, never an ANTHROPIC_BASE_URL router-proxy: a proxy makes a non-Claude model speak Claude Code's Anthropic-shaped API, and the translation shim corrupts tool calls (empty-string params, fake tool_use, mistranslated server tools, infinite Read loops). Each vendor's own CLI speaks its own protocol natively, so the tool loop stays intact and the work bills that vendor, not your Anthropic allocation.

When to use (the decision)

Call should_delegate(task) (pure fn in scripts/delegate.py) or apply its rule directly:

Task shapeRecommendWhy
off-budget + bulk + cheap-okgemmafree local model via Ollama, zero marginal cost
off-budget + needs X/Grokgrokmetered xAI key, X-search-grounded
off-budget + frontier codingcodexGPT on the ToS-sanctioned ChatGPT subscription
not off-budgetstay-claudekeep it on the orchestrator

Only delegate genuinely separable, well-scoped work.

Terms-of-Service reality (the binding constraint, not the tooling). Reusing a consumer subscription inside a third-party harness is prohibited and enforced at most vendors. Codex on a ChatGPT plan is the one sanctioned subscription path. Grok here uses a metered API key, not a consumer login; the local Ollama lane has no subscription to reuse. Do NOT wire a consumer Gemini, Grok, or Claude subscription through this layer; if you want those models, use their paid API keys.

Usage

D=~/.claude/skills/delegate/scripts/delegate.py
python3 "$D" codex "Refactor foo.py for readability" --dry-run   # inspect argv + env, run nothing
python3 "$D" codex "Summarize the diff in HEAD"                    # real off-budget codex run
# grok + gemma read their config from the environment at call time (keep secrets off the argv):
XAI_API_KEY=xai-...                          python3 "$D" grok "X sentiment on agentic coding"
OLLAMA_HOST=http://<your-ollama-host>:11434  python3 "$D" gemma "cheap bulk summarize"

From Python (fan-out, abstention-safe):

import delegate
delegate.fanout([
    {"target": "codex", "task": "..."},
    {"target": "gemma", "task": "..."},   # runs concurrently; errored lens -> state:"pending", never dropped
])

Security posture (enforced in code, asserted by tests)

  • NEVER emits a sandbox-bypass flag (--dangerously-*, -y, --yolo, ...). Community CLI-bridges commonly bake those in; this layer exists partly to avoid that.
  • Child env is a least-privilege WHITELIST: base keys + ONLY the target's own key; no sibling-provider keys, no GH/Slack/secret-manager/Anthropic tokens.
  • Child CLI selection must be an absolute first PATH hit outside the workspace. Each traversed symlink/junction is checked, and the exact selected launcher is checked again immediately before dispatch; launcher identity is preserved. Unsafe selections raise DelegateError, with no fallback to another CLI. This is workspace path exclusion, not publisher/binary authentication.
  • codex sandbox defaults read-only; --write escalates to workspace-write (never danger-full-access).
  • codex stdin is /dev/null (guards the >=0.120 non-TTY exec deadlock).
  • Rule of Two: a delegate acting on untrusted input must not also hold private access AND unsandboxed/consequential output at once. Keep the sandbox read-only unless you have vetted the input.

Gotchas

  • Compatibility change proposed for the next MAJOR release: relative/empty PATH selections and even intentional workspace-local CLI installs are now denied. System, user, custom and group-writable absolute installations outside the workspace remain accepted; no fixed installation allowlist is used. Workspace means the nearest enclosing .git marker, otherwise cwd. Start a non-Git call at the intended workspace root; nested repos define separate roots. Choose a vetted external installation deliberately; do not bypass denial by pointing an outside symlink back into the workspace. No version is reserved.
  • The OS, caller cwd/marker selection, outside installation writers and launcher contents are trusted. Interpreters, dependencies, inherited PATH and HOME access are unchanged. Hard-link/mount aliases and same-user replacement after the last check are not prevented. Use OS isolation for hostile code. Native Windows and macOS process execution remain unqualified; Linux fixture results are not native platform certification.
  • The helper assignment above remains a deliberate direct-install path. Plugin-only helper resolution is not qualified by this change, and loading grants no execution permission.
  • grok/gemma need their config at call time: an XAI_API_KEY for grok, an OLLAMA_HOST pointed at your endpoint for gemma. Without them the run fails honestly (no silent fallback). A shell HOOK cannot reliably wrap a secret-injection step (it fails open); call this from an interactive session or a timer/service that already has the secret in its environment.
  • codex OAuth tokens are single-use/rotating; a concurrent Codex app-server (e.g. an IDE extension) can invalidate this one (refresh_token_reused 401). codex login status can LIE; trust a real run.
  • gemma uses keep_alive:-1 so a probe does not evict the hot local model.
  • Parallel fan-out: codex app-server launches serialize via a broker; grok/gemma are independent. Reap an orphaned broker process by EXACT PID, never a broad pkill -f.
  • The grok -p/--single flag is load-bearing: a positional prompt opens the interactive TUI and hangs a non-interactive caller.

Boundary (defer to your own setup)

This skill is the DECISION + a uniform 3-target interface + fan-out; it is deliberately not a credential manager or a deploy tool. Secret storage/injection, which host runs Ollama, and which ChatGPT/xAI plan you hold are your environment's concern. Provide XAI_API_KEY and OLLAMA_HOST from wherever you keep them; the skill only ever reads the one key its target needs and never prints it. Adapt the three target CLIs to whichever vendor CLIs you have authenticated locally.

Verify a target is live before trusting it: python3 scripts/delegate.py codex "Reply with exactly: PONG" should return ok:true, off_anthropic:true with an absolute argv0 and a genuine model reply.

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.