@a5c-ai/babysitter-opencode 5.0.1-staging.d73033a7 → 5.0.1-staging.daf8e165bc4a

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.
Files changed (63) hide show
  1. package/README.md +19 -21
  2. package/bin/cli.cjs +1 -191
  3. package/bin/cli.js +90 -49
  4. package/bin/install-shared.cjs +1 -478
  5. package/bin/install-shared.js +615 -0
  6. package/bin/install.cjs +1 -143
  7. package/bin/install.js +18 -98
  8. package/bin/uninstall.cjs +1 -87
  9. package/bin/uninstall.js +12 -34
  10. package/commands/blueprints.md +64 -0
  11. package/commands/call.md +11 -7
  12. package/commands/check-forbidden-markers.md +68 -0
  13. package/commands/cleanup.md +37 -9
  14. package/commands/contrib.md +31 -31
  15. package/commands/doctor.md +7 -8
  16. package/commands/forever.md +6 -6
  17. package/commands/help.md +246 -244
  18. package/commands/observe.md +17 -12
  19. package/commands/plan.md +17 -7
  20. package/commands/plugins.md +22 -255
  21. package/commands/project-install.md +10 -10
  22. package/commands/resume.md +8 -8
  23. package/commands/retrospect.md +55 -55
  24. package/commands/user-install.md +10 -10
  25. package/commands/yolo.md +11 -7
  26. package/hooks/babysitter-proxied-session-created.js +20 -212
  27. package/hooks/babysitter-proxied-session-created.sh +11 -0
  28. package/hooks/babysitter-proxied-shell-env.js +23 -145
  29. package/hooks/babysitter-proxied-shell-env.sh +3 -0
  30. package/hooks/babysitter-proxied-stop-hook.sh +3 -0
  31. package/hooks/babysitter-proxied-tool-execute-after.js +22 -160
  32. package/hooks/babysitter-proxied-tool-execute-after.sh +3 -0
  33. package/hooks/babysitter-proxied-tool-execute-before.js +22 -162
  34. package/hooks/babysitter-proxied-tool-execute-before.sh +3 -0
  35. package/hooks/hooks.json +14 -22
  36. package/package.json +21 -19
  37. package/plugin.json +6 -4
  38. package/scripts/create-release-tag.mjs +18 -0
  39. package/scripts/publish-from-tag.mjs +41 -0
  40. package/scripts/team-install.js +23 -0
  41. package/skills/accomplish-status/SKILL.md +8 -2
  42. package/skills/babysit/SKILL.md +35 -10
  43. package/skills/blueprints/SKILL.md +66 -0
  44. package/skills/call/SKILL.md +5 -1
  45. package/skills/check-forbidden-markers/SKILL.md +69 -0
  46. package/skills/cleanup/SKILL.md +37 -9
  47. package/skills/doctor/SKILL.md +7 -8
  48. package/skills/help/SKILL.md +13 -11
  49. package/skills/observe/SKILL.md +7 -2
  50. package/skills/plan/SKILL.md +11 -1
  51. package/skills/plugins/SKILL.md +12 -245
  52. package/skills/yolo/SKILL.md +5 -1
  53. package/versions.json +2 -2
  54. package/hooks/babysitter-proxied-session-idle.js +0 -173
  55. package/hooks/hooks.json.legacy +0 -46
  56. package/hooks/proxied-hooks.json +0 -47
  57. package/hooks/session-created.js +0 -182
  58. package/hooks/session-idle.js +0 -124
  59. package/hooks/shell-env.js +0 -88
  60. package/hooks/tool-execute-after.js +0 -107
  61. package/hooks/tool-execute-before.js +0 -109
  62. package/scripts/sync-command-docs.cjs +0 -107
  63. package/scripts/sync-command-surfaces.js +0 -52
@@ -1,166 +1,26 @@
1
1
  #!/usr/bin/env node
2
- /**
3
- * Unified Tool Execute Before Hook for OpenCode
4
- * Routes through hooks-proxy for all hook execution.
5
- *
6
- * Fires before a tool execution in OpenCode. Delegates to
7
- * `babysitter hook:run --hook-type pre-tool-use` via hooks-proxy.
8
- *
9
- * This hook can be used to:
10
- * - Log tool invocations for babysitter run observability
11
- * - Block certain tool calls during specific orchestration phases
12
- * - Inject babysitter context into tool arguments
13
- *
14
- * OpenCode plugin protocol:
15
- * - Receives tool context as JSON via stdin
16
- * - Outputs JSON to stdout (empty = allow, { block: true } = block)
17
- * - Exit 0 = success
18
- */
19
-
20
2
  "use strict";
