@a5c-ai/babysitter-opencode 5.0.1-staging.ef4e872c → 5.0.1-staging.f01483e80761
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -19
- package/bin/install-shared.js +1 -1
- package/commands/call.md +5 -1
- package/commands/cleanup.md +30 -8
- package/commands/doctor.md +2 -3
- package/commands/yolo.md +11 -7
- package/hooks/babysitter-proxied-session-created.sh +0 -0
- package/hooks/babysitter-proxied-shell-env.sh +0 -0
- package/hooks/babysitter-proxied-stop-hook.sh +3 -0
- package/hooks/babysitter-proxied-tool-execute-after.sh +0 -0
- package/hooks/babysitter-proxied-tool-execute-before.sh +0 -0
- package/hooks/hooks.json +0 -8
- package/package.json +6 -8
- package/plugin.json +1 -1
- package/scripts/create-release-tag.mjs +18 -0
- package/scripts/publish-from-tag.mjs +41 -0
- package/scripts/team-install.js +0 -0
- package/skills/accomplish-status/SKILL.md +1 -1
- package/skills/babysit/SKILL.md +1 -1
- package/skills/call/SKILL.md +5 -1
- package/skills/cleanup/SKILL.md +30 -8
- package/skills/doctor/SKILL.md +2 -3
- package/skills/yolo/SKILL.md +5 -1
- package/versions.json +2 -2
- package/hooks/babysitter-proxied-session-idle.js +0 -24
- package/hooks/babysitter-proxied-session-idle.sh +0 -3
- package/scripts/sync-command-docs.cjs +0 -107
- package/scripts/sync-command-surfaces.js +0 -52
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ complex multi-step workflows -- powered by the Babysitter SDK.
|
|
|
9
9
|
## Plugin Structure
|
|
10
10
|
|
|
11
11
|
```
|
|
12
|
-
plugins/
|
|
12
|
+
artifacts/generated-plugins/opencode/
|
|
13
13
|
bin/
|
|
14
14
|
cli.cjs CLI entry point (babysitter-opencode command)
|
|
15
15
|
install.cjs Installation script
|
|
@@ -36,31 +36,29 @@ plugins/babysitter-opencode/
|
|
|
36
36
|
|
|
37
37
|
### Prerequisites
|
|
38
38
|
|
|
39
|
-
Install the Babysitter
|
|
39
|
+
Install the Babysitter CLI once:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
npm install -g @a5c-ai/babysitter
|
|
42
|
+
npm install -g @a5c-ai/babysitter
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
### Method 1:
|
|
45
|
+
### Method 1: Babysitter harness install (recommended)
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
npm install -g @a5c-ai/babysitter-opencode
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
The `postinstall` script automatically copies the plugin into your current
|
|
52
|
-
workspace's `.opencode/plugins/babysitter/` directory.
|
|
53
|
-
|
|
54
|
-
To install into a specific workspace:
|
|
47
|
+
Use the SDK helper for scriptable global or workspace installs. This is the canonical path used by the installer tests and resolves to `npx --yes @a5c-ai/babysitter-opencode install ...` under the hood:
|
|
55
48
|
|
|
56
49
|
```bash
|
|
57
|
-
|
|
50
|
+
# Global install
|
|
51
|
+
babysitter harness:install-plugin opencode
|
|
52
|
+
|
|
53
|
+
# Workspace install
|
|
54
|
+
babysitter harness:install-plugin opencode --workspace /path/to/project
|
|
58
55
|
```
|
|
59
56
|
|
|
60
|
-
### Method 2:
|
|
57
|
+
### Method 2: Published package installer
|
|
61
58
|
|
|
62
59
|
```bash
|
|
63
|
-
babysitter
|
|
60
|
+
npx --yes @a5c-ai/babysitter-opencode install --global
|
|
61
|
+
npx --yes @a5c-ai/babysitter-opencode install --workspace /path/to/project
|
|
64
62
|
```
|
|
65
63
|
|
|
66
64
|
### Method 3: Manual copy
|
|
@@ -94,13 +92,13 @@ OpenCode config directory (`<userDataPath>/opencode/plugins/babysitter/`).
|
|
|
94
92
|
|
|
95
93
|
```bash
|
|
96
94
|
# Auto-detects Accomplish during standard install
|
|
97
|
-
|
|
95
|
+
npx --yes @a5c-ai/babysitter-opencode install --global
|
|
98
96
|
|
|
99
97
|
# Or target Accomplish explicitly
|
|
100
|
-
babysitter-opencode install --accomplish
|
|
98
|
+
npx --yes @a5c-ai/babysitter-opencode install --accomplish
|
|
101
99
|
|
|
102
100
|
# Install to both standalone OpenCode and Accomplish
|
|
103
|
-
babysitter-opencode install --global --accomplish
|
|
101
|
+
npx --yes @a5c-ai/babysitter-opencode install --global --accomplish
|
|
104
102
|
```
|
|
105
103
|
|
|
106
104
|
Accomplish stores OpenCode config at platform-specific locations:
|
|
@@ -206,7 +204,7 @@ babysitter process-library:active --json
|
|
|
206
204
|
## Running Tests
|
|
207
205
|
|
|
208
206
|
```bash
|
|
209
|
-
cd plugins/
|
|
207
|
+
cd artifacts/generated-plugins/opencode
|
|
210
208
|
npm test
|
|
211
209
|
```
|
|
212
210
|
|
package/bin/install-shared.js
CHANGED
|
@@ -104,7 +104,7 @@ function ensureMarketplaceEntry(marketplacePath, pluginRoot) {
|
|
|
104
104
|
name: PLUGIN_NAME,
|
|
105
105
|
source: relSource,
|
|
106
106
|
description: "Orchestrate complex, multi-step workflows with event-sourced state management, hook-based extensibility, and human-in-the-loop approval",
|
|
107
|
-
version: "5.0.
|
|
107
|
+
version: "5.0.1-staging.f01483e80761",
|
|
108
108
|
author: { name: "a5c.ai" },
|
|
109
109
|
};
|
|
110
110
|
if (idx >= 0) marketplace.plugins[idx] = entry;
|
package/commands/call.md
CHANGED
|
@@ -4,4 +4,8 @@ argument-hint: Specific instructions for the run.
|
|
|
4
4
|
allowed-tools: Read, Grep, Write, Task, Bash, Edit, Grep, Glob, WebFetch, WebSearch, Search, AskUserQuestion, TodoWrite, TodoRead, Skill, BashOutput, KillShell, MultiEdit, LS
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).
|
|
7
|
+
Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md). Then continue executing the returned instructions in this same turn. Do not stop after the Skill tool returns; carry the requested run through to completion proof.
|
|
8
|
+
|
|
9
|
+
User arguments for this command:
|
|
10
|
+
|
|
11
|
+
$ARGUMENTS
|
package/commands/cleanup.md
CHANGED
|
@@ -10,11 +10,33 @@ Create and run a cleanup process using the process at `skills\babysit\process\cr
|
|
|
10
10
|
|
|
11
11
|
Implementation notes (for the process):
|
|
12
12
|
- Parse arguments for `--dry-run` flag (if present, set dryRun: true in inputs) and `--keep-days N` (default: 7)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
13
|
+
|
|
14
|
+
CRITICAL: The cleanup MUST follow this exact phase order. Do NOT delete any run before Phase 2 completes.
|
|
15
|
+
|
|
16
|
+
Phase 1 — Scan:
|
|
17
|
+
- Scan .a5c/runs/ for all runs
|
|
18
|
+
- Classify each as terminal (completed/failed) or active (in-progress/created)
|
|
19
|
+
- Identify terminal runs older than the keep-days threshold as removal candidates
|
|
20
|
+
- Never mark active/in-progress runs for removal
|
|
21
|
+
- Count and report: total runs, terminal, active, removal candidates, disk usage
|
|
22
|
+
|
|
23
|
+
Phase 2 — Aggregate insights (BEFORE any deletion):
|
|
24
|
+
- For EVERY removal candidate, read its run.json and journal/ events
|
|
25
|
+
- Extract: processId, prompt, status, event count, created date, task summaries
|
|
26
|
+
- Group by process type and extract patterns (retry counts, convergence behavior, failure modes)
|
|
27
|
+
- Append a new dated section to docs/run-history-insights.md with:
|
|
28
|
+
- Summary statistics (runs removed, disk freed, runs retained)
|
|
29
|
+
- Run categories with counts and descriptions
|
|
30
|
+
- Key patterns observed (multi-batch convergence, retry behavior, etc.)
|
|
31
|
+
- What worked well / what didn't from the run data
|
|
32
|
+
- This file MUST be written and verified before proceeding to Phase 3
|
|
33
|
+
|
|
34
|
+
Phase 3 — Confirm removal:
|
|
35
|
+
- In interactive mode, show the user what will be removed via a breakpoint
|
|
36
|
+
- In non-interactive mode (yolo), proceed with defaults
|
|
37
|
+
- In dry-run mode, stop here and show what would be removed
|
|
38
|
+
|
|
39
|
+
Phase 4 — Remove:
|
|
40
|
+
- Delete the terminal runs older than keep-days threshold
|
|
41
|
+
- Identify and remove orphaned process files not referenced by remaining runs
|
|
42
|
+
- Show remaining run count and disk usage after cleanup
|
package/commands/doctor.md
CHANGED
|
@@ -156,7 +156,6 @@ If it exists:
|
|
|
156
156
|
**Goal:** Inspect babysitter session files for health and detect runaway loops.
|
|
157
157
|
|
|
158
158
|
- Search for session state files using Glob:
|
|
159
|
-
- `plugins/babysitter/skills/babysit/state/*.md`
|
|
160
159
|
- `.a5c/state/*.md`
|
|
161
160
|
- `.a5c/state/*.json`
|
|
162
161
|
- For each session state file found:
|
|
@@ -260,7 +259,7 @@ Mark as PASS if total size < 500MB and no files > 10MB. Mark as WARN if total si
|
|
|
260
259
|
|
|
261
260
|
### 10a. Hook Registration
|
|
262
261
|
|
|
263
|
-
- Locate the plugin root. Check for `CLAUDE_PLUGIN_ROOT` env var, or search for `
|
|
262
|
+
- Locate the plugin root. Check for `CLAUDE_PLUGIN_ROOT` env var first, or search for a babysitter `hooks.json` by walking up from the current directory.
|
|
264
263
|
- If found, read `hooks.json` and verify:
|
|
265
264
|
- A `Stop` hook entry exists with a command referencing `babysitter-stop-hook.sh`.
|
|
266
265
|
- A `SessionStart` hook entry exists with a command referencing `babysitter-session-start-hook.sh`.
|
|
@@ -315,7 +314,7 @@ If the stop hook shows NO evidence of execution (no log entries, no journal even
|
|
|
315
314
|
|
|
316
315
|
Perform these diagnostic steps in order and report the first failure found:
|
|
317
316
|
|
|
318
|
-
1. **Plugin not installed**: Check if `
|
|
317
|
+
1. **Plugin not installed**: Check if `CLAUDE_PLUGIN_ROOT` is set or if a babysitter plugin directory exists relative to the project root. If neither exists, report: "Plugin not installed — the babysitter plugin directory is missing."
|
|
319
318
|
|
|
320
319
|
2. **Plugin not enabled**: Check for Claude settings files:
|
|
321
320
|
- `~/.claude/settings.json` — look for `babysitter` in `enabledPlugins`.
|
package/commands/yolo.md
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Orchestrate a babysitter run. use this command to start babysitting a complex workflow in a non-interactive mode, without any user interaction or breakpoints in the run.
|
|
3
|
-
argument-hint: Specific instructions for the run.
|
|
4
|
-
allowed-tools: Read, Grep, Write, Task, Bash, Edit, Grep, Glob, WebFetch, WebSearch, Search, AskUserQuestion, TodoWrite, TodoRead, Skill, BashOutput, KillShell, MultiEdit, LS
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
---
|
|
2
|
+
description: Orchestrate a babysitter run. use this command to start babysitting a complex workflow in a non-interactive mode, without any user interaction or breakpoints in the run.
|
|
3
|
+
argument-hint: Specific instructions for the run.
|
|
4
|
+
allowed-tools: Read, Grep, Write, Task, Bash, Edit, Grep, Glob, WebFetch, WebSearch, Search, AskUserQuestion, TodoWrite, TodoRead, Skill, BashOutput, KillShell, MultiEdit, LS
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Start the Babysitter run directly through the CLI, without any user interaction or breakpoints. Do not invoke the Skill tool and do not run an instructions-only command. In Claude Code, use Bash to run `babysitter harness:yolo --harness claude-code --workspace "$PWD" --prompt "<user arguments>" --json`; in Codex, run `babysitter harness:yolo --harness codex --workspace "$PWD" --prompt "<user arguments>" --json`; in other harnesses, use the same command with that harness id. Replace `<user arguments>` with the arguments shown below, wait for the command to finish, and treat the CLI completion proof as the result.
|
|
8
|
+
|
|
9
|
+
User arguments for this command:
|
|
10
|
+
|
|
11
|
+
$ARGUMENTS
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/hooks/hooks.json
CHANGED
|
@@ -26,14 +26,6 @@
|
|
|
26
26
|
"timeoutMs": 30000
|
|
27
27
|
}
|
|
28
28
|
],
|
|
29
|
-
"session.idle": [
|
|
30
|
-
{
|
|
31
|
-
"type": "command",
|
|
32
|
-
"script": "./hooks/babysitter-proxied-session-idle.js",
|
|
33
|
-
"description": "babysitter SessionIdle hook",
|
|
34
|
-
"timeoutMs": 30000
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
29
|
"shell.env": [
|
|
38
30
|
{
|
|
39
31
|
"type": "command",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a5c-ai/babysitter-opencode",
|
|
3
|
-
"version": "5.0.1-staging.
|
|
3
|
+
"version": "5.0.1-staging.f01483e80761",
|
|
4
4
|
"description": "Orchestrate complex, multi-step workflows with event-sourced state management, hook-based extensibility, and human-in-the-loop approval",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"deploy": "npm publish --access public",
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
"postinstall": "node bin/install.js",
|
|
9
9
|
"preuninstall": "node bin/uninstall.js",
|
|
10
10
|
"team:install": "node scripts/team-install.js",
|
|
11
|
-
"test": "node test/integration.test.js"
|
|
12
|
-
"sync:commands": "node scripts/sync-command-docs.cjs"
|
|
11
|
+
"test": "node test/integration.test.js"
|
|
13
12
|
},
|
|
14
13
|
"bin": {
|
|
15
14
|
"babysitter-opencode": "bin/cli.js"
|
|
@@ -36,15 +35,14 @@
|
|
|
36
35
|
"access": "public"
|
|
37
36
|
},
|
|
38
37
|
"dependencies": {
|
|
39
|
-
"@a5c-ai/babysitter-sdk": "5.0.1-staging.
|
|
38
|
+
"@a5c-ai/babysitter-sdk": "5.0.1-staging.f01483e80761"
|
|
40
39
|
},
|
|
41
40
|
"repository": {
|
|
42
41
|
"type": "git",
|
|
43
|
-
"url": "git+https://github.com/a5c-ai/babysitter.git"
|
|
44
|
-
"directory": "plugins/babysitter-opencode"
|
|
42
|
+
"url": "git+https://github.com/a5c-ai/babysitter-opencode.git"
|
|
45
43
|
},
|
|
46
|
-
"homepage": "https://github.com/a5c-ai/babysitter
|
|
44
|
+
"homepage": "https://github.com/a5c-ai/babysitter-opencode#readme",
|
|
47
45
|
"bugs": {
|
|
48
|
-
"url": "https://github.com/a5c-ai/babysitter/issues"
|
|
46
|
+
"url": "https://github.com/a5c-ai/babysitter-opencode/issues"
|
|
49
47
|
}
|
|
50
48
|
}
|
package/plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babysitter",
|
|
3
|
-
"version": "5.0.1-staging.
|
|
3
|
+
"version": "5.0.1-staging.f01483e80761",
|
|
4
4
|
"description": "Orchestrate complex, multi-step workflows with event-sourced state management, hook-based extensibility, and human-in-the-loop approval",
|
|
5
5
|
"author": "a5c.ai",
|
|
6
6
|
"license": "MIT",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
4
|
+
|
|
5
|
+
function run(command, args) {
|
|
6
|
+
const result = spawnSync(command, args, { encoding: 'utf8', stdio: 'inherit' });
|
|
7
|
+
if (result.status !== 0) process.exit(result.status || 1);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const branch = process.env.GITHUB_REF_NAME || 'develop';
|
|
11
|
+
const sha = (process.env.GITHUB_SHA || '').slice(0, 12);
|
|
12
|
+
const version = existsSync('package.json') ? JSON.parse(readFileSync('package.json', 'utf8')).version : JSON.parse(readFileSync('versions.json', 'utf8')).sdkVersion;
|
|
13
|
+
const normalized = String(version).replace(/[^0-9A-Za-z._-]/g, '-');
|
|
14
|
+
const tag = 'release/' + branch + '/v' + normalized + '-' + sha;
|
|
15
|
+
run('git', ['config', 'user.name', 'github-actions[bot]']);
|
|
16
|
+
run('git', ['config', 'user.email', 'github-actions[bot]@users.noreply.github.com']);
|
|
17
|
+
run('git', ['tag', tag]);
|
|
18
|
+
run('git', ['push', 'origin', tag]);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
|
|
5
|
+
function run(command, args, options = {}) {
|
|
6
|
+
const result = spawnSync(command, args, { stdio: options.stdio || 'inherit', encoding: options.encoding });
|
|
7
|
+
if (result.status !== 0 && !options.allowFailure) process.exit(result.status || 1);
|
|
8
|
+
return result;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function npmView(packageSpec) {
|
|
12
|
+
return run('npm', ['view', packageSpec, 'version'], { allowFailure: true, stdio: 'pipe', encoding: 'utf8' }).status === 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const pkg = JSON.parse(readFileSync('package.json', 'utf8'));
|
|
16
|
+
const ref = process.env.GITHUB_REF_NAME || '';
|
|
17
|
+
const branch = ref.split('/')[1] || 'develop';
|
|
18
|
+
const tag = branch === 'main' ? 'latest' : branch;
|
|
19
|
+
|
|
20
|
+
if (!process.env.NODE_AUTH_TOKEN) {
|
|
21
|
+
console.log('NODE_AUTH_TOKEN is not configured; skipping npm publish.');
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (npmView(pkg.name + '@' + pkg.version)) {
|
|
26
|
+
console.log(pkg.name + '@' + pkg.version + ' already exists; ensuring dist-tag ' + tag + '.');
|
|
27
|
+
run('npm', ['dist-tag', 'add', pkg.name + '@' + pkg.version, tag], { allowFailure: true });
|
|
28
|
+
process.exit(0);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
for (const field of ['dependencies', 'peerDependencies', 'optionalDependencies']) {
|
|
32
|
+
for (const [name, version] of Object.entries(pkg[field] || {})) {
|
|
33
|
+
if (!name.startsWith('@a5c-ai/') || version.startsWith('^') || version.startsWith('~') || version === '*' || version.startsWith('workspace:')) continue;
|
|
34
|
+
if (!npmView(name + '@' + version)) {
|
|
35
|
+
console.log('Required internal dependency ' + name + '@' + version + ' is not published yet; skipping npm publish.');
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
run('npm', ['publish', '--access', 'public', '--tag', tag]);
|
package/scripts/team-install.js
CHANGED
|
File without changes
|
|
@@ -29,7 +29,7 @@ Where `OPENCODE_CONFIG_DIR` is resolved from the `OPENCODE_CONFIG_DIR` environme
|
|
|
29
29
|
Read the SDK version from `versions.json` to ensure version compatibility:
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
SDK_VERSION=$(node -e "try{const fs=require('fs');const probes=['./plugins/babysitter-
|
|
32
|
+
SDK_VERSION=$(node -e "try{const fs=require('fs');const probes=['./plugins/babysitter-unified/versions.json','./node_modules/@a5c-ai/babysitter-opencode/versions.json'];for(const probe of probes){if(fs.existsSync(probe)){console.log(JSON.parse(fs.readFileSync(probe,'utf8')).sdkVersion||'latest');process.exit(0)}}console.log('latest')}catch{console.log('latest')}")
|
|
33
33
|
npm i -g @a5c-ai/babysitter-sdk@$SDK_VERSION
|
|
34
34
|
|
|
35
35
|
CLI="npx -y @a5c-ai/babysitter-sdk@$SDK_VERSION"
|
package/skills/babysit/SKILL.md
CHANGED
|
@@ -14,7 +14,7 @@ Orchestrate `.a5c/runs/<runId>/` through iterative execution.
|
|
|
14
14
|
Read the SDK version from `versions.json` to ensure version compatibility:
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
SDK_VERSION=$(node -e "try{const fs=require('fs');const probes=['./plugins/babysitter-
|
|
17
|
+
SDK_VERSION=$(node -e "try{const fs=require('fs');const probes=['./plugins/babysitter-unified/versions.json','./node_modules/@a5c-ai/babysitter-opencode/versions.json'];for(const probe of probes){if(fs.existsSync(probe)){console.log(JSON.parse(fs.readFileSync(probe,'utf8')).sdkVersion||'latest');process.exit(0)}}console.log('latest')}catch{console.log('latest')}")
|
|
18
18
|
|
|
19
19
|
npm i -g @a5c-ai/babysitter-sdk@$SDK_VERSION
|
|
20
20
|
CLI="npx -y @a5c-ai/babysitter-sdk@$SDK_VERSION"
|
package/skills/call/SKILL.md
CHANGED
|
@@ -5,4 +5,8 @@ description: Orchestrate a babysitter run. use this command to start babysitting
|
|
|
5
5
|
|
|
6
6
|
# call
|
|
7
7
|
|
|
8
|
-
Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).
|
|
8
|
+
Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md). Then continue executing the returned instructions in this same turn. Do not stop after the Skill tool returns; carry the requested run through to completion proof.
|
|
9
|
+
|
|
10
|
+
User arguments for this command:
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
package/skills/cleanup/SKILL.md
CHANGED
|
@@ -11,11 +11,33 @@ Create and run a cleanup process using the process at `skills\babysit\process\cr
|
|
|
11
11
|
|
|
12
12
|
Implementation notes (for the process):
|
|
13
13
|
- Parse arguments for `--dry-run` flag (if present, set dryRun: true in inputs) and `--keep-days N` (default: 7)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
14
|
+
|
|
15
|
+
CRITICAL: The cleanup MUST follow this exact phase order. Do NOT delete any run before Phase 2 completes.
|
|
16
|
+
|
|
17
|
+
Phase 1 — Scan:
|
|
18
|
+
- Scan .a5c/runs/ for all runs
|
|
19
|
+
- Classify each as terminal (completed/failed) or active (in-progress/created)
|
|
20
|
+
- Identify terminal runs older than the keep-days threshold as removal candidates
|
|
21
|
+
- Never mark active/in-progress runs for removal
|
|
22
|
+
- Count and report: total runs, terminal, active, removal candidates, disk usage
|
|
23
|
+
|
|
24
|
+
Phase 2 — Aggregate insights (BEFORE any deletion):
|
|
25
|
+
- For EVERY removal candidate, read its run.json and journal/ events
|
|
26
|
+
- Extract: processId, prompt, status, event count, created date, task summaries
|
|
27
|
+
- Group by process type and extract patterns (retry counts, convergence behavior, failure modes)
|
|
28
|
+
- Append a new dated section to docs/run-history-insights.md with:
|
|
29
|
+
- Summary statistics (runs removed, disk freed, runs retained)
|
|
30
|
+
- Run categories with counts and descriptions
|
|
31
|
+
- Key patterns observed (multi-batch convergence, retry behavior, etc.)
|
|
32
|
+
- What worked well / what didn't from the run data
|
|
33
|
+
- This file MUST be written and verified before proceeding to Phase 3
|
|
34
|
+
|
|
35
|
+
Phase 3 — Confirm removal:
|
|
36
|
+
- In interactive mode, show the user what will be removed via a breakpoint
|
|
37
|
+
- In non-interactive mode (yolo), proceed with defaults
|
|
38
|
+
- In dry-run mode, stop here and show what would be removed
|
|
39
|
+
|
|
40
|
+
Phase 4 — Remove:
|
|
41
|
+
- Delete the terminal runs older than keep-days threshold
|
|
42
|
+
- Identify and remove orphaned process files not referenced by remaining runs
|
|
43
|
+
- Show remaining run count and disk usage after cleanup
|
package/skills/doctor/SKILL.md
CHANGED
|
@@ -157,7 +157,6 @@ If it exists:
|
|
|
157
157
|
**Goal:** Inspect babysitter session files for health and detect runaway loops.
|
|
158
158
|
|
|
159
159
|
- Search for session state files using Glob:
|
|
160
|
-
- `plugins/babysitter/skills/babysit/state/*.md`
|
|
161
160
|
- `.a5c/state/*.md`
|
|
162
161
|
- `.a5c/state/*.json`
|
|
163
162
|
- For each session state file found:
|
|
@@ -261,7 +260,7 @@ Mark as PASS if total size < 500MB and no files > 10MB. Mark as WARN if total si
|
|
|
261
260
|
|
|
262
261
|
### 10a. Hook Registration
|
|
263
262
|
|
|
264
|
-
- Locate the plugin root. Check for `CLAUDE_PLUGIN_ROOT` env var, or search for `
|
|
263
|
+
- Locate the plugin root. Check for `CLAUDE_PLUGIN_ROOT` env var first, or search for a babysitter `hooks.json` by walking up from the current directory.
|
|
265
264
|
- If found, read `hooks.json` and verify:
|
|
266
265
|
- A `Stop` hook entry exists with a command referencing `babysitter-stop-hook.sh`.
|
|
267
266
|
- A `SessionStart` hook entry exists with a command referencing `babysitter-session-start-hook.sh`.
|
|
@@ -316,7 +315,7 @@ If the stop hook shows NO evidence of execution (no log entries, no journal even
|
|
|
316
315
|
|
|
317
316
|
Perform these diagnostic steps in order and report the first failure found:
|
|
318
317
|
|
|
319
|
-
1. **Plugin not installed**: Check if `
|
|
318
|
+
1. **Plugin not installed**: Check if `CLAUDE_PLUGIN_ROOT` is set or if a babysitter plugin directory exists relative to the project root. If neither exists, report: "Plugin not installed — the babysitter plugin directory is missing."
|
|
320
319
|
|
|
321
320
|
2. **Plugin not enabled**: Check for Claude settings files:
|
|
322
321
|
- `~/.claude/settings.json` — look for `babysitter` in `enabledPlugins`.
|
package/skills/yolo/SKILL.md
CHANGED
|
@@ -5,4 +5,8 @@ description: Orchestrate a babysitter run. use this command to start babysitting
|
|
|
5
5
|
|
|
6
6
|
# yolo
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Start the Babysitter run directly through the CLI, without any user interaction or breakpoints. Do not invoke the Skill tool and do not run an instructions-only command. In Claude Code, use Bash to run `babysitter harness:yolo --harness claude-code --workspace "$PWD" --prompt "<user arguments>" --json`; in Codex, run `babysitter harness:yolo --harness codex --workspace "$PWD" --prompt "<user arguments>" --json`; in other harnesses, use the same command with that harness id. Replace `<user arguments>` with the arguments shown below, wait for the command to finish, and treat the CLI completion proof as the result.
|
|
9
|
+
|
|
10
|
+
User arguments for this command:
|
|
11
|
+
|
|
12
|
+
$ARGUMENTS
|
package/versions.json
CHANGED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var execSync = require("child_process").execSync;
|
|
4
|
-
var path = require("path");
|
|
5
|
-
var readFileSync = require("fs").readFileSync;
|
|
6
|
-
|
|
7
|
-
var PLUGIN_ROOT = process.env.PLUGIN_ROOT || process.env.PLUGIN_ROOT || path.resolve(__dirname, "..");
|
|
8
|
-
var stdin = "";
|
|
9
|
-
try { stdin = readFileSync(0, "utf8"); } catch {}
|
|
10
|
-
try {
|
|
11
|
-
var result = execSync("bash " + JSON.stringify(path.join(PLUGIN_ROOT, "hooks/session-idle.sh")), {
|
|
12
|
-
input: stdin,
|
|
13
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
14
|
-
timeout: 30000,
|
|
15
|
-
env: Object.assign({}, process.env, {
|
|
16
|
-
HOOK_TYPE: process.env.HOOK_TYPE || "",
|
|
17
|
-
ADAPTER_NAME: process.env.ADAPTER_NAME || "opencode",
|
|
18
|
-
PLUGIN_ROOT: PLUGIN_ROOT
|
|
19
|
-
})
|
|
20
|
-
});
|
|
21
|
-
process.stdout.write(result);
|
|
22
|
-
} catch (e) {
|
|
23
|
-
process.stdout.write("{}\n");
|
|
24
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const {
|
|
5
|
-
listMarkdownBasenames,
|
|
6
|
-
reportCheckResult,
|
|
7
|
-
syncCommandMirrors,
|
|
8
|
-
syncSkillsFromCommands,
|
|
9
|
-
writeFileIfChanged,
|
|
10
|
-
} = require('../../../scripts/plugin-command-sync-lib.cjs');
|
|
11
|
-
|
|
12
|
-
const PACKAGE_ROOT = path.resolve(__dirname, '..');
|
|
13
|
-
const REPO_ROOT = path.resolve(PACKAGE_ROOT, '..', '..');
|
|
14
|
-
const ROOT_COMMANDS = path.join(REPO_ROOT, 'plugins', 'babysitter', 'commands');
|
|
15
|
-
const COMMANDS_ROOT = path.join(PACKAGE_ROOT, 'commands');
|
|
16
|
-
const SKILLS_ROOT = path.join(PACKAGE_ROOT, 'skills');
|
|
17
|
-
const LABEL = 'babysitter-opencode sync';
|
|
18
|
-
|
|
19
|
-
const BABYSIT_SKILL = `---
|
|
20
|
-
name: babysit
|
|
21
|
-
description: Orchestrate via @babysitter. Use this skill when asked to babysit a run, orchestrate a process or whenever it is called explicitly. (babysit, babysitter, orchestrate, orchestrate a run, workflow, etc.)
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
# babysit
|
|
25
|
-
|
|
26
|
-
Orchestrate \`.a5c/runs/<runId>/\` through iterative execution.
|
|
27
|
-
|
|
28
|
-
## Dependencies
|
|
29
|
-
|
|
30
|
-
### Babysitter SDK and CLI
|
|
31
|
-
|
|
32
|
-
Read the SDK version from \`versions.json\` to ensure version compatibility:
|
|
33
|
-
|
|
34
|
-
\`\`\`bash
|
|
35
|
-
SDK_VERSION=$(node -e "try{const fs=require('fs');const probes=['./plugins/babysitter-opencode/versions.json','./node_modules/@a5c-ai/babysitter-opencode/versions.json'];for(const probe of probes){if(fs.existsSync(probe)){console.log(JSON.parse(fs.readFileSync(probe,'utf8')).sdkVersion||'latest');process.exit(0)}}console.log('latest')}catch{console.log('latest')}")
|
|
36
|
-
|
|
37
|
-
npm i -g @a5c-ai/babysitter-sdk@$SDK_VERSION
|
|
38
|
-
CLI="npx -y @a5c-ai/babysitter-sdk@$SDK_VERSION"
|
|
39
|
-
\`\`\`
|
|
40
|
-
|
|
41
|
-
## Instructions
|
|
42
|
-
|
|
43
|
-
Run the following command to get full orchestration instructions:
|
|
44
|
-
|
|
45
|
-
\`\`\`bash
|
|
46
|
-
babysitter instructions:babysit-skill --harness opencode --interactive
|
|
47
|
-
\`\`\`
|
|
48
|
-
|
|
49
|
-
For non-interactive mode:
|
|
50
|
-
|
|
51
|
-
\`\`\`bash
|
|
52
|
-
babysitter instructions:babysit-skill --harness opencode --no-interactive
|
|
53
|
-
\`\`\`
|
|
54
|
-
|
|
55
|
-
Follow the instructions returned by the command above to orchestrate the run.
|
|
56
|
-
`;
|
|
57
|
-
|
|
58
|
-
function getCommandNames() {
|
|
59
|
-
return listMarkdownBasenames(ROOT_COMMANDS);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function main() {
|
|
63
|
-
const check = process.argv.includes('--check');
|
|
64
|
-
const commandNames = getCommandNames();
|
|
65
|
-
const mirrorResult = syncCommandMirrors({
|
|
66
|
-
label: LABEL,
|
|
67
|
-
sourceRoot: ROOT_COMMANDS,
|
|
68
|
-
targetRoot: COMMANDS_ROOT,
|
|
69
|
-
names: commandNames,
|
|
70
|
-
check,
|
|
71
|
-
cwd: PACKAGE_ROOT,
|
|
72
|
-
});
|
|
73
|
-
const skillsResult = syncSkillsFromCommands({
|
|
74
|
-
label: LABEL,
|
|
75
|
-
sourceRoot: COMMANDS_ROOT,
|
|
76
|
-
skillsRoot: SKILLS_ROOT,
|
|
77
|
-
names: commandNames,
|
|
78
|
-
check,
|
|
79
|
-
cwd: PACKAGE_ROOT,
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
const babysitSkillPath = path.join(SKILLS_ROOT, 'babysit', 'SKILL.md');
|
|
83
|
-
if (check) {
|
|
84
|
-
const fs = require('fs');
|
|
85
|
-
const stale = [...mirrorResult.stale, ...skillsResult.stale];
|
|
86
|
-
const current = fs.existsSync(babysitSkillPath)
|
|
87
|
-
? fs.readFileSync(babysitSkillPath, 'utf8')
|
|
88
|
-
: null;
|
|
89
|
-
if (current !== BABYSIT_SKILL) {
|
|
90
|
-
stale.push(path.relative(PACKAGE_ROOT, babysitSkillPath));
|
|
91
|
-
}
|
|
92
|
-
reportCheckResult(LABEL, stale);
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const babysitUpdated = writeFileIfChanged(babysitSkillPath, BABYSIT_SKILL) ? 1 : 0;
|
|
97
|
-
const updated = mirrorResult.updated + skillsResult.updated + babysitUpdated;
|
|
98
|
-
|
|
99
|
-
if (updated === 0) {
|
|
100
|
-
console.log(`[${LABEL}] no OpenCode command or skill changes were needed.`);
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
console.log(`[${LABEL}] updated ${updated} OpenCode command/skill file(s).`);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
main();
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Sync command surfaces from the canonical babysitter plugin.
|
|
4
|
-
*
|
|
5
|
-
* Copies command .md files from the cursor/codex plugins or generates
|
|
6
|
-
* them from the SDK CLI command definitions. Used during build/deploy
|
|
7
|
-
* to keep command surfaces in sync across harness plugins.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
"use strict";
|
|
11
|
-
|
|
12
|
-
const fs = require("fs");
|
|
13
|
-
const path = require("path");
|
|
14
|
-
|
|
15
|
-
const PLUGIN_ROOT = path.resolve(__dirname, "..");
|
|
16
|
-
const COMMANDS_DIR = path.join(PLUGIN_ROOT, "commands");
|
|
17
|
-
|
|
18
|
-
// Check mode
|
|
19
|
-
const checkOnly = process.argv.includes("--check");
|
|
20
|
-
|
|
21
|
-
function main() {
|
|
22
|
-
// Verify commands directory exists and has files
|
|
23
|
-
if (!fs.existsSync(COMMANDS_DIR)) {
|
|
24
|
-
console.error("ERROR: commands/ directory not found");
|
|
25
|
-
process.exit(1);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const files = fs.readdirSync(COMMANDS_DIR).filter(f => f.endsWith(".md"));
|
|
29
|
-
if (files.length === 0) {
|
|
30
|
-
console.error("ERROR: No command .md files found in commands/");
|
|
31
|
-
process.exit(1);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
console.log(`Found ${files.length} command files:`);
|
|
35
|
-
for (const file of files) {
|
|
36
|
-
const content = fs.readFileSync(path.join(COMMANDS_DIR, file), "utf8");
|
|
37
|
-
const hasHeader = content.startsWith("---");
|
|
38
|
-
const status = hasHeader ? "OK" : "MISSING FRONTMATTER";
|
|
39
|
-
console.log(` ${file} [${status}]`);
|
|
40
|
-
if (checkOnly && !hasHeader) {
|
|
41
|
-
process.exit(1);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (checkOnly) {
|
|
46
|
-
console.log("\nAll command files are valid.");
|
|
47
|
-
} else {
|
|
48
|
-
console.log("\nCommand surfaces synced.");
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
main();
|