peon-poke
Skill2 starsChanged 4 months agoMITView on GitHub
Farm implementation work out to external CLI agents (Codex, Grok, Gemini, Antigravity) in isolated git worktrees, then review and merge. Trigger phrases: 'peon-poke', 'dispatch a peon', 'farm this out', 'send this task to codex/grok/gemini/agy', 'have codex build', 'get grok to implement', 'gemini can build this', 'poke the peon'. Claude is the foreman: dispatches, reviews, pokes with feedback, merges.
In this repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- plan-checkSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
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
- Very specific: line 11
All mechanics live in the peon script — never hand-roll worktrees or provider CLI calls.
- Distinctive: line 34
No runnable verify command in the repo, or style/architecture is the point of the task — and the final diff is still clearly cheaper to …
≈ “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.
Files
Peon Poke — Farm Implementation Work to External CLI Agents
/plan-check pulls opinions in; /peon-poke pushes labor out. An external agent (a "peon") does an implementation chore in an isolated git worktree; Claude — the foreman — reviews the work and merges it or sends it back. Nothing reaches the real working tree without review and an explicit merge.
All mechanics live in the peon script — never hand-roll worktrees or provider CLI calls. If command -v peon fails, tell the user to install it (README of ytubecoder/codex-in-claude) and stop.
Commands
| Command | Does |
peon dispatch <codex|grok|gemini|agy> "<task>" [--repo DIR] [--base REF] [--slug NAME] [--force] [--allow "glob[,glob...]"] [--verify "cmd"] | Create worktree + peon/<slug> branch, run the provider inside it. Synchronous — background it to keep working. Fails loudly if the peon breaks contract (no commits / no report / dirty tree), preserving the worktree. --allow/--verify record the acceptance contract (file-scope allowlist + verify command) that check executes and merge enforces. |
peon list [--repo DIR] | Active peons, report status, orphan detection |
peon report <slug> | PEON_REPORT.md + commits + diffstat vs base + provider-self-reported token usage (codex/agy; n/a for grok/gemini) (+ dirty-tree warning). Usage is observability only — never quote it as "savings"; the counterfactual is unmeasurable. |
peon diff <slug> [--stat|--files] | Diff vs base. --stat/--files for black-box review (never print the full diff you don't intend to read); bare = full diff for classic review |
peon check <slug> [--allow ...] [--verify ...] | Mechanical acceptance gates, foreman-side: contract + allowlist scope + verify command run in the worktree (result recorded against the branch tip; a later poke invalidates it). Overrides are one-off when a contract was recorded at dispatch; when none was, they late-declare the contract (persisted, merge-enforced). |
peon adopt <slug> [-m "msg"] | Foreman-commits work a sandbox-blocked provider left uncommitted (work + PEON_REPORT.md on disk, dispatch/poke exited 3). Refuses a clean worktree or a missing report. Adoption is mechanics, not acceptance — review still decides the merge. |
peon poke <slug> "<feedback>" | Resume the same provider session for revisions; fails loudly on a no-op round |
peon merge <slug> [--into BRANCH] [--unchecked] | After review: merge, strip the report, clean up. Refuses out-of-scope files and failed/stale/missing verify when a contract was recorded; --unchecked bypasses loudly. --into only asserts BRANCH is already checked out — peon never switches your branch. |
peon scrap <slug> | Discard the work, remove worktree + branch + metadata |
Slugs are globally unique across repos. Exit codes: 1 = usage/environment/provider error; 3 = peon contract violation with the worktree preserved. Grok approval strategy is GROK_APPROVE (mode:<m> or always) — but expect grok dispatches to exit 3 even on success: grok's sandbox cannot write a linked worktree's git dir (it lives under the main repo's .git/worktrees/), so the peon leaves work + report on disk uncommitted. That is the healthy grok path, not a crash: review, peon adopt <slug>, continue. The session persists before the gate, so pokes still work — and each poke round repeats the exit-3 → adopt pattern. Gemini peons run --approval-mode yolo (required for headless commits) and resume as --resume latest scoped to the worktree — never run your own gemini session inside a peon worktree, or the poke will resume the wrong session. agy (Antigravity) is the provider for Google AI Pro/Ultra subscriptions — gemini-cli stopped serving consumer accounts on 2026-06-18; when the user says "gemini" for labor and only agy works on this machine, dispatch agy. State (worktrees, logs, metadata) lives under ~/.peon/ by default, overridable via PEON_HOME.
Workflow
- Scope the task. Peons execute; they don't design. Good: a feature slice, a refactor, tests, docs — one well-defined chore with clear done-criteria. If the task is ambiguous, tighten it (or brainstorm with the user) before dispatch. Include acceptance criteria and relevant file paths in the task text.
Pick the review mode BEFORE dispatch — it changes how you dispatch. Ask in order, first hit wins: 0. Would you read the whole diff anyway (small function, one-file tweak)? → Don't dispatch. Do it in the main thread. Delegation must be net token-SAVING for the orchestrator — on a small chore, brief + report + full-diff read costs more than writing the change yourself. A peon saves provider-side labor; it must never increase orchestrator-side reading.
- No runnable verify command in the repo, or style/architecture is the point of the task — and the final diff is still clearly cheaper to READ than to produce (bulk mechanical sweep, exploration-heavy chore whose dead ends burn the provider's tokens, not yours)? → Classic.
- Auth, billing, security, migrations, or data-loss blast radius? → Test-gated.
- Writing a spec would be cheaper than reading the diff (rule of thumb: expected change spans >5 files or >~300 lines)? → Black-box.
- Otherwise → Spot.
In doubt between two tiers, take the one with MORE verification, not more diff-reading. What each means:
- Black-box acceptance (default for spec-driven, multi-file work in a repo with a runnable test suite): write a self-contained spec (all design decisions pre-made, mandated tests with names+assertions, file allowlist, DoD), commit it, then dispatch with
--allowand--verifyso the contract is recorded. Full method:docs/BLACKBOX-ACCEPTANCE.mdin the codex-in-claude repo. - Spot review (mid-size self-tested chores — too big to read 1:1, too small to spec): brief the peon as a self-tested work unit — "add the mandated tests, run them plus the full suite, paste BOTH actual outputs into PEON_REPORT.md". Dispatch with
--verify(or late-declare it at check time). You will read the diffstat and only the load-bearing hunks, never the full diff. See the Spot review variant indocs/BLACKBOX-ACCEPTANCE.md. - Test-gated dispatch (high-risk escalation of black-box: auth, billing, migrations — where even an audited peon-authored suite isn't enough): YOU author the tests in the orchestration thread, commit them, and run the verify once to prove them red on base. Then dispatch with
--verifypointing at them and an--allowthat EXCLUDES the test paths — any peon edit to a test file is a scope violation, i.e. the tests are locked read-only with no extra tooling. Highest orchestrator up-front cost (you write tests, not just read them) — never the default — but it is the treatment that saves the most tokens per round after that: the suite is authored once, gates every poke round for free, and the implementation is never read. - Classic full-diff review (suite-less repos or style-is-the-point tasks, and ONLY when reading the final diff beats producing it): dispatch with the criteria in the task text; you will read the whole diff. If that read wouldn't be clearly cheaper than writing the change, step 0 already kept the task in the main thread — never dispatch a peon just to re-read everything it did.
- Dispatch. One peon per task. Parallel peons = different tasks (never the same task to two providers — that's plan-check's council, not labor). Provider: user's choice if stated, else either. Dirty repo? Ask the user before
--force— dispatch branches from the last commit, so uncommitted work is invisible to the peon. While a black-box peon works, pre-author your independent probes — the wait is free. Dispatch is synchronous (minutes); if you background it through an orchestrating harness, know the harness can kill the wrapper — and the provider child dies with it (two codex dispatches died this way mid-task, live 2026-08-03). From such a harness, detach instead:nohup <dispatch-script> &with a.donemarker touched on exit, and watch the marker, not the wrapper. A killed dispatch leaves a commit-less worktree —peon scrapand re-dispatch. - Review.
- Black-box:
peon report <slug>→peon check <slug>(contract + scope + foreman-run verify; never trust the report's pasted test output) →peon diff <slug> --files→ read ONLY the test files against the spec's mandated list (really asserting, no tautologies, no test-gaming) → run your independent probes in the worktree. Do NOT read the implementation diff — that's the token sink this mode exists to avoid. - Spot:
peon report <slug>(pasted outputs are triage, never the gate) →peon check <slug>(the foreman-run verify IS the gate) →peon diff <slug> --stat→ read only the hunks where a defect would slip past the verify suite: interfaces, error paths, anything security- or data-touching. If the diffstat surprises you — unexpected files, outsized churn — escalate to a stronger treatment instead of squinting harder. - Classic:
peon report <slug>, thenpeon diff <slug>. Judge correctness, conventions, tests, scope-creep against your conversation context — you know things the peon does not. Then eitherpeon poke <slug> "<specific feedback>"(repeatable; re-runcheckafter — a poke invalidates the recorded verify) orpeon merge <slug>.
- Black-box:
- Report to the user. Summarize what the peon did, your review verdict (which mode, which gates), and what you merged or why you poked/scrapped.
Rules
- Every merge gets exactly one review treatment: the full-diff read (classic), the complete black-box gate set (check + test audit + probes; test-gated is this with foreman-authored tests), or the spot set (foreman-run verify + diffstat + load-bearing hunks). Never none. Draft-until-reviewed is the whole point;
mergemechanically enforces recorded scope/verify gates, and--uncheckedis for deliberate, stated overrides only. - Record
--verifyat dispatch whenever the repo has a runnable suite, whatever treatment you picked — it costs nothing, andmergethen mechanically refuses failed, stale, or never-run verifies. A verify-less dispatch into a repo with tests needs a stated reason. - Evidence beats claims. Everything the peon writes — report prose, pasted test output, "all green" — is generator-class self-reporting and advisory only. The gates that decide (contract, scope, verify) are computed foreman-side from git facts and foreman-run commands. Never chase a peon-reported test failure before reproducing it with
peon check— forced-color env leakage alone has faked failures. - Never bypass the script to poke provider sessions or touch
peon/*branches by hand. - Peons are sandboxed to their worktree and may lack network access — don't dispatch tasks needing
npm installof new deps without checking the result carefully. - A failed peon leaves its worktree AND metadata for inspection:
peon reportstill works;peon scrapcleans up. Logs live in~/.peon/logs/and are removed on merge/scrap; a long-ignored failed peon is the only thing that accumulates —peon listsurfaces them. - Merge conflicts are the foreman's job: resolve manually or
peon pokethe peon to rebase onto an updated base. - Very large repos:
git worktree addcopies nothing but checkout time and LFS smudge can be slow — prefer--baseon a small stable ref where possible.
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
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.

