agentleFS
karanmrnkaranmrn/kstack/skills/delegate-to-model/SKILL.md

delegate-to-model

Skill11 starsChanged 24 days agoMITView on GitHub

Hand a task from the current agent to another model on your subscriptions - Codex CLI, Cursor agent CLI, or any OpenRouter model - and check the result before you use it. Use when you want a second opinion, a different model's strength, a parallel attempt, or to save quota on the current model.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

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

    Check quota before a long run if you have a quota tool.

    line 18
  2. Distinctive:

    Remove secrets, tokens and private data from the handoff.

    line 44
  3. Distinctive:

    Run long jobs in the background and wait for them to exit.

    line 80
  4. Very specific:

    Read result.md in full. Check that it answers the handoff, in the shape you asked for.

    line 86
  5. Distinctive:

    Run the "Done when" check yourself.

    line 88
  6. Very specific:

    Check each factual claim and each file:line against the code.

    line 89
  7. Very specific:

    If the result fails, send one focused follow-up with the failure output (codex exec resume --last, or cursor-agent --resume <chat-id>).

    line 92

≈ “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 to another model

You stay the owner of the task. The other model is a worker. You write the handoff, run the worker, and check its result like code from a stranger.

1. Choose the worker

NeedWorkerWhy
Code change or deep bug hunt in a repoCodex CLI (codex exec)Runs tools and edits files in a sandbox. Has a built-in review command.
Code change with a model Cursor servesCursor agent CLI (cursor-agent -p)Many vendor models behind one login. Has read-only plan and ask modes.
One answer, review or rewrite from a named modelOpenRouterAny listed model through one API key. No file access.

Check quota before a long run if you have a quota tool. Run <cli> --help once when a flag below fails. CLI flags change between versions.

2. Write the handoff

The worker sees only the handoff. Write it to a file, for example handoff.md:

## Goal
<one sentence, and why it matters>

## Context
<repo path, branch, the files that matter, what you already ruled out>

## Task
<the exact work; what is in scope and what is out>

## Constraints
<read-only or allowed to edit; no commits, no pushes, no new dependencies unless stated>

## Done when
<a check the worker can run, e.g. "`npm test -- parser` passes">

## Report
<the shape of the answer: a diff summary, findings with file:line, or a JSON object>

Remove secrets, tokens and private data from the handoff. The text goes to another vendor.

3. Run the worker

Give a write-capable worker its own git worktree, so its edits cannot mix with yours:

git worktree add ../task-codex -b delegate/codex

Codex CLI:

codex exec -C ../task-codex -s workspace-write -m <model> \
  -o result.md - < handoff.md            # edits allowed
codex exec -C <repo> -s read-only -o result.md - < handoff.md   # analysis only
codex exec review                         # review the current repo changes

Cursor agent CLI (agent is the same binary):

cursor-agent --list-models
cursor-agent -p --workspace ../task-cursor --model <model> \
  --output-format text "$(cat handoff.md)" > result.md
cursor-agent -p --mode plan --workspace <repo> "$(cat handoff.md)" > result.md   # read-only

OpenRouter, through the CLI of the openrouter skill. The reply goes to result.md, and tokens and cost go to stderr:

openrouter ask <vendor/model> - < handoff.md > result.md

opencode run -m openrouter/<vendor/model> "$(cat handoff.md)" does the same through OpenCode when it is set up.

Run long jobs in the background and wait for them to exit. Do not poll every few seconds.

4. Check the result

The worker's report is a claim, not evidence.

  1. Read result.md in full. Check that it answers the handoff, in the shape you asked for.
  2. For edits, read the diff yourself: git -C ../task-codex diff. Look for scope creep, deleted tests and weaker checks.
  3. Run the "Done when" check yourself. Run the repo's tests and lint.
  4. Check each factual claim and each file:line against the code.
  5. Take the change into your branch only after these checks pass: cherry-pick or apply the diff, then remove the worker's worktree.

If the result fails, send one focused follow-up with the failure output (codex exec resume --last, or cursor-agent --resume <chat-id>). After two failed rounds, do the task yourself or choose another worker.

Report which model did which part, and what you verified.

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.