@a5c-ai/babysitter-github 5.0.1-staging.ff2c19f9 → 5.1.1-staging.00ceebd28cf2

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 (55) hide show
  1. package/README.md +33 -25
  2. package/bin/install-shared.js +32 -21
  3. package/bin/install.js +9 -0
  4. package/bin/uninstall.js +25 -4
  5. package/commands/blueprints.md +64 -0
  6. package/commands/call.md +11 -7
  7. package/commands/check-forbidden-markers.md +68 -0
  8. package/commands/cleanup.md +37 -9
  9. package/commands/contrib.md +31 -31
  10. package/commands/doctor.md +2 -3
  11. package/commands/forever.md +6 -6
  12. package/commands/help.md +11 -10
  13. package/commands/observe.md +6 -1
  14. package/commands/plan.md +17 -7
  15. package/commands/plugins.md +22 -255
  16. package/commands/project-install.md +10 -10
  17. package/commands/resume.md +8 -8
  18. package/commands/retrospect.md +55 -55
  19. package/commands/user-install.md +10 -10
  20. package/commands/yolo.md +11 -7
  21. package/hooks/babysitter-proxied-post-tool-use.ps1 +13 -0
  22. package/hooks/babysitter-proxied-post-tool-use.sh +3 -0
  23. package/hooks/babysitter-proxied-pre-compact.ps1 +13 -0
  24. package/hooks/babysitter-proxied-pre-compact.sh +3 -0
  25. package/hooks/babysitter-proxied-pre-tool-use.ps1 +13 -0
  26. package/hooks/babysitter-proxied-pre-tool-use.sh +3 -0
  27. package/hooks/babysitter-proxied-session-end.ps1 +1 -0
  28. package/hooks/babysitter-proxied-session-end.sh +0 -0
  29. package/hooks/babysitter-proxied-session-start.ps1 +1 -0
  30. package/hooks/babysitter-proxied-session-start.sh +1 -1
  31. package/hooks/babysitter-proxied-user-prompt-submitted.ps1 +1 -0
  32. package/hooks/babysitter-proxied-user-prompt-submitted.sh +0 -0
  33. package/hooks.json +24 -0
  34. package/package.json +12 -11
  35. package/plugin.json +1 -1
  36. package/scripts/create-release-tag.mjs +18 -0
  37. package/scripts/publish-from-tag.mjs +41 -0
  38. package/skills/babysit/SKILL.md +32 -46
  39. package/skills/blueprints/SKILL.md +66 -0
  40. package/skills/call/SKILL.md +5 -1
  41. package/skills/check-forbidden-markers/SKILL.md +69 -0
  42. package/skills/cleanup/SKILL.md +37 -9
  43. package/skills/contrib/SKILL.md +25 -25
  44. package/skills/doctor/SKILL.md +2 -3
  45. package/skills/help/SKILL.md +11 -10
  46. package/skills/observe/SKILL.md +6 -1
  47. package/skills/plan/SKILL.md +11 -1
  48. package/skills/plugins/SKILL.md +18 -251
  49. package/skills/project-install/SKILL.md +3 -3
  50. package/skills/resume/SKILL.md +1 -1
  51. package/skills/retrospect/SKILL.md +48 -48
  52. package/skills/user-install/SKILL.md +3 -3
  53. package/skills/yolo/SKILL.md +5 -1
  54. package/versions.json +2 -1
  55. package/scripts/sync-command-surfaces.js +0 -62
package/README.md CHANGED
@@ -18,7 +18,8 @@ directly.
18
18
  - **Node.js 22+**
19
19
  - **GitHub Copilot CLI** (`copilot`) -- requires an active GitHub Copilot
20
20
  subscription
21
- - **Babysitter SDK CLI** (`@a5c-ai/babysitter-sdk`) -- installed globally
21
+ - **Babysitter CLI** (`@a5c-ai/babysitter`) -- installed globally when using
22
+ the SDK helper
22
23
 
23
24
  ## Installation
24
25
 
@@ -28,7 +29,7 @@ Register the a5c.ai marketplace and install the plugin:
28
29
 
