Adding an AI Runner to aidev
Use this skill when adding a new AI runner (e.g. another CLI-based agent) so the agent follows the project’s runner contract and wiring.
Checklist
Implement AIRunner — Create
src/ai/<name>.tsimplementing the interface fromsrc/ai/base.ts:name: string— short id (lowercase, e.g.'myrunner')isAvailable(): boolean— true if the runner’s CLI is on PATH (usecommandExists()fromsrc/platform.tsif appropriate)run(prompt: string, notes?: string): Promise<AIRunResult>— usespawnSync(bin, [...args])with array arguments only; return{ success, output, error }UsegetUserShellEnv()fromsrc/platform.tsfor env when spawning if the CLI needs the user’s shell environment.
Register runner — In
src/ai/index.ts: import the new runner class and add it to theregistryobject.createRunners(config)already returns runners inconfig.agentsorder; no change needed there if the new name is inconfig.agents.AgentName type — In
src/types.ts: add the new runner id to theAgentNameunion (e.g.'claude' | 'cursor' | 'windsurf' | 'myrunner').Config validation — In
src/config.tsinloadConfig(): add the new id to thevalidAgentsarray soAGENTScan include it.Init picker — In
src/commands/init.ts: add the new id to theVALID_AGENTSarray soaidev initlists and accepts it.Permissions (optional) — If the runner needs permission or availability checks during
aidev init, insrc/permissions.tsadd a branch invalidateAgentPermissions()for the new agent name (e.g.else if (agent === 'myrunner') { await validateMyRunnerPermissions(rl, dir); }).Docs and tests — Update
.env.aidev.examplecomment forAGENTSif you add a new option. Add or extend tests insrc/__tests__/ai-runners.test.ts. Runnpm run buildandnpm test.
Reference
- Existing runners:
src/ai/claude.ts,src/ai/cursor.ts,src/ai/windsurf.ts. - Interface:
src/ai/base.ts(AIRunner,AIRunResult). - Registry and createRunners:
src/ai/index.ts. - Valid agents and init:
src/config.ts(validAgents),src/commands/init.ts(VALID_AGENTS),src/permissions.ts(validateAgentPermissions).
Source: qelos-io/aidev — distributed by TomeVault.