@a5c-ai/babysitter-github 0.1.1-staging.e2c886b5 → 0.1.1-staging.f2d9bb68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # @a5c-ai/babysitter-github
2
2
 
3
- Babysitter orchestration plugin for [GitHub Copilot CLI](https://docs.github.com/en/copilot/using-github-copilot/using-github-copilot-in-the-command-line).
3
+ Babysitter orchestration plugin for GitHub Copilot. It supports both:
4
+
5
+ - **GitHub Copilot CLI** via the local plugin and hook model
6
+ - **GitHub Copilot coding agent / cloud agent** via repository-installed skills and instructions
4
7
 
5
8
  This package ships a complete Copilot CLI plugin bundle -- skills, lifecycle
6
9
  hooks, and SDK integration -- that lets you run Babysitter's event-sourced,
@@ -71,6 +74,30 @@ Install into a specific workspace:
71
74
  babysitter-github install --workspace /path/to/repo
72
75
  ```
73
76
 
77
+ ### GitHub Copilot cloud agent installation
78
+
79
+ For GitHub Copilot's cloud-hosted coding agent, install repository-scoped
80
+ Babysitter support instead of the local `~/.copilot` CLI plugin surface:
81
+
82
+ ```bash
83
+ babysitter-github install --cloud-agent --workspace /path/to/repo
84
+ ```
85
+
86
+ This installs:
87
+
88
+ - a mirrored Babysitter GitHub plugin bundle under `.github/babysitter/github-plugin/`
89
+ - Babysitter skills under `.github/skills/`
90
+ - a managed Babysitter block in `AGENTS.md`
91
+ - a managed Babysitter block in `.github/copilot-instructions.md`
92
+ - a `copilot-setup-steps` workflow, or a generated merge candidate if the repo already has one
93
+
94
+ If the repository already has a custom `copilot-setup-steps.yml`, the
95
+ installer preserves it and writes a merge candidate to:
96
+
97
+ ```text
98
+ .github/workflows/copilot-setup-steps.babysitter.generated.yml
99
+ ```
100
+
74
101
  If the workspace does not already have an active process-library binding, the
75
102
  installer bootstraps the shared global SDK process library automatically:
76
103
 
@@ -101,6 +128,11 @@ The plugin provides:
101
128
  - Plugin-level lifecycle hooks for `sessionStart`, `sessionEnd`, and
102
129
  `userPromptSubmitted`
103
130
 
131
+ For Copilot cloud agent, the hook scripts are mirrored into the repository as
132
+ part of the installed plugin bundle for reference and parity, but the hosted
133
+ agent path is driven by repository instructions, skills, and setup workflow
134
+ instead of local `~/.copilot/hooks.json`.
135
+
104
136
  The process library is fetched and bound through the SDK CLI in
105
137
  `~/.a5c/active/process-library.json`.
106
138
 
@@ -173,8 +205,21 @@ preserving semantic content.
173
205
  ### AGENTS.md
174
206
 
175
207
  The plugin uses `AGENTS.md` (the Copilot CLI equivalent of `CLAUDE.md`) for
176
- custom agent instructions. This file is read by Copilot CLI to configure
177
- agent behavior within sessions.
208
+ custom agent instructions. The cloud-agent installer appends a managed
209
+ Babysitter section to the repository root `AGENTS.md` so the hosted agent can
210
+ see the same orchestration guidance.
211
+
212
+ ### .github/copilot-instructions.md
213
+
214
+ The cloud-agent installer also appends a managed Babysitter block to
215
+ `.github/copilot-instructions.md`. This gives GitHub-hosted Copilot sessions a
216
+ repository-wide entrypoint for the Babysitter skills and setup workflow.
217
+
218
+ ### copilot-setup-steps workflow
219
+
220
+ The cloud-agent path seeds `.github/workflows/copilot-setup-steps.yml` with a
221
+ `copilot-setup-steps` job that installs the Babysitter SDK and initializes the
222
+ active process library before the cloud agent starts working.
178
223
 
179
224
  ### Environment Variables
180
225
 
@@ -446,6 +491,22 @@ plugins/babysitter-github/
446
491
  AGENTS.md # Custom instructions for Copilot CLI
447
492
  ```
448
493
 
494
+ Cloud-agent installation additionally writes into the target repository:
495
+
496
+ ```
497
+ .github/
498
+ babysitter/github-plugin/ # Mirrored plugin bundle for repo-local visibility
499
+ skills/
500
+ babysitter-babysit/SKILL.md # Installed Babysitter cloud skills
501
+ babysitter-call/SKILL.md
502
+ ...
503
+ copilot-instructions.md # Managed Babysitter block appended
504
+ workflows/
505
+ copilot-setup-steps.yml # Managed workflow when no custom file exists
506
+ copilot-setup-steps.babysitter.generated.yml # Merge candidate when a custom file already exists
507
+ AGENTS.md # Managed Babysitter block appended
508
+ ```
509
+
449
510
  ## Verification
450
511
 
451
512
  Verify marketplace registration:
package/bin/cli.js CHANGED
@@ -11,6 +11,7 @@ function printUsage() {
11
11
  'Usage:',
12
12
  ' babysitter-github install [--global]',
13
13
  ' babysitter-github install --workspace [path]',
14
+ ' babysitter-github install --cloud-agent [--workspace [path]]',
14
15
  ' babysitter-github uninstall',
15
16
  ].join('\n'));