29
30
  ```bash
30
31
  # Register the marketplace
31
- copilot plugin marketplace add a5c-ai/babysitter
32
+ copilot plugin marketplace add a5c-ai/babysitter-claude
32
33
 
33
34
  # Install the plugin
34
35
  copilot plugin install babysitter
@@ -36,42 +37,50 @@ copilot plugin install babysitter
36
37
 
37
38
  ### Direct GitHub install
38
39
 
39
- Install directly from the Git repository using Copilot CLI. Copilot CLI
40
- discovers the plugin via `.github/plugin/marketplace.json` at the repo root:
40
+ Install directly from the generated external plugin repository:
41
41
 
42
42
  ```bash
43
- copilot plugin install a5c-ai/babysitter
43
+ copilot plugin install a5c-ai/babysitter-github-copilot
44
44
  ```
45
45
 
46
- ### Alternative Installation (npm / development)
46
+ ### Alternative Installation (SDK helper / development)
47
47
 
48
- For development or environments where the Copilot CLI plugin system is not
49
- available, install via npm:
48
+ For development, automation, or environments where the Copilot CLI plugin system is not available, install through the Babysitter SDK helper. This is the canonical scriptable path used by the installer tests and resolves to `npx --yes @a5c-ai/babysitter-github install ...` under the hood:
50
49
 
51
- Install the SDK CLI first:
50
+ Install the Babysitter CLI first:
52
51
 
53
52
  ```bash
54
- npm install -g @a5c-ai/babysitter-sdk
53
+ npm install -g @a5c-ai/babysitter
55
54
  ```
56
55
 
57
- Then install the GitHub Copilot plugin globally:
56
+ Then install the GitHub Copilot plugin globally or into a workspace:
58
57
 
59
58
  ```bash
60
- npm install -g @a5c-ai/babysitter-github
61
- babysitter-github install
59
+ # Global install
60
+ babysitter harness:install-plugin github-copilot
61
+
62
+ # Workspace install
63
+ babysitter harness:install-plugin github-copilot --workspace /path/to/repo
62
64
  ```
63
65
 
64
- Or install from source:
66
+ You can also run the published package installer directly:
65
67
 
66
68
  ```bash
67
- cd plugins/babysitter-github
68
- node bin/install.js
69
+ npx --yes @a5c-ai/babysitter-github install --global
70
+ npx --yes @a5c-ai/babysitter-github install --workspace /path/to/repo
71
+ ```
72
+
73
+ Or install from generated source:
74
+
75
+ ```bash
76
+ npm run generate:plugins
77
+ node artifacts/generated-plugins/github-copilot/bin/install.js
69
78
  ```
70
79
 
71
- Install into a specific workspace:
80
+ Install into a specific workspace from generated source:
72
81
 
73
82
  ```bash
74
- babysitter-github install --workspace /path/to/repo
83
+ node artifacts/generated-plugins/github-copilot/bin/install.js --workspace /path/to/repo
75
84
  ```
76
85
 
77
86
  ### GitHub Copilot cloud agent installation
@@ -253,8 +262,7 @@ Copilot CLI looks for the plugin manifest in these paths, checked in order:
253
262
  The first match wins. This plugin uses `plugin.json` at the package root.
254
263
 
255
264
  For marketplace discovery, Copilot CLI looks for `.github/plugin/marketplace.json`
256
- at the repository root. This file lists all available plugins in the repo and is
257
- used when installing via `copilot plugin install OWNER/REPO`.
265
+ at the repository root of the generated plugin repository.
258
266
 
259
267
  ### plugin.json Schema
260
268
 
@@ -404,7 +412,7 @@ repository root in `.github/plugin/marketplace.json`:
404
412
  "name": "babysitter",
405
413
  "description": "Multi-step workflow orchestration with event-sourced state",
406
414
  "version": "0.1.0",
407
- "source": "./plugins/babysitter-github"
415
+ "source": "./"
408
416
  }
409
417
  ]
410
418
  }
@@ -461,7 +469,7 @@ These registries are available without running `marketplace add`.
461
469
  ## Plugin Structure (Directory Layout)
462
470
 
463
471
  ```
464
- plugins/babysitter-github/
472
+ artifacts/generated-plugins/github-copilot/
465
473
  plugin.json # Plugin manifest (skills, hooks, metadata)
466
474
  .github/plugin.json # Plugin manifest (alternate discovery path)
467
475
  hooks.json # Hook configuration (sessionStart, sessionEnd, userPromptSubmitted)
@@ -579,14 +587,14 @@ compatibility where PowerShell execution is available.
579
587
  git clone https://github.com/a5c-ai/babysitter.git
580
588
  cd babysitter