21
-
22
- const { execSync } = require("child_process");
23
- const { readFileSync, mkdirSync, appendFileSync, existsSync, writeFileSync } = require("fs");
24
- const os = require("os");
25
- const path = require("path");
26
-
27
- const PLUGIN_ROOT = process.env.OPENCODE_PLUGIN_ROOT || path.resolve(__dirname, "..");
28
- const GLOBAL_ROOT = process.env.BABYSITTER_GLOBAL_STATE_DIR || path.join(os.homedir(), ".a5c");
29
- const STATE_DIR = process.env.BABYSITTER_STATE_DIR || path.join(GLOBAL_ROOT, "state");
30
- const LOG_DIR = process.env.BABYSITTER_LOG_DIR || path.join(GLOBAL_ROOT, "logs");
31
- const LOG_FILE = path.join(LOG_DIR, "babysitter-tool-before-hook.log");
32
- const PROXY_MARKER = path.join(PLUGIN_ROOT, ".hooks-proxy-install-attempted");
33
-
34
- function ensureDir(dir) {
35
- try { mkdirSync(dir, { recursive: true }); } catch { /* best-effort */ }
36
- }
37
-
38
- function blog(msg) {
39
- ensureDir(LOG_DIR);
40
- const ts = new Date().toISOString();
41
- try {
42
- appendFileSync(LOG_FILE, `[INFO] ${ts} ${msg}\n`);
43
- } catch { /* best-effort */ }
44
- }
45
-
46
- function getSdkVersion() {
47
- try {
48
- const versions = JSON.parse(readFileSync(path.join(PLUGIN_ROOT, "versions.json"), "utf8"));
49
- return versions.sdkVersion || "latest";
50
- } catch {
51
- return "latest";
52
- }
53
- }
54
-
55
- function resolveHooksProxy() {
56
- try {
57
- execSync("a5c-hooks-proxy --version", { stdio: "pipe", timeout: 5000 });
58
- return "a5c-hooks-proxy";
59
- } catch { /* not in PATH */ }
60
-
61
- const localProxy = path.join(
62
- process.env.HOME || process.env.USERPROFILE || "~",
63
- ".local", "bin", process.platform === "win32" ? "a5c-hooks-proxy.exe" : "a5c-hooks-proxy"
64
- );
65
- if (existsSync(localProxy)) {
66
- return localProxy;
67
- }
68
-
69
- return null;
70
- }
71
-
72
- function installHooksProxy(version) {
73
- if (existsSync(PROXY_MARKER)) return;
74
-
75
- try {
76
- execSync(`npm i -g "@a5c-ai/hooks-proxy-cli@${version}" --loglevel=error`, {
77
- stdio: "pipe",
78
- timeout: 120000,
79
- });
80
- blog(`Installed hooks-proxy globally (${version})`);
81
- } catch {
82
- try {
83
- const prefix = path.join(process.env.HOME || process.env.USERPROFILE || "~", ".local");
84
- execSync(`npm i -g "@a5c-ai/hooks-proxy-cli@${version}" --prefix "${prefix}" --loglevel=error`, {
85
- stdio: "pipe",
86
- timeout: 120000,
87
- });
88
- blog(`Installed hooks-proxy to user prefix (${version})`);
89
- } catch {
90
- blog("hooks-proxy installation failed");
91
- }
92
- }
93
-
94
- try { writeFileSync(PROXY_MARKER, version); } catch { /* best-effort */ }
95
- }
96
-
97
- function main() {
98
- const sessionId = process.env.BABYSITTER_SESSION_ID
99
- || process.env.OPENCODE_SESSION_ID
100
- || "";
101
-
102
- if (!sessionId) {
103
- // No session -- pass through without intervention
104
- process.stdout.write("{}\n");
105
- return;
106
- }
107
-
108
- // Read stdin for tool context
109
- let inputData = "";
110
- try {
111
- inputData = require("fs").readFileSync(0, "utf8");
112
- } catch {
113
- // No stdin available
114
- }
115
-
116
- blog(`Unified tool-execute-before: session=${sessionId}`);
117
-
118
- const hookInput = JSON.stringify({
119
- session_id: sessionId,
120
- cwd: process.cwd(),
121
- harness: "opencode",
122
- plugin_root: PLUGIN_ROOT,
123
- tool_context: inputData ? JSON.parse(inputData) : {},
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 (e) { process.stderr.write("[extension-mux] stdin read failed: " + (e instanceof Error ? e.message : String(e)) + "\n"); }
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
+ })
124
20
  });
