@a5c-ai/babysitter-github 5.0.1-staging.e4f17eff → 5.0.1-staging.e920fef118ef

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 (53) hide show
  1. package/README.md +33 -25
  2. package/bin/cli.js +14 -26
  3. package/bin/install-shared.js +398 -215
  4. package/bin/install.js +49 -89
  5. package/bin/uninstall.js +30 -60
  6. package/commands/call.md +5 -1
  7. package/commands/cleanup.md +30 -8
  8. package/commands/doctor.md +7 -8
  9. package/commands/help.md +246 -244
  10. package/commands/observe.md +17 -12
  11. package/commands/yolo.md +11 -7
  12. package/hooks/babysitter-proxied-post-tool-use.ps1 +12 -0
  13. package/hooks/babysitter-proxied-post-tool-use.sh +3 -0
  14. package/hooks/babysitter-proxied-pre-compact.ps1 +12 -0
  15. package/hooks/babysitter-proxied-pre-compact.sh +3 -0
  16. package/hooks/babysitter-proxied-pre-tool-use.ps1 +12 -0
  17. package/hooks/babysitter-proxied-pre-tool-use.sh +3 -0
  18. package/hooks/babysitter-proxied-session-end.ps1 +10 -114
  19. package/hooks/babysitter-proxied-session-end.sh +2 -111
  20. package/hooks/babysitter-proxied-session-start.ps1 +10 -187
  21. package/hooks/babysitter-proxied-session-start.sh +6 -168
  22. package/hooks/babysitter-proxied-user-prompt-submitted.ps1 +10 -90
  23. package/hooks/babysitter-proxied-user-prompt-submitted.sh +2 -86
  24. package/hooks.json +33 -9
  25. package/package.json +20 -21
  26. package/plugin.json +7 -6
  27. package/scripts/create-release-tag.mjs +18 -0
  28. package/scripts/publish-from-tag.mjs +41 -0
  29. package/scripts/team-install.js +14 -84
  30. package/skills/babysit/SKILL.md +2 -4
  31. package/skills/call/SKILL.md +5 -1
  32. package/skills/cleanup/SKILL.md +43 -0
  33. package/skills/contrib/SKILL.md +34 -0
  34. package/skills/doctor/SKILL.md +7 -8
  35. package/skills/forever/SKILL.md +8 -0
  36. package/skills/help/SKILL.md +4 -2
  37. package/skills/observe/SKILL.md +7 -2
  38. package/skills/plugins/SKILL.md +257 -0
  39. package/skills/project-install/SKILL.md +18 -0
  40. package/skills/resume/SKILL.md +1 -1
  41. package/skills/retrospect/SKILL.md +48 -48
  42. package/skills/user-install/SKILL.md +3 -3
  43. package/skills/yolo/SKILL.md +12 -0
  44. package/versions.json +2 -1
  45. package/.github/plugin.json +0 -25
  46. package/hooks/proxied-hooks.json +0 -29
  47. package/hooks/session-end.ps1 +0 -69
  48. package/hooks/session-end.sh +0 -54
  49. package/hooks/session-start.ps1 +0 -111
  50. package/hooks/session-start.sh +0 -101
  51. package/hooks/user-prompt-submitted.ps1 +0 -52
  52. package/hooks/user-prompt-submitted.sh +0 -31
  53. package/scripts/sync-command-surfaces.js +0 -62
