agentleFS
JaimeJunrJaimeJunr/polyagent-mcp/.claude/skills/add-engine/SKILL.md

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

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. bablsoft/accessflow★ 12same name
    2. 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.

The file

Files
SKILL.md

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 enginetype 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
Dialetobuild<Engine>Args + ramo no buildArgs
Saídaparse<Engine>Jsonl/reuso de parseCliJson + ramo no parseOutput
SandboxSANDBOX_ENGINE_RO / SANDBOX_ENGINE_RW (~/.local é RO inteiro: subpasta gravável precisa RW explícito)
CapacidadesENGINE_CAPABILITIES (engineReadOnly, modeAtEngineLevel, webSearch...) — é o que resolveAuxTool/quotaCandidates consultam
Cotapadrões em classifyQuotaError só se observados em runtime; senão fica null (classificar errado é pior que não classificar)
CascatasTIERS/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.

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.