add-engine
Skill5 starsChanged 52 days agoMITView on GitHub
Use when adding a new coding-agent CLI as a polyagent-mcp engine (a new `Engine` value next to codex/grok/claude/opencode/kimi/muse), or when an engine's CLI changed its flags, output format, session/resume handling or auth/config paths and the bridge now hangs, returns empty text, loses the session_id or fails inside the bwrap sandbox.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- bablsoft/accessflowtheir own version, first seen Sep 9, 2026
- alphacrack/readme2demotheir own version, first seen Jul 5, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- bablsoft/accessflow★ 12same name
- alphacrack/readme2demo★ 9same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository4 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- model-refreshSkill
- run-benchSkill
- shipSkill
The file
Files
add-engine — onde uma engine nova precisa tocar
As regras de cada dialeto e do sandbox estão no CLAUDE.md (seções "Engines & tiers" e "The
sandbox") — leia as duas antes. Esta skill é o mapa de pontos de toque, porque esquecer um deles não
quebra o build: a engine só falha em runtime.
Antes de codar: spike
Rode o CLI à mão e registre em research/AAAA-MM-DD-<engine>-engine.md (modelo: os spikes de
opencode/kimi/muse linkados em research/README.md): flag de prompt headless, formato de saída
(JSON único ou JSONL e qual evento traz o texto), onde vem o session id, como retomar, flag de
autonomia, se lê stdin, onde guarda auth/config/sessões no $HOME, e se é assinatura ou
pay-per-token. Sem isso você vai adivinhar o parser.
Pontos de toque em src/cli.ts
| O quê | Onde |
| Nome da engine | type Engine (topo) e o parse do prefixo de session_id (prefix !== ...) |
| Binário | <ENGINE>_BIN com env POLYAGENT_<ENGINE>_BIN, e o seletor de binário em runCursor |
| Dialeto | build<Engine>Args + ramo no buildArgs |
| Saída | parse<Engine>Jsonl/reuso de parseCliJson + ramo no parseOutput |
| Sandbox | SANDBOX_ENGINE_RO / SANDBOX_ENGINE_RW (~/.local é RO inteiro: subpasta gravável precisa RW explícito) |
| Capacidades | ENGINE_CAPABILITIES (engineReadOnly, modeAtEngineLevel, webSearch...) — é o que resolveAuxTool/quotaCandidates consultam |
| Cota | padrões em classifyQuotaError só se observados em runtime; senão fica null (classificar errado é pior que não classificar) |
| Cascatas | TIERS/FAST_CANDIDATES/FALLBACK_ENGINE_ORDER: pay-per-token fica fora por padrão; FALLBACK_ENGINE_ORDER descarta mode, então engine sem read-only próprio não entra lá |
Em src/index.ts: as strings de engine nas descrições (delegate.engine e as auxiliares).
Testes
test/cli.test.ts (args, parser com saída real capturada do spike, resume), test/aux-engine.test.ts
(read-only/requisitos), test/quota.test.ts (candidatos). Use uma saída real do CLI como
fixture, não uma inventada.
Prova final
Uma chamada real pelo caminho do bridge, com sandbox ligado: runCursor({ engine, prompt, cwd })
importado de dist/cli.js, e depois um follow_up na sessão devolvida. Parser que passa na fixture
e falha no CLI real é o caso comum.
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.