581
589
  npm install
582
- cd plugins/babysitter-github
590
+ npm run generate:plugins
583
591
  node bin/install.js
584
592
  ```
585
593
 
586
594
  ### Publishing
587
595
 
588
596
  ```bash
589
- cd plugins/babysitter-github
597
+ cd artifacts/generated-plugins/github-copilot
590
598
  npm run deploy # Publish to npm (public)
591
599
  npm run deploy:staging # Publish to npm with staging tag
592
600
  ```
@@ -594,7 +602,7 @@ npm run deploy:staging # Publish to npm with staging tag
594
602
  ### Team installation
595
603
 
596
604
  ```bash
597
- cd plugins/babysitter-github
605
+ cd artifacts/generated-plugins/github-copilot
598
606
  npm run team:install
599
607
  ```
600
608
 
@@ -13,7 +13,7 @@ function getUserHome() {
13
13
  }
14
14
 
15
15
  function getHarnessHome() {
16
- return path.join(os.homedir(), '.copilot');
16
+ return path.join(os.homedir(), ".copilot");
17
17
  }
18
18
 
19
19
  function getHomePluginRoot(scope) {
@@ -29,7 +29,7 @@ function writeFileIfChanged(filePath, contents) {
29
29
  try {
30
30
  const existing = fs.readFileSync(filePath, 'utf8');
31
31
  if (existing === contents) return false;
32
- } catch {}
32
+ } catch (e) { process.stderr.write('[extensions-adapter] file read failed for ' + filePath + ', overwriting: ' + (e instanceof Error ? e.message : String(e)) + '\n'); }
33
33
  fs.mkdirSync(path.dirname(filePath), { recursive: true });
34
34
  fs.writeFileSync(filePath, contents);
35
35
  return true;
@@ -82,7 +82,7 @@ function writeJson(filePath, value) {
82
82
  function ensureExecutable(filePath) {
83
83
  try {
84
84
  fs.chmodSync(filePath, 0o755);
85
- } catch {}
85
+ } catch (e) { process.stderr.write('[extensions-adapter] chmod failed for ' + filePath + ': ' + (e instanceof Error ? e.message : String(e)) + '\n'); }
86
86
  }
87
87
 
88
88
  function normalizeMarketplaceSourcePath(source, marketplacePath) {
@@ -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.0",
107
+ version: "5.1.1-staging.00ceebd28cf2",
108
108
  author: { name: "a5c.ai" },
109
109
  };
110
110
  if (idx >= 0) marketplace.plugins[idx] = entry;
@@ -130,7 +130,7 @@ function runPostInstall(pluginRoot) {
130
130
  if (fs.existsSync(postInstall)) {
131
131
  spawnSync(process.execPath, [postInstall], {
132
132
  cwd: pluginRoot, stdio: 'inherit',
133
- env: { ...process.env, PLUGIN_ROOT: pluginRoot },
133
+ env: { ...process.env, PLUGIN_ROOT: pluginRoot, CLAUDE_PLUGIN_ROOT: pluginRoot },
134
134
  });
135
135
  }
136
136
  }
@@ -147,7 +147,7 @@ function resolveCliCommand(packageRoot) {
147
147
  const versionsPath = path.join(packageRoot, 'versions.json');
148
148
  const versions = readJson(versionsPath) || {};
149
149
  const ver = versions.sdkVersion || 'latest';
150
- return `npx -y @a5c-ai/babysitter-sdk@${ver}`;
150
+ return `npm exec --yes --package @a5c-ai/babysitter-sdk@${ver} -- babysitter`;
151
151
  }
152
152
 
153
153
  function runCli(packageRoot, cliArgs, options = {}) {
@@ -454,8 +454,9 @@ function installManagedHooks(packageRoot, copilotHome) {
454
454
  mergeManagedHooksConfig(packageRoot, copilotHome);
455
455
  }
456
456
 
457
- function removeLegacyHooks(copilotHome) {
458
- for (const hookName of LEGACY_HOOK_SCRIPT_NAMES) {
457
+ function removeManagedHooks(copilotHome) {
458
+ const managedHookNames = [...LEGACY_HOOK_SCRIPT_NAMES, ...HOOK_SCRIPT_NAMES];
459
+ for (const hookName of managedHookNames) {
459
460
  fs.rmSync(path.join(copilotHome, 'hooks', hookName), { force: true });
460
461
  }
461
462
 
@@ -476,10 +477,17 @@ function removeLegacyHooks(copilotHome) {
476
477
  const eventHooks = Array.isArray(hooksConfig.hooks[eventName]) ? hooksConfig.hooks[eventName] : [];
477
478
  const filteredMatchers = eventHooks
478
479
  .map((matcher) => {
480
+ const directBash = String(matcher?.bash || matcher?.command || '');
481
+ const directPs = String(matcher?.powershell || '');
482
+ const hasDirectHook = directBash.length > 0 || directPs.length > 0;
483
+ const directIsManaged = managedHookNames.some((name) => directBash.includes(name) || directPs.includes(name));
484
+ if (hasDirectHook) {
485
+ return directIsManaged ? null : matcher;
486
+ }
479
487
  const hooks = Array.isArray(matcher.hooks) ? matcher.hooks : [];
480
488
  const keptHooks = hooks.filter((hook) => {
481
489
  const command = String(hook.command || '');
482
- return !LEGACY_HOOK_SCRIPT_NAMES.some((name) => command.includes(name));
490
+ return !managedHookNames.some((name) => command.includes(name));
483
491
  });
484
492
  return keptHooks.length > 0 ? { ...matcher, hooks: keptHooks } : null;
485
493
  })
@@ -498,11 +506,13 @@ function removeLegacyHooks(copilotHome) {
498
506
  }
499
507
 
500
508
  function installCopilotSurface(packageRoot, copilotHome) {
501
- removeLegacyHooks(copilotHome);
509
+ removeManagedHooks(copilotHome);
502
510
  installManagedSkills(packageRoot, copilotHome);
503
511
  installManagedHooks(packageRoot, copilotHome);
504
512
  }
505
513
 
514
+ const removeLegacyHooks = removeManagedHooks;
515
+
506
516
  function renderCloudAgentAgentsBlock() {
507
517
  return [
508
518
  '## Babysitter Cloud Agent',
@@ -831,10 +841,19 @@ module.exports = {
831
841
  resolveCliCommand,
832
842
  runCli,
833
843
  ensureGlobalProcessLibrary,
844
+ PLUGIN_BUNDLE_ENTRIES,
845
+ copyRecursive,
846
+ copyPluginBundle,
847
+ DEFAULT_MARKETPLACE,
848
+ normalizeMarketplaceSourcePath,
849
+ ensureMarketplaceEntry,
850
+ removeMarketplaceEntry,
851
+ installManagedSkills,
852
+ mergeManagedHooksConfig,
853
+ installManagedHooks,
854
+ warnWindowsHooks,
834
855
  LEGACY_HOOK_SCRIPT_NAMES,
835
856
  HOOK_SCRIPT_NAMES,
836
- DEFAULT_MARKETPLACE,
837
- PLUGIN_BUNDLE_ENTRIES,
838
857
  CLOUD_AGENT_BUNDLE_ENTRIES,
839
858
  MANAGED_BLOCK_START,
840
859
  MANAGED_BLOCK_END,
@@ -849,10 +868,8 @@ module.exports = {
849
868
  rewriteCloudSkill,
850
869
  registerCopilotPlugin,
851
870
  deregisterCopilotPlugin,
852
- installManagedSkills,
853
- mergeManagedHooksConfig,
854
- installManagedHooks,
855
871
  removeLegacyHooks,
872
+ removeManagedHooks,
856
873
  installCopilotSurface,
857
874
  renderCloudAgentAgentsBlock,
858
875
  renderCloudAgentCopilotInstructionsBlock,
@@ -862,12 +879,6 @@ module.exports = {
862
879
  installCloudAgentInstructions,
863
880
  installCloudAgentSetupSteps,
864
881
  installCloudAgentSurface,
865
- normalizeMarketplaceSourcePath,
866
- ensureMarketplaceEntry,
867
- removeMarketplaceEntry,
868
- warnWindowsHooks,
869
- copyPluginBundle,
870
- copyRecursive,
871
882
  harnessCliRoute,
872
883
  harnessInstall,
873
884
  };
package/bin/install.js CHANGED
@@ -65,6 +65,15 @@ function main() {
65
65
  try {
66
66
  shared.copyPluginBundle(PACKAGE_ROOT, pluginRoot);
67
67
  shared.ensureMarketplaceEntry(marketplacePath, pluginRoot);
68
+ if (typeof shared.registerCopilotPlugin === 'function') {
69
+ shared.registerCopilotPlugin(pluginRoot);
70
+ }
71
+ if (typeof shared.installCopilotSurface === 'function' && typeof shared.getCopilotHome === 'function') {
72
+ shared.installCopilotSurface(PACKAGE_ROOT, shared.getCopilotHome());
73
+ }
74
+ if (typeof shared.warnWindowsHooks === 'function') {
75
+ shared.warnWindowsHooks();
76
+ }
68
77
  if (typeof shared.harnessInstall === 'function') {
69
78
  shared.harnessInstall(PACKAGE_ROOT, pluginRoot);
70
79
  }
package/bin/uninstall.js CHANGED
@@ -7,17 +7,38 @@ const shared = require('./install-shared');
7
7
 
8
8
  function main() {
9
9
  const pluginRoot = shared.getHomePluginRoot();
10
+ const marketplacePath = typeof shared.getHomeMarketplacePath === 'function'
11
+ ? shared.getHomeMarketplacePath()
12
+ : null;
13
+ const copilotHome = typeof shared.getCopilotHome === 'function'
14
+ ? shared.getCopilotHome()
15
+ : null;
10
16
 
11
17
  if (!fs.existsSync(pluginRoot)) {
12
18
  console.log(`[${shared.PLUGIN_NAME}] Plugin not installed at ${pluginRoot}`);
13
- return;
19
+ } else {
20
+ try {
21
+ fs.rmSync(pluginRoot, { recursive: true, force: true });
22
+ console.log(`[${shared.PLUGIN_NAME}] Uninstalled from ${pluginRoot}`);
23
+ } catch (err) {
24
+ console.error(`[${shared.PLUGIN_NAME}] Failed to uninstall: ${err.message}`);
25
+ process.exitCode = 1;
26
+ return;
27
+ }
14
28
  }
15
29
 
16
30
  try {
17
- fs.rmSync(pluginRoot, { recursive: true, force: true });
18
- console.log(`[${shared.PLUGIN_NAME}] Uninstalled from ${pluginRoot}`);
31
+ if (typeof shared.deregisterCopilotPlugin === 'function') {
32
+ shared.deregisterCopilotPlugin(pluginRoot);
33
+ }
34
+ if (copilotHome && typeof shared.removeManagedHooks === 'function') {
35
+ shared.removeManagedHooks(copilotHome);
36
+ }
37
+ if (marketplacePath && typeof shared.removeMarketplaceEntry === 'function') {
38
+ shared.removeMarketplaceEntry(marketplacePath);
39
+ }
19
40
  } catch (err) {
20
- console.error(`[${shared.PLUGIN_NAME}] Failed to uninstall: ${err.message}`);
41
+ console.error(`[${shared.PLUGIN_NAME}] Failed to clean up uninstall state: ${err.message}`);
21
42
  process.exitCode = 1;
22
43
  }
23
44
  }
@@ -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 blueprints: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 blueprints:update-marketplace --marketplace-name <name> [--marketplace-branch <ref>] --global|--project [--json]
29
+ ```
30
+
31
+ ### List blueprints in a marketplace
32
+
33
+ ```bash
34
+ babysitter blueprints:list-blueprints --marketplace-name <name> --global|--project [--json]
35
+ ```
36
+
37
+ ## Blueprint Lifecycle
38
+
39
+ For `blueprint:install`, `blueprint:update`, `blueprint:configure`, and `blueprint:list-blueprints`, the `--marketplace-name` flag is auto-detected when only one marketplace is cloned for the selected scope.
40
+
41
+ ```bash
42
+ babysitter blueprints:install --plugin-name <name> [--marketplace-name <mp>] --global|--project [--json]
43
+ babysitter blueprints:update --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
44
+ babysitter blueprints:configure --plugin-name <name> --marketplace-name <mp> --global|--project [--json]
45
+ babysitter blueprints: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 blueprints:list-installed --global|--project [--json]
54
+ babysitter blueprints:update-registry --plugin-name <name> --plugin-version <ver> --marketplace-name <mp> --global|--project [--json]
55
+ babysitter blueprints: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-adapter, extensions-adapter, 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
@@ -1,33 +1,33 @@
1
- ---
2
- description: Submit feedback or contribute to babysitter project
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).
8
-
9
- ## Process Routing
10
-
1
+ ---
2
+ description: Submit feedback or contribute to babysitter project
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).
8
+
9
+ ## Process Routing
10
+
11
11
  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:
12
-
13
- ### Issue-based (opens a GitHub issue in a5c-ai/babysitter)
14
- * **Bug report** → `cradle/bug-report.js#process` — Report a bug in the SDK, CLI, process library, etc.
15
- * **Feature request** → `cradle/feature-request.js#process` — Request a new feature or enhancement
16
- * **Documentation question** → `cradle/documentation-question.js#process` — Ask about undocumented behavior or missing docs
17
-
18
- ### PR-based (forks repo, creates branch, submits PR to a5c-ai/babysitter)
19
- * **Bugfix** → `cradle/bugfix.js#process` — User already has the fix for a bug
20
- * **Feature implementation** → `cradle/feature-implementation-contribute.js#process` — User already has a feature implementation
21
- * **Harness integration** → `cradle/feature-harness-integration-contribute.js#process` — User has a harness (CI/CD, IDE, editor) integration
22
- * **Library contribution** → `cradle/library-contribution.js#process` — New or improved process/skill/subagent for the library
23
- * **Documentation answer** → `cradle/documentation-contribute-answer.js#process` — User has an answer for an unanswered docs question
24
-
25
- ### Router (when arguments are empty or general)
26
- * **Contribute** → `cradle/contribute.js#process` — Explains contribution types and routes to the specific process
27
-
28
- ## Contribution Rules
29
-
30
- * PR-based contributions: fork the babysitter repo (a5c-ai/babysitter) for the user, ask to star if not already starred, perform changes, submit PR
31
- * Issue-based contributions: gather details, search for duplicates, review, then open an issue in a5c-ai/babysitter
32
- * Add breakpoints (permissions) before ALL gh actions (fork, star, submit PR/issue) to allow user review and cancellation
12
+
13
+ ### Issue-based (opens a GitHub issue in a5c-ai/babysitter)
14
+ * **Bug report** → `cradle/bug-report.js#process` — Report a bug in the SDK, CLI, process library, etc.
15
+ * **Feature request** → `cradle/feature-request.js#process` — Request a new feature or enhancement
16
+ * **Documentation question** → `cradle/documentation-question.js#process` — Ask about undocumented behavior or missing docs
17
+
18
+ ### PR-based (forks repo, creates branch, submits PR to a5c-ai/babysitter)
19
+ * **Bugfix** → `cradle/bugfix.js#process` — User already has the fix for a bug
20
+ * **Feature implementation** → `cradle/feature-implementation-contribute.js#process` — User already has a feature implementation
21
+ * **Harness integration** → `cradle/feature-harness-integration-contribute.js#process` — User has a harness (CI/CD, IDE, editor) integration
22
+ * **Library contribution** → `cradle/library-contribution.js#process` — New or improved process/skill/subagent for the library
23
+ * **Documentation answer** → `cradle/documentation-contribute-answer.js#process` — User has an answer for an unanswered docs question
24
+
25
+ ### Router (when arguments are empty or general)
26
+ * **Contribute** → `cradle/contribute.js#process` — Explains contribution types and routes to the specific process
27
+
28
+ ## Contribution Rules
29
+
30
+ * PR-based contributions: fork the babysitter repo (a5c-ai/babysitter) for the user, ask to star if not already starred, perform changes, submit PR
31
+ * Issue-based contributions: gather details, search for duplicates, review, then open an issue in a5c-ai/babysitter
32
+ * Add breakpoints (permissions) before ALL gh actions (fork, star, submit PR/issue) to allow user review and cancellation
33
33
  * If arguments are empty: use the `contribute.js` router process to show options and route accordingly
@@ -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 `plugins/babysitter/hooks/hooks.json` by walking up from the current directory.
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 `plugins/babysitter/` exists relative to the project root and if `CLAUDE_PLUGIN_ROOT` is set. If the plugin directory doesn't exist, report: "Plugin not installed — the babysitter plugin directory is missing."
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`.
@@ -1,7 +1,7 @@
1
- ---
2
- description: Use this command to start babysitting a never-ending babysitter 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
-
1
+ ---
2
+ description: Use this command to start babysitting a never-ending babysitter 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
7
  Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md). but create a process that uses an infinte loop and a ctx.sleep to create a never-ending babysitter loop. an example of such process is a daily process that reads new support ticket every day and tries to resolve them, then sleeps for 4 hours and repeats the process.