@@ -1,92 +1,12 @@
1
- # Unified userPromptSubmitted Hook for GitHub Copilot CLI (PowerShell)
2
- # Routes through hooks-proxy for all hook execution.
3
- #
4
- # Applies density-filter compression to long user prompts.
5
- #
6
- # NOTE: Output from this hook is IGNORED by Copilot CLI.
7
- # This hook is for logging and side-effects only.
8
-
9
- $ErrorActionPreference = "Continue"
10
-
11
- $PluginRoot = if ($env:COPILOT_PLUGIN_DIR) { $env:COPILOT_PLUGIN_DIR } else { Split-Path -Parent $PSScriptRoot }
12
- $ProxyMarkerFile = Join-Path $PluginRoot ".hooks-proxy-install-attempted"
13
-
14
- $GlobalRoot = if ($env:BABYSITTER_GLOBAL_STATE_DIR) { $env:BABYSITTER_GLOBAL_STATE_DIR } else { Join-Path $HOME ".a5c" }
15
- $LogDir = if ($env:BABYSITTER_LOG_DIR) { $env:BABYSITTER_LOG_DIR } else { Join-Path $GlobalRoot "logs" }
16
- New-Item -ItemType Directory -Path $LogDir -Force -ErrorAction SilentlyContinue | Out-Null
17
-
18
- # Get required version from versions.json (used for hooks-proxy)
19
- $versionsFile = Join-Path $PluginRoot "versions.json"
20
- try {
21
- $SdkVersion = (Get-Content $versionsFile -Raw | ConvertFrom-Json).sdkVersion
22
- if (-not $SdkVersion) { $SdkVersion = "latest" }
23
- } catch {
24
- $SdkVersion = "latest"
25
- }
26
-
27
- # ---------------------------------------------------------------------------
28
- # Hooks-proxy install (same pattern as SDK install in session-start)
29
- # ---------------------------------------------------------------------------
30
-
31
- function Install-HooksProxy {
32
- param([string]$TargetVersion)
33
- try {
34
- & npm i -g "@a5c-ai/hooks-proxy-cli@$TargetVersion" --loglevel=error 2>$null
35
- if ($LASTEXITCODE -eq 0) { return $true }
36
- } catch {}
37
- try {
38
- $prefix = Join-Path $env:USERPROFILE ".local"
39
- & npm i -g "@a5c-ai/hooks-proxy-cli@$TargetVersion" --prefix $prefix --loglevel=error 2>$null
40
- if ($LASTEXITCODE -eq 0) {
41
- $env:PATH = "$prefix\bin;$env:PATH"
42
- return $true
43
- }
44
- } catch {}
45
- return $false
46
- }
47
-
48
- # Resolve hooks-proxy binary
49
- $Proxy = $null
50
- if (Get-Command a5c-hooks-proxy -ErrorAction SilentlyContinue) {
51
- $Proxy = "a5c-hooks-proxy"
1
+ # PowerShell hook wrapper sets env vars and delegates to bash
2
+ $env:HOOK_TYPE = 'user-prompt-submit'
3
+ $env:ADAPTER_NAME = 'copilot'
4
+ $env:PLUGIN_ROOT = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
5
+
6
+ $input_data = [Console]::In.ReadToEnd()
7
+ $result = $input_data | & bash "$PSScriptRoot/../$($MyInvocation.MyCommand.Name -replace '\.ps1$','.sh')" 2>$null
8
+ if ($LASTEXITCODE -eq 0 -and $result) {
9
+ Write-Output $result
52
10
  } else {
53
- $localProxy = Join-Path $env:USERPROFILE ".local\bin\a5c-hooks-proxy.exe"
54
- if (Test-Path $localProxy) {
55
- $Proxy = $localProxy
56
- }
11
+ Write-Output '{}'
57
12
  }
58
-
59
- # Install if not found (only attempt once per plugin version)
60
- if (-not $Proxy -and -not (Test-Path $ProxyMarkerFile)) {
61
- Install-HooksProxy $SdkVersion | Out-Null
62
- Set-Content -Path $ProxyMarkerFile -Value $SdkVersion -ErrorAction SilentlyContinue
63
- if (Get-Command a5c-hooks-proxy -ErrorAction SilentlyContinue) {
64
- $Proxy = "a5c-hooks-proxy"
65
- } else {
66
- $localProxy = Join-Path $env:USERPROFILE ".local\bin\a5c-hooks-proxy.exe"
67
- if (Test-Path $localProxy) {
68
- $Proxy = $localProxy
69
- }
70
- }
71
- }
72
-
73
- # ---------------------------------------------------------------------------
74
- # Capture stdin and delegate to hooks-proxy
75
- # ---------------------------------------------------------------------------
76
-
77
- $InputFile = [System.IO.Path]::GetTempFileName()
78
- $input | Out-File -FilePath $InputFile -Encoding utf8
79
-
80
- $stderrLog = Join-Path $LogDir "babysitter-user-prompt-submitted-hook-stderr.log"
81
-
82
- try {
83
- if ($Proxy) {
84
- Get-Content $InputFile | & $Proxy invoke --adapter copilot --handler "babysitter hook:run --harness unified --hook-type user-prompt-submitted --json" --json 2>$stderrLog | Out-Null
85
- } else {
86
- Get-Content $InputFile | & npx -y "@a5c-ai/hooks-proxy-cli@$SdkVersion" invoke --adapter copilot --handler "babysitter hook:run --harness unified --hook-type user-prompt-submitted --json" --json 2>$stderrLog | Out-Null
87
- }
88
- } catch {}
89
-
90
- Remove-Item $InputFile -Force -ErrorAction SilentlyContinue
91
-
92
- exit 0
@@ -1,87 +1,3 @@
1
1
  #!/bin/bash
2
- # Unified userPromptSubmitted Hook for GitHub Copilot CLI
3
- # Routes through hooks-proxy for all hook execution.
4
- #
5
- # Applies density-filter compression to long user prompts.
6
- # Delegates to SDK CLI: babysitter hook:run --hook-type user-prompt-submitted
7
- #
8
- # NOTE: Output from this hook is IGNORED by Copilot CLI.
9
- # This hook is for logging and side-effects only.
10
-
11
- PLUGIN_ROOT="${COPILOT_PLUGIN_DIR:-$(cd "$(dirname "$0")/.." && pwd)}"
12
- PROXY_MARKER_FILE="${PLUGIN_ROOT}/.hooks-proxy-install-attempted"
13
-
14
- GLOBAL_ROOT="${BABYSITTER_GLOBAL_STATE_DIR:-$HOME/.a5c}"
15
- LOG_DIR="${BABYSITTER_LOG_DIR:-${GLOBAL_ROOT}/logs}"
16
- mkdir -p "$LOG_DIR" 2>/dev/null
17
-
18
- # Get required version from versions.json (used for hooks-proxy)
19
- SDK_VERSION=$(node -e "try{console.log(JSON.parse(require('fs').readFileSync('${PLUGIN_ROOT}/versions.json','utf8')).sdkVersion||'latest')}catch{console.log('latest')}" 2>/dev/null || echo "latest")
20
-
21
- # ---------------------------------------------------------------------------
22
- # Hooks-proxy install (same pattern as SDK install in session-start)
23
- # ---------------------------------------------------------------------------
24
-
25
- install_hooks_proxy() {
26
- local target_version="$1"
27
- if npm i -g "@a5c-ai/hooks-proxy-cli@${target_version}" --loglevel=error 2>/dev/null; then
28
- return 0
29
- else
30
- if npm i -g "@a5c-ai/hooks-proxy-cli@${target_version}" --prefix "$HOME/.local" --loglevel=error 2>/dev/null; then
31
- export PATH="$HOME/.local/bin:$PATH"
32
- return 0
33
- fi
34
- fi
35
- return 1
36
- }
37
-
38
- # Resolve hooks-proxy binary
39
- PROXY=""
40
- if command -v a5c-hooks-proxy &>/dev/null; then
41
- PROXY="a5c-hooks-proxy"
42
- elif [ -f "$HOME/.local/bin/a5c-hooks-proxy" ]; then
43
- PROXY="$HOME/.local/bin/a5c-hooks-proxy"
44
- fi
45
-
46
- # Install if not found (only attempt once per plugin version)
47
- if [ -z "$PROXY" ] && [ ! -f "$PROXY_MARKER_FILE" ]; then
48
- install_hooks_proxy "$SDK_VERSION"
49
- echo "$SDK_VERSION" > "$PROXY_MARKER_FILE" 2>/dev/null
50
- if command -v a5c-hooks-proxy &>/dev/null; then
51
- PROXY="a5c-hooks-proxy"
52
- elif [ -f "$HOME/.local/bin/a5c-hooks-proxy" ]; then
53
- PROXY="$HOME/.local/bin/a5c-hooks-proxy"
54
- fi
55
- fi
56
-
57
- # npx fallback if still not found
58
- if [ -z "$PROXY" ]; then
59
- PROXY="npx -y @a5c-ai/hooks-proxy-cli@${SDK_VERSION} "
60
- fi
61
-
62
- # ---------------------------------------------------------------------------
63
- # Capture stdin and delegate to hooks-proxy
64
- # ---------------------------------------------------------------------------
65
-
66
- INPUT_FILE=$(mktemp 2>/dev/null || echo "/tmp/hook-user-prompt-submitted-$$.json")
67
- cat > "$INPUT_FILE"
68
-
69
- if command -v babysitter &>/dev/null; then
70
- babysitter log --type hook --label "hook:user-prompt-submitted" --message "Unified hook invoked" --source shell-hook 2>/dev/null || true
71
- fi
72
-
73
- STDERR_LOG="$LOG_DIR/babysitter-user-prompt-submitted-hook-stderr.log"
74
-
75
- $PROXY invoke \
76
- --adapter copilot \
77
- --handler "babysitter hook:run --harness unified --hook-type user-prompt-submitted --json" \
78
- --json \
79
- < "$INPUT_FILE" 2>"$STDERR_LOG" || true
80
-
81
- if command -v babysitter &>/dev/null; then
82
- babysitter log --type hook --label "hook:user-prompt-submitted" --message "Hook complete" --source shell-hook 2>/dev/null || true
83
- fi
84
-
85
- rm -f "$INPUT_FILE" 2>/dev/null
86
-
87
- exit 0
2
+ set -euo pipefail
3
+ babysitter hook:run --harness unified --hook-type user-prompt-submit --json
package/hooks.json CHANGED
@@ -4,25 +4,49 @@
4
4
  "sessionStart": [
5
5
  {
6
6
  "type": "command",
7
- "bash": "bash \"./hooks/babysitter-proxied-session-start.sh\"",
8
- "powershell": "powershell -NoProfile -ExecutionPolicy Bypass -File \"./hooks/babysitter-proxied-session-start.ps1\"",
7
+ "bash": "./hooks/babysitter-proxied-session-start.sh",
8
+ "powershell": "./hooks/babysitter-proxied-session-start.ps1",
9
9
  "timeoutSec": 30
10
10
  }
11
11
  ],
12
- "sessionEnd": [
12
+ "userPromptSubmitted": [
13
13
  {
14
14
  "type": "command",
15
- "bash": "bash \"./hooks/babysitter-proxied-session-end.sh\"",
16
- "powershell": "powershell -NoProfile -ExecutionPolicy Bypass -File \"./hooks/babysitter-proxied-session-end.ps1\"",
15
+ "bash": "./hooks/babysitter-proxied-user-prompt-submitted.sh",
16
+ "powershell": "./hooks/babysitter-proxied-user-prompt-submitted.ps1",
17
+ "timeoutSec": 15
18
+ }
19
+ ],
20
+ "preToolUse": [
21
+ {
22
+ "type": "command",
23
+ "bash": "./hooks/babysitter-proxied-pre-tool-use.sh",
24
+ "powershell": "./hooks/babysitter-proxied-pre-tool-use.ps1",
17
25
  "timeoutSec": 30
18
26
  }
19
27
  ],
20
- "userPromptSubmitted": [
28
+ "postToolUse": [
21
29
  {
22
30
  "type": "command",
23
- "bash": "bash \"./hooks/babysitter-proxied-user-prompt-submitted.sh\"",
24
- "powershell": "powershell -NoProfile -ExecutionPolicy Bypass -File \"./hooks/babysitter-proxied-user-prompt-submitted.ps1\"",
25
- "timeoutSec": 15
31
+ "bash": "./hooks/babysitter-proxied-post-tool-use.sh",
32
+ "powershell": "./hooks/babysitter-proxied-post-tool-use.ps1",
33
+ "timeoutSec": 30
34
+ }
35
+ ],
36
+ "PreCompact": [
37
+ {
38
+ "type": "command",
39
+ "bash": "./hooks/babysitter-proxied-pre-compact.sh",
40
+ "powershell": "./hooks/babysitter-proxied-pre-compact.ps1",
41
+ "timeoutSec": 30
42
+ }
43
+ ],
44
+ "sessionEnd": [
45
+ {
46
+ "type": "command",
47
+ "bash": "./hooks/babysitter-proxied-session-end.sh",
48
+ "powershell": "./hooks/babysitter-proxied-session-end.ps1",
49
+ "timeoutSec": 30
26
50
  }
27
51
  ]
28
52
  }
package/package.json CHANGED
@@ -1,50 +1,49 @@
1
1
  {
2
2
  "name": "@a5c-ai/babysitter-github",
3
- "version": "5.0.1-staging.e4f17eff",
4
- "description": "Babysitter orchestration plugin for GitHub Copilot CLI with lifecycle hooks and SDK-managed process-library bootstrapping",
3
+ "version": "5.0.1-staging.e920fef118ef",
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 scripts/sync-command-surfaces.js --check && node test/cloud-agent-install.test.js",
7
- "sync:commands": "node scripts/sync-command-surfaces.js",
8
- "postinstall": "node bin/install.js",
9
- "preuninstall": "node bin/uninstall.js",
10
- "team:install": "node scripts/team-install.js",
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
+ "plugin:install": "node bin/install.js --global",
9
+ "plugin:uninstall": "node bin/uninstall.js --global",
10
+ "team:install": "node scripts/team-install.js"
13
11
  },
14
12
  "bin": {
15
13
  "babysitter-github": "bin/cli.js"
16
14
  },
17
15
  "files": [
18
- "plugin.json",
16
+ "bin/",
19
17
  "hooks.json",
18
+ "AGENTS.md",
20
19
  "hooks/",
21
20
  "skills/",
22
- "bin/",
21
+ "commands/",
23
22
  "scripts/",
23
+ "plugin.json",
24
+ "README.md",
24
25
  "versions.json",
25
- "AGENTS.md",
26
- "commands/",
27
- ".github/",
28
- "README.md"
26
+ "package.json"
29
27
  ],
30
28
  "keywords": [
31
29
  "babysitter",
32
30
  "github-copilot",
33
- "orchestration",
34
- "ai-agent",
35
- "sdk-integration"
31
+ "orchestration"
36
32
  ],
37
33
  "author": "a5c.ai",
38
34
  "license": "MIT",
39
35
  "publishConfig": {
40
36
  "access": "public"
41
37
  },
38
+ "dependencies": {
39
+ "@a5c-ai/babysitter-sdk": "5.0.1-staging.e920fef118ef"
40
+ },
42
41
  "repository": {
43
42
  "type": "git",
44
- "url": "https://github.com/a5c-ai/babysitter"
43
+ "url": "git+https://github.com/a5c-ai/babysitter-github-copilot.git"
45
44
  },
46
- "homepage": "https://github.com/a5c-ai/babysitter/tree/main/plugins/babysitter-github#readme",
47
- "dependencies": {
48
- "@a5c-ai/babysitter-sdk": "5.0.1-staging.e4f17eff"
45
+ "homepage": "https://github.com/a5c-ai/babysitter-github-copilot#readme",
46
+ "bugs": {
47
+ "url": "https://github.com/a5c-ai/babysitter-github-copilot/issues"
49
48
  }
50
49
  }
package/plugin.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "babysitter",
3
- "version": "5.0.1-staging.e4f17eff",
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.e920fef118ef",
4
+ "description": "Orchestrate complex, multi-step workflows with event-sourced state management, hook-based extensibility, and human-in-the-loop approval",
5
5
  "author": {
6
- "name": "a5c.ai",
7
- "email": "support@a5c.ai"
6
+ "name": "a5c.ai"
8
7
  },
9
8
  "license": "MIT",
10
9
  "skills": "skills/",
@@ -21,8 +20,10 @@
21
20
  "automation",
22
21
  "event-sourced",
23
22
  "hooks",
24
- "github-copilot",
23
+ "TDD",
24
+ "quality-convergence",
25
25
  "agent",
26
- "LLM"
26
+ "LLM",
27
+ "github-copilot"
27
28
  ]
28
29
  }
