@a5c-ai/babysitter-github 0.1.1-staging.04cc300a
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/.github/plugin.json +25 -0
- package/AGENTS.md +41 -0
- package/README.md +606 -0
- package/bin/cli.js +116 -0
- package/bin/install-shared.js +701 -0
- package/bin/install.js +129 -0
- package/bin/uninstall.js +76 -0
- package/commands/assimilate.md +37 -0
- package/commands/call.md +7 -0
- package/commands/cleanup.md +20 -0
- package/commands/contrib.md +33 -0
- package/commands/doctor.md +426 -0
- package/commands/forever.md +7 -0
- package/commands/help.md +244 -0
- package/commands/observe.md +12 -0
- package/commands/plan.md +7 -0
- package/commands/plugins.md +255 -0
- package/commands/project-install.md +17 -0
- package/commands/resume.md +8 -0
- package/commands/retrospect.md +55 -0
- package/commands/user-install.md +17 -0
- package/commands/yolo.md +7 -0
- package/hooks/session-end.ps1 +68 -0
- package/hooks/session-end.sh +65 -0
- package/hooks/session-start.ps1 +110 -0
- package/hooks/session-start.sh +100 -0
- package/hooks/user-prompt-submitted.ps1 +51 -0
- package/hooks/user-prompt-submitted.sh +41 -0
- package/hooks.json +29 -0
- package/package.json +50 -0
- package/plugin.json +25 -0
- package/scripts/sync-command-surfaces.js +62 -0
- package/scripts/team-install.js +93 -0
- package/skills/assimilate/SKILL.md +38 -0
- package/skills/babysit/SKILL.md +77 -0
- package/skills/call/SKILL.md +8 -0
- package/skills/doctor/SKILL.md +427 -0
- package/skills/help/SKILL.md +245 -0
- package/skills/observe/SKILL.md +13 -0
- package/skills/plan/SKILL.md +8 -0
- package/skills/resume/SKILL.md +9 -0
- package/skills/retrospect/SKILL.md +56 -0
- package/skills/user-install/SKILL.md +18 -0
- package/versions.json +3 -0
package/bin/install.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { spawnSync } = require('child_process');
|
|
6
|
+
const {
|
|
7
|
+
copyPluginBundle,
|
|
8
|
+
ensureGlobalProcessLibrary,
|
|
9
|
+
ensureMarketplaceEntry,
|
|
10
|
+
getCopilotHome,
|
|
11
|
+
getHomeMarketplacePath,
|
|
12
|
+
getHomePluginRoot,
|
|
13
|
+
installCloudAgentSurface,
|
|
14
|
+
installCopilotSurface,
|
|
15
|
+
warnWindowsHooks,
|
|
16
|
+
} = require('./install-shared');
|
|
17
|
+
|
|
18
|
+
const PACKAGE_ROOT = path.resolve(__dirname, '..');
|
|
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
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Attempt to register the plugin via `copilot plugin install ./path`.
|
|
48
|
+
* Falls back to manual config.json registration if the CLI is not available.
|
|
49
|
+
*/
|
|
50
|
+
function registerViaCopilotCli(pluginRoot) {
|
|
51
|
+
const result = spawnSync('copilot', ['plugin', 'install', pluginRoot], {
|
|
52
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
53
|
+
encoding: 'utf8',
|
|
54
|
+
timeout: 30000,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
if (result.status === 0) {
|
|
58
|
+
console.log(`[babysitter] Registered plugin via 'copilot plugin install'`);
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// CLI not available or failed -- fall back to manual registration
|
|
63
|
+
const stderr = (result.stderr || '').trim();
|
|
64
|
+
if (result.error || stderr.includes('not found') || stderr.includes('not recognized')) {
|
|
65
|
+
console.log(`[babysitter] Copilot CLI not found, using manual registration`);
|
|
66
|
+
} else {
|
|
67
|
+
console.warn(`[babysitter] 'copilot plugin install' failed: ${stderr || 'unknown error'}, using manual registration`);
|
|
68
|
+
}
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function main() {
|
|
73
|
+
const args = parseArgs(process.argv.slice(2));
|
|
74
|
+
const copilotHome = getCopilotHome();
|
|
75
|
+
const pluginRoot = getHomePluginRoot();
|
|
76
|
+
const marketplacePath = getHomeMarketplacePath();
|
|
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
|
+
|
|
98
|
+
console.log(`[babysitter] Installing plugin to ${pluginRoot}`);
|
|
99
|
+
|
|
100
|
+
try {
|
|
101
|
+
copyPluginBundle(PACKAGE_ROOT, pluginRoot);
|
|
102
|
+
ensureMarketplaceEntry(marketplacePath, pluginRoot);
|
|
103
|
+
|
|
104
|
+
// Try native copilot CLI registration first; fall back to manual config.json
|
|
105
|
+
if (!registerViaCopilotCli(pluginRoot)) {
|
|
106
|
+
const { registerCopilotPlugin } = require('./install-shared');
|
|
107
|
+
registerCopilotPlugin(pluginRoot);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
installCopilotSurface(PACKAGE_ROOT, copilotHome);
|
|
111
|
+
|
|
112
|
+
const active = ensureGlobalProcessLibrary(PACKAGE_ROOT);
|
|
113
|
+
console.log(`[babysitter] marketplace: ${marketplacePath}`);
|
|
114
|
+
console.log(`[babysitter] copilot config: ${path.join(copilotHome, 'config.json')}`);
|
|
115
|
+
console.log(`[babysitter] process library: ${active.binding?.dir}`);
|
|
116
|
+
if (active.defaultSpec?.cloneDir) {
|
|
117
|
+
console.log(`[babysitter] process library clone: ${active.defaultSpec.cloneDir}`);
|
|
118
|
+
}
|
|
119
|
+
console.log(`[babysitter] process library state: ${active.stateFile}`);
|
|
120
|
+
warnWindowsHooks();
|
|
121
|
+
console.log('[babysitter] Installation complete!');
|
|
122
|
+
console.log('[babysitter] Restart GitHub Copilot CLI to pick up the installed plugin and config changes.');
|
|
123
|
+
} catch (err) {
|
|
124
|
+
console.error(`[babysitter] Failed to install plugin: ${err.message}`);
|
|
125
|
+
process.exitCode = 1;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
main();
|
package/bin/uninstall.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const { spawnSync } = require('child_process');
|
|
6
|
+
const {
|
|
7
|
+
deregisterCopilotPlugin,
|
|
8
|
+
getCopilotHome,
|
|
9
|
+
getHomeMarketplacePath,
|
|
10
|
+
getHomePluginRoot,
|
|
11
|
+
removeLegacyHooks,
|
|
12
|
+
removeMarketplaceEntry,
|
|
13
|
+
} = require('./install-shared');
|
|
14
|
+
|
|
15
|
+
const PLUGIN_NAME = 'babysitter';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Attempt to unregister the plugin via `copilot plugin uninstall`.
|
|
19
|
+
* Falls back to manual config.json cleanup if the CLI is not available.
|
|
20
|
+
*/
|
|
21
|
+
function unregisterViaCopilotCli() {
|
|
22
|
+
const result = spawnSync('copilot', ['plugin', 'uninstall', PLUGIN_NAME], {
|
|
23
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
24
|
+
encoding: 'utf8',
|
|
25
|
+
timeout: 30000,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
if (result.status === 0) {
|
|
29
|
+
console.log(`[${PLUGIN_NAME}] Unregistered plugin via 'copilot plugin uninstall'`);
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// CLI not available or failed
|
|
34
|
+
const stderr = (result.stderr || '').trim();
|
|
35
|
+
if (result.error || stderr.includes('not found') || stderr.includes('not recognized')) {
|
|
36
|
+
console.log(`[${PLUGIN_NAME}] Copilot CLI not found, using manual cleanup`);
|
|
37
|
+
} else {
|
|
38
|
+
console.warn(`[${PLUGIN_NAME}] 'copilot plugin uninstall' failed: ${stderr || 'unknown error'}, using manual cleanup`);
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function main() {
|
|
44
|
+
const copilotHome = getCopilotHome();
|
|
45
|
+
const pluginRoot = getHomePluginRoot();
|
|
46
|
+
const marketplacePath = getHomeMarketplacePath();
|
|
47
|
+
let removedPlugin = false;
|
|
48
|
+
|
|
49
|
+
if (fs.existsSync(pluginRoot)) {
|
|
50
|
+
try {
|
|
51
|
+
fs.rmSync(pluginRoot, { recursive: true, force: true });
|
|
52
|
+
console.log(`[${PLUGIN_NAME}] Removed ${pluginRoot}`);
|
|
53
|
+
removedPlugin = true;
|
|
54
|
+
} catch (err) {
|
|
55
|
+
console.warn(`[${PLUGIN_NAME}] Warning: Could not remove plugin directory ${pluginRoot}: ${err.message}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
removeMarketplaceEntry(marketplacePath);
|
|
60
|
+
|
|
61
|
+
// Try native copilot CLI unregistration first; fall back to manual config.json
|
|
62
|
+
if (!unregisterViaCopilotCli()) {
|
|
63
|
+
deregisterCopilotPlugin(pluginRoot);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
removeLegacyHooks(copilotHome);
|
|
67
|
+
|
|
68
|
+
if (!removedPlugin) {
|
|
69
|
+
console.log(`[${PLUGIN_NAME}] Plugin directory not found, config and hooks cleaned if present.`);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
console.log(`[${PLUGIN_NAME}] Restart GitHub Copilot CLI to complete uninstallation.`);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
main();
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Assimilate an external methodology, harness, or specification into babysitter process definitions with skills and agents.
|
|
3
|
+
argument-hint: Target to assimilate (e.g. repo URL, harness name, or spec path)
|
|
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
|
+
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.
|
|
10
|
+
|
|
11
|
+
If the workspace does not already have an active process-library binding, initialize it first through the shared global SDK binding:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
babysitter process-library:active --json
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Run the process after formalizing it.
|
|
18
|
+
|
|
19
|
+
Available assimilation workflows:
|
|
20
|
+
- **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.
|
|
21
|
+
- **harness integration** (`specializations/domains/assimilation/harness/*`) - Integrates babysitter SDK with a specific AI coding harness (generic, codex, opencode, gemini-cli, openclaw, antigravity).
|
|
22
|
+
|
|
23
|
+
During the interview phase, determine which assimilation workflow to use based on the user's target:
|
|
24
|
+
- If the target is a **repo URL or methodology name** then use the methodology-assimilation workflow.
|
|
25
|
+
- If the target is a **harness name** (e.g. codex, opencode, antigravity) then use the matching harness process.
|
|
26
|
+
- If the target is a **specification or other source** then adapt the methodology-assimilation workflow for the spec format.
|
|
27
|
+
- If unclear, ask the user to clarify the assimilation target and type.
|
|
28
|
+
|
|
29
|
+
## After Assimilation: Contribute Back
|
|
30
|
+
|
|
31
|
+
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:
|
|
32
|
+
|
|
33
|
+
- **Completed a methodology assimilation**: `/babysitter:contrib library contribution: assimilated [methodology-name] into babysitter process definitions`
|
|
34
|
+
- **Completed a harness integration**: `/babysitter:contrib library contribution: [harness-name] harness integration`
|
|
35
|
+
- **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]`
|
|
36
|
+
|
|
37
|
+
Even just reporting that an assimilation didn't work well helps improve babysitter for everyone.
|
package/commands/call.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
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).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
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.
|
|
3
|
+
argument-hint: "[--dry-run] [--keep-days N] Optional flags. --dry-run shows what would be removed without deleting. --keep-days N keeps runs newer than N days (default 7)."
|
|
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
|
+
Create and run a cleanup process using the process at `skills\babysit\process\cradle\cleanup-runs.js/processes/cleanup-runs.js`.
|
|
10
|
+
|
|
11
|
+
Implementation notes (for the process):
|
|
12
|
+
- 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
|
|
@@ -0,0 +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
|
+
|
|
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
|
|
33
|
+
* If arguments are empty: use the `contribute.js` router process to show options and route accordingly
|