125
-
126
- const sdkVersion = getSdkVersion();
127
-
128
- // Ensure hooks-proxy is installed
129
- let proxy = resolveHooksProxy();
130
- if (!proxy) {
131
- installHooksProxy(sdkVersion);
132
- proxy = resolveHooksProxy();
133
- }
134
-
135
- const handler = `babysitter hook:run --harness unified --hook-type pre-tool-use --plugin-root ${PLUGIN_ROOT} --state-dir ${STATE_DIR} --json`;
136
-
137
- try {
138
- let result;
139
- if (proxy) {
140
- blog(`Using hooks-proxy: ${proxy}`);
141
- result = execSync(`"${proxy}" invoke --adapter opencode --handler "${handler}" --json`, {
142
- input: hookInput,
143
- stdio: ["pipe", "pipe", "pipe"],
144
- timeout: 10000,
145
- env: { ...process.env, BABYSITTER_STATE_DIR: STATE_DIR },
146
- });
147
- } else {
148
- blog("hooks-proxy not found after install, using npx fallback");
149
- result = execSync(`npx -y "@a5c-ai/hooks-proxy-cli@${sdkVersion}" invoke --adapter opencode --handler "${handler}" --json`, {
150
- input: hookInput,
151
- stdio: ["pipe", "pipe", "pipe"],
152
- timeout: 30000,
153
- env: { ...process.env, BABYSITTER_STATE_DIR: STATE_DIR },
154
- });
155
- }
156
- const output = result.toString("utf8").trim();
157
- blog(`Hook result: ${output}`);
158
- process.stdout.write((output || "{}") + "\n");
159
- } catch (err) {
160
- // On failure, allow the tool execution to proceed
161
- blog(`Pre-tool-use hook failed: ${err.message} -- allowing execution`);
162
- process.stdout.write("{}\n");
163
- }
21
+ process.stdout.write(result);
22
+ } catch (e) {
23
+ process.stderr.write("[extension-mux] hook execution failed: " + (e instanceof Error ? e.message : String(e)) + "\n");
24
+ process.stdout.write(JSON.stringify({ error: e instanceof Error ? e.message : String(e) }) + "\n");
25
+ process.exit(1);
164
26
  }
