@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
package/bin/install.cjs CHANGED
@@ -1,146 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- /**
5
- * Babysitter OpenCode Plugin Installer
6
- *
7
- * Copies the babysitter plugin bundle into the OpenCode plugins directory:
8
- * <workspace>/.opencode/plugins/babysitter/
9
- *
10
- * Registers hooks in OpenCode config, creates the index.js entry point
11
- * for plugin discovery, and bootstraps the global process library.
12
- *
13
- * Usage:
14
- * node install.cjs # Install into cwd workspace
15
- * node install.cjs --workspace /path # Install into specified workspace
16
- * node install.cjs --global # Global install (user home)
17
- * node install.cjs --accomplish # Install only to Accomplish AI data dir
18
- */
19
-
20
- const path = require('path');
21
- const {
22
- copyPluginBundle,
23
- ensureGlobalProcessLibrary,
24
- ensureMarketplaceEntry,
25
- getAccomplishOpenCodeHome,
26
- getHomeMarketplacePath,
27
- getHomePluginRoot,
28
- getOpenCodeHome,
29
- installAccomplishSurface,
30
- installOpenCodeSurface,
31
- isAccomplishInstalled,
32
- writeIndexJs,
33
- } = require('./install-shared.cjs');
34
-
35
- const PACKAGE_ROOT = path.resolve(__dirname, '..');
36
-
37
- function parseArgs(argv) {
38
- let workspace = process.env.OPENCODE_WORKSPACE || process.cwd();
39
- let accomplish = false;
40
- for (let i = 2; i < argv.length; i += 1) {
41
- const arg = argv[i];
42
- if (arg === '--workspace') {
43
- const next = argv[i + 1];
44
- workspace = next && !next.startsWith('-') ? path.resolve(argv[++i]) : process.cwd();
45
- continue;
46
- }
47
- if (arg === '--global') {
48
- workspace = null;
49
- continue;
50
- }
51
- if (arg === '--accomplish') {
52
- accomplish = true;
53
- continue;
54
- }
55
- throw new Error(`unknown argument: ${arg}`);
56
- }
57
- return { workspace, accomplish };
58
- }
59
-
60
- function installStandardOpenCode(workspace) {
61
- const openCodeHome = getOpenCodeHome(workspace);
62
- const pluginRoot = getHomePluginRoot(workspace);
63
- const marketplacePath = getHomeMarketplacePath(workspace);
64
-
65
- console.log(`[babysitter] Installing OpenCode plugin to ${pluginRoot}`);
66
-
67
- // 1. Copy plugin bundle
68
- copyPluginBundle(PACKAGE_ROOT, pluginRoot);
69
- console.log('[babysitter] Copied plugin bundle');
70
-
71
- // 2. Write index.js entry point for OpenCode plugin discovery
72
- writeIndexJs(pluginRoot);
73
- console.log('[babysitter] Created index.js entry point');
74
-
75
- // 3. Register in marketplace
76
- ensureMarketplaceEntry(marketplacePath, pluginRoot);
77
- console.log(`[babysitter] Marketplace: ${marketplacePath}`);
78
-
79
- // 4. Install OpenCode surfaces (skills, hooks config)
80
- installOpenCodeSurface(PACKAGE_ROOT, openCodeHome);
81
- console.log('[babysitter] Installed hooks and skills');
82
-
83
- // 5. Bootstrap global process library
84
- try {
85
- const active = ensureGlobalProcessLibrary(PACKAGE_ROOT);
86
- console.log(`[babysitter] Process library: ${active.binding?.dir || '(default)'}`);
87
- if (active.defaultSpec?.cloneDir) {
88
- console.log(`[babysitter] Process library clone: ${active.defaultSpec.cloneDir}`);
89
- }
90
- console.log(`[babysitter] Process library state: ${active.stateFile}`);
91
- } catch (err) {
92
- console.warn(`[babysitter] Warning: Could not bootstrap process library: ${err.message}`);
93
- console.warn('[babysitter] Run "babysitter process-library:clone" manually if needed.');
94
- }
95
- }
96
-
97
- function installToAccomplish() {
98
- const accomplishHome = getAccomplishOpenCodeHome();
99
- console.log(`[babysitter] Installing plugin to Accomplish AI: ${accomplishHome}`);
100
-
101
- installAccomplishSurface(PACKAGE_ROOT, accomplishHome);
102
-
103
- console.log('[babysitter] Copied plugin bundle to Accomplish');
104
- console.log('[babysitter] Created index.js entry point for Accomplish');
105
- console.log('[babysitter] Installed hooks and skills for Accomplish');
106
- console.log('[babysitter] Accomplish AI installation complete.');
107
- console.log('[babysitter] Restart Accomplish to pick up the installed plugin.');
108
- }
109
-
110
- function main() {
111
- const { workspace, accomplish } = parseArgs(process.argv);
112
-
113
- try {
114
- // If --accomplish is used without --global/--workspace, install only to Accomplish
115
- if (accomplish && workspace !== null) {
116
- installToAccomplish();
117
- return;
118
- }
119
-
120
- // Standard OpenCode install
121
- installStandardOpenCode(workspace);
122
-
123
- // Auto-detect Accomplish and install there too (unless --accomplish was explicit)
124
- if (!accomplish) {
125
- try {
126
- if (isAccomplishInstalled()) {
127
- console.log('[babysitter] Detected Accomplish AI installation.');
128
- installToAccomplish();
129
- }
130
- } catch (err) {
131
- console.warn(`[babysitter] Warning: Accomplish AI detection failed: ${err.message}`);
132
- }
133
- } else {
134
- // --accomplish combined with --global: install to both
135
- installToAccomplish();
136
- }
137
-
138
- console.log('[babysitter] Installation complete!');
139
- console.log('[babysitter] Restart OpenCode to pick up the installed plugin.');
140
- } catch (err) {
141
- console.error(`[babysitter] Failed to install plugin: ${err.message}`);
142
- process.exitCode = 1;
143
- }
144
- }
145
-
146
- main();
4
+ require('./install.js');
package/bin/install.js CHANGED
@@ -1,110 +1,30 @@
1
1
  #!/usr/bin/env node
