agentleFS
lehcodelehcode/claudelegate/skills/delegate/SKILL.md

delegate

Skill4 starsChanged 14 days agoMITView on GitHub

Delegate coding or analysis work to another model through OpenCode (Grok, Kimi, GLM, Qwen, DeepSeek, MiMo, MiniMax, GPT… anything `opencode models` lists) while Claude stays the orchestrator. Use when the user says things like "use grok 4.7 via opencode to implement X", "ask kimi via opencode", "delegate this to glm", "get a second opinion from deepseek", "have opencode do it", or asks to run/compare several OpenCode models.

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 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

  • 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, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 68 edited versions we read keep these.

  • 4

    Distinctive

    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. Very specific:

    Write mode passes --agent build because the project default agent may be plan.

    line 38
  2. Distinctive:

    If the user names no model, omit it.

    line 44
  3. Distinctive:

    Read the diff (git diff) for the files it lists.

    line 64
  4. Distinctive:

    Run the tests or build yourself.

    line 65
  5. Distinctive:

    Second opinion: read-only mode with a prompt like "review this diff for bugs: …".

    line 73

“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

Delegating to OpenCode models

From the main thread, delegate through the opencode-worker agent (spawned in the background) or the /opencode <model> -- <task> slash command, which spawns it. The worker is the only caller of the opencode MCP tools. The delegated model has its own tools (read, edit, shell), so it can implement code, not just answer. You stay the orchestrator: you hand over the task, and you review what comes back.

Mechanism

The opencode MCP server runs opencode run in the project and returns the reply, session id, token usage and git changes. The opencode-worker agent calls its delegate tool, verifies the git changes and tests, iterates at most twice with the same session_id, and reports. The main thread never calls delegate or delegate_async: delegate blocks it, async tasks are lost when the MCP server restarts, and a PreToolUse hook denies the call.

MethodWhen to use
opencode-worker agentImplementation, read-only exploration, parallel fan-out
/opencode <model> -- <task>Simple delegation: spawns opencode-worker
MCP toolsCalled by opencode-worker only, never by the main thread

Tools (used by the worker)

ToolUse
list_models (filter?)Find the exact provider/model id.
delegateRun a task and wait for the result.
delegate_async → task_result (wait_s)Long tasks, or several models in parallel. Also task_list, task_cancel.
list_sessionsFind a session_id to continue.

In a plugin install the tools are named like mcp__plugin_claudelegate_opencode__delegate. With a manual install they are mcp__opencode__delegate. The worker's prompt must be a self-contained brief (the model cannot see this conversation); pass auto: false for read-only work, session_id to continue.

Modes

ModeWhenOpenCode flags
write (default)Implement, fix, refactor--agent build --auto
read-onlyReview, question, summary, second opinion--agent plan (no --auto)

Write mode passes --agent build because the project default agent may be plan. --auto approves permissions not explicitly denied; opencode rules set to "deny" are still enforced. In read-only mode, permission requests are rejected rather than approved.

Picking the model

  • Pass what the user said: grok 4.7, kimi k3, xai/grok-4.7. The delegate tool resolves a loose name against opencode models and requires an exact version match. If several models match, it returns an ambiguous error with the candidates and the worker picks the best candidate that fits the instructions (a named provider wins); name the exact provider/model when the choice matters.
  • For a reasoning variant, add #variant, e.g. xai/grok-4.7#high.
  • If the user names no model, omit it. OpenCode then uses its configured default model.

Writing the task

The OpenCode model cannot see this conversation, so the brief must stand on its own. Give:

  1. Goal: what to build or fix.
  2. Constraints: what not to touch. The agent already tells the model not to commit unless the task says so.
  3. Done when: acceptance criteria, e.g. "bun test passes".

Skip pasting file contents and long background; the model looks them up. Run from the project root.

Continuing a session

The agent reports a session id. To give feedback or continue after a timeout, invoke opencode-worker again with that session id and precise feedback.

After it returns: review, don't trust blindly

The worker has already checked the git changes and run the tests; it reports the model used, session id, changed files, its verification and a verdict. Still read the diff.

  1. Read the diff (git diff) for the files it lists.
  2. Run the tests or build yourself.
  3. To fix something, spawn opencode-worker again with the session id and precise feedback.
  4. Tell the user which model did what, and your verdict on it.

Parallel and multi-model patterns

  • Fan out: spawn separate opencode-worker agents for each model or subtask. Parallel tasks that edit files must use separate git worktrees (git worktree add) or non-overlapping files, because they share the directory.
  • Compare: give the same task to 2–3 models in separate worktrees, then diff the results and pick or merge the best one.
  • Second opinion: read-only mode with a prompt like "review this diff for bugs: …".
  • Subagents / workflows: spawn opencode-worker with the model and task in its prompt, e.g. "Use opencode model kimi k3 to add tests for src/foo.ts".

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.