@@ -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]);
@@ -1,93 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- const fs = require('fs');
5
- const path = require('path');
6
- const {
7
- copyPluginBundle,
8
- ensureGlobalProcessLibrary,
9
- ensureMarketplaceEntry,
10
- installCopilotSurface,
11
- registerCopilotPlugin,
12
- warnWindowsHooks,
13
- writeJson,
14
- } = require('../bin/install-shared');
4
+ var path = require('path');
5
+ var shared = require('../bin/install-shared');
15
6
 
16
- function parseArgs(argv) {
17
- const args = {
18
- workspace: process.cwd(),
19
- cloudAgent: false,
20
- dryRun: false,
21
- };
22
- for (let i = 2; i < argv.length; i += 1) {
23
- if (argv[i] === '--workspace' && argv[i + 1]) {
24
- args.workspace = path.resolve(argv[++i]);
25
- } else if (argv[i] === '--cloud-agent') {
26
- args.cloudAgent = true;
27
- } else if (argv[i] === '--dry-run') {
28
- args.dryRun = true;
29
- }
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]);
30
11
  }
31
- return args;
32
12
  }
33
13
 
34
- function main() {
35
- const args = parseArgs(process.argv);
36
- const packageRoot = path.resolve(process.env.BABYSITTER_PACKAGE_ROOT || path.join(__dirname, '..'));
37
- const workspaceRoot = args.workspace;
38
- const workspacePluginRoot = path.join(workspaceRoot, 'plugins', 'babysitter');
39
- const workspaceMarketplacePath = path.join(workspaceRoot, '.agents', 'plugins', 'marketplace.json');
40
- const workspaceCopilotDir = path.join(workspaceRoot, '.copilot');
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);
41
17
 