2
- /**
3
- * Babysitter OpenCode Plugin Installer
4
- *
5
- * Copies plugin files into the OpenCode plugins directory:
6
- * .opencode/plugins/babysitter/
7
- *
8
- * OpenCode discovers plugins as JS/TS modules in .opencode/plugins/.
9
- * This installer creates the necessary directory structure and copies
10
- * hook scripts, skills, and an index.js entry point.
11
- */
2
+ 'use strict';
12
3
 
13
- "use strict";
4
+ const path = require('path');
5
+ const shared = require('./install-shared');
14
6
 
15
- const fs = require("fs");
16
- const path = require("path");
17
-
18
- const PLUGIN_ROOT = path.resolve(__dirname, "..");
19
- const WORKSPACE = process.env.OPENCODE_WORKSPACE || process.cwd();
20
- const TARGET_DIR = path.join(WORKSPACE, ".opencode", "plugins", "babysitter");
21
-
22
- function copyRecursive(src, dest) {
23
- const stat = fs.statSync(src);
24
- if (stat.isDirectory()) {
25
- fs.mkdirSync(dest, { recursive: true });
26
- for (const entry of fs.readdirSync(src)) {
27
- copyRecursive(path.join(src, entry), path.join(dest, entry));
28
- }
29
- } else {
30
- fs.mkdirSync(path.dirname(dest), { recursive: true });
31
- fs.copyFileSync(src, dest);
32
- }
33
- }
7
+ const PACKAGE_ROOT = path.resolve(__dirname, '..');
34
8
 
