@a5c-ai/babysitter-gemini 4.0.153

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.
@@ -0,0 +1,426 @@
1
+ ---
2
+ description: Diagnose babysitter run health - journal integrity, state cache, effects, locks, sessions, logs, and disk usage
3
+ argument-hint: "[run-id] Optional run ID to diagnose. If omitted, uses the most recent 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
+ You are a diagnostic agent for the babysitter runtime. Your job is to perform a comprehensive health check across 10 areas and produce a structured diagnostic report. Follow each section methodically. Track results as you go and produce the final summary at the end.
8
+
9
+ Initialize a results tracker with these 10 checks, all starting as PENDING:
10
+ 1. Run Discovery
11
+ 2. Journal Integrity
12
+ 3. State Cache Consistency
13
+ 4. Effect Status
14
+ 5. Lock Status
15
+ 6. Session State
16
+ 7. Log Analysis
17
+ 8. Disk Usage
18
+ 9. Process Validation
19
+ 10. Hook Execution Health
20
+
21
+ ---
22
+
23
+ ## 1. Run Discovery
24
+
25
+ **Goal:** Identify the target run and display its metadata.
26
+
27
+ - List all runs by running: `ls -lt .a5c/runs/`
28
+ - If the user provided a run ID argument, use that as the run ID. Otherwise, use the most recent run directory (the first entry from the listing).
29
+ - Store the resolved run ID and construct the run directory path: `.a5c/runs/<runId>`
30
+ - Verify the run directory exists. If it does not exist, report FAIL for this check and stop the entire diagnostic (no run to diagnose).
31
+ - Show run metadata by running: `npx babysitter run:status .a5c/runs/<runId> --json`
32
+ - Parse and display: runId, processId, entrypoint/importPath, createdAt, current state.
33
+ - Mark this check as PASS.
34
+
35
+ ---
36
+
37
+ ## 2. Journal Integrity
38
+
39
+ **Goal:** Verify the append-only event journal is well-formed and uncorrupted.
40
+
41
+ - List all journal events by running: `npx babysitter run:events .a5c/runs/<runId> --json`
42
+ - List all files in `.a5c/runs/<runId>/journal/` sorted by name.
43
+ - If the journal directory is empty or missing, mark as FAIL and note "No journal entries found."
44
+
45
+ For each journal file (named `<seq>.<ulid>.json`):
46
+
47
+ **Sequential numbering check:**
48
+ - Extract the sequence number prefix from each filename (e.g., `000001` from `000001.01JAXYZ.json`).
49
+ - Verify sequence numbers are contiguous starting from 000001 with no gaps.
50
+ - If gaps found, mark as WARN and list the missing sequence numbers.
51
+
52
+ **Checksum verification:**
53
+
54
+ The SDK computes checksums as follows: it first builds the event payload **without** the `checksum` field (`{ type, recordedAt, data }`), serializes it with `JSON.stringify(payload, null, 2) + "\n"` (pretty-printed with a trailing newline), then computes SHA256 of that string. To verify:
55
+
56
+ - Read each journal file as JSON.
57
+ - Extract and remove the `checksum` field from the parsed object.
58
+ - Re-serialize the remaining object with `JSON.stringify(remaining, null, 2) + "\n"` — **must** use 2-space indentation and a trailing newline to match the SDK.
59
+ - Compute SHA256 (hex) of that exact string.
60
+ - Compare computed checksum with the stored checksum.
61
+ - If any mismatch, mark as FAIL and list the corrupt files.
62
+
63
+ Example bash one-liner for a single file:
64
+ ```bash
65
+ node -e "const fs=require('fs'); const f=process.argv[1]; const obj=JSON.parse(fs.readFileSync(f,'utf8')); const stored=obj.checksum; delete obj.checksum; const expected=require('crypto').createHash('sha256').update(JSON.stringify(obj,null,2)+'\n').digest('hex'); console.log(stored===expected?'OK':'MISMATCH',f)" <file>
66
+ ```
67
+
68
+ **Timestamp monotonicity check:**
69
+ - Extract `recordedAt` from each event.
70
+ - Verify each timestamp is >= the previous one.
71
+ - If any timestamp goes backward, mark as WARN and list the offending entries.
72
+
73
+ **Event type summary:**
74
+ - Count events by type: RUN_CREATED, EFFECT_REQUESTED, EFFECT_RESOLVED, STOP_HOOK_INVOKED, RUN_COMPLETED, RUN_FAILED, and any other types encountered.
75
+ - Display the counts in a table.
76
+
77
+ **Orphan detection:**
78
+ - Flag any files in the journal directory that do not match the expected `<seq>.<ulid>.json` naming pattern.
79
+
80
+ If all sub-checks pass, mark as PASS. If any sub-check is WARN, mark as WARN. If any sub-check is FAIL, mark as FAIL.
81
+
82
+ ---
83
+
84
+ ## 3. State Cache Consistency
85
+
86
+ **Goal:** Verify the derived state cache matches the current journal.
87
+
88
+ - Check if `.a5c/runs/<runId>/state/state.json` exists.
89
+ - If it does not exist, mark as WARN and recommend: `npx babysitter run:rebuild-state .a5c/runs/<runId>`
90
+
91
+ If it exists:
92
+ - Read `state.json` and extract the `journalHead` field (contains `seq`, `ulid`, and `checksum`).
93
+ - Determine the actual last journal entry by reading the last file in `.a5c/runs/<runId>/journal/` (highest sequence number).
94
+ - Extract the sequence number and ULID from the last journal filename, and the checksum from its content.
95
+ - Compare:
96
+ - `journalHead.seq` should match the last journal file's sequence number.
97
+ - `journalHead.ulid` should match the last journal file's ULID.
98
+ - `journalHead.checksum` should match the last journal file's checksum.
99
+ - If all match, mark as PASS.
100
+ - If any mismatch, mark as WARN and recommend: `npx babysitter run:rebuild-state .a5c/runs/<runId>`
101
+ - Also verify `schemaVersion` field is present and report its value.
102
+
103
+ ---
104
+
105
+ ## 4. Effect Status
106
+
107
+ **Goal:** Identify stuck, errored, or pending effects.
108
+
109
+ - Run: `npx babysitter task:list .a5c/runs/<runId> --json`
110
+ - Run: `npx babysitter task:list .a5c/runs/<runId> --pending --json`
111
+ - Parse the JSON output from both commands.
112
+
113
+ **All effects summary:**
114
+ - Count total effects, resolved effects, and pending effects.
115
+ - Group and count effects by `kind` (node, breakpoint, orchestrator_task, sleep, etc.).
116
+
117
+ **Stuck effect detection:**
118
+ - For each pending effect, check its `requestedAt` timestamp.
119
+ - If any pending effect was requested more than 30 minutes ago, flag it as STUCK.
120
+ - List stuck effects with their effectId, kind, taskId, and age.
121
+
122
+ **Error detection:**
123
+ - Identify any effects with error status in their results.
124
+ - List errored effects with their effectId and error message.
125
+
126
+ **Pending summary:**
127
+ - Summarize pending effects grouped by kind with count per kind.
128
+
129
+ Mark as PASS if no stuck or errored effects. Mark as WARN if there are pending effects older than 30 minutes. Mark as FAIL if there are errored effects.
130
+
131
+ ---
132
+
133
+ ## 5. Lock Status
134
+
135
+ **Goal:** Detect stale or orphaned run locks.
136
+
137
+ - Check if `.a5c/runs/<runId>/run.lock` exists.
138
+ - If it does not exist, mark as PASS ("No lock held -- run is not actively being iterated").
139
+
140
+ If it exists:
141
+ - Read the lock file (JSON with `pid`, `owner`, `acquiredAt`).
142
+ - Display the lock info: PID, owner, acquired time, and age of the lock.
143
+ - Check if the PID is still alive by running: `kill -0 <pid> 2>/dev/null; echo $?` (exit code 0 means alive, non-zero means dead). On Windows/MINGW, use `tasklist //FI "PID eq <pid>" 2>/dev/null` or equivalent.
144
+ - If the process is alive, mark as PASS ("Lock held by active process").
145
+ - If the process is dead, mark as FAIL ("Stale lock detected -- process <pid> is no longer running").
146
+ - Recommend: `rm .a5c/runs/<runId>/run.lock`
147
+
148
+ ---
149
+
150
+ ## 6. Session State
151
+
152
+ **Goal:** Inspect babysitter session files for health and detect runaway loops.
153
+
154
+ - Search for session state files using Glob:
155
+ - `plugins/babysitter/skills/babysit/state/*.md`
156
+ - `.a5c/state/*.md`
157
+ - `.a5c/state/*.json`
158
+ - For each session state file found:
159
+ - Read the file and extract available information: iteration count, associated runId, timestamps, session status.
160
+ - Display: filename, iteration count, runId (if present), last activity time.
161
+
162
+ **Runaway loop detection:**
163
+ - If any session file contains iteration timing data, compute the average time between iterations.
164
+ - If the average iteration time is less than 3 seconds, flag as WARN ("Possible runaway loop detected -- average iteration time is under 3 seconds").
165
+
166
+ **Session classification:**
167
+ - Active: session has recent activity (within last 30 minutes).
168
+ - Stale: session has no activity for more than 30 minutes.
169
+ - Display counts of active vs stale sessions.
170
+
171
+ Mark as PASS if no issues. Mark as WARN if runaway loops or stale sessions detected.
172
+
173
+ ---
174
+
175
+ ## 7. Log Analysis
176
+
177
+ **Goal:** Analyze babysitter log files for errors, warnings, and stop hook decisions.
178
+
179
+ Read the last 50 lines of each of these log files (if they exist):
180
+ - `$CLAUDE_PLUGIN_ROOT/.a5c/logs/hooks.log`
181
+ - `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter-stop-hook.log`
182
+ - `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter-stop-hook-stderr.log`
183
+ - `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter-session-start-hook.log`
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
+
188
+
189
+ For each log file:
190
+ - If the file does not exist, note it as "Not found (OK if hooks have not run yet)."
191
+ - If the file exists, analyze its content.
192
+
193
+ **Stop hook analysis (babysitter-stop-hook.log):**
194
+ - Count lines containing "approve" vs "block" decisions (case-insensitive).
195
+ - Display the approve/block ratio.
196
+ - Show the last 20 stop hook decision entries (lines containing "approve" or "block").
197
+ - Count and display CLI exit codes from lines containing "CLI exit code=".
198
+
199
+ **Stderr analysis (babysitter-stop-hook-stderr.log, babysitter-session-start-hook-stderr.log):**
200
+ - If stderr logs contain content, display the last 20 lines from each.
201
+ - Look for common failure patterns: "command not found", "MODULE_NOT_FOUND", "ENOENT", "EACCES", "permission denied", "npm ERR", "Cannot find module".
202
+ - Flag any stderr content as a potential issue.
203
+
204
+ **Error/Warning detection (all logs):**
205
+ - Count and list lines containing "ERROR" or "WARN" (case-insensitive).
206
+ - Display the last 10 error/warning lines from each log.
207
+
208
+ Mark as PASS if no ERROR lines found and stderr logs are empty. Mark as WARN if WARN lines found or stderr has content but no ERROR. Mark as FAIL if ERROR lines found.
209
+
210
+ ---
211
+
212
+ ## 8. Disk Usage
213
+
214
+ **Goal:** Report disk consumption and identify oversized files.
215
+
216
+ - Run `du -sh .a5c/runs/<runId>` for the total run directory size.
217
+ - Run `du -sh` on each subdirectory:
218
+ - `.a5c/runs/<runId>/journal/`
219
+ - `.a5c/runs/<runId>/tasks/`
220
+ - `.a5c/runs/<runId>/blobs/`
221
+ - `.a5c/runs/<runId>/state/`
222
+ - `.a5c/runs/<runId>/process/` (if it exists)
223
+
224
+ - Display results in a table: directory, size.
225
+
226
+ **Large file detection:**
227
+ - Find individual files larger than 10MB within the run directory: `find .a5c/runs/<runId> -type f -size +10M -exec ls -lh {} \;`
228
+ - If any found, list them with their paths and sizes.
229
+
230
+ - Report the total run directory size prominently.
231
+
232
+ Mark as PASS if total size < 500MB and no files > 10MB. Mark as WARN if total size > 500MB or any files > 10MB. Mark as FAIL if total size > 2GB.
233
+
234
+ ---
235
+
236
+ ## 9. Process Validation
237
+
238
+ **Goal:** Verify the process entrypoint and SDK dependency are valid.
239
+
240
+ - Read `.a5c/runs/<runId>/run.json` and extract the `importPath` (or `entrypoint`) field.
241
+ - Check if the referenced process file exists on disk. Use Glob or file read to verify.
242
+ - If the file does not exist, mark as FAIL ("Process entrypoint not found on disk").
243
+
244
+ **SDK dependency check:**
245
+ - Read `.a5c/package.json` (if it exists) or the project root `package.json`.
246
+ - Check for `@a5c-ai/babysitter-sdk` in `dependencies` or `devDependencies`.
247
+ - Report the installed version.
248
+ - If the dependency is missing, mark as WARN.
249
+ - If present, verify it looks like a valid semver version and mark as PASS.
250
+
251
+ ---
252
+
253
+ ## 10. Hook Execution Health
254
+
255
+ **Goal:** Verify that the stop hook and session-start hook are properly configured, can execute, and have been running. If the stop hook has NOT been running, diagnose why.
256
+
257
+ ### 10a. Hook Registration
258
+
259
+ - 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.
260
+ - If found, read `hooks.json` and verify:
261
+ - A `Stop` hook entry exists with a command referencing `babysitter-stop-hook.sh`.
262
+ - A `SessionStart` hook entry exists with a command referencing `babysitter-session-start-hook.sh`.
263
+ - If `hooks.json` is not found, mark as FAIL ("Hook registration file not found — hooks are not registered with Claude Code").
264
+
265
+ ### 10b. Hook Script Availability
266
+
267
+ - Locate the hook scripts relative to the plugin root:
268
+ - `hooks/babysitter-stop-hook.sh`
269
+ - `hooks/babysitter-session-start-hook.sh`
270
+ - For each script:
271
+ - Check if the file exists.
272
+ - Check if it is executable (`test -x <path>`).
273
+ - If any script is missing or not executable, mark as FAIL and list which scripts are missing/not-executable.
274
+
275
+ ### 10c. CLI Availability (babysitter command)
276
+
277
+ The hooks delegate to the `babysitter` CLI. Check if it is available:
278
+ - Run: `command -v babysitter 2>/dev/null && babysitter --version 2>/dev/null`
279
+ - If the command is found, display its path and version. Mark sub-check as PASS.
280
+ - If not found, check the user-local prefix: `$HOME/.local/bin/babysitter --version 2>/dev/null`
281
+ - If neither is found, mark sub-check as FAIL ("babysitter CLI not found — hooks will fail with exit code 127. Install with: `npm i -g @a5c-ai/babysitter-sdk`").
282
+
283
+ ### 10d. Stop Hook Execution Evidence
284
+
285
+ Check whether the stop hook has actually been invoked during this run's lifetime:
286
+
287
+ **From log files:**
288
+ - Read `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter-stop-hook.log` (if it exists).
289
+ - Count the number of "Hook script invoked" lines. This is the total invocation count.
290
+ - Count the number of "CLI exit code=" lines and extract exit codes.
291
+ - If the log file does not exist or has zero invocations, the stop hook has NOT been running.
292
+
293
+ **From journal events:**
294
+ - Search the run's journal events for `STOP_HOOK_INVOKED` type events (using the run:events output from section 2 if available).
295
+ - Count the number of STOP_HOOK_INVOKED events.
296
+ - If present, display the last 5 with their timestamps and decision data.
297
+ - If no STOP_HOOK_INVOKED events exist in the journal, note that the stop hook has not recorded any decisions for this run.
298
+
299
+ **From stderr:**
300
+ - Read `$CLAUDE_PLUGIN_ROOT/.a5c/logs/babysitter-stop-hook-stderr.log`.
301
+ - If it contains error output, display it and diagnose:
302
+ - "command not found" or exit code 127 → CLI not installed (see 10c)
303
+ - "MODULE_NOT_FOUND" or "Cannot find module" → SDK package corrupted or not built
304
+ - "ENOENT" → Missing file referenced by the hook
305
+ - "EACCES" or "permission denied" → Permission issue on hook script or CLI
306
+ - "npm ERR" → npm installation failure during hook execution
307
+
308
+ ### 10e. Stop Hook Not Running — Root Cause Diagnosis
309
+
310
+ If the stop hook shows NO evidence of execution (no log entries, no journal events, zero invocations):
311
+
312
+ Perform these diagnostic steps in order and report the first failure found:
313
+
314
+ 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."
315
+
316
+ 2. **Plugin not enabled**: Check for Claude settings files:
317
+ - `~/.claude/settings.json` — look for `babysitter` in `enabledPlugins`.
318
+ - `~/.claude/plugins/installed_plugins.json` — look for `babysitter` in the plugins list.
319
+ - If not found in either, report: "Plugin not enabled in Claude Code settings."
320
+
321
+ 3. **hooks.json not registered**: If `hooks.json` doesn't contain a `Stop` hook entry (checked in 10a), report: "Stop hook not registered in hooks.json."
322
+
323
+ 4. **Hook script missing or not executable**: If the stop hook script doesn't exist or isn't executable (checked in 10b), report with the specific file path.
324
+
325
+ 5. **CLI not available**: If `babysitter` CLI is not found (checked in 10c), report: "babysitter CLI not installed — hook script will fail silently."
326
+
327
+ 6. **Hook running but failing silently**: If the log file exists but shows exit codes other than 0, or if stderr has content, report: "Stop hook is being invoked but failing — see stderr log for details."
328
+
329
+ 7. **No active session**: If no session state files exist (from section 6), report: "No active babysitter session — the stop hook only activates when a session is bound to a run."
330
+
331
+ 8. **All checks pass but hook still not running**: Report: "All prerequisites are met but the stop hook shows no evidence of execution. Possible causes: Claude Code may not be invoking plugin hooks (check Claude Code version), or the session may have ended before the hook could fire."
332
+
333
+ ### 10f. Verdict
334
+
335
+ Mark as PASS if:
336
+ - Hook registration is correct (10a)
337
+ - Hook scripts exist and are executable (10b)
338
+ - CLI is available (10c)
339
+ - There is evidence of stop hook execution (10d) with exit code 0
340
+
341
+ Mark as WARN if:
342
+ - Hooks are registered and scripts exist, but there's no evidence of execution yet
343
+ - Stop hook ran but had non-zero exit codes
344
+
345
+ Mark as FAIL if:
346
+ - Hook registration is missing
347
+ - Hook scripts are missing or not executable
348
+ - CLI is not available
349
+ - Stop hook is failing (consistent non-zero exit codes or stderr errors)
350
+
351
+ ---
352
+
353
+ ## Final Report
354
+
355
+ After completing all 10 checks, produce the diagnostic report in this format:
356
+
357
+ ```
358
+ ============================================
359
+ BABYSITTER DIAGNOSTIC REPORT
360
+ Run: <runId>
361
+ Time: <current timestamp>
362
+ ============================================
363
+
364
+ OVERALL HEALTH: <HEALTHY | WARNING | CRITICAL>
365
+
366
+ --------------------------------------------
367
+ CHECK RESULTS
368
+ --------------------------------------------
369
+
370
+ | # | Check | Status |
371
+ |----|--------------------------|--------|
372
+ | 1 | Run Discovery | <status> |
373
+ | 2 | Journal Integrity | <status> |
374
+ | 3 | State Cache Consistency | <status> |
375
+ | 4 | Effect Status | <status> |
376
+ | 5 | Lock Status | <status> |
377
+ | 6 | Session State | <status> |
378
+ | 7 | Log Analysis | <status> |
379
+ | 8 | Disk Usage | <status> |
380
+ | 9 | Process Validation | <status> |
381
+ | 10 | Hook Execution Health | <status> |
382
+
383
+ --------------------------------------------
384
+ ISSUES & RECOMMENDATIONS
385
+ --------------------------------------------
386
+
387
+ <For each WARN or FAIL check, list:>
388
+ - [WARN|FAIL] <Check name>: <description of issue>
389
+ Fix: <specific actionable command or instruction>
390
+
391
+ --------------------------------------------
392
+ ```
393
+
394
+ **Overall health determination:**
395
+ - **HEALTHY**: All 10 checks are PASS.
396
+ - **WARNING**: At least one check is WARN but none are FAIL.
397
+ - **CRITICAL**: At least one check is FAIL.
398
+
399
+ Present the full detailed findings for each check BEFORE the summary table, so the user can see the evidence. End with the summary table and recommendations. Also, create a single HTML report file with all the findings that uses the arwes UI framework and open it for the user in the browser.
400
+
401
+ ---
402
+
403
+ ## Escalation: Claude /debug
404
+
405
+ If any check results in FAIL and the root cause is unclear after your own analysis -- especially for environment issues, hook execution failures, CLI availability problems, or permission errors that may relate to the Claude Code runtime itself -- invoke the built-in Claude `/debug` command to get additional diagnostic context from the Claude Code environment. This is particularly useful for:
406
+ - Hook scripts that should be running but show no evidence of execution (check 10)
407
+ - Permission or path resolution issues that don't match expected behavior
408
+ - Unexpected CLI behavior that might be a Claude Code environment issue rather than a babysitter issue
409
+
410
+ Call `/debug` with a summary of the failing check and what you've already ruled out, so it can focus on environment-level causes.
411
+
412
+ ---
413
+
414
+ ## After Diagnosis: Contribute Back
415
+
416
+ After diagnosing issues, prompt the user to report or fix what was found -- they don't need to fix the bug themselves, just reporting it is valuable. Suggest `/babysitter:contrib` based on the situation:
417
+
418
+ - **Found a bug but didn't fix it**: `/babysitter:contrib bug report: [what the doctor found, e.g. "state cache rebuild silently drops EFFECT_RESOLVED events when journal has duplicate invocation keys"]`
419
+ - **Found and fixed a bug**: `/babysitter:contrib bugfix: [description of the fix]`
420
+ - **Found confusing or missing docs that made diagnosis harder**: `/babysitter:contrib documentation question: [what was unclear or missing]`
421
+ - **Found an issue in a plugin**: `/babysitter:contrib bug report: [plugin-name] [description]`
422
+ - **Improved a process or skill during diagnosis**: `/babysitter:contrib library contribution: [description]`
423
+
424
+ Example prompt after diagnosis:
425
+
426
+ > "Diagnosis found a stale lock -- process 12847 crashed without cleanup. This is a known edge case in the orchestration loop. Even if you don't want to fix it yourself, reporting it helps: run `/babysitter:contrib bug report: orchestration loop doesn't release lock on unhandled rejection` to open an issue."
@@ -0,0 +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
+
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.
@@ -0,0 +1,244 @@
1
+ ---
2
+ description: help and documentation for babysitter command usage, processes, skills, agents, and methodologies. use this command to understand how to use babysitter effectively.
3
+ argument-hint: Specific command, process, skill, agent, or methodology you want help with (e.g. "help command doctor" or "help process retrospect").
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
+ ## if no arguments provided:
8
+
9
+ show this message:
10
+
11
+ ```
12
+ Welcome to the Babysitter Help Center! Here you can find documentation and guidance on how to use Babysitter effectively.
13
+
14
+ Documentation: Explore our comprehensive documentation to understand Babysitter's features, processes, skills, agents, and methodologies. Read the Docs: https://github.com/a5c-ai/babysitter
15
+
16
+ Or ask specific questions about commands, processes, skills, agents, methodologies, domains, specialities to get targeted help.
17
+
18
+ Just type /babysitter:help followed by your question or the topic you want to learn more about.
19
+
20
+
21
+ PRIMARY COMMANDS
22
+ ================
23
+
24
+ /babysitter:call [input]
25
+ Start a babysitter-orchestrated run. Babysitter analyzes your request, interviews you
26
+ to gather requirements, selects or creates the best process definition (from 50+
27
+ domain-specific processes covering science, business, engineering, and more), then
28
+ executes it step by step with breakpoints where you can steer direction.
29
+
30
+ How it works: The babysitter skill reads your input, explores the process library to
31
+ find matching processes, interviews you to refine scope, creates an SDK run with
32
+ run:create, and orchestrates iterations with run:iterate -- dispatching tasks,
33
+ handling breakpoints, and posting results until the run completes or you pause it.
34
+
35
+ Example: /babysitter:call migrate our Express.js REST API to Fastify, keeping all
36
+ existing routes and middleware behavior identical, with integration tests proving
37
+ parity
38
+
39
+
40
+ /babysitter:resume [run id or name]
41
+ Resume a paused or interrupted babysitter run. If you don't specify a run, babysitter
42
+ discovers all runs under .a5c/runs/, shows their status (created, waiting, completed,
43
+ failed), and suggests which incomplete run to pick up based on its process, pending
44
+ effects, and last activity.
45
+
46
+ How it works: Reads run metadata and journal, rebuilds state cache if stale, identifies
47
+ pending effects (breakpoints awaiting approval, tasks needing results), and continues
48
+ orchestration from exactly where it left off -- no work is repeated thanks to the
49
+ replay engine.
50
+
51
+ Example: /babysitter:resume
52
+ (discovers runs and offers: "Run abc123 is waiting on a breakpoint in the 'review
53
+ test results' phase of your API migration -- resume this one?")
54
+
55
+
56
+ /babysitter:yolo [input]
57
+ Start a babysitter run in fully autonomous mode. Identical to /call but all breakpoints
58
+ are auto-approved and no user interaction is requested. The babysitter makes every
59
+ decision on its own until the run completes or hits a critical failure it can't recover
60
+ from. Best for well-understood tasks where you trust the process.
61
+
62
+ How it works: Same orchestration as /call, but the process context is configured to
63
+ skip breakpoint effects -- instead of pausing for human approval, each breakpoint
64
+ resolves immediately with an auto-approve result.
65
+
66
+ Example: /babysitter:yolo add comprehensive unit tests for all functions in
67
+ src/utils/ using vitest with >90% branch coverage
68
+
69
+
70
+ /babysitter:plan [input]
71
+ Generate a detailed execution plan without running anything. Babysitter goes through
72
+ the full interview and process selection flow, designs the process definition with
73
+ all tasks, breakpoints, and dependencies, but stops before creating the actual SDK run.
74
+ You get a complete plan you can review, modify, or execute later with /call.
75
+
76
+ How it works: Runs the babysitter skill's planning phase only -- analyzes input,
77
+ matches to domain processes, interviews for requirements, then outputs the process
78
+ definition file and a human-readable execution plan showing each phase, task, and
79
+ decision point.
80
+
81
+ Example: /babysitter:plan redesign our database schema to support multi-tenancy,
82
+ migrate existing data, and update all queries -- I want to review the plan before
83
+ we touch anything
84
+
85
+
86
+ /babysitter:forever [input]
87
+ Start a babysitter run that loops indefinitely with sleep intervals. Designed for
88
+ ongoing operational tasks: monitoring, periodic maintenance, continuous improvement,
89
+ or recurring workflows. The process uses an infinite loop with ctx.sleepUntil() to
90
+ pause between iterations.
91
+
92
+ How it works: Creates a process definition with a while(true) loop. Each cycle performs
93
+ the task (e.g., check metrics, process tickets, run audits), then calls ctx.sleepUntil()
94
+ to pause for a configured interval. The run stays in "waiting" state during sleep and
95
+ resumes automatically when the sleep expires on the next orchestration iteration.
96
+
97
+ Example: /babysitter:forever every 4 hours, check our GitHub issues labeled "bug",
98
+ attempt to reproduce and fix any that look straightforward, and submit PRs for the fixes
99
+
100
+
101
+ SECONDARY COMMANDS
102
+ ==================
103
+
104
+ /babysitter:doctor [issue]
105
+ Run a comprehensive 10-point health check on a babysitter run. Inspects journal
106
+ integrity (checksum verification, sequence gaps, timestamp ordering), state cache
107
+ consistency, stuck/errored effects, stale locks, session state, log files, disk usage,
108
+ process validation, and hook execution health. Produces a structured diagnostic report
109
+ with PASS/WARN/FAIL status per check and specific fix commands.
110
+
111
+ If no run ID is provided, automatically targets the most recent run. Can also diagnose
112
+ environment-wide issues like missing CLI, unregistered hooks, or plugin problems.
113
+
114
+ Example: /babysitter:doctor
115
+ (checks the latest run: "CRITICAL -- Check 5 Lock Status: FAIL -- stale lock detected,
116
+ process 12847 is no longer running. Fix: rm .a5c/runs/abc123/run.lock")
117
+
118
+
119
+ /babysitter:assimilate [target]
120
+ Convert an external methodology, AI coding harness, or specification into native
121
+ babysitter process definitions. Takes a GitHub repo URL, harness name, or spec file
122
+ and produces a complete process package with skills/ and agents/ directories.
123
+
124
+ Two workflows available:
125
+ - Methodology assimilation: clones the repo, learns its procedures and commands,
126
+ converts manual flows into babysitter processes with refactored skills and agents
127
+ - Harness integration: wires babysitter's SDK into a specific AI coding tool
128
+ (codex, opencode, gemini-cli, antigravity, etc.) so it can orchestrate runs
129
+
130
+ Example: /babysitter:assimilate https://github.com/some-org/their-deployment-playbook
131
+ (clones the repo, analyzes their deployment procedures, and generates babysitter
132
+ processes that replicate the same workflow with proper task definitions and breakpoints)
133
+
134
+
135
+ /babysitter:user-install
136
+ First-time onboarding for new babysitter users. Installs dependencies, runs an
137
+ interactive interview about your development specialties, preferred tools, coding
138
+ style, and how much autonomy you want babysitter to have. Builds a user profile
139
+ stored at ~/.a5c/user-profile.json that personalizes future runs.
140
+
141
+ Uses the cradle/user-install process which covers: dependency verification, user
142
+ interview (expertise areas, preferred languages, IDE, terminal setup), profile
143
+ generation, tool configuration, and optional global plugin installation.
144
+
145
+ Example: /babysitter:user-install
146
+ (walks you through: "What's your primary programming language? What frameworks do
147
+ you use most? Do you prefer babysitter to auto-approve routine tasks or always ask?")
148
+
149
+
150
+ /babysitter:project-install
151
+ Onboard a new or existing project for babysitter orchestration. Researches the
152
+ codebase (reads package.json, scans directory structure, identifies frameworks and
153
+ patterns), interviews you about project goals and workflows, generates a project
154
+ profile at .a5c/project-profile.json, and optionally sets up CI/CD integration.
155
+
156
+ Uses the cradle/project-install process which covers: codebase analysis, project
157
+ interview, profile creation, recommended plugin installation, hook configuration,
158
+ and optional CI pipeline setup.
159
+
160
+ Example: /babysitter:project-install
161
+ (scans your repo: "I see this is a Next.js 16 app with Tailwind, using vitest for
162
+ tests and PostgreSQL. What are your main development goals for this project?")
163
+
164
+
165
+ /babysitter:retrospect [run id or name]
166
+ Analyze a completed run to extract lessons and improve future runs. Reviews what
167
+ happened (journal events, task results, timing, errors), evaluates the process that
168
+ was followed, and suggests concrete improvements to process definitions, skills,
169
+ and agents. Interactive -- multiple breakpoints let you steer the analysis and
170
+ decide which improvements to implement.
171
+
172
+ Covers: run result analysis, process effectiveness review, improvement suggestions,
173
+ implementation of changes, and routing to /contrib if improvements belong in the
174
+ shared process library.
175
+
176
+ Example: /babysitter:retrospect
177
+ (analyzes the last run: "The API migration run completed but the 'verify parity'
178
+ phase took 8 iterations because test assertions were too brittle. Suggestion: add
179
+ a fuzzy comparison step before strict assertion. Implement this fix?")
180
+
181
+
182
+ /babysitter:plugins [action]
183
+ Manage babysitter plugins: list installed plugins, browse marketplaces, install,
184
+ update, configure, uninstall, or create new plugins. Plugins are version-managed
185
+ instruction packages (not executable code) that guide the agent through install,
186
+ configure, and uninstall steps via markdown files.
187
+
188
+ Without arguments: shows installed plugins (name, version, marketplace, dates) and
189
+ available marketplaces. With arguments: routes to the specific action.
190
+
191
+ Key actions:
192
+ - install <name> --global|--project: fetch install.md from marketplace and execute
193
+ - configure <name> --global|--project: fetch configure.md and walk through options
194
+ - update <name> --global|--project: resolve migration chain via BFS and apply steps
195
+ - uninstall <name> --global|--project: fetch uninstall.md and execute removal
196
+ - create: scaffold a new plugin package with the meta/plugin-creation process
197
+
198
+ Example: /babysitter:plugins install sound-hooks --project
199
+ (fetches sound-hooks from marketplace, reads install.md, walks you through player
200
+ detection, sound selection, hook configuration, and registers in plugin-registry.json)
201
+
202
+
203
+ /babysitter:contrib [feedback]
204
+ Submit feedback or contribute to the babysitter project. Routes to the appropriate
205
+ workflow based on what you want to do:
206
+
207
+ Issue-based (opens GitHub issue in a5c-ai/babysitter):
208
+ - Bug report: describe a bug in the SDK, CLI, or process library
209
+ - Feature request: propose a new feature or enhancement
210
+ - Documentation question: flag undocumented behavior or missing docs
211
+
212
+ PR-based (forks repo, creates branch, submits PR):
213
+ - Bugfix: you already have a fix ready
214
+ - Feature implementation: you've built a new feature
215
+ - Library contribution: new or improved process/skill/agent for the library
216
+ - Harness integration: CI/CD or IDE integration
217
+
218
+ Without arguments: shows all contribution types and helps you pick the right one.
219
+ Breakpoints are placed before all GitHub actions (fork, star, PR, issue) so you
220
+ can review before anything is submitted.
221
+
222
+ Example: /babysitter:contrib bug report: plugin:update-registry fails when the
223
+ marketplace hasn't been cloned yet, even though the registry update doesn't need
224
+ marketplace access
225
+
226
+
227
+ /babysitter:observe
228
+ Launch the babysitter observer dashboard -- a real-time web UI that monitors active
229
+ and past runs. Displays task progress, journal events, orchestration state, and
230
+ effect status in your browser. Useful when running /yolo or /forever to watch
231
+ progress without interrupting the run.
232
+
233
+ How it works: Runs npx @yoavmayer/babysitter-observer-dashboard@latest which watches
234
+ the .a5c/runs/ directory (or a parent directory containing multiple projects) and
235
+ serves a live dashboard. The process is blocking -- it runs until you stop it.
236
+
237
+ Example: /babysitter:observe
238
+ (opens browser showing all runs with live-updating task
239
+ status, journal event stream, and effect resolution timeline)
240
+ ```
241
+
242
+ ## if arguments provided:
243
+
244
+ if the argument is "command [command name]", "process [process name]", "skill [skill name]", "agent [agent name]", or "methodology [methodology name]", then show the detailed documentation for that specific command, process, skill, agent, or methodology after reading the relevant files.