42
- const installInfo = {
43
- installedAt: new Date().toISOString(),
44
- packageRoot,
45
- workspaceRoot,
46
- pluginRoot: workspacePluginRoot,
47
- marketplacePath: workspaceMarketplacePath,
48
- copilotDir: workspaceCopilotDir,
49
- };
50
-
51
- if (args.dryRun) {
52
- console.log(JSON.stringify({
53
- ok: true,
54
- dryRun: true,
55
- installInfo,
56
- }, null, 2));
57
- return;
58
- }
59
-
60
- copyPluginBundle(packageRoot, workspacePluginRoot);
61
- ensureMarketplaceEntry(workspaceMarketplacePath, workspacePluginRoot);
62
- registerCopilotPlugin(workspacePluginRoot);
63
- installCopilotSurface(packageRoot, workspaceCopilotDir);
64
- if (args.cloudAgent) {
65
- const { installCloudAgentSurface } = require('../bin/install-shared');
66
- installInfo.cloudAgent = installCloudAgentSurface(packageRoot, workspaceRoot);
67
- }
68
-
69
- const active = ensureGlobalProcessLibrary(packageRoot);
70
- installInfo.processLibraryStateFile = active.stateFile;
71
- installInfo.processLibraryRoot = active.binding?.dir || '';
72
- installInfo.processLibraryCloneDir = active.defaultSpec?.cloneDir || '';
73
-
74
- const outDir = path.join(workspaceRoot, '.a5c', 'team');
75
- fs.mkdirSync(outDir, { recursive: true });
76
- writeJson(path.join(outDir, 'install.json'), installInfo);
77
-
78
- const profilePath = path.join(outDir, 'profile.json');
79
- if (!fs.existsSync(profilePath)) {
80
- writeJson(profilePath, {
81
- teamName: 'default',
82
- pluginRoot: workspacePluginRoot,
83
- marketplacePath: workspaceMarketplacePath,
84
- copilotDir: workspaceCopilotDir,
85
- processLibraryLookupCommand: 'babysitter process-library:active --json',
86
- });
87
- }
88
-
89
- warnWindowsHooks();
90
- console.log('[team-install] complete');
18
+ shared.copyPluginBundle(src, dest);
19
+ if (typeof shared.harnessTeamInstall === 'function') {
20
+ shared.harnessTeamInstall(src, dest, workspace);
91
21
  }