35
9
  function main() {
36
- console.log(`Installing babysitter plugin for OpenCode...`);
37
- console.log(` Source: ${PLUGIN_ROOT}`);
38
- console.log(` Target: ${TARGET_DIR}`);
10
+ const pluginRoot = shared.getHomePluginRoot();
11
+ const marketplacePath = shared.getHomeMarketplacePath();
39
12
 
40
- // Create target directory
41
- fs.mkdirSync(TARGET_DIR, { recursive: true });
13
+ console.log(`[${shared.PLUGIN_NAME}] Installing plugin to ${pluginRoot}`);
42
14
 
43
- // Copy hooks
44
- const hooksDir = path.join(PLUGIN_ROOT, "hooks");
45
- if (fs.existsSync(hooksDir)) {
46
- copyRecursive(hooksDir, path.join(TARGET_DIR, "hooks"));
47
- console.log(" Copied hooks/");
48
- }
49
-
50
- // Copy skills
51
- const skillsDir = path.join(PLUGIN_ROOT, "skills");
52
- if (fs.existsSync(skillsDir)) {
53
- copyRecursive(skillsDir, path.join(TARGET_DIR, "skills"));
54
- console.log(" Copied skills/");
55
- }
56
-
57
- // Copy commands
58
- const commandsDir = path.join(PLUGIN_ROOT, "commands");
59
- if (fs.existsSync(commandsDir)) {
60
- copyRecursive(commandsDir, path.join(TARGET_DIR, "commands"));
61
- console.log(" Copied commands/");
62
- }
63
-
64
- // Copy plugin.json and versions.json
65
- for (const file of ["plugin.json", "versions.json"]) {
66
- const src = path.join(PLUGIN_ROOT, file);
67
- if (fs.existsSync(src)) {
68
- fs.copyFileSync(src, path.join(TARGET_DIR, file));
69
- console.log(` Copied ${file}`);
15
+ try {
16
+ shared.copyPluginBundle(PACKAGE_ROOT, pluginRoot);
17
+ shared.ensureMarketplaceEntry(marketplacePath, pluginRoot);
18
+ if (typeof shared.harnessInstall === 'function') {
19
+ shared.harnessInstall(PACKAGE_ROOT, pluginRoot);
70
20
  }
21
+ shared.runPostInstall && shared.runPostInstall(pluginRoot);
22
+ console.log(`[${shared.PLUGIN_NAME}] Installation complete!`);
23
+ console.log(`[${shared.PLUGIN_NAME}] Restart your IDE/CLI to pick up the plugin.`);
24
+ } catch (err) {
25
+ console.error(`[${shared.PLUGIN_NAME}] Failed to install: ${err.message}`);
26
+ process.exitCode = 1;
71
27
  }
72
-
73
- // Create index.js entry point for OpenCode plugin discovery
74
- const indexContent = `#!/usr/bin/env node
75
- /**
76
- * Babysitter plugin entry point for OpenCode.
77
- *
78
- * OpenCode discovers plugins by looking for JS/TS modules in
79
- * .opencode/plugins/. This file registers the babysitter hooks
80
- * with the OpenCode plugin system.
81
- */
82
-
83
- "use strict";
84
-
85
- const path = require("path");
86
-
87
- const PLUGIN_DIR = __dirname;
88
-
89
- module.exports = {
90
- name: "babysitter",
91
- version: require(path.join(PLUGIN_DIR, "plugin.json")).version,
92
-
93
- hooks: {
94
- "session.created": require(path.join(PLUGIN_DIR, "hooks", "session-created.js")),
95
- "session.idle": require(path.join(PLUGIN_DIR, "hooks", "session-idle.js")),
96
- "shell.env": require(path.join(PLUGIN_DIR, "hooks", "shell-env.js")),
97
- "tool.execute.before": require(path.join(PLUGIN_DIR, "hooks", "tool-execute-before.js")),
98
- "tool.execute.after": require(path.join(PLUGIN_DIR, "hooks", "tool-execute-after.js")),
99
- },
100
- };
101
- `;
102
-
103
- fs.writeFileSync(path.join(TARGET_DIR, "index.js"), indexContent);
104
- console.log(" Created index.js");
105
-
106
- console.log(`\nBabysitter plugin installed to ${TARGET_DIR}`);
107
- console.log("Restart OpenCode to activate the plugin.");
108
28
  }
109
29
 
110
30
  main();
package/bin/uninstall.cjs CHANGED
@@ -1,90 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- /**
5
- * Babysitter OpenCode Plugin Uninstaller
6
- *
7
- * Removes the babysitter plugin from the OpenCode plugins directory
8
- * and cleans up hooks config and marketplace entries.
9
- *
10
- * Usage:
11
- * node uninstall.cjs # Uninstall from cwd workspace
12
- * node uninstall.cjs --workspace /path # Uninstall from specified workspace
13
- * node uninstall.cjs --global # Global uninstall
14
- */
15
-
16
- const fs = require('fs');
17
- const path = require('path');
18
- const {
19
- getHomeMarketplacePath,
20
- getHomePluginRoot,
21
- getOpenCodeHome,
22
- removeManagedHooks,
23
- removeMarketplaceEntry,
24
- } = require('./install-shared.cjs');
25
-
26
- function parseArgs(argv) {
27
- let workspace = process.env.OPENCODE_WORKSPACE || process.cwd();
28
- for (let i = 2; i < argv.length; i += 1) {
29
- const arg = argv[i];
30
- if (arg === '--workspace') {
31
- const next = argv[i + 1];
32
- workspace = next && !next.startsWith('-') ? path.resolve(argv[++i]) : process.cwd();
33
- continue;
34
- }
35
- if (arg === '--global') {
36
- workspace = null;
37
- continue;
38
- }
39
- throw new Error(`unknown argument: ${arg}`);
40
- }
41
- return { workspace };
42
- }
43
-
44
- function main() {
45
- const { workspace } = parseArgs(process.argv);
46
- const openCodeHome = getOpenCodeHome(workspace);
47
- const pluginRoot = getHomePluginRoot(workspace);
48
- const marketplacePath = getHomeMarketplacePath(workspace);
49
- let removedPlugin = false;
50
-
51
- console.log(`[babysitter] Uninstalling OpenCode plugin from ${pluginRoot}`);
52
-
53
- // 1. Remove plugin directory
54
- if (fs.existsSync(pluginRoot)) {
55
- try {
56
- fs.rmSync(pluginRoot, { recursive: true, force: true });
57
- console.log(`[babysitter] Removed ${pluginRoot}`);
58
- removedPlugin = true;
59
- } catch (err) {
60
- console.warn(`[babysitter] Warning: Could not remove plugin directory: ${err.message}`);
61
- }
62
- }
63
-
64
- // 2. Remove marketplace entry
65
- removeMarketplaceEntry(marketplacePath);
66
- console.log('[babysitter] Cleaned marketplace entry');
67
-
68
- // 3. Remove managed hooks from OpenCode config
69
- removeManagedHooks(openCodeHome);
70
- console.log('[babysitter] Cleaned hooks config');
71
-
72
- // 4. Clean up empty parent directories
73
- const pluginsDir = path.dirname(pluginRoot);
74
- try {
75
- const remaining = fs.readdirSync(pluginsDir);
76
- if (remaining.length === 0) {
77
- fs.rmdirSync(pluginsDir);
78
- console.log('[babysitter] Removed empty plugins/ directory');
79
- }
80
- } catch { /* best-effort */ }
81
-
82
- if (!removedPlugin) {
83
- console.log('[babysitter] Plugin directory not found; config and hooks cleaned if present.');
84
- return;
85
- }
86
-
87
- console.log('[babysitter] Uninstallation complete. Restart OpenCode to finish removal.');
88
- }
89
-
90
- main();
4
+ require('./uninstall.js');
package/bin/uninstall.js CHANGED
@@ -1,46 +1,24 @@
1
1
  #!/usr/bin/env node
2
- /**
3
- * Babysitter OpenCode Plugin Uninstaller
4
- *
5
- * Removes the babysitter plugin from the OpenCode plugins directory.
6
- */
2
+ 'use strict';
7
3
 
8
- "use strict";
9
-
10
- const fs = require("fs");
11
- const path = require("path");
12
-
13
- const WORKSPACE = process.env.OPENCODE_WORKSPACE || process.cwd();
14
- const TARGET_DIR = path.join(WORKSPACE, ".opencode", "plugins", "babysitter");
15
-
16
- function removeRecursive(dir) {
17
- if (!fs.existsSync(dir)) return;
18
- fs.rmSync(dir, { recursive: true, force: true });
19
- }
4
+ const fs = require('fs');
5
+ const shared = require('./install-shared');
20
6
 
21
7
  function main() {
22
- console.log(`Uninstalling babysitter plugin from OpenCode...`);
23
- console.log(` Target: ${TARGET_DIR}`);
8
+ const pluginRoot = shared.getHomePluginRoot();
24
9
 
25
- if (!fs.existsSync(TARGET_DIR)) {
26
- console.log(" Plugin not installed -- nothing to remove.");
10
+ if (!fs.existsSync(pluginRoot)) {
11
+ console.log(`[${shared.PLUGIN_NAME}] Plugin not installed at ${pluginRoot}`);
27
12
  return;
28
13
  }
29
14
 
30
- removeRecursive(TARGET_DIR);
31
- console.log(" Removed babysitter plugin directory.");
32
-
33
- // Clean up empty parent directories
34
- const pluginsDir = path.join(WORKSPACE, ".opencode", "plugins");
35
15
  try {
36
- const remaining = fs.readdirSync(pluginsDir);
37
- if (remaining.length === 0) {
38
- fs.rmdirSync(pluginsDir);
39
- console.log(" Removed empty .opencode/plugins/ directory.");
40
- }
41
- } catch { /* best-effort */ }
42
-
43
- console.log("\nBabysitter plugin uninstalled. Restart OpenCode to complete removal.");
16
+ fs.rmSync(pluginRoot, { recursive: true, force: true });
17
+ console.log(`[${shared.PLUGIN_NAME}] Uninstalled from ${pluginRoot}`);
18
+ } catch (err) {
19
+ console.error(`[${shared.PLUGIN_NAME}] Failed to uninstall: ${err.message}`);
20
+ process.exitCode = 1;
21
+ }
44
22
  }
45
23
 
46
24
  main();
@@ -0,0 +1,64 @@
1
+ ---
2
+ description: manage Babysitter blueprints. Use this command to list installed blueprints, browse marketplaces, install, update, uninstall, configure, or create a new blueprint.
3
+ argument-hint: Blueprint action and options.
4
+ ---
5
+
6
+ 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.
7
+
8
+ 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.
9
+
10
+ Blueprints can be installed at two scopes:
11
+
12
+ - **global** (`--global`): stored under `~/.a5c/`, available for all projects
13
+ - **project** (`--project`): stored under `<projectDir>/.a5c/`, project-specific
14
+
15
+ ## Marketplace Management
16
+
17
+ 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.
18
+
19
+ ### Add a marketplace
20
+
21
+ ```bash
22
+ babysitter blueprint:add-marketplace --marketplace-url <url> [--marketplace-path <relative-path>] [--marketplace-branch <ref>] [--force] --global|--project [--json]
23
+ ```
24
+
25
+ ### Update a marketplace
26
+
27
+ ```bash
28
+ babysitter blueprint:update-marketplace --marketplace-name <name> [--marketplace-branch <ref>] --global|--project [--json]
29
+ ```
30
+
31
+ ### List blueprints in a marketplace
32
+
33
+ ```bash
34
+ babysitter blueprint:list-plugins --marketplace-name <name> --global|--project [--json]
35
+ ```
36
+
37
+ ## Blueprint Lifecycle
38
+
39
+ 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.
40
+
41
+ ```bash
42
+ babysitter blueprint:install --plugin-name <name> [--marketplace-name <mp>] --global|--project [--json]
43
+ babysitter blueprint:update --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
44
+ babysitter blueprint:configure --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
45
+ babysitter blueprint:uninstall --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
46
+ ```
47
+
48
+ The `--plugin-name` flag is preserved for CLI compatibility with existing marketplace manifests. User-facing docs should call the installable a blueprint.
49
+
50
+ ## Registry Management
51
+
52
+ ```bash
53
+ babysitter blueprint:list-installed --global|--project [--json]
54
+ babysitter blueprint:update-registry --plugin-name <name> --plugin-version <ver> --marketplace-name <mp> --global|--project [--json]
55
+ babysitter blueprint:remove-from-registry --plugin-name <name> --global|--project [--json]
56
+ ```
57
+
58
+ ## Deprecated Aliases
59
+
60
+ The old `plugin:*` commands remain available as deprecated aliases for one release. Prefer `blueprint:*` in new docs, skills, and process instructions.
61
+
62
+ ## Agent Plugins Are Separate
63
+
64
+ 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.
package/commands/call.md CHANGED
@@ -1,7 +1,11 @@
1
- ---
2
- description: Orchestrate a babysitter run. use this command to start babysitting a complex workflow.
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
- Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).
1
+ ---
2
+ description: Orchestrate a babysitter run. use this command to start babysitting a complex workflow.
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
+ 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
@@ -0,0 +1,68 @@
1
+ ---
2
+ description: Pre-deploy gate that scans built JS chunks for forbidden substring markers (saga-era / obsolete code paths) listed in a project-local forbidden-markers.txt
3
+ argument-hint: "[--markers-file <path>] [--chunks-dir <path>] [--json] Optional overrides; defaults are project-relative."
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
+ Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md). Compose the gate from the shared helper at `library/processes/shared/forbidden-markers-scanner.js` (issue #477).
8
+
9
+ ## What this gate does
10
+
11
+ Reads a list of literal substring markers from `scripts/forbidden-markers.txt` (blank lines and `#`-prefixed comments stripped) and greps every `.js` chunk under `.vercel/output/static/_next/static/chunks/` (Next.js / Vercel default; configurable) for any occurrence. Reports structured hits per `(marker, chunk)` pair with occurrence counts. Designed to chain between `vercel build --prod` and `vercel deploy --prod`.
12
+
13
+ Use this gate when a refactor or restart-from-baseline replaced load-bearing code paths and you need a structural guarantee the obsolete symbols never re-ship. Burned-in evidence: cookbook VI-9 / VI-12 near-miss revivals during the 2026-05 iOS-Safari saga; the prototype lives at `cookbook/scripts/check-no-forbidden.mjs` and shipped two upstream contributions before being generalized as this gate.
14
+
15
+ ## When to use
16
+
17
+ - **Pre-deploy.** Insert after build, before deploy. Block the deploy when `ok: false`.
18
+ - **Post-restart.** After a baseline rollback + step-by-step re-add, snapshot the saga-era markers in `forbidden-markers.txt` and let CI hold the line.
19
+ - **Post-refactor.** When old helper / handler / module names must not coexist with the new ones in the same bundle.
20
+
21
+ ## Expected config locations
22
+
23
+ - `scripts/forbidden-markers.txt` — one marker per line, `#` for comments. The list is the contract; the gate is mechanical. Commit this file to source control.
24
+ - `.vercel/output/static/_next/static/chunks/` — default scan target. Override for non-Vercel frameworks via the `--chunks-dir` flag or the `chunksDir` task input.
25
+
26
+ A missing markers file is a no-op (`ok: true`, `reason: 'missing-markers-file'`) — misconfiguration is never a deploy block. A missing chunks directory is likewise a no-op (`reason: 'missing-chunks-dir'`) so the gate is safe to chain into `check:all` before the build runs.
27
+
28
+ ## Exit semantics
29
+
30
+ | Reason | `ok` | Deploy decision |
31
+ |-------------------------|--------|--------------------------------|
32
+ | `missing-markers-file` | true | Pass (no gate active) |
33
+ | `missing-chunks-dir` | true | Pass (run before build) |
34
+ | `empty-markers` | true | Pass (list is empty) |
35
+ | `no-chunks` | true | Pass (nothing to scan) |
36
+ | `clean` | true | Pass — proceed to deploy |
37
+ | `hits` | false | **BLOCK** — surface hits, ask for triage |
38
+
39
+ For each hit, the gate emits `{ marker, chunk, count }` so the operator sees the exact marker string, the absolute chunk path, and the number of occurrences in that chunk. Multiple hits across chunks for the same marker are reported separately.
40
+
41
+ ## Programmatic surface
42
+
43
+ ```js
44
+ import { scanForbiddenMarkers, checkForbiddenMarkersTask } from '@a5c-ai/babysitter-library/processes/shared';
45
+
46
+ // Direct call:
47
+ const result = await scanForbiddenMarkers({
48
+ markersFile: 'scripts/forbidden-markers.txt',
49
+ chunksDir: '.vercel/output/static/_next/static/chunks',
50
+ });
51
+ if (!result.ok) {
52
+ // result.hits: Array<{ marker, chunk, count }>
53
+ // result.reason === 'hits'
54
+ process.exit(1);
55
+ }
56
+
57
+ // Or dispatched as a babysitter task:
58
+ const gate = await ctx.task(checkForbiddenMarkersTask, {
59
+ projectDir: '.',
60
+ // markersFile / chunksDir are inferred from projectDir if omitted
61
+ });
62
+ ```
63
+
64
+ ## Reference
65
+
66
+ - Issue: https://github.com/a5c-ai/babysitter/issues/477
67
+ - Helper module: `library/processes/shared/forbidden-markers-scanner.js`
68
+ - Origin (cookbook prototype): `cookbook/scripts/check-no-forbidden.mjs` (81 lines)
@@ -6,15 +6,43 @@ allowed-tools: Read, Grep, Write, Task, Bash, Edit, Grep, Glob, WebFetch, WebSea
6
6
 
7
7
  Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).
