delegate-skill
Claude Code skill: Claude orchestrates, big self-contained work goes to Codex, Gemini (agy) or OpenCode in one call
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Badge for your README
Markdown
[](/listings/tanvir3056--delegate-skill)HTML
<a href="/listings/tanvir3056--delegate-skill"><img src="/api/listings/tanvir3056--delegate-skill/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
git clone https://github.com/tanvir3056/delegate-skill ~/delegate-skill && bash ~/delegate-skill/install.sh
Needs Node 20+ and git, on macOS. `install.sh` runs `node bin/delegate.js install` for every Claude account folder it finds (`~/.claude`, each `~/.claude-*`, `$CLAUDE_CONFIG_DIR`); pass folders to pick them yourself: `bash ~/delegate-skill/install.sh ~/.claude-work`. Then log in to at least one Provider CLI (below) and start a new Claude Code session. How it works: https://tanvir3056.github.io/delegate-skill/
Update: `git -C ~/delegate-skill pull && bash ~/delegate-skill/install.sh` (install copies the skill, so re-run it after a pull).
`install` does these in one Claude config dir, idempotently (safe to re-run, e.g. after moving the checkout or updating): 1. copies the skill folder to `skills/delegate/` (`SKILL.md` plus its reference files, checkout path filled in); 2. adds one permission rule, `Bash(DELEGATE_LIVE=1 node <checkout>/bin/delegate.js *)`, so delegating runs without prompts; 3. removes the old SessionStart/SubagentStart hook entry (`inject-rules.js`) from `settings.json` if an earlier version added one (ADR 0005). Sessions that did not invoke the skill carry no delegate rules.
Other settings, hooks and rules in `settings.json` are kept. If `settings.json` is not valid JSON, install stops and changes nothing.
Two config dirs (e.g. two Claude accounts)
Each account has its own config dir. Install into each one:
node bin/delegate.js install --config-dir ~/.claude node bin/delegate.js install --config-dir ~/.some-other-config-dir # or: CLAUDE_CONFIG_DIR=~/.some-other-config-dir node bin/delegate.js install
Start Claude Code afresh afterwards (the skill list loads at session start). To uninstall: delete `<dir>/skills/delegate/`, and the rule from `<dir>/settings.json`.
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
README.md · README · 88 lines
- # delegate-skill
- A Claude Code skill plus a small Node helper (`delegate`). Claude stays the Orchestrator: it plans, briefs, verifies. Well-scoped work goes to other models' CLIs (Codex, Antigravity `agy`, OpenCode) through one command, with Fallback when a model is capped. No third-party packages. Node >= 20, macOS.
- MIT licensed. Design records: `docs/adr/`. Behaviour contracts: `docs/contracts.md`. Vocabulary: `GLOSSARY.md`.
- ## Install
- ```sh
- git clone https://github.com/tanvir3056/delegate-skill ~/delegate-skill && bash ~/delegate-skill/install.sh
- ```
- Needs Node 20+ and git, on macOS. `install.sh` runs `node bin/delegate.js install` for every Claude account folder it finds (`~/.claude`, each `~/.claude-*`, `$CLAUDE_CONFIG_DIR`); pass folders to pick them yourself: `bash ~/delegate-skill/install.sh ~/.claude-work`. Then log in to at least one Provider CLI (below) and start a new Claude Code session. How it works: https://tanvir3056.github.io/delegate-skill/
- Update: `git -C ~/delegate-skill pull && bash ~/delegate-skill/install.sh` (install copies the skill, so re-run it after a pull).
- `install` does these in one Claude config dir, idempotently (safe to re-run, e.g. after moving the checkout or updating):
- 1. copies the skill folder to `skills/delegate/` (`SKILL.md` plus its reference files, checkout path filled in);
- 2. adds one permission rule, `Bash(DELEGATE_LIVE=1 node <checkout>/bin/delegate.js *)`, so delegating runs without prompts;
- 3. removes the old SessionStart/SubagentStart hook entry (`inject-rules.js`) from `settings.json` if an earlier version added one (ADR 0005). Sessions that did not invoke the skill carry no delegate rules.
- Other settings, hooks and rules in `settings.json` are kept. If `settings.json` is not valid JSON, install stops and changes nothing.
- ### Two config dirs (e.g. two Claude accounts)
- Each account has its own config dir. Install into each one:
- ```sh
- node bin/delegate.js install --config-dir ~/.claude
- node bin/delegate.js install --config-dir ~/.some-other-config-dir
- # or: CLAUDE_CONFIG_DIR=~/.some-other-config-dir node bin/delegate.js install
- ```
- Start Claude Code afresh afterwards (the skill list loads at session start). To uninstall: delete `<dir>/skills/delegate/`, and the rule from `<dir>/settings.json`.
- ## Use
- Type `/delegate` once at the start of a Claude Code session. From then on Claude decides per task: small work (under ~100 lines, or needing the live conversation) it does itself; big self-contained work with checkable acceptance (150+ lines or 3+ files) it hands to another model in one call, then verifies. Delegated work needs a git workspace; the worker sees committed state only, so commit first (ADR 0002). By hand:
- ```sh
- DELEGATE_LIVE=1 node bin/delegate.js handoff --kind delegate --task-type code-feature --complexity medium \
- --workspace . --file - <<'EOF'
- Add a --json flag to cli.js; tests in test/cli.test.js must pass
- EOF
- ```
- - stdout: a header line (`delegate: <outcome> | <provider>/<model> | exit <code> = <meaning> | result: <file>`), then the worker's text. Exit 0 done (verify it); 10 no model succeeded (Orchestrator does it); 11 critical stop; 2/3 bad call.
- - `DELEGATE_LIVE=1` is required to start real Provider CLIs; without it they are refused and the helper exits 10 (so tests and probes never reach a login).
- - `--kind consult` asks read-only questions; `--targets "codex:<model>,opencode:<model>" [--fresh]` asks several models in parallel, each answer labelled.
- - `--file brief.txt` (a file instead of stdin) still works and prints one JSON line. `--dry-run` shows the route chain without running anything.
- - Edits from a `delegate` run arrive uncommitted in your workspace; review and commit them yourself.
- - `node bin/delegate.js report` summarises usage per model (token counts are a proxy, not Claude allowance). `overhead` records the context cost of the skill (`docs/overhead.md`).
- ## Providers
- Install and log in to the CLIs you want; the helper only uses what is present:
- | Provider | CLI | Note |
- |---|---|---|
- | `codex` | `codex` | OpenAI models; also the route for desktop-control |
- | `agy` | `agy` | Gemini. Never started when logged out (it would open a browser login) |
- | `opencode` | `opencode` | free and paid models; models on the restricted list in `config/routing.json` run only in public workspaces |
- ```sh
- node bin/delegate.js status # which Providers are usable (no model call)
- node bin/delegate.js status --probe # one tiny real call per usable Provider
- ```
- Configuration files, all local and personal (never commit them). The state dir is `$DELEGATE_STATE_DIR`, else `~/.delegate-skill`:
- - `<state>/config.json`: `{"disabled_providers": ["agy"], "public_workspaces": ["/abs/dir"]}`. Disabled Providers are skipped silently. Restricted models (Chinese-vendor or unknown-origin) run only in workspaces listed under `public_workspaces`, on copies of the files passed with `--files`.
- - `<state>/routing.local.json`: override the shipped Routing table (`config/routing.json`): `{"version":1,"add":[<row>],"remove":[{"provider":"codex"}]}`. Row and field details: `docs/contracts.md`.
- Routing rationale and sources: `docs/research/routing.md`.
- ## Unattended runs
- Everything is non-interactive: worker stdin is closed, each attempt has a hard timeout (`--timeout`, default 900 s), workers run in a throwaway `git worktree`, and a capped or failing model hands over to the next route at once.
- - Quota: the Provider goes into cooldown (until its reset time, else 60 min) and is skipped.
- - Nothing left: exit 10, the Orchestrator does the task. If the Orchestrator itself is out of allowance, pass `--orchestrator-unavailable "<reason>"`: the helper logs a critical stop, shows a macOS notification and exits 11. Skip that task and carry on with others.
- - Log: `<state>/log/handoffs.jsonl`; results: `<state>/results/`.
- - Unattended Claude sessions still need their own permission mode for editing files; this tool only pre-approves the helper command.
- - Never run `delegate` from inside a worker; it refuses (exit 3).
- ## Develop
- `npm test` runs Seam 1 (fake CLIs, temp state, no network). `npm run test:seam2` drives real `claude -p` against the skill and spends Claude allowance. Tests never touch your real Claude config or state dir.
- Pre-commit hook (`.githooks/pre-commit`: rejects sed backup files `*-e`/`*-E`, duplicate-object-key lint on staged JS/JSON; no test run). `npm install` activates it via the `prepare` script; otherwise run `git config core.hooksPath .githooks`.
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.