92
-
93
- main();
22
+ shared.runPostInstall(dest);
23
+ console.log('[babysitter] Team install complete.');
@@ -1,14 +1,12 @@
1
1
  ---
2
2
  name: babysit
3
3
  description: >-
4
- Orchestrate via @babysitter. Use this skill when asked to babysit a run,
5
- orchestrate a process or whenever it is called explicitly. (babysit,
6
- babysitter, orchestrate, orchestrate a run, workflow, etc.)
4
+ Execute via @babysitter. Use this skill when asked to babysit a task, do anything that is structured process-driven (even a loop) or whenever it is called explicitly. (babysit, babysitter, with a process, orchestrate, orchestrate a run, workflow, loop until, etc.)
7
5
  ---
8
6
 
9
7
  # babysit
10
8
 
11
- Orchestrate `.a5c/runs/<runId>/` through iterative execution.
9
+ Follow the commands below exactly. but apply judgement and creativity to get the job done. no matter how small or simple the task may seem, you must use the babysitter SDK and run lifecycle to execute it. This is non-negotiable. If you are asked to do something that seems like it could be done with a simple tool call, you must still use the babysitter SDK to create a run, define tasks, execute them, and complete the run. This is how you will learn and demonstrate mastery of the babysitter system. Always follow the full process, even for trivial tasks.
12
10
 