8
8
 
9
- Create and run a cleanup process using the process at `skills\babysit\process\cradle\cleanup-runs.js/processes/cleanup-runs.js`.
9
+ Resolve the active process library with:
10
+
11
+ ```bash
12
+ babysitter process-library:active --json
13
+ ```
14
+
15
+ Read `binding.dir` from that JSON and create/run the cleanup process from `cradle/cleanup-runs.js#process` relative to that active library root. Do not use plugin-cache-relative cradle paths.
10
16
 
11
17
  Implementation notes (for the process):
12
18
  - Parse arguments for `--dry-run` flag (if present, set dryRun: true in inputs) and `--keep-days N` (default: 7)
13
- - The process scans .a5c/runs/ for completed/failed runs, aggregates insights, writes summaries, then removes old data
14
- - Always show the user what will be removed before removing (in interactive mode via breakpoints)
15
- - In non-interactive mode (yolo), proceed with cleanup using defaults
16
- - The insights file goes to docs/run-history-insights.md
17
- - Only remove terminal runs (completed/failed) older than the keep-days threshold
18
- - Never remove active/in-progress runs
19
- - Remove orphaned process files not referenced by remaining runs
20
- - After cleanup, show remaining run count and disk usage
19
+
20
+ CRITICAL: The cleanup MUST follow this exact phase order. Do NOT delete any run before Phase 2 completes.
21
+
22
+ Phase 1 Scan:
23
+ - Scan .a5c/runs/ for all runs
24
+ - Classify each as terminal (completed/failed) or active (in-progress/created)
25
+ - Identify terminal runs older than the keep-days threshold as removal candidates
26
+ - Never mark active/in-progress runs for removal
27
+ - Count and report: total runs, terminal, active, removal candidates, disk usage
28
+
29
+ Phase 2 — Aggregate insights (BEFORE any deletion):
30
+ - For EVERY removal candidate, read its run.json and journal/ events
31
+ - Extract: processId, prompt, status, event count, created date, task summaries
32
+ - Group by process type and extract patterns (retry counts, convergence behavior, failure modes)
33
+ - Append a new dated section to docs/run-history-insights.md with:
34
+ - Summary statistics (runs removed, disk freed, runs retained)
35
+ - Run categories with counts and descriptions
36
+ - Key patterns observed (multi-batch convergence, retry behavior, etc.)
37
+ - What worked well / what didn't from the run data
38
+ - This file MUST be written and verified before proceeding to Phase 3
39
+
40
+ Phase 3 — Confirm removal:
41
+ - In interactive mode, show the user what will be removed via a breakpoint
42
+ - In non-interactive mode (yolo), proceed with defaults
43
+ - In dry-run mode, stop here and show what would be removed
44
+
45
+ Phase 4 — Remove:
46
+ - Delete the terminal runs older than keep-days threshold
47
+ - Identify and remove orphaned process files not referenced by remaining runs
48
+ - Show remaining run count and disk usage after cleanup