| name | add-backend |
| description | Scaffold a new LLM backend for multi-bark-pack |
| user-invocable | true |
Add Backend Skill
Scaffold a new LLM agent backend for multi-bark-pack.
Usage
/add-backend cursor
/add-backend codex
/add-backend <backend-name>
Steps to Add a New Backend
1. Create Backend Module
Create backends/<name>.js:
const { execSync } = require('child_process');
const crypto = require('crypto');
const EXEC_OPTS = { encoding: 'utf8', timeout: 5000 };
module.exports = function create<Name>Backend(config = {}) {
return {
name: '<name>',
displayName: '<Display Name>',
async isInstalled() {
try {
execSync('which <cli-command>', EXEC_OPTS);
return true;
} catch {
return false;
}
},
async getVersion() {
try {
const output = execSync('<cli-command> --version', EXEC_OPTS);
return output.trim();
} catch {
return null;
}
},
models: ['model1', 'model2'],
defaultModel: 'model1',
validateModel(model) {
return this.models.includes(model);
},
canResume: true,
generateSessionId() {
return crypto.randomUUID();
},
buildCommand(opts) {
const { promptFile, sessionId, isResume, model, systemPromptFile, streamParserScript, agentId, tmpDir } = opts;
let script = '#!/bin/bash\n';
script += `# TODO: Implement <name> CLI invocation\n`;
return { script, env: {} };
},
streamParserName: '<name>',
extractSessionId(output) {
return null;
},
capabilities: {
streaming: true,
sessionPersistence: true,
workingDirectory: true,
forceMode: true,
systemPrompt: true,
planning: true,
},
};
};
2. Create Stream Parser
Create stream-parsers/<name>.js:
const TOOL_ICONS = {
};
module.exports = {
name: '<name>',
toolIcons: TOOL_ICONS,
parseLine(line) {
},
getToolIcon(name) {
return TOOL_ICONS[name] || '🔧';
},
};
3. Register Backend
In backends/index.js, add:
const create<Name>Backend = require('./<name>');
const backendFactories = {
'claude-code': createClaudeCodeBackend,
'<name>': create<Name>Backend,
};
4. Register Parser
In stream-parsers/index.js, add:
const <name>Parser = require('./<name>');
const parsers = {
claude: claudeParser,
'<name>': <name>Parser,
};
5. Update Config
In .env.example, add:
ENABLED_BACKENDS=claude-code,<name>
6. Test
node server.js
Checklist