13
11
  ## Dependencies
14
12
 
@@ -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
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: cleanup
3
+ description: Clean up .a5c/runs and .a5c/processes directories. Aggregates insights from completed/failed runs into docs/run-history-insights.md, then removes old run data and orphaned process files.
4
+ ---
5
+
6
+ # cleanup
7
+
8
+ Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).
9
+
10
+ Create and run a cleanup process using the process at `skills\babysit\process\cradle\cleanup-runs.js/processes/cleanup-runs.js`.
11
+
12
+ Implementation notes (for the process):
13
+ - Parse arguments for `--dry-run` flag (if present, set dryRun: true in inputs) and `--keep-days N` (default: 7)
14
+
15
+ CRITICAL: The cleanup MUST follow this exact phase order. Do NOT delete any run before Phase 2 completes.
16
+
17
+ Phase 1 — Scan:
18
+ - Scan .a5c/runs/ for all runs
19
+ - Classify each as terminal (completed/failed) or active (in-progress/created)
20
+ - Identify terminal runs older than the keep-days threshold as removal candidates
21
+ - Never mark active/in-progress runs for removal
22
+ - Count and report: total runs, terminal, active, removal candidates, disk usage
23
+
24
+ Phase 2 — Aggregate insights (BEFORE any deletion):
25
+ - For EVERY removal candidate, read its run.json and journal/ events
26
+ - Extract: processId, prompt, status, event count, created date, task summaries
27
+ - Group by process type and extract patterns (retry counts, convergence behavior, failure modes)
28
+ - Append a new dated section to docs/run-history-insights.md with:
29
+ - Summary statistics (runs removed, disk freed, runs retained)
30
+ - Run categories with counts and descriptions
31
+ - Key patterns observed (multi-batch convergence, retry behavior, etc.)
32
+ - What worked well / what didn't from the run data
33
+ - This file MUST be written and verified before proceeding to Phase 3
34
+
35
+ Phase 3 — Confirm removal:
36
+ - In interactive mode, show the user what will be removed via a breakpoint
37
+ - In non-interactive mode (yolo), proceed with defaults
38
+ - In dry-run mode, stop here and show what would be removed
39
+
40
+ Phase 4 — Remove:
41
+ - Delete the terminal runs older than keep-days threshold
42
+ - Identify and remove orphaned process files not referenced by remaining runs
43
+ - Show remaining run count and disk usage after cleanup
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: contrib
3
+ description: Submit feedback or contribute to babysitter project
4
+ ---
5
+
6
+ # contrib
7
+
8
+ Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).
9
+
10
+ ## Process Routing
11
+
12
+ Contribution processes live under the active process library's `cradle/` directory. Resolve the active library root with `babysitter process-library:active --json` and route based on arguments:
13
+
14
+ ### Issue-based (opens a GitHub issue in a5c-ai/babysitter)
15
+ * **Bug report** → `cradle/bug-report.js#process` — Report a bug in the SDK, CLI, process library, etc.
16
+ * **Feature request** → `cradle/feature-request.js#process` — Request a new feature or enhancement
17
+ * **Documentation question** → `cradle/documentation-question.js#process` — Ask about undocumented behavior or missing docs
18
+
19
+ ### PR-based (forks repo, creates branch, submits PR to a5c-ai/babysitter)
20
+ * **Bugfix** → `cradle/bugfix.js#process` — User already has the fix for a bug
21
+ * **Feature implementation** → `cradle/feature-implementation-contribute.js#process` — User already has a feature implementation
22
+ * **Harness integration** → `cradle/feature-harness-integration-contribute.js#process` — User has a harness (CI/CD, IDE, editor) integration
23
+ * **Library contribution** → `cradle/library-contribution.js#process` — New or improved process/skill/subagent for the library
24
+ * **Documentation answer** → `cradle/documentation-contribute-answer.js#process` — User has an answer for an unanswered docs question
25
+
26
+ ### Router (when arguments are empty or general)
27
+ * **Contribute** → `cradle/contribute.js#process` — Explains contribution types and routes to the specific process
28
+
29
+ ## Contribution Rules
30
+
31
+ * PR-based contributions: fork the babysitter repo (a5c-ai/babysitter) for the user, ask to star if not already starred, perform changes, submit PR
32
+ * Issue-based contributions: gather details, search for duplicates, review, then open an issue in a5c-ai/babysitter
33
+ * Add breakpoints (permissions) before ALL gh actions (fork, star, submit PR/issue) to allow user review and cancellation
34
+ * If arguments are empty: use the `contribute.js` router process to show options and route accordingly