@a5c-ai/babysitter-opencode 0.1.4-staging.fd3ab4c2 → 5.0.1-staging.04ca6ab00d21
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 +19 -21
- package/bin/cli.cjs +1 -191
- package/bin/cli.js +90 -49
- package/bin/install-shared.cjs +1 -478
- package/bin/install-shared.js +615 -0
- package/bin/install.cjs +1 -143
- package/bin/install.js +18 -98
- package/bin/uninstall.cjs +1 -87
- package/bin/uninstall.js +12 -34
- package/commands/call.md +5 -1
- package/commands/cleanup.md +30 -8
- package/commands/doctor.md +7 -8
- package/commands/help.md +246 -244
- package/commands/observe.md +17 -12
- package/commands/yolo.md +11 -7
- package/hooks/babysitter-proxied-session-created.js +24 -0
- package/hooks/babysitter-proxied-session-created.sh +11 -0
- package/hooks/babysitter-proxied-shell-env.js +24 -0
- package/hooks/babysitter-proxied-shell-env.sh +3 -0
- package/hooks/babysitter-proxied-stop-hook.sh +3 -0
- package/hooks/babysitter-proxied-tool-execute-after.js +24 -0
- package/hooks/babysitter-proxied-tool-execute-after.sh +3 -0
- package/hooks/babysitter-proxied-tool-execute-before.js +24 -0
- package/hooks/babysitter-proxied-tool-execute-before.sh +3 -0
- package/hooks/hooks.json +14 -22
- package/package.json +21 -19
- package/plugin.json +6 -4
- package/scripts/create-release-tag.mjs +18 -0
- package/scripts/publish-from-tag.mjs +41 -0
- package/scripts/team-install.js +23 -0
- package/skills/accomplish-status/SKILL.md +3 -1
- package/skills/babysit/SKILL.md +6 -3
- package/skills/call/SKILL.md +5 -1
- package/skills/cleanup/SKILL.md +30 -8
- package/skills/contrib/SKILL.md +25 -25
- package/skills/doctor/SKILL.md +7 -8
- package/skills/help/SKILL.md +4 -2
- package/skills/observe/SKILL.md +7 -2
- package/skills/plugins/SKILL.md +243 -243
- package/skills/project-install/SKILL.md +3 -3
- package/skills/resume/SKILL.md +1 -1
- package/skills/retrospect/SKILL.md +48 -48
- package/skills/user-install/SKILL.md +3 -3
- package/skills/yolo/SKILL.md +5 -1
- package/versions.json +2 -2
- package/hooks/session-created.js +0 -181
- package/hooks/session-idle.js +0 -123
- package/hooks/shell-env.js +0 -87
- package/hooks/tool-execute-after.js +0 -106
- package/hooks/tool-execute-before.js +0 -108
- package/scripts/sync-command-docs.cjs +0 -105
- package/scripts/sync-command-surfaces.js +0 -52
|
@@ -0,0 +1,24 @@
|
|
|
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/pre-tool-use.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
|
+
}
|
package/hooks/hooks.json
CHANGED
|
@@ -1,45 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"description": "
|
|
3
|
+
"description": "babysitter hook registration for OpenCode.",
|
|
4
4
|
"hooks": {
|
|
5
5
|
"session.created": [
|
|
6
6
|
{
|
|
7
7
|
"type": "command",
|
|
8
|
-
"script": "hooks/session-created.js",
|
|
9
|
-
"description": "
|
|
8
|
+
"script": "./hooks/babysitter-proxied-session-created.js",
|
|
9
|
+
"description": "babysitter SessionStart hook",
|
|
10
10
|
"timeoutMs": 30000
|
|
11
11
|
}
|
|
12
12
|
],
|
|
13
|
-
"
|
|
13
|
+
"tool.execute.before": [
|
|
14
14
|
{
|
|
15
15
|
"type": "command",
|
|
16
|
-
"script": "hooks/
|
|
17
|
-
"description": "
|
|
16
|
+
"script": "./hooks/babysitter-proxied-tool-execute-before.js",
|
|
17
|
+
"description": "babysitter PreToolUse hook",
|
|
18
18
|
"timeoutMs": 30000
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
|
-
"
|
|
22
|
-
{
|
|
23
|
-
"type": "command",
|
|
24
|
-
"script": "hooks/shell-env.js",
|
|
25
|
-
"description": "Inject BABYSITTER_SESSION_ID and other env vars into shell",
|
|
26
|
-
"timeoutMs": 5000
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
"tool.execute.before": [
|
|
21
|
+
"tool.execute.after": [
|
|
30
22
|
{
|
|
31
23
|
"type": "command",
|
|
32
|
-
"script": "hooks/tool-execute-
|
|
33
|
-
"description": "
|
|
34
|
-
"timeoutMs":
|
|
24
|
+
"script": "./hooks/babysitter-proxied-tool-execute-after.js",
|
|
25
|
+
"description": "babysitter PostToolUse hook",
|
|
26
|
+
"timeoutMs": 30000
|
|
35
27
|
}
|
|
36
28
|
],
|
|
37
|
-
"
|
|
29
|
+
"shell.env": [
|
|
38
30
|
{
|
|
39
31
|
"type": "command",
|
|
40
|
-
"script": "hooks/
|
|
41
|
-
"description": "
|
|
42
|
-
"timeoutMs":
|
|
32
|
+
"script": "./hooks/babysitter-proxied-shell-env.js",
|
|
33
|
+
"description": "babysitter ShellEnv hook",
|
|
34
|
+
"timeoutMs": 5000
|
|
43
35
|
}
|
|
44
36
|
]
|
|
45
37
|
}
|
package/package.json
CHANGED
|
@@ -1,46 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a5c-ai/babysitter-opencode",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "5.0.1-staging.04ca6ab00d21",
|
|
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
|
-
"test": "node test/integration.test.js",
|
|
7
|
-
"test:integration": "node test/integration.test.js",
|
|
8
|
-
"sync:commands": "node scripts/sync-command-docs.cjs",
|
|
9
|
-
"postinstall": "node bin/install.cjs",
|
|
10
|
-
"preuninstall": "node bin/uninstall.cjs",
|
|
11
6
|
"deploy": "npm publish --access public",
|
|
12
|
-
"deploy:staging": "npm publish --access public --tag staging"
|
|
7
|
+
"deploy:staging": "npm publish --access public --tag staging",
|
|
8
|
+
"postinstall": "node bin/install.js",
|
|
9
|
+
"preuninstall": "node bin/uninstall.js",
|
|
10
|
+
"team:install": "node scripts/team-install.js",
|
|
11
|
+
"test": "node test/integration.test.js"
|
|
13
12
|
},
|
|
14
13
|
"bin": {
|
|
15
|
-
"babysitter-opencode": "bin/cli.
|
|
14
|
+
"babysitter-opencode": "bin/cli.js"
|
|
16
15
|
},
|
|
17
16
|
"files": [
|
|
18
17
|
"bin/",
|
|
19
|
-
"commands/",
|
|
20
18
|
"hooks/",
|
|
21
|
-
"scripts/",
|
|
22
19
|
"skills/",
|
|
20
|
+
"commands/",
|
|
21
|
+
"scripts/",
|
|
23
22
|
"plugin.json",
|
|
24
|
-
"
|
|
23
|
+
"README.md",
|
|
24
|
+
"versions.json",
|
|
25
|
+
"package.json"
|
|
25
26
|
],
|
|
26
27
|
"keywords": [
|
|
27
28
|
"babysitter",
|
|
28
29
|
"opencode",
|
|
29
|
-
"orchestration"
|
|
30
|
-
"ai-agent",
|
|
31
|
-
"sdk-integration"
|
|
30
|
+
"orchestration"
|
|
32
31
|
],
|
|
33
32
|
"author": "a5c.ai",
|
|
34
33
|
"license": "MIT",
|
|
35
34
|
"publishConfig": {
|
|
36
35
|
"access": "public"
|
|
37
36
|
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@a5c-ai/babysitter-sdk": "5.0.1-staging.04ca6ab00d21"
|
|
39
|
+
},
|
|
38
40
|
"repository": {
|
|
39
41
|
"type": "git",
|
|
40
|
-
"url": "https://github.com/a5c-ai/babysitter"
|
|
42
|
+
"url": "git+https://github.com/a5c-ai/babysitter-opencode.git"
|
|
41
43
|
},
|
|
42
|
-
"homepage": "https://github.com/a5c-ai/babysitter
|
|
43
|
-
"
|
|
44
|
-
"
|
|
44
|
+
"homepage": "https://github.com/a5c-ai/babysitter-opencode#readme",
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/a5c-ai/babysitter-opencode/issues"
|
|
45
47
|
}
|
|
46
48
|
}
|
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babysitter",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Orchestrate complex, multi-step workflows with event-sourced state management, hook-based extensibility, and human-in-the-loop approval
|
|
3
|
+
"version": "5.0.1-staging.04ca6ab00d21",
|
|
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",
|
|
7
7
|
"harness": "opencode",
|
|
@@ -18,8 +18,10 @@
|
|
|
18
18
|
"automation",
|
|
19
19
|
"event-sourced",
|
|
20
20
|
"hooks",
|
|
21
|
-
"
|
|
21
|
+
"TDD",
|
|
22
|
+
"quality-convergence",
|
|
22
23
|
"agent",
|
|
23
|
-
"LLM"
|
|
24
|
+
"LLM",
|
|
25
|
+
"opencode"
|
|
24
26
|
]
|
|
25
27
|
}
|
|
@@ -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]);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var path = require('path');
|
|
5
|
+
var shared = require('../bin/install-shared');
|
|
6
|
+
|
|
7
|
+
var workspace = process.cwd();
|
|
8
|
+
for (var i = 0; i < process.argv.length; i++) {
|
|
9
|
+
if (process.argv[i] === '--workspace' && process.argv[i + 1]) {
|
|
10
|
+
workspace = path.resolve(process.argv[i + 1]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
var src = process.env.PLUGIN_PACKAGE_ROOT || path.resolve(__dirname, '..');
|
|
15
|
+
var dest = shared.getHomePluginRoot('workspace');
|
|
16
|
+
console.log('[babysitter] Team install to ' + dest);
|
|
17
|
+
|
|
18
|
+
shared.copyPluginBundle(src, dest);
|
|
19
|
+
if (typeof shared.harnessTeamInstall === 'function') {
|
|
20
|
+
shared.harnessTeamInstall(src, dest, workspace);
|
|
21
|
+
}
|
|
22
|
+
shared.runPostInstall(dest);
|
|
23
|
+
console.log('[babysitter] Team install complete.');
|
|
@@ -29,7 +29,9 @@ 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
|
+
npm i -g @a5c-ai/babysitter-sdk@$SDK_VERSION
|
|
34
|
+
|
|
33
35
|
CLI="npx -y @a5c-ai/babysitter-sdk@$SDK_VERSION"
|
|
34
36
|
```
|
|
35
37
|
|
package/skills/babysit/SKILL.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: babysit
|
|
3
|
-
description:
|
|
3
|
+
description: >-
|
|
4
|
+
Execute via @babysitter. Use this skill when asked to babysit a task, do anything that is structured process-driven (even a loop) or whenever it is called explicitly. (babysit, babysitter, with a process, orchestrate, orchestrate a run, workflow, loop until, etc.)
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# babysit
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
Follow the commands below exactly. but apply judgement and creativity to get the job done. no matter how small or simple the task may seem, you must use the babysitter SDK and run lifecycle to execute it. This is non-negotiable. If you are asked to do something that seems like it could be done with a simple tool call, you must still use the babysitter SDK to create a run, define tasks, execute them, and complete the run. This is how you will learn and demonstrate mastery of the babysitter system. Always follow the full process, even for trivial tasks.
|
|
9
10
|
|
|
10
11
|
## Dependencies
|
|
11
12
|
|
|
@@ -14,7 +15,9 @@ Orchestrate `.a5c/runs/<runId>/` through iterative execution.
|
|
|
14
15
|
Read the SDK version from `versions.json` to ensure version compatibility:
|
|
15
16
|
|
|
16
17
|
```bash
|
|
17
|
-
SDK_VERSION=$(node -e "try{const fs=require('fs');const probes=['./plugins/babysitter-
|
|
18
|
+
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')}")
|
|
19
|
+
|
|
20
|
+
npm i -g @a5c-ai/babysitter-sdk@$SDK_VERSION
|
|
18
21
|
CLI="npx -y @a5c-ai/babysitter-sdk@$SDK_VERSION"
|
|
19
22
|
```
|
|
20
23
|
|
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/contrib/SKILL.md
CHANGED
|
@@ -5,30 +5,30 @@ description: Submit feedback or contribute to babysitter project
|
|
|
5
5
|
|
|
6
6
|
# contrib
|
|
7
7
|
|
|
8
|
-
Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).
|
|
9
|
-
|
|
10
|
-
## Process Routing
|
|
11
|
-
|
|
8
|
+
Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).
|
|
9
|
+
|
|
10
|
+
## Process Routing
|
|
11
|
+
|
|
12
12
|
Contribution processes live under the active process library's `cradle/` directory. Resolve the active library root with `babysitter process-library:active --json` and route based on arguments:
|
|
13
|
-
|
|
14
|
-
### Issue-based (opens a GitHub issue in a5c-ai/babysitter)
|
|
15
|
-
* **Bug report** → `cradle/bug-report.js#process` — Report a bug in the SDK, CLI, process library, etc.
|
|
16
|
-
* **Feature request** → `cradle/feature-request.js#process` — Request a new feature or enhancement
|
|
17
|
-
* **Documentation question** → `cradle/documentation-question.js#process` — Ask about undocumented behavior or missing docs
|
|
18
|
-
|
|
19
|
-
### PR-based (forks repo, creates branch, submits PR to a5c-ai/babysitter)
|
|
20
|
-
* **Bugfix** → `cradle/bugfix.js#process` — User already has the fix for a bug
|
|
21
|
-
* **Feature implementation** → `cradle/feature-implementation-contribute.js#process` — User already has a feature implementation
|
|
22
|
-
* **Harness integration** → `cradle/feature-harness-integration-contribute.js#process` — User has a harness (CI/CD, IDE, editor) integration
|
|
23
|
-
* **Library contribution** → `cradle/library-contribution.js#process` — New or improved process/skill/subagent for the library
|
|
24
|
-
* **Documentation answer** → `cradle/documentation-contribute-answer.js#process` — User has an answer for an unanswered docs question
|
|
25
|
-
|
|
26
|
-
### Router (when arguments are empty or general)
|
|
27
|
-
* **Contribute** → `cradle/contribute.js#process` — Explains contribution types and routes to the specific process
|
|
28
|
-
|
|
29
|
-
## Contribution Rules
|
|
30
|
-
|
|
31
|
-
* PR-based contributions: fork the babysitter repo (a5c-ai/babysitter) for the user, ask to star if not already starred, perform changes, submit PR
|
|
32
|
-
* Issue-based contributions: gather details, search for duplicates, review, then open an issue in a5c-ai/babysitter
|
|
33
|
-
* Add breakpoints (permissions) before ALL gh actions (fork, star, submit PR/issue) to allow user review and cancellation
|
|
13
|
+
|
|
14
|
+
### Issue-based (opens a GitHub issue in a5c-ai/babysitter)
|
|
15
|
+
* **Bug report** → `cradle/bug-report.js#process` — Report a bug in the SDK, CLI, process library, etc.
|
|
16
|
+
* **Feature request** → `cradle/feature-request.js#process` — Request a new feature or enhancement
|
|
17
|
+
* **Documentation question** → `cradle/documentation-question.js#process` — Ask about undocumented behavior or missing docs
|
|
18
|
+
|
|
19
|
+
### PR-based (forks repo, creates branch, submits PR to a5c-ai/babysitter)
|
|
20
|
+
* **Bugfix** → `cradle/bugfix.js#process` — User already has the fix for a bug
|
|
21
|
+
* **Feature implementation** → `cradle/feature-implementation-contribute.js#process` — User already has a feature implementation
|
|
22
|
+
* **Harness integration** → `cradle/feature-harness-integration-contribute.js#process` — User has a harness (CI/CD, IDE, editor) integration
|
|
23
|
+
* **Library contribution** → `cradle/library-contribution.js#process` — New or improved process/skill/subagent for the library
|
|
24
|
+
* **Documentation answer** → `cradle/documentation-contribute-answer.js#process` — User has an answer for an unanswered docs question
|
|
25
|
+
|
|
26
|
+
### Router (when arguments are empty or general)
|
|
27
|
+
* **Contribute** → `cradle/contribute.js#process` — Explains contribution types and routes to the specific process
|
|
28
|
+
|
|
29
|
+
## Contribution Rules
|
|
30
|
+
|
|
31
|
+
* PR-based contributions: fork the babysitter repo (a5c-ai/babysitter) for the user, ask to star if not already starred, perform changes, submit PR
|
|
32
|
+
* Issue-based contributions: gather details, search for duplicates, review, then open an issue in a5c-ai/babysitter
|
|
33
|
+
* Add breakpoints (permissions) before ALL gh actions (fork, star, submit PR/issue) to allow user review and cancellation
|
|
34
34
|
* If arguments are empty: use the `contribute.js` router process to show options and route accordingly
|
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`.
|
|
@@ -363,13 +362,13 @@ Mark as FAIL if:
|
|
|
363
362
|
- Parse the output and inspect the `resolvedFrom` field. Classify as follows:
|
|
364
363
|
- `resolvedFrom: "pid-marker"` → mark as PASS ("Session ID derives from the live Claude Code ancestor process -- authoritative").
|
|
365
364
|
- `resolvedFrom: "env-file"` → mark as PASS with a note ("CLAUDE_ENV_FILE was used; typically healthy").
|
|
366
|
-
- `resolvedFrom: "env-var"` → mark as WARN ("`
|
|
367
|
-
- Remediation: run `babysitter session:cleanup` and start a fresh Claude Code session, or `unset
|
|
365
|
+
- `resolvedFrom: "env-var"` → mark as WARN ("`AGENT_SESSION_ID` is set without a corroborating PID marker. Likely stale from a prior Claude Code session -- see GitHub issue #130").
|
|
366
|
+
- Remediation: run `babysitter session:cleanup` and start a fresh Claude Code session, or `unset AGENT_SESSION_ID` before invoking babysitter.
|
|
368
367
|
- `resolvedFrom: "none"` → mark as ERROR ("No session ID resolvable. Either no session-start hook fired, or the ancestor walk failed").
|
|
369
368
|
|
|
370
369
|
**Env-var shadow check:**
|
|
371
370
|
- Independently inspect `envVarPresent` and `envVarMatches` in the output.
|
|
372
|
-
- If `envVarPresent && !envVarMatches`, mark as WARN ("`
|
|
371
|
+
- If `envVarPresent && !envVarMatches`, mark as WARN ("`AGENT_SESSION_ID` in env does not match the resolved session ID; a stale value is shadowing the authoritative one. Unset the env var").
|
|
373
372
|
|
|
374
373
|
---
|
|
375
374
|
|
|
@@ -391,7 +390,7 @@ Mark as FAIL if:
|
|
|
391
390
|
|
|
392
391
|
- Enumerate files in `~/.a5c/` matching the pattern `current-session-*-pid-*`.
|
|
393
392
|
- Count markers per harness (derived from the filename).
|
|
394
|
-
- If more than one live marker exists for the same harness, mark as INFO ("Multiple live Claude Code / harness sessions detected; ensure each shell scopes `
|
|
393
|
+
- If more than one live marker exists for the same harness, mark as INFO ("Multiple live Claude Code / harness sessions detected; ensure each shell scopes `AGENT_SESSION_ID` appropriately -- the PID marker handles this automatically").
|
|
395
394
|
- Otherwise mark as PASS.
|
|
396
395
|
|
|
397
396
|
---
|
|
@@ -502,7 +501,7 @@ babysitter session:cleanup --dry-run # preview
|
|
|
502
501
|
babysitter session:cleanup # apply
|
|
503
502
|
|
|
504
503
|
# 2. Unset a stale env var
|
|
505
|
-
unset
|
|
504
|
+
unset AGENT_SESSION_ID
|
|
506
505
|
|
|
507
506
|
# 3. Re-bind a run explicitly if needed
|
|
508
507
|
babysitter session:resume --session-id <fresh-id> --state-dir ~/.a5c --run-id <runId> --runs-dir .a5c/runs
|
package/skills/help/SKILL.md
CHANGED
|
@@ -231,9 +231,11 @@ SECONDARY COMMANDS
|
|
|
231
231
|
effect status in your browser. Useful when running /yolo or /forever to watch
|
|
232
232
|
progress without interrupting the run.
|
|
233
233
|
|
|
234
|
-
How it works: Runs npx @
|
|
234
|
+
How it works: Runs npx @a5c-ai/babysitter-observer-dashboard@latest which watches
|
|
235
235
|
the .a5c/runs/ directory (or a parent directory containing multiple projects) and
|
|
236
|
-
serves a live dashboard. The process is blocking -- it runs until you stop it
|
|
236
|
+
serves a live dashboard. The process is blocking -- it runs until you stop it, and
|
|
237
|
+
it prints the local URL to share with the user. Do not use `babysitter observe`
|
|
238
|
+
as a fallback; the core Babysitter CLI does not expose that subcommand.
|
|
237
239
|
|
|
238
240
|
Example: /babysitter:observe
|
|
239
241
|
(opens browser showing all runs with live-updating task
|
package/skills/observe/SKILL.md
CHANGED
|
@@ -8,6 +8,11 @@ description: Launch the babysitter observer dashboard. Installs and runs the rea
|
|
|
8
8
|
Run the babysitter observer dashboard:
|
|
9
9
|
|
|
10
10
|
1. Determine the watch directory — this is usually the project's container directory (the parent of the project dir), or the current working directory if not specified.
|
|
11
|
-
2. Launch the dashboard: `npx -y @a5c-ai/babysitter-observer-dashboard@latest --watch-dir <dir
|
|
11
|
+
2. Launch the standalone dashboard package: `npx -y @a5c-ai/babysitter-observer-dashboard@latest --watch-dir <dir>`.
|
|
12
12
|
3. This is a blocking process — it will keep running until stopped.
|
|
13
|
-
4.
|
|
13
|
+
4. Report the URL printed by the dashboard to the user, then open it in the browser.
|
|
14
|
+
|
|
15
|
+
Do not fall back to `babysitter observe`; the core Babysitter CLI does not expose
|
|
16
|
+
that subcommand. Some harness runtimes may provide a separate
|
|
17
|
+
`agent-platform observe` surface, but this skill uses the verified standalone
|
|
18
|
+
dashboard package.
|