16
17
  }
@@ -18,6 +19,7 @@ function printUsage() {
18
19
  function parseInstallArgs(argv) {
19
20
  let scope = 'global';
20
21
  let workspace = null;
22
+ let cloudAgent = false;
21
23
  const passthrough = [];
22
24
 
23
25
  for (let i = 0; i < argv.length; i += 1) {
@@ -43,10 +45,16 @@ function parseInstallArgs(argv) {
43
45
  }
44
46
  continue;
45
47
  }
48
+ if (arg === '--cloud-agent') {
49
+ cloudAgent = true;
50
+ passthrough.push(arg);
51
+ continue;
52
+ }
46
53
  passthrough.push(arg);
47
54
  }
48
55
 
49
56
  return {
57
+ cloudAgent,
50
58
  scope,
51
59
  workspace,
52
60
  passthrough,
@@ -75,6 +83,10 @@ function main() {
75
83
 
76
84
  if (command === 'install') {
77
85
  const parsed = parseInstallArgs(rest);
86
+ if (parsed.cloudAgent) {
87
+ runNodeScript(path.join(PACKAGE_ROOT, 'bin', 'install.js'), parsed.passthrough);
88
+ return;
89
+ }
78
90
  if (parsed.scope === 'workspace') {
79
91
  const args = [];
80
92
  if (parsed.workspace) {
@@ -35,6 +35,22 @@ const PLUGIN_BUNDLE_ENTRIES = [
35
35
  'versions.json',
36
36
  'AGENTS.md',
37
37
  ];
38
+ const CLOUD_AGENT_BUNDLE_ENTRIES = [
39
+ '.github',
40
+ 'AGENTS.md',
41
+ 'README.md',
42
+ 'bin',
43
+ 'commands',
44
+ 'hooks',
45
+ 'hooks.json',
46
+ 'package.json',
47
+ 'plugin.json',
48
+ 'scripts',
49
+ 'skills',
50
+ 'versions.json',
51
+ ];
52
+ const MANAGED_BLOCK_START = '<!-- BEGIN BABYSITTER GITHUB CLOUD AGENT -->';
53
+ const MANAGED_BLOCK_END = '<!-- END BABYSITTER GITHUB CLOUD AGENT -->';
38
54
 
39
55
  function getCopilotHome() {
40
56
  if (process.env.COPILOT_HOME) return path.resolve(process.env.COPILOT_HOME);
@@ -145,6 +161,79 @@ function writeJson(filePath, value) {
145
161
  writeFileIfChanged(filePath, `${JSON.stringify(value, null, 2)}\n`);
146
162
  }
147
163
 
164
+ function replaceManagedMarkdownBlock(existing, block) {
165
+ const normalized = String(existing || '').replace(/\r\n/g, '\n');
166
+ const managedBlock = `${MANAGED_BLOCK_START}\n${block.trim()}\n${MANAGED_BLOCK_END}`;
167
+ const escapedStart = MANAGED_BLOCK_START.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
168
+ const escapedEnd = MANAGED_BLOCK_END.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
169
+ const managedPattern = new RegExp(`${escapedStart}[\\s\\S]*?${escapedEnd}`, 'm');
170
+
171
+ if (managedPattern.test(normalized)) {
172
+ return normalized.replace(managedPattern, managedBlock).replace(/\n{3,}/g, '\n\n').trimEnd() + '\n';
173
+ }
174
+
175
+ if (normalized.trim().length === 0) {
176
+ return `${managedBlock}\n`;
177
+ }
178
+
179
+ return `${normalized.trimEnd()}\n\n${managedBlock}\n`;
180
+ }
181
+
182
+ function writeManagedMarkdown(filePath, block) {
183
+ const existing = fs.existsSync(filePath) ? fs.readFileSync(filePath, 'utf8') : '';
184
+ return writeFileIfChanged(filePath, replaceManagedMarkdownBlock(existing, block));
185
+ }
186
+
187
+ function readSdkVersion(packageRoot) {
188
+ const versionsPath = path.join(packageRoot, 'versions.json');
189
+ if (!fs.existsSync(versionsPath)) {
190
+ return 'latest';
191
+ }
192
+ try {
193
+ const parsed = readJson(versionsPath);
194
+ return typeof parsed.sdkVersion === 'string' && parsed.sdkVersion.trim() !== ''
195
+ ? parsed.sdkVersion.trim()
196
+ : 'latest';
197
+ } catch {
198
+ return 'latest';
199
+ }
200
+ }
201
+
202
+ function toLowerHyphenName(name) {
203
+ return String(name)
204
+ .trim()
205
+ .toLowerCase()
206
+ .replace(/[^a-z0-9]+/g, '-')
207
+ .replace(/^-+|-+$/g, '');
208
+ }
209
+
210
+ function rewriteCloudSkill(skillId, contents) {
211
+ const normalized = String(contents).replace(/\r\n/g, '\n');
212
+ const prefixedName = `babysitter-${skillId}`;
213
+ let next = normalized;
214
+
215
+ if (next.startsWith('---\n')) {
216
+ next = next.replace(/^---\n([\s\S]*?)\n---\n?/, (_match, frontmatter) => {
217
+ const lines = String(frontmatter).split('\n');
218
+ let sawName = false;
219
+ const updatedLines = lines.map((line) => {
220
+ if (/^name:\s*/.test(line)) {
221
+ sawName = true;
222
+ return `name: ${prefixedName}`;
223
+ }
224
+ return line;
225
+ });
226
+ if (!sawName) {
227
+ updatedLines.push(`name: ${prefixedName}`);
228
+ }
229
+ return `---\n${updatedLines.join('\n')}\n---\n`;
230
+ });
231
+ }
232
+
233
+ next = next.replace(/^#\s+.+$/m, `# ${prefixedName}`);
234
+ return next.replace(/\n{3,}/g, '\n\n').trimEnd() + '\n';
235
+ }
236
+
148
237
  function ensureMarketplaceEntry(marketplacePath, pluginSourcePath) {
149
238
  const marketplace = fs.existsSync(marketplacePath)
150
239
  ? readJson(marketplacePath)
@@ -369,6 +458,167 @@ function installCopilotSurface(packageRoot, copilotHome) {
369
458
  installManagedHooks(packageRoot, copilotHome);
370
459
  }
371
460
 
461
+ function renderCloudAgentAgentsBlock() {
462
+ return [
463
+ '## Babysitter Cloud Agent',
464
+ '',
465
+ 'This repository is configured to let GitHub Copilot cloud agent use Babysitter orchestration assets.',
466
+ '',
467
+ '- For complex multi-step work, use the Babysitter skills installed under `.github/skills/` when relevant.',
468
+ '- The cloud-agent setup workflow installs the Babysitter SDK before work begins.',
469
+ '- If you need the full orchestration instructions, run `babysitter instructions:babysit-skill --harness github-copilot --json`.',
470
+ '- Execute requested shell and Node tasks directly and report the results instead of describing what should be done.',
471
+ '- Do not revert unrelated user changes.',
472
+ ].join('\n');
473
+ }
474
+
475
+ function renderCloudAgentCopilotInstructionsBlock() {
476
+ return [
477
+ '# Babysitter Copilot Cloud Agent Support',
478
+ '',
479
+ 'This repository includes Babysitter support for GitHub Copilot cloud agent.',
480
+ '',
481
+ '- Read the nearest `AGENTS.md` instructions before making changes.',
482
+ '- Consider the Babysitter skills under `.github/skills/` when the task is a multi-step workflow, orchestration run, diagnosis, planning, or retrospective.',
483
+ '- The `copilot-setup-steps` workflow installs the Babysitter SDK and initializes the active process library before the agent starts working.',
484
+ '- Add repository-specific build, test, and validation commands below this managed section if they are not already documented elsewhere in the repo.',
485
+ ].join('\n');
486
+ }
487
+
488
+ function renderCloudAgentSetupWorkflow(packageRoot) {
489
+ const sdkVersion = readSdkVersion(packageRoot);
490
+ return [
491
+ 'name: "Copilot Setup Steps"',
492
+ '',
493
+ 'on:',
494
+ ' workflow_dispatch:',
495
+ ' push:',
496
+ ' paths:',
497
+ ' - .github/workflows/copilot-setup-steps.yml',
498
+ ' - .github/copilot-instructions.md',
499
+ ' - .github/skills/**',
500
+ ' - AGENTS.md',
501
+ ' pull_request:',
502
+ ' paths:',
503
+ ' - .github/workflows/copilot-setup-steps.yml',
504
+ ' - .github/copilot-instructions.md',
505
+ ' - .github/skills/**',
506
+ ' - AGENTS.md',
507
+ '',
508
+ 'jobs:',
509
+ ' copilot-setup-steps:',
510
+ ' runs-on: ubuntu-latest',
511
+ ' permissions:',
512
+ ' contents: read',
513
+ ' steps:',
514
+ ' - name: Check out repository',
515
+ ' uses: actions/checkout@v4',
516
+ '',
517
+ ' - name: Set up Node.js',
518
+ ' uses: actions/setup-node@v4',
519
+ ' with:',
520
+ ' node-version: 22',
521
+ ' cache: npm',
522
+ '',
523
+ ' - name: Install Babysitter SDK',
524
+ ` run: npm install -g @a5c-ai/babysitter-sdk@${sdkVersion}`,
525
+ '',
526
+ ' - name: Initialize active process library',
527
+ ' run: babysitter process-library:active --json',
528
+ ].join('\n') + '\n';
529
+ }
530
+
531
+ function installCloudAgentBundle(packageRoot, workspaceRoot) {
532
+ const bundleRoot = path.join(workspaceRoot, '.github', 'babysitter', 'github-plugin');
533
+ fs.rmSync(bundleRoot, { recursive: true, force: true });
534
+ fs.mkdirSync(bundleRoot, { recursive: true });
535
+ for (const entry of CLOUD_AGENT_BUNDLE_ENTRIES) {
536
+ const sourcePath = path.join(packageRoot, entry);
537
+ if (!fs.existsSync(sourcePath)) {
538
+ continue;
539
+ }
540
+ copyRecursive(sourcePath, path.join(bundleRoot, entry));
541
+ }
542
+ return bundleRoot;
543
+ }
544
+
545
+ function installCloudAgentSkills(packageRoot, workspaceRoot) {
546
+ const sourceRoot = path.join(packageRoot, 'skills');
547
+ if (!fs.existsSync(sourceRoot)) return [];
548
+
549
+ const targetRoot = path.join(workspaceRoot, '.github', 'skills');
550
+ fs.mkdirSync(targetRoot, { recursive: true });
551
+ const installed = [];
552
+
553
+ for (const entry of fs.readdirSync(sourceRoot, { withFileTypes: true })) {
554
+ if (!entry.isDirectory()) continue;
555
+ const sourceDir = path.join(sourceRoot, entry.name);
556
+ const skillId = toLowerHyphenName(entry.name);
557
+ const targetDir = path.join(targetRoot, `babysitter-${skillId}`);
558
+ fs.rmSync(targetDir, { recursive: true, force: true });
559
+ copyRecursive(sourceDir, targetDir);
560
+ const skillPath = path.join(targetDir, 'SKILL.md');
561
+ if (fs.existsSync(skillPath)) {
562
+ const rewritten = rewriteCloudSkill(skillId, fs.readFileSync(skillPath, 'utf8'));
563
+ fs.writeFileSync(skillPath, rewritten, 'utf8');
564
+ }
565
+ installed.push(targetDir);
566
+ }
567
+
568
+ return installed;
569
+ }
570
+
571
+ function installCloudAgentInstructions(packageRoot, workspaceRoot) {
572
+ const agentsPath = path.join(workspaceRoot, 'AGENTS.md');
573
+ const copilotInstructionsPath = path.join(workspaceRoot, '.github', 'copilot-instructions.md');
574
+
575
+ writeManagedMarkdown(agentsPath, renderCloudAgentAgentsBlock(packageRoot));
576
+ writeManagedMarkdown(copilotInstructionsPath, renderCloudAgentCopilotInstructionsBlock(packageRoot));
577
+
578
+ return {
579
+ agentsPath,
580
+ copilotInstructionsPath,
581
+ };
582
+ }
583
+
584
+ function installCloudAgentSetupSteps(packageRoot, workspaceRoot) {
585
+ const workflowsDir = path.join(workspaceRoot, '.github', 'workflows');
586
+ const workflowPath = path.join(workflowsDir, 'copilot-setup-steps.yml');
587
+ const examplePath = path.join(workflowsDir, 'copilot-setup-steps.babysitter.generated.yml');
588
+ const contents = renderCloudAgentSetupWorkflow(packageRoot);
589
+
590
+ fs.mkdirSync(workflowsDir, { recursive: true });
591
+
592
+ if (!fs.existsSync(workflowPath)) {
593
+ writeFileIfChanged(workflowPath, contents);
594
+ fs.rmSync(examplePath, { force: true });
595
+ return { workflowPath, examplePath: null, managed: true, needsManualMerge: false };
596
+ }
597
+
598
+ const existing = fs.readFileSync(workflowPath, 'utf8');
599
+ if (existing.includes('copilot-setup-steps') && existing.includes('@a5c-ai/babysitter-sdk')) {
600
+ writeFileIfChanged(workflowPath, contents);
601
+ fs.rmSync(examplePath, { force: true });
602
+ return { workflowPath, examplePath: null, managed: true, needsManualMerge: false };
603
+ }
604
+
605
+ writeFileIfChanged(examplePath, contents);
606
+ return { workflowPath, examplePath, managed: false, needsManualMerge: true };
607
+ }
608
+
609
+ function installCloudAgentSurface(packageRoot, workspaceRoot) {
610
+ const bundleRoot = installCloudAgentBundle(packageRoot, workspaceRoot);
611
+ const skillDirs = installCloudAgentSkills(packageRoot, workspaceRoot);
612
+ const instructions = installCloudAgentInstructions(packageRoot, workspaceRoot);
613
+ const setupWorkflow = installCloudAgentSetupSteps(packageRoot, workspaceRoot);
614
+ return {
615
+ bundleRoot,
616
+ skillDirs,
617
+ ...instructions,
618
+ setupWorkflow,
619
+ };
620
+ }
621
+
372
622
  function resolveBabysitterCommand(packageRoot) {
373
623
  if (process.env.BABYSITTER_SDK_CLI) {
374
624
  return {
@@ -442,6 +692,7 @@ module.exports = {
442
692
  getHomeMarketplacePath,
443
693
  getHomePluginRoot,
444
694
  installCopilotSurface,
695
+ installCloudAgentSurface,
445
696
  registerCopilotPlugin,
446
697
  removeLegacyHooks,
447
698
  removeMarketplaceEntry,
package/bin/install.js CHANGED
@@ -10,12 +10,39 @@ const {
10
10
  getCopilotHome,
11
11
  getHomeMarketplacePath,
12
12
  getHomePluginRoot,
13
+ installCloudAgentSurface,
13
14
  installCopilotSurface,
14
15
  warnWindowsHooks,
15
16
  } = require('./install-shared');
16
17
 
17
18
  const PACKAGE_ROOT = path.resolve(__dirname, '..');
18
19
 
20
+ function parseArgs(argv) {
21
+ const args = {
22
+ cloudAgent: false,
23
+ workspace: process.cwd(),
24
+ };
25
+
26
+ for (let i = 0; i < argv.length; i += 1) {
27
+ const arg = argv[i];
28
+ if (arg === '--cloud-agent') {
29
+ args.cloudAgent = true;
30
+ continue;
31
+ }
32
+ if (arg === '--workspace') {
33
+ const next = argv[i + 1];
34
+ if (next && !next.startsWith('-')) {
35
+ args.workspace = path.resolve(next);
36
+ i += 1;
37
+ } else {
38
+ args.workspace = process.cwd();
39
+ }
40
+ }
41
+ }
42
+
43
+ return args;
44
+ }
45
+
19
46
  /**
20
47
  * Attempt to register the plugin via `copilot plugin install ./path`.
21
48
  * Falls back to manual config.json registration if the CLI is not available.
@@ -43,10 +70,31 @@ function registerViaCopilotCli(pluginRoot) {
43
70
  }
44
71
 
45
72
  function main() {
73
+ const args = parseArgs(process.argv.slice(2));
46
74
  const copilotHome = getCopilotHome();
47
75
  const pluginRoot = getHomePluginRoot();
48
76
  const marketplacePath = getHomeMarketplacePath();
49
77
 
78
+ if (args.cloudAgent) {
79
+ const active = ensureGlobalProcessLibrary(PACKAGE_ROOT);
80
+ const installed = installCloudAgentSurface(PACKAGE_ROOT, args.workspace);
81
+ console.log(`[babysitter] Installed Copilot cloud-agent support into ${args.workspace}`);
82
+ console.log(`[babysitter] plugin bundle: ${installed.bundleRoot}`);
83
+ console.log(`[babysitter] skills: ${path.join(args.workspace, '.github', 'skills')}`);
84
+ console.log(`[babysitter] instructions: ${installed.copilotInstructionsPath}`);
85
+ console.log(`[babysitter] agents: ${installed.agentsPath}`);
86
+ if (installed.setupWorkflow.needsManualMerge) {
87
+ console.warn(`[babysitter] Existing copilot-setup-steps workflow preserved: ${installed.setupWorkflow.workflowPath}`);
88
+ console.warn(`[babysitter] Merge Babysitter setup steps from: ${installed.setupWorkflow.examplePath}`);
89
+ } else {
90
+ console.log(`[babysitter] setup workflow: ${installed.setupWorkflow.workflowPath}`);
91
+ }
92
+ console.log(`[babysitter] process library: ${active.binding?.dir}`);
93
+ console.log(`[babysitter] process library state: ${active.stateFile}`);
94
+ console.log('[babysitter] Cloud-agent installation complete!');
95
+ return;
96
+ }
97
+
50
98
  console.log(`[babysitter] Installing plugin to ${pluginRoot}`);
51
99
 
52
100
  try {
@@ -182,6 +182,9 @@ Read the last 50 lines of each of these log files (if they exist):
182
182
  - `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter-stop-hook-stderr.log`
183
183
  - `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter-session-start-hook.log`
184
184
  - `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter-session-start-hook-stderr.log`
185
+ - `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter.log`
186
+ - `$HOME/.a5c/logs/` and relevant logs and run/session specific logs there
187
+
185
188
 
186
189
  For each log file:
187
190
  - If the file does not exist, note it as "Not found (OK if hooks have not run yet)."
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@a5c-ai/babysitter-github",
3
- "version": "0.1.1-staging.e2c886b5",
3
+ "version": "0.1.1-staging.f2d9bb68",
4
4
  "description": "Babysitter orchestration plugin for GitHub Copilot CLI with lifecycle hooks and SDK-managed process-library bootstrapping",
5
5
  "scripts": {
6
- "test": "echo \"No tests yet\"",
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",
7
8
  "postinstall": "node bin/install.js",
8
9
  "preuninstall": "node bin/uninstall.js",
9
10
  "team:install": "node scripts/team-install.js",
@@ -44,6 +45,6 @@
44
45
  },
45
46
  "homepage": "https://github.com/a5c-ai/babysitter/tree/main/plugins/babysitter-github#readme",
46
47
  "dependencies": {
47
- "@a5c-ai/babysitter-sdk": "0.0.184-staging.e2c886b5"
48
+ "@a5c-ai/babysitter-sdk": "0.0.184-staging.f2d9bb68"
48
49
  }
49
50
  }
@@ -0,0 +1,62 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+ const {
5
+ listDirectories,
6
+ listMarkdownBasenames,
7
+ reportCheckResult,
8
+ syncCommandMirrors,
9
+ syncSkillsFromCommands,
10
+ } = require('../../../scripts/plugin-command-sync-lib.cjs');
11
+
12
+ const PACKAGE_ROOT = path.resolve(__dirname, '..');
13
+ const REPO_ROOT = path.resolve(PACKAGE_ROOT, '..', '..');
14
+ const ROOT_COMMANDS = path.join(REPO_ROOT, 'plugins', 'babysitter', 'commands');
15
+ const PLUGIN_COMMANDS = path.join(PACKAGE_ROOT, 'commands');
16
+ const PLUGIN_SKILLS = path.join(PACKAGE_ROOT, 'skills');
17
+ const LABEL = 'babysitter-github sync';
18
+
19
+ function getMirroredCommandNames() {
20
+ const local = new Set(listMarkdownBasenames(PLUGIN_COMMANDS));
21
+ return listMarkdownBasenames(ROOT_COMMANDS).filter((name) => local.has(name));
22
+ }
23
+
24
+ function getDerivedSkillNames() {
25
+ const local = new Set(listDirectories(PLUGIN_SKILLS));
26
+ return listMarkdownBasenames(PLUGIN_COMMANDS).filter((name) => local.has(name));
27
+ }
28
+
29
+ function main() {
30
+ const check = process.argv.includes('--check');
31
+ const mirrorResult = syncCommandMirrors({
32
+ label: LABEL,
33
+ sourceRoot: ROOT_COMMANDS,
34
+ targetRoot: PLUGIN_COMMANDS,
35
+ names: getMirroredCommandNames(),
36
+ check,
37
+ cwd: PACKAGE_ROOT,
38
+ });
39
+ const skillsResult = syncSkillsFromCommands({
40
+ label: LABEL,
41
+ sourceRoot: PLUGIN_COMMANDS,
42
+ skillsRoot: PLUGIN_SKILLS,
43
+ names: getDerivedSkillNames(),
44
+ check,
45
+ cwd: PACKAGE_ROOT,
46
+ });
47
+
48
+ if (check) {
49
+ reportCheckResult(LABEL, [...mirrorResult.stale, ...skillsResult.stale]);
50
+ return;
51
+ }
52
+
53
+ const updated = mirrorResult.updated + skillsResult.updated;
54
+ if (updated === 0) {
55
+ console.log(`[${LABEL}] no GitHub plugin command changes were needed.`);
56
+ return;
57
+ }
58
+
59
+ console.log(`[${LABEL}] updated ${updated} GitHub plugin file(s).`);
60
+ }
61
+
62
+ main();
@@ -16,11 +16,14 @@ const {
16
16
  function parseArgs(argv) {
17
17
  const args = {
18
18
  workspace: process.cwd(),
19
+ cloudAgent: false,
19
20
  dryRun: false,
20
21
  };
21
22
  for (let i = 2; i < argv.length; i += 1) {
22
23
  if (argv[i] === '--workspace' && argv[i + 1]) {
23
24
  args.workspace = path.resolve(argv[++i]);
25
+ } else if (argv[i] === '--cloud-agent') {
26
+ args.cloudAgent = true;
24
27
  } else if (argv[i] === '--dry-run') {
25
28
  args.dryRun = true;
26
29
  }
@@ -58,6 +61,10 @@ function main() {
58
61
  ensureMarketplaceEntry(workspaceMarketplacePath, workspacePluginRoot);
59
62
  registerCopilotPlugin(workspacePluginRoot);
60
63
  installCopilotSurface(packageRoot, workspaceCopilotDir);
64
+ if (args.cloudAgent) {
65
+ const { installCloudAgentSurface } = require('../bin/install-shared');
66
+ installInfo.cloudAgent = installCloudAgentSurface(packageRoot, workspaceRoot);
67
+ }
61
68
 
62
69
  const active = ensureGlobalProcessLibrary(packageRoot);
63
70
  installInfo.processLibraryStateFile = active.stateFile;
@@ -1,17 +1,38 @@
1
1
  ---
2
2
  name: assimilate
3
- description: Assimilate an external methodology, repo, spec, or process into a Babysitter workflow.
3
+ description: Assimilate an external methodology, harness, or specification into babysitter process definitions with skills and agents.
4
4
  ---
5
5
 
6
6
  # assimilate
7
7
 
8
- Load and use the installed `babysit` skill.
8
+ Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).
9
9
 
10
- Resolve the request in `assimilate` mode:
10
+ Use the assimilation domain processes from the active process library to convert external sources into well-defined babysitter process definitions with accompanying skills/ and agents/ directories.
11
11
 
12
- - treat everything after `$assimilate` as the target repo, methodology, spec,
13
- or reference to ingest
14
- - follow the `babysit` skill contract for research, process-library discovery,
15
- and orchestration
16
- - do not create a separate command surface here; this skill only forwards into
17
- `babysit`
12
+ If the workspace does not already have an active process-library binding, initialize it first through the shared global SDK binding:
13
+
14
+ ```bash
15
+ babysitter process-library:active --json
16
+ ```
17
+
18
+ Run the process after formalizing it.
19
+
20
+ Available assimilation workflows:
21
+ - **methodology-assimilation** (`specializations/domains/assimilation/workflows/methodology-assimilation`) - Learns an external methodology from its repo and converts procedural instructions, commands, and manual flows into babysitter processes with refactored skills and agents. Supports output as methodology or specialization.
22
+ - **harness integration** (`specializations/domains/assimilation/harness/*`) - Integrates babysitter SDK with a specific AI coding harness (generic, codex, opencode, gemini-cli, openclaw, antigravity).
23
+
24
+ During the interview phase, determine which assimilation workflow to use based on the user's target:
25
+ - If the target is a **repo URL or methodology name** then use the methodology-assimilation workflow.
26
+ - If the target is a **harness name** (e.g. codex, opencode, antigravity) then use the matching harness process.
27
+ - If the target is a **specification or other source** then adapt the methodology-assimilation workflow for the spec format.
28
+ - If unclear, ask the user to clarify the assimilation target and type.
29
+
30
+ ## After Assimilation: Contribute Back
31
+
32
+ After successfully assimilating a methodology or harness integration, prompt the user to share it with the community. The assimilated process definitions, skills, and agents could benefit other babysitter users:
33
+
34
+ - **Completed a methodology assimilation**: `/babysitter:contrib library contribution: assimilated [methodology-name] into babysitter process definitions`
35
+ - **Completed a harness integration**: `/babysitter:contrib library contribution: [harness-name] harness integration`
36
+ - **Hit issues during assimilation** (e.g. unsupported patterns, missing SDK features): `/babysitter:contrib bug report: assimilation of [target] failed because [description]` or `/babysitter:contrib feature request: [what the SDK needs to support]`
37
+
38
+ Even just reporting that an assimilation didn't work well helps improve babysitter for everyone.
@@ -1,17 +1,8 @@
1
1
  ---
2
2
  name: call
3
- description: Start a new Babysitter orchestration run from GitHub Copilot CLI.
3
+ description: Orchestrate a babysitter run. use this command to start babysitting a complex workflow.
4
4
  ---
5
5
 
6
6
  # call
7
7
 
8
- Load and use the installed `babysit` skill.
9
-
10
- Resolve the request in `call` mode:
11
-
12
- - treat everything after `$call` as the initial Babysitter request for a new
13
- orchestration run
14
- - create the process, create the run, and enter the Babysitter loop
15
- - using this always means the user meant an interactive run
16
- - do not create a separate command surface here; this skill only forwards into
17
- `babysit`
8
+ Invoke the babysitter:babysit skill (using the Skill tool) and follow its instructions (SKILL.md).