II.
Page JSON
Structured · livepage:docs-assimilation-harness-accomplish-integration
Babysitter + Accomplish Integration Guide json
Inspect the normalized record payload exactly as the atlas UI reads it.
{
"id": "page:docs-assimilation-harness-accomplish-integration",
"_kind": "Page",
"_file": "wiki/docs/assimilation/harness/accomplish/integration.md",
"_cluster": "wiki",
"attributes": {
"nodeKind": "Page",
"sourcePath": "docs/assimilation/harness/accomplish/integration.md",
"sourceKind": "repo-docs",
"title": "Babysitter + Accomplish Integration Guide",
"displayName": "Babysitter + Accomplish Integration Guide",
"slug": "docs/assimilation/harness/accomplish/integration",
"articlePath": "wiki/docs/assimilation/harness/accomplish/integration.md",
"article": "\n# Babysitter + Accomplish Integration Guide\n\n## What is Accomplish?\n\n[Accomplish AI](https://github.com/accomplish-ai/accomplish) is an Electron desktop application for AI-assisted software development. It spawns [OpenCode](https://opencode.ai) as a subprocess to execute AI coding tasks, providing a rich desktop UI around the agent interaction -- including task management, permission dialogs, and a conversation view.\n\nBabysitter integrates with Accomplish through the OpenCode plugin system. When babysitter is installed, Accomplish gains:\n\n- **Structured orchestration** -- multi-phase task execution with deterministic replay\n- **Breakpoint approval gates** -- human-in-the-loop decisions resolved conversationally via Accomplish's `ask-user-question` MCP tool\n- **Progress visibility** -- phase progress, iteration counts, and pending effects visible in the agent conversation\n\n---\n\n## Prerequisites\n\n1. **Babysitter SDK** installed globally or in your project:\n ```bash\n npm install -g @a5c-ai/babysitter\n # or\n npm install @a5c-ai/babysitter\n ```\n\n2. **[Accomplish AI](https://github.com/accomplish-ai/accomplish)** installed and set up on your machine. The installer auto-detects Accomplish by checking for the platform-specific data directory:\n - **macOS**: `~/Library/Application Support/Accomplish/`\n - **Windows**: `%APPDATA%/Accomplish/`\n - **Linux**: `~/.config/Accomplish/`\n\n3. **OpenCode** -- bundled with Accomplish; no separate installation needed.\n\n---\n\n## Installation\n\n### Automatic (recommended)\n\nThe babysitter plugin installer auto-detects Accomplish when present:\n\n```bash\nbabysitter plugin:install babysitter --global\n```\n\nThis performs two installations in one step:\n1. Installs the OpenCode plugin to `~/.opencode/plugins/babysitter/` (standard OpenCode)\n2. Detects Accomplish and copies the plugin to `<accomplishDataDir>/opencode/plugins/babysitter/`\n\n### Accomplish-only install\n\nTo install exclusively to the Accomplish data directory without touching the standard OpenCode paths:\n\n```bash\ncd artifacts/generated-plugins/opencode\nnode bin/install.cjs --accomplish\n```\n\n### Manual install\n\nCopy the plugin bundle manually:\n\n```bash\n# Determine your Accomplish data directory\n# macOS: ~/Library/Application Support/Accomplish/opencode/plugins/babysitter/\n# Windows: %APPDATA%/Accomplish/opencode/plugins/babysitter/\n# Linux: ~/.config/Accomplish/opencode/plugins/babysitter/\n\ncp -r artifacts/generated-plugins/opencode/* <accomplishDataDir>/opencode/plugins/babysitter/\n```\n\nAfter any installation method, restart Accomplish to pick up the plugin.\n\n---\n\n## How It Works\n\n### Plugin auto-discovery\n\nAccomplish spawns OpenCode with its data directory as the working context. OpenCode discovers plugins by scanning `.opencode/plugins/` for JS modules. The babysitter plugin registers itself via `index.js`, which exports hooks for the OpenCode plugin system:\n\n- `session.created` -- initializes babysitter session state\n- `session.idle` -- handles iteration orchestration\n- `shell.env` -- injects `AGENT_SESSION_ID` and other env vars\n- `tool.execute.before` / `tool.execute.after` -- pre/post tool hooks\n\n### Hook lifecycle within Accomplish\n\n```\nAccomplish spawns OpenCode subprocess\n |\n v\nOpenCode loads babysitter plugin (index.js)\n |\n v\nsession.created hook fires\n |-- Creates session state file\n |-- Detects ACCOMPLISH_TASK_ID from env\n |-- Stores task correlation in session metadata\n |\n v\nUser invokes /babysitter skill (or agent triggers it)\n |\n v\nbabysitter run:create\n |-- Creates .a5c/runs/<runId>/ directory\n |-- Writes run-status JSON to IPC directory\n |-- Session state updated with runId\n |\n v\nbabysitter run:iterate (loop)\n |-- Replays journal, executes process\n |-- On pending effects: agent handles them\n |-- On breakpoints:\n | |\n | v\n | Agent uses ask-user-question MCP tool\n | User approves/rejects in Accomplish conversation\n | |\n | v\n | babysitter task:post resolves the breakpoint\n |\n v\nRun completes or fails\n```\n\n### Session binding\n\nWhen running inside Accomplish, the adapter detects `ACCOMPLISH_TASK_ID` and stores it in the session state's `metadata` field:\n\n```typescript\n// SessionState.metadata\n{\n accomplishTaskId: \"task_abc123\"\n}\n```\n\nThis correlation allows the Accomplish daemon to match babysitter runs to its own task records.\n\n---\n\n## Using the /babysitter Skill in Accomplish\n\nOnce the plugin is installed, the `/babysitter` skill is available in Accomplish's agent conversation. It orchestrates complex multi-step tasks:\n\n1. **Invoke**: Type `/babysitter` in the Accomplish conversation, or let the agent invoke it for multi-step tasks\n2. **Run creation**: The skill creates a structured run with phased execution\n3. **Progress reporting**: Each iteration updates Accomplish's UI with current phase and progress\n4. **Breakpoints**: Human approval gates appear as native Accomplish dialogs -- approve, reject, or provide feedback without leaving the app\n5. **Completion**: Results and artifacts are available in `.a5c/runs/<runId>/`\n\n### Additional skills\n\n- `/accomplish-status` -- Manually trigger a status update to the Accomplish UI for a specific run\n\n---\n\n## Environment Variables\n\n| Variable | Set by | Description |\n|----------|--------|-------------|\n| `ACCOMPLISH_TASK_ID` | Accomplish | Correlation ID linking the OpenCode session to an Accomplish task. Set automatically when Accomplish spawns the subprocess. |\n| `OPENCODE_CONFIG` | OpenCode | Path to OpenCode configuration file |\n| `OPENCODE_CONFIG_DIR` | Accomplish/OpenCode | OpenCode config directory; when set, its parent is treated as the Accomplish data directory |\n| `BABYSITTER_STATE_DIR` | User/Plugin | Override for babysitter state directory (default: `.a5c`) |\n| `AGENT_SESSION_ID` | Plugin (shell.env hook) | Session ID injected by the babysitter plugin for cross-harness session tracking |\n| `OPENCODE_PLUGIN_ROOT` | Plugin (shell.env hook) | Plugin root directory for babysitter plugin discovery |\n\n---\n\n## How Breakpoints Work\n\nWhen the orchestration reaches a breakpoint (human approval gate), the agent resolves it conversationally using Accomplish's `ask-user-question` MCP tool:\n\n1. `babysitter run:iterate` returns with a pending breakpoint effect\n2. The agent reads the breakpoint details (title, question, options)\n3. The agent calls the `ask-user-question` MCP tool to present the decision to the user\n4. The user responds in the Accomplish conversation UI\n5. The agent posts the resolution: `babysitter task:post <runDir> <effectId> --status ok --value-inline '{\"approved\": true}'`\n6. The next iteration picks up the resolved breakpoint and continues\n\nThis works without any changes to the Accomplish codebase. The user experience is conversational rather than a dedicated dialog, but fully functional.\n\n---\n\n## Troubleshooting\n\n### Plugin not detected by Accomplish\n\n**Symptoms**: `/babysitter` skill not available in Accomplish conversation; no babysitter hooks firing.\n\n**Steps**:\n1. Verify the plugin directory exists:\n - macOS: `ls ~/Library/Application\\ Support/Accomplish/opencode/plugins/babysitter/`\n - Windows: `dir %APPDATA%\\Accomplish\\opencode\\plugins\\babysitter\\`\n - Linux: `ls ~/.config/Accomplish/opencode/plugins/babysitter/`\n2. Verify `index.js` and `plugin.json` exist in that directory\n3. Restart Accomplish completely (quit and relaunch, not just close the window)\n4. Check Accomplish logs for plugin loading errors\n\n### Breakpoints not being presented to the user\n\n**Symptoms**: Babysitter run reaches a breakpoint but the agent doesn't ask for approval.\n\n**Steps**:\n1. Check that the run has pending breakpoints: `babysitter task:list .a5c/runs/<runId> --pending`\n2. Verify the agent is handling breakpoint effects by calling `ask-user-question` MCP tool\n3. If using the `/babysitter` skill, ensure the skill instructions are loaded correctly\n4. Check that `ACCOMPLISH_TASK_ID` is set: the agent uses this to correlate the session\n\n### Run stuck or state inconsistent\n\n**Steps**:\n```bash\n# Rebuild derived state from journal\nbabysitter run:rebuild-state .a5c/runs/<runId>\n\n# Repair journal integrity\nbabysitter run:repair-journal .a5c/runs/<runId>\n\n# Full diagnostic\nbabysitter-harness doctor --run-id <runId>\n```\n\n### ACCOMPLISH_TASK_ID not set\n\nIf `ACCOMPLISH_TASK_ID` is not in the environment, babysitter still works normally -- it just cannot correlate runs with specific Accomplish tasks. Runs execute, breakpoints are resolved conversationally, and results are available in `.a5c/runs/`.\n\nVerify Accomplish is setting this variable when spawning OpenCode. This is an Accomplish-side configuration.\n\n---\n\n## Architecture Reference\n\n| Component | Path | Purpose |\n|-----------|------|---------|\n| OpenCode adapter | `packages/sdk/src/harness/opencode.ts` | Accomplish detection, `ACCOMPLISH_TASK_ID` handling, data dir resolution, session metadata |\n| Discovery module | `packages/sdk/src/harness/discovery.ts` | Caller detection via env vars including `ACCOMPLISH_TASK_ID` |\n| Generated OpenCode bundle | `artifacts/generated-plugins/opencode/` | Harness-specific plugin output generated from `plugins/babysitter-unified` |\n| Installer (shared) | `artifacts/generated-plugins/opencode/bin/install-shared.cjs` | Accomplish detection, plugin bundle copy, surface installation |\n| Installer (entry) | `artifacts/generated-plugins/opencode/bin/install.cjs` | CLI entry point with `--accomplish` flag |\n| `/babysitter` skill (Accomplish format) | `artifacts/generated-plugins/opencode/skills/babysit/SKILL.md` | Orchestration skill formatted for Accomplish's skill system |\n| `/accomplish-status` skill | `artifacts/generated-plugins/opencode/skills/accomplish-status/SKILL.md` | Run status reporting |\n| Session types | `packages/sdk/src/session/types.ts` | `SessionState.metadata` field for `accomplishTaskId` correlation |\n",
"documents": []
},
"outgoingEdges": [],
"incomingEdges": [
{
"from": "page:docs-assimilation-harness",
"to": "page:docs-assimilation-harness-accomplish-integration",
"kind": "contains_page"
}
]
}