165
-
166
- main();
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ babysitter hook:run --harness unified --hook-type pre-tool-use --json
package/hooks/hooks.json CHANGED
@@ -1,45 +1,37 @@
1
1
  {
2
2
  "version": 1,
3
- "description": "Babysitter hook registration for OpenCode. Maps OpenCode plugin events to unified babysitter hook scripts with hooks-proxy support.",
3
+ "description": "babysitter hook registration for OpenCode.",
4
4
  "hooks": {
5
5
  "session.created": [
6
6
  {
7
7
  "type": "command",
8
- "script": "hooks/babysitter-proxied-session-created.js",
9
- "description": "Initialize babysitter session state and inject context (proxied via a5c-hooks-proxy)",
8
+ "script": "./hooks/babysitter-proxied-session-created.js",
9
+ "description": "babysitter SessionStart hook",
10
10
  "timeoutMs": 30000
11
11
  }
12
12
  ],
13
- "session.idle": [
13
+ "tool.execute.before": [
14
14
  {
15
15
  "type": "command",
16
- "script": "hooks/babysitter-proxied-session-idle.js",
17
- "description": "Check for pending babysitter effects when agent goes idle (proxied via a5c-hooks-proxy)",
16
+ "script": "./hooks/babysitter-proxied-tool-execute-before.js",
17
+ "description": "babysitter PreToolUse hook",
18
18
  "timeoutMs": 30000
19
19
  }
20
20
  ],
21
- "shell.env": [
22
- {
23
- "type": "command",
24
- "script": "hooks/babysitter-proxied-shell-env.js",
25
- "description": "Inject BABYSITTER_SESSION_ID and other env vars into shell (proxied via a5c-hooks-proxy)",
26
- "timeoutMs": 5000
27
- }
28
- ],
29
- "tool.execute.before": [
21
+ "tool.execute.after": [
30
22
  {
31
23
  "type": "command",
32
- "script": "hooks/babysitter-proxied-tool-execute-before.js",
33
- "description": "Pre-tool-use hook for babysitter awareness (proxied via a5c-hooks-proxy)",
34
- "timeoutMs": 10000
24
+ "script": "./hooks/babysitter-proxied-tool-execute-after.js",
25
+ "description": "babysitter PostToolUse hook",
26
+ "timeoutMs": 30000
35
27
  }
36
28
  ],
37
- "tool.execute.after": [
29
+ "shell.env": [
38
30
  {
39
31
  "type": "command",
40
- "script": "hooks/babysitter-proxied-tool-execute-after.js",
41
- "description": "Post-tool-use hook for babysitter awareness (proxied via a5c-hooks-proxy)",
42
- "timeoutMs": 10000
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": "5.0.1-staging.d73033a7",
4
- "description": "Babysitter orchestration plugin for OpenCode with SDK-managed process-library bootstrapping and in-turn iteration model",
3
+ "version": "5.0.1-staging.daf8e165bc4a",
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.cjs"
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
- "versions.json"
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.daf8e165bc4a"
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/tree/main/plugins/babysitter-opencode#readme",
43
- "dependencies": {
44
- "@a5c-ai/babysitter-sdk": "5.0.1-staging.d73033a7"
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": "5.0.1-staging.d73033a7",
4
- "description": "Orchestrate complex, multi-step workflows with event-sourced state management, hook-based extensibility, and human-in-the-loop approval -- powered by the Babysitter SDK",
3
+ "version": "5.0.1-staging.daf8e165bc4a",
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
- "opencode",
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,12 +29,18 @@ 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-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')}")
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
- CLI="npx -y @a5c-ai/babysitter-sdk@$SDK_VERSION"
35
+ if command -v babysitter >/dev/null 2>&1 && babysitter --version >/dev/null 2>&1; then
36
+ CLI="babysitter"
37
+ else
38
+ CLI="npm exec --yes --package @a5c-ai/babysitter-sdk@$SDK_VERSION -- babysitter"
39
+ fi
36
40
  ```
37
41
 
42
+ If a stale or broken global shim fails with `MODULE_NOT_FOUND`, repair it with `npm rm -g @a5c-ai/babysitter @a5c-ai/babysitter-sdk && npm i -g @a5c-ai/babysitter-sdk@$SDK_VERSION`, then re-run `babysitter --version`.
43
+
38
44
  ## Instructions
39
45
 
40
46
  ### 1. Resolve the status directory
@@ -1,11 +1,24 @@
1
1
  ---
2
2
  name: babysit
3
- 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.)
3
+ description: 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
+ allowed-tools: Read, Grep, Write, Task, Bash, Edit, Grep, Glob, WebFetch, WebSearch, Search, AskUserQuestion, TodoWrite, TodoRead, Skill, BashOutput, KillShell, MultiEdit, LS
5
+ version: 0.1.3
4
6
  ---
5
7
 
6
8
  # babysit
7
9
 
8
- Orchestrate `.a5c/runs/<runId>/` through iterative execution.
10
+ 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.
11
+
12
+ Subagents that need a scratch checkout or working directory must create it under
13
+ `/tmp/<descriptive-name>/`, not under `.a5c/runs/<runId>/work`. Before returning
14
+ deliverables, validate that no run-dir worktree was left behind, for example:
15
+
16
+ ```bash
17
+ find .a5c/runs -maxdepth 3 -name work -type d -print
18
+ ```
19
+
20
+ That command should print nothing. If it prints a non-empty work directory, move
21
+ or remove only the scratch data you created before returning.
9
22
 
10
23
  ## Dependencies
11
24
 
@@ -14,24 +27,36 @@ Orchestrate `.a5c/runs/<runId>/` through iterative execution.
14
27
  Read the SDK version from `versions.json` to ensure version compatibility:
15
28
 
16
29
  ```bash
17
- 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')}")
18
-
19
- npm i -g @a5c-ai/babysitter-sdk@$SDK_VERSION
20
- CLI="npx -y @a5c-ai/babysitter-sdk@$SDK_VERSION"
30
+ SDK_VERSION=$(node -e "try{console.log(JSON.parse(require('fs').readFileSync('${OPENCODE_PLUGIN_ROOT}/versions.json','utf8')).sdkVersion||'latest')}catch{console.log('latest')}")
31
+ npm i -g @a5c-ai/babysitter-sdk@$SDK_VERSION || npm i -g @a5c-ai/babysitter-sdk@latest
32
+
33
+ if command -v babysitter >/dev/null 2>&1 && babysitter --version >/dev/null 2>&1; then
34
+ CLI="babysitter"
35
+ else
36
+ CLI="npm exec --yes --package @a5c-ai/babysitter-sdk@$SDK_VERSION -- babysitter"
37
+ fi
21
38
  ```
22
39
 
40
+ If the pinned version fails to install (e.g. not yet published), the fallback installs `latest`.
41
+
42
+ If a stale or broken global shim fails with `MODULE_NOT_FOUND`, repair it with `npm rm -g @a5c-ai/babysitter @a5c-ai/babysitter-sdk && npm i -g @a5c-ai/babysitter-sdk@$SDK_VERSION`, then re-run `babysitter --version`.
43
+
44
+ ### jq
45
+
46
+ Make sure `jq` is installed and available in the path. If not, install it.
47
+
23
48
  ## Instructions
24
49
 
25
- Run the following command to get full orchestration instructions:
50
+ Run the following command to get full instructions:
26
51
 
27
52
  ```bash
28
- babysitter instructions:babysit-skill --harness opencode --interactive
53
+ $CLI instructions:babysit-skill --harness opencode --interactive
29
54
  ```
30
55
 
31
- For non-interactive mode:
56
+ For non-interactive mode (running with `-p` flag or no AskUserQuestion tool):
32
57
 
33
58
  ```bash
34
- babysitter instructions:babysit-skill --harness opencode --no-interactive
59
+ $CLI instructions:babysit-skill --harness opencode --no-interactive
35
60
  ```
36
61
 
37
62
  Follow the instructions returned by the command above to orchestrate the run.
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: blueprints
3
+ description: manage Babysitter blueprints. Use this command to list installed blueprints, browse marketplaces, install, update, uninstall, configure, or create a new blueprint.
4
+ ---
5
+
6
+ # blueprints
7
+
8
+ This command installs and manages Babysitter blueprints. A blueprint is a version-managed package of contextual instructions or deterministic Babysitter processes, not a conventional software plugin.
9
+
10
+ If the command is run without arguments, list installed blueprints with their name, version, marketplace, installation date, and last update date. Also list configured marketplaces and show how to add the default marketplace when none exist.
11
+
12
+ Blueprints can be installed at two scopes:
13
+
14
+ - **global** (`--global`): stored under `~/.a5c/`, available for all projects
15
+ - **project** (`--project`): stored under `<projectDir>/.a5c/`, project-specific
16
+
17
+ ## Marketplace Management
18
+
19
+ Marketplaces are git repositories containing a `marketplace.json` manifest and blueprint package directories. The SDK clones new marketplaces to `.a5c/blueprints/marketplaces/` for the selected scope and reads legacy `.a5c/marketplaces/` clones for compatibility.
20
+
21
+ ### Add a marketplace
22
+
23
+ ```bash
24
+ babysitter blueprint:add-marketplace --marketplace-url <url> [--marketplace-path <relative-path>] [--marketplace-branch <ref>] [--force] --global|--project [--json]
25
+ ```
26
+
27
+ ### Update a marketplace
28
+
29
+ ```bash
30
+ babysitter blueprint:update-marketplace --marketplace-name <name> [--marketplace-branch <ref>] --global|--project [--json]
31
+ ```
32
+
33
+ ### List blueprints in a marketplace
34
+
35
+ ```bash
36
+ babysitter blueprint:list-plugins --marketplace-name <name> --global|--project [--json]
37
+ ```
38
+
39
+ ## Blueprint Lifecycle
40
+
41
+ For `blueprint:install`, `blueprint:update`, `blueprint:configure`, and `blueprint:list-plugins`, the `--marketplace-name` flag is auto-detected when only one marketplace is cloned for the selected scope.
42
+
43
+ ```bash
44
+ babysitter blueprint:install --plugin-name <name> [--marketplace-name <mp>] --global|--project [--json]
45
+ babysitter blueprint:update --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
46
+ babysitter blueprint:configure --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
47
+ babysitter blueprint:uninstall --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
48
+ ```
49
+
50
+ The `--plugin-name` flag is preserved for CLI compatibility with existing marketplace manifests. User-facing docs should call the installable a blueprint.
51
+
52
+ ## Registry Management
53
+
54
+ ```bash
55
+ babysitter blueprint:list-installed --global|--project [--json]
56
+ babysitter blueprint:update-registry --plugin-name <name> --plugin-version <ver> --marketplace-name <mp> --global|--project [--json]
57
+ babysitter blueprint:remove-from-registry --plugin-name <name> --global|--project [--json]
58
+ ```
59
+
60
+ ## Deprecated Aliases
61
+
62
+ The old `plugin:*` commands remain available as deprecated aliases for one release. Prefer `blueprint:*` in new docs, skills, and process instructions.
63
+
64
+ ## Agent Plugins Are Separate
65
+
66
+ Do not rename or reinterpret agent harness plugins while handling blueprints. `CLAUDE_PLUGIN_ROOT`, `PI_PLUGIN_ROOT`, `.claude/plugins/`, hooks-mux, extension-mux, and agent plugin manifests stay plugin-specific.
@@ -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