@a5c-ai/babysitter-codex 0.1.6-staging.4ebefe91 → 0.1.6-staging.551a5f7a

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 (66) hide show
  1. package/.codex-plugin/plugin.json +44 -0
  2. package/README.md +46 -89
  3. package/SKILL.md +329 -44
  4. package/bin/cli.js +104 -0
  5. package/bin/install-shared.js +425 -0
  6. package/bin/install.js +48 -0
  7. package/bin/uninstall.js +40 -37
  8. package/hooks/babysitter-session-start.sh +37 -0
  9. package/hooks/babysitter-stop-hook.sh +37 -0
  10. package/hooks/user-prompt-submit.sh +39 -0
  11. package/{.codex/hooks.json → hooks.json} +3 -3
  12. package/package.json +11 -10
  13. package/scripts/team-install.js +32 -291
  14. package/skills/assimilate/SKILL.md +17 -0
  15. package/skills/babysit/SKILL.md +388 -0
  16. package/skills/call/SKILL.md +16 -0
  17. package/skills/doctor/SKILL.md +16 -0
  18. package/skills/forever/SKILL.md +15 -0
  19. package/skills/help/SKILL.md +15 -0
  20. package/skills/issue/SKILL.md +16 -0
  21. package/skills/model/SKILL.md +15 -0
  22. package/skills/observe/SKILL.md +15 -0
  23. package/skills/plan/SKILL.md +16 -0
  24. package/skills/project-install/SKILL.md +15 -0
  25. package/skills/resume/SKILL.md +15 -0
  26. package/skills/retrospect/SKILL.md +15 -0
  27. package/skills/team-install/SKILL.md +15 -0
  28. package/skills/user-install/SKILL.md +15 -0
  29. package/skills/yolo/SKILL.md +16 -0
  30. package/.codex/config.toml +0 -24
  31. package/.codex/hooks/babysitter-session-start.sh +0 -15
  32. package/.codex/hooks/babysitter-stop-hook.sh +0 -15
  33. package/.codex/hooks/user-prompt-submit.sh +0 -15
  34. package/.codex/skills/babysitter/assimilate/SKILL.md +0 -58
  35. package/.codex/skills/babysitter/call/SKILL.md +0 -588
  36. package/.codex/skills/babysitter/doctor/SKILL.md +0 -89
  37. package/.codex/skills/babysitter/forever/SKILL.md +0 -45
  38. package/.codex/skills/babysitter/help/SKILL.md +0 -48
  39. package/.codex/skills/babysitter/issue/SKILL.md +0 -36
  40. package/.codex/skills/babysitter/model/SKILL.md +0 -31
  41. package/.codex/skills/babysitter/observe/SKILL.md +0 -38
  42. package/.codex/skills/babysitter/plan/SKILL.md +0 -44
  43. package/.codex/skills/babysitter/project-install/SKILL.md +0 -62
  44. package/.codex/skills/babysitter/resume/SKILL.md +0 -30
  45. package/.codex/skills/babysitter/retrospect/SKILL.md +0 -43
  46. package/.codex/skills/babysitter/team-install/SKILL.md +0 -35
  47. package/.codex/skills/babysitter/user-install/SKILL.md +0 -53
  48. package/.codex/skills/babysitter/yolo/SKILL.md +0 -48
  49. package/agents/openai.yaml +0 -4
  50. package/bin/postinstall.js +0 -224
  51. package/commands/README.md +0 -23
  52. package/commands/assimilate.md +0 -26
  53. package/commands/call.md +0 -29
  54. package/commands/doctor.md +0 -27
  55. package/commands/forever.md +0 -26
  56. package/commands/help.md +0 -27
  57. package/commands/issue.md +0 -26
  58. package/commands/model.md +0 -26
  59. package/commands/observe.md +0 -26
  60. package/commands/plan.md +0 -26
  61. package/commands/project-install.md +0 -30
  62. package/commands/resume.md +0 -28
  63. package/commands/retrospect.md +0 -26
  64. package/commands/team-install.md +0 -28
  65. package/commands/user-install.md +0 -26
  66. package/commands/yolo.md +0 -27
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "babysitter-codex",
3
+ "version": "0.1.5",
4
+ "description": "Babysitter orchestration plugin for Codex with skill entrypoints and lifecycle hooks.",
5
+ "author": {
6
+ "name": "a5c.ai",
7
+ "email": "support@a5c.ai",
8
+ "url": "https://github.com/a5c-ai/babysitter"
9
+ },
10
+ "homepage": "https://github.com/a5c-ai/babysitter/tree/main/plugins/babysitter-codex#readme",
11
+ "repository": "https://github.com/a5c-ai/babysitter",
12
+ "license": "MIT",
13
+ "keywords": [
14
+ "babysitter",
15
+ "codex",
16
+ "orchestration",
17
+ "hooks",
18
+ "skills"
19
+ ],
20
+ "skills": "./skills/",
21
+ "hooks": "./hooks.json",
22
+ "interface": {
23
+ "displayName": "Babysitter",
24
+ "shortDescription": "Run Babysitter orchestration flows from Codex",
25
+ "longDescription": "Babysitter adds orchestration entrypoints such as $call, $plan, and $resume, plus Codex lifecycle hooks that keep runs and workspace state in sync.",
26
+ "developerName": "a5c.ai",
27
+ "category": "Coding",
28
+ "capabilities": [
29
+ "Interactive",
30
+ "Read",
31
+ "Write"
32
+ ],
33
+ "websiteURL": "https://github.com/a5c-ai/babysitter",
34
+ "privacyPolicyURL": "https://github.com/a5c-ai/babysitter",
35
+ "termsOfServiceURL": "https://github.com/a5c-ai/babysitter",
36
+ "defaultPrompt": [
37
+ "Use Babysitter to start a new orchestration run",
38
+ "Plan a Babysitter workflow before executing it",
39
+ "Resume the latest Babysitter run in this workspace"
40
+ ],
41
+ "brandColor": "#0F766E",
42
+ "screenshots": []
43
+ }
44
+ }
package/README.md CHANGED
@@ -2,41 +2,16 @@
2
2
 
3
3
  Babysitter integration package for OpenAI Codex CLI.
4
4
 
5
- This package is a Codex skill bundle plus installer assets. It is not a native
6
- Codex plugin manifest and it does not run an external orchestrator. The Codex
7
- plugin path is:
5
+ This package now ships as a real Codex plugin bundle:
8
6
 
9
- - installed skill bundle under `~/.codex/skills/babysitter-codex`
10
- - workspace `.codex/hooks.json`
11
- - workspace `.codex/config.toml`
12
- - workspace `.a5c/` state
13
- - Babysitter SDK CLI for run creation, iteration, result posting, and
14
- process-library binding
7
+ - `.codex-plugin/plugin.json`
8
+ - `skills/`
9
+ - `hooks.json`
10
+ - `hooks/`
15
11
 
16
- ## What This Package Installs
17
-
18
- Global install copies the Codex-facing bundle into `CODEX_HOME`:
19
-
20
- - `SKILL.md`
21
- - `.codex/`
22
- - `agents/`
23
- - `commands/`
24
- - `bin/`
25
- - `scripts/`
26
- - `babysitter.lock.json`
27
-
28
- It does not bundle the process library.
29
-
30
- ## Integration Model
31
-
32
- Babysitter for Codex uses only the hooks model:
33
-
34
- - `SessionStart` seeds Babysitter session state
35
- - `UserPromptSubmit` handles prompt-time transformations
36
- - `Stop` yields continuation back into the Babysitter orchestration loop
37
-
38
- The process library is fetched at workspace-install time through the SDK CLI and
39
- bound for active use in `.a5c/active/process-library.json`.
12
+ It still uses the Babysitter SDK CLI and the shared `~/.a5c` process-library
13
+ state, but it no longer installs itself by copying fake skill and hook payloads
14
+ into `~/.codex/skills` and `~/.codex/hooks.json`.
40
15
 
41
16
  ## Installation
42
17
 
@@ -46,92 +21,74 @@ Install the SDK CLI first:
46
21
  npm install -g @a5c-ai/babysitter-sdk
47
22
  ```
48
23
 
49
- Install the Codex package:
24
+ Install the Codex plugin globally:
50
25
 
51
26
  ```bash
52
- npm install -g @a5c-ai/babysitter-codex
27
+ npx @a5c-ai/babysitter-codex install
53
28
  ```
54
29
 
55
- Then install the Codex plugin payload into the target workspace:
30
+ This copies the plugin into `~/.codex/plugins/babysitter-codex`, registers it
31
+ in `~/.agents/plugins/marketplace.json`, merges the required global Codex
32
+ config into `~/.codex/config.toml`, and ensures the Babysitter process library
33
+ is active in `~/.a5c`.
34
+
35
+ Install the plugin into a specific workspace:
56
36
 
57
37
  ```bash
58
- babysitter harness:install-plugin codex --workspace /path/to/repo
38
+ npx @a5c-ai/babysitter-codex install --workspace /path/to/repo
59
39
  ```
60
40
 
61
- If `npm install -g @a5c-ai/babysitter-codex` is run from inside the target
62
- workspace, `postinstall` will also auto-run the packaged `team-install.js`
63
- against that workspace.
41
+ This copies the plugin into `<workspace>/plugins/babysitter-codex`, registers
42
+ it in `<workspace>/.agents/plugins/marketplace.json`, merges
43
+ `<workspace>/.codex/config.toml`, and records install metadata under
44
+ `<workspace>/.a5c/team/`.
64
45
 
65
- ## What `team-install.js` Does
66
-
67
- `scripts/team-install.js` is the workspace installer used by the package and by
68
- `babysitter harness:install-plugin codex`.
46
+ ## Integration Model
69
47
 
70
- It:
48
+ The plugin provides:
71
49
 
72
- 1. Resolves the installed package root.
73
- 2. Reads `babysitter.lock.json`.
74
- 3. Clones or updates the upstream Babysitter repo into
75
- `<workspace>/.a5c/process-library/babysitter-repo`.
76
- 4. Binds `<workspace>/.a5c/process-library/babysitter-repo/library` with
77
- `babysitter process-library:use`.
78
- 5. Writes `<workspace>/.a5c/active/process-library.json`.
79
- 6. Writes or refreshes `<workspace>/.codex/hooks.json`.
80
- 7. Creates or merges `<workspace>/.codex/config.toml` so the workspace has the
81
- required Codex settings.
82
- 8. Writes `<workspace>/.a5c/team/install.json`.
83
- 9. Creates `<workspace>/.a5c/team/profile.json` if it does not already exist.
50
+ - `skills/babysit/SKILL.md` as the core entrypoint
51
+ - mode wrapper skills such as `$call`, `$plan`, and `$resume`
52
+ - plugin-level lifecycle hooks for `SessionStart`, `UserPromptSubmit`, and
53
+ `Stop`
84
54
 
85
- It does not create an external orchestrator, bundle the process library, or
86
- turn the workspace into a fake Codex plugin manifest.
55
+ The process library is fetched and bound through the SDK CLI in
56
+ `~/.a5c/active/process-library.json`.
87
57
 
88
- ## Resulting Workspace Files
58
+ ## Workspace Output
89
59
 
90
- After a successful workspace install, the important files are:
60
+ After `install --workspace`, the important files are:
91
61
 
92
- - `.codex/hooks.json`
62
+ - `plugins/babysitter-codex/.codex-plugin/plugin.json`
63
+ - `plugins/babysitter-codex/skills/babysit/SKILL.md`
64
+ - `plugins/babysitter-codex/hooks.json`
65
+ - `.agents/plugins/marketplace.json`
93
66
  - `.codex/config.toml`
94
67
  - `.a5c/team/install.json`
95
68
  - `.a5c/team/profile.json`
96
- - `.a5c/active/process-library.json`
97
- - `.a5c/process-library/babysitter-repo/library`
98
-
99
- ## Using It In Codex
100
-
101
- Use normal Codex chat phrases:
102
-
103
- ```text
104
- babysitter call implement authentication with tests
105
- babysitter resume
106
- babysitter doctor
107
- babysitter team-install
108
- babysitter project-install
109
- ```
110
-
111
- The Codex skill and hooks own the plugin flow. Low-level SDK commands are still
112
- the runtime mechanism, but they are not the user-facing interface.
113
69
 
114
70
  ## Verification
115
71
 
116
- Verify the installed skill bundle:
72
+ Verify the installed plugin bundle:
117
73
 
118
74
  ```bash
119
75
  npm ls -g @a5c-ai/babysitter-codex --depth=0
120
- ls -1 ~/.codex/skills/babysitter-codex
121
- test -f ~/.codex/skills/babysitter-codex/scripts/team-install.js
122
- test -f ~/.codex/skills/babysitter-codex/.codex/hooks/babysitter-stop-hook.sh
76
+ test -f ~/.codex/plugins/babysitter-codex/.codex-plugin/plugin.json
77
+ test -f ~/.codex/plugins/babysitter-codex/hooks.json
78
+ test -f ~/.codex/plugins/babysitter-codex/hooks/babysitter-stop-hook.sh
79
+ test -f ~/.codex/plugins/babysitter-codex/skills/babysit/SKILL.md
80
+ test -f ~/.agents/plugins/marketplace.json
123
81
  ```
124
82
 
125
- Verify the active process-library binding for a workspace:
83
+ Verify the active shared process-library binding:
126
84
 
127
85
  ```bash
128
- babysitter process-library:active --state-dir /path/to/repo/.a5c --json
86
+ babysitter process-library:active --json
129
87
  ```
130
88
 
131
- ## Docs
132
-
133
- - [commands/README.md](./commands/README.md)
134
- - Internal orchestration details: [.codex/skills/babysitter/call/SKILL.md](./.codex/skills/babysitter/call/SKILL.md)
89
+ On native Windows, Codex currently does not execute hooks. The plugin still
90
+ installs correctly, but the lifecycle hooks will not fire until Codex enables
91
+ Windows hook execution.
135
92
 
136
93
  ## License
137
94
 
package/SKILL.md CHANGED
@@ -1,21 +1,24 @@
1
1
  ---
2
- name: babysitter-codex
2
+ name: babysit
3
3
  description: >-
4
- Run babysitter workflows from Codex using the installed skill bundle,
5
- workspace Codex hooks, workspace Codex config, and the Babysitter SDK runtime
6
- loop.
7
- Use when the user wants to babysit a task, resume a run, diagnose run health,
8
- install the Codex skill, or assimilate a methodology for Codex.
4
+ Run babysitter workflows from Codex using the installed babysit skill bundle,
5
+ Codex mode-wrapper skills, Codex hooks/config, and the Babysitter SDK runtime
6
+ loop. Use when the user wants to babysit a task, start or resume a run,
7
+ diagnose run health, install Codex integration, or assimilate a methodology.
9
8
  ---
10
9
 
11
- # Babysitter for Codex CLI
10
+ # babysit
12
11
 
13
12
  Babysitter on Codex is implemented as:
14
13
 
15
- - the installed skill bundle under `~/.codex/skills/babysitter-codex`
16
- - workspace `.codex/hooks.json`
17
- - workspace `.codex/config.toml`
14
+ - the installed plugin under `~/.codex/plugins/babysitter-codex` or `<workspace>/plugins/babysitter-codex`
15
+ - the plugin skill tree under `skills/babysit` and `skills/<mode>`
16
+ - the plugin hook registry at `hooks.json`
17
+ - the plugin hook scripts under `hooks/`
18
+ - global `~/.codex/config.toml`
19
+ - optional workspace `.codex/config.toml`
18
20
  - workspace `.a5c/`
21
+ - shared global `.a5c/` process-library state
19
22
  - the Babysitter SDK CLI for `run:create`, `run:iterate`, `run:status`,
20
23
  `task:list`, `task:post`, and process-library binding
21
24
 
@@ -25,79 +28,361 @@ machinery for the Codex integration.
25
28
 
26
29
  ## Choosing a Mode
27
30
 
28
- Read the matching sub-skill from `.codex/skills/babysitter/<mode>/SKILL.md`.
29
- If the user intent is unclear, default to `call/SKILL.md`.
31
+ Use this skill whenever it is invoked directly, and whenever one of the
32
+ installed mode-wrapper skills such as `$call`, `$plan`, `$resume`, or `$yolo`
33
+ loads it.
34
+
35
+ Choose the mode from either:
36
+
37
+ 1. the direct user intent when the skill is invoked as `$babysit`
38
+ 2. the installed wrapper skill name when the user invoked `$call`, `$plan`,
39
+ `$resume`, `$yolo`, and the rest
30
40
 
31
41
  | User intent | Mode |
32
42
  |-------------|------|
33
43
  | Start an orchestration run | `call` |
44
+ | Work an issue-centric flow | `issue` |
34
45
  | Run autonomously | `yolo` |
46
+ | Run continuously / recurring workflow | `forever` |
35
47
  | Resume an existing run | `resume` |
36
48
  | Plan without executing | `plan` |
49
+ | Observe or inspect a run | `observe` |
50
+ | Summarize a completed run | `retrospect` |
37
51
  | Diagnose run health | `doctor` |
52
+ | Change or inspect model routing | `model` |
38
53
  | Help and documentation | `help` |
39
54
  | Install into a project | `project-install` |
40
55
  | Install user profile/setup | `user-install` |
41
56
  | Install team-pinned setup | `team-install` |
42
57
  | Assimilate external methodology | `assimilate` |
43
58
 
44
- ## Runtime Contract
59
+ Deprecated prompt aliases are not the Codex command surface anymore. Do not
60
+ depend on `.codex/prompts` for normal operation.
61
+
62
+ ## Dependencies
63
+
64
+ ### Babysitter SDK and CLI
65
+
66
+ Use the installed CLI alias:
67
+
68
+ ```bash
69
+ CLI="babysitter"
70
+ ```
71
+
72
+ If it is not available on the path, use:
73
+
74
+ ```bash
75
+ CLI="npx -y @a5c-ai/babysitter-sdk"
76
+ ```
77
+
78
+ ### jq
79
+
80
+ Make sure `jq` is available in the path. Install it if missing.
81
+
82
+ ## Core Iteration Workflow
83
+
84
+ The Babysitter workflow has 8 steps:
85
+
86
+ 1. **Create or find the process** - interview the user or parse the prompt,
87
+ research the repo and process library, and build a process definition
88
+ 2. **Create run and bind session** - create the run via the Babysitter CLI and
89
+ bind it to the current Codex session honestly
90
+ 3. **Run iteration** - execute one orchestration step
91
+ 4. **Get effects** - inspect pending effects
92
+ 5. **Perform effects** - execute the requested tasks through skills, agents, or
93
+ shell work
94
+ 6. **Post results** - commit results back through `task:post`
95
+ 7. **Stop and yield** - the Codex stop hook decides whether to continue
96
+ 8. **Completion proof** - finish only when the emitted proof is returned
97
+
98
+ ### 1. Create or find the process for the run
99
+
100
+ #### Interview phase
101
+
102
+ ##### Interactive mode (default)
103
+
104
+ Interview the user for intent, requirements, goals, scope, and constraints
105
+ before entering the hook-driven loop.
106
+
107
+ This phase should be iterative and adaptive:
108
+
109
+ - inspect the current repo state first
110
+ - resolve the active process-library root with
111
+ `babysitter process-library:active --json`
112
+ - conduct an actual search against that active process library before writing a
113
+ process
114
+ - research the repo, online references, methodologies, specializations, skills,
115
+ agents, and related processes as needed
116
+ - ask the user follow-up questions when the intent or constraints are still not
117
+ clear
118
+
119
+ Do not plan more than one step ahead during the interview phase. After each
120
+ step, decide the next best step from the current evidence.
121
+
122
+ The `process-library:active` command bootstraps the shared global SDK process
123
+ library automatically if no binding exists yet. Read:
124
+
125
+ - `binding.dir` as the active process-library root that must be searched
126
+ - `defaultSpec.cloneDir` as the cloned repo root when adjacent repo-level
127
+ material is needed
128
+
129
+ After that, treat `specializations/**/**/**`, `methodologies/`, `contrib/`, and
130
+ `reference/` as paths relative to `binding.dir`.
131
+
132
+ ##### Non-interactive mode
133
+
134
+ When running non-interactively:
135
+
136
+ 1. parse the initial prompt to extract intent, scope, and constraints
137
+ 2. inspect the repo structure
138
+ 3. resolve the active process-library root with
139
+ `babysitter process-library:active --json`
140
+ 4. search that active library for the most relevant specialization,
141
+ methodology, process, skill, or agent
142
+ 5. proceed directly to process creation
143
+
144
+ Do not skip the active-library search step.
145
+
146
+ #### User Profile Integration
147
+
148
+ Before building the process, check for an existing user profile:
149
+
150
+ 1. run `babysitter profile:read --user --json`
151
+ 2. use the profile to pre-fill user preferences, expertise, and communication
152
+ style
153
+ 3. calibrate breakpoint density from `breakpointTolerance`
154
+ 4. prefer tools, skills, and agents the user already uses
155
+ 5. adapt explanations and breakpoint text to the user's communication style
156
+ 6. if no profile exists, proceed normally and consider suggesting `$user-install`
157
+
158
+ All profile read/write/merge/render operations must go through the Babysitter
159
+ CLI, never direct SDK imports.
160
+
161
+ #### Process creation phase
162
+
163
+ After the interview phase, create the full custom process files for the run
164
+ according to the process-library patterns and the process-creation guidelines
165
+ below.
166
+
167
+ Install `@a5c-ai/babysitter-sdk` into `.a5c/` if it is missing. When doing so,
168
+ run the install from the project root and use either `npm i --prefix .a5c ...`
169
+ or a subshell so the working directory does not stay inside `.a5c/`.
170
+
171
+ Always use an **absolute path** for `--entry` when calling `run:create`.
172
+
173
+ After the process is created and before creating the run:
174
+
175
+ - in interactive mode, describe the process at a high level, generate
176
+ `[process-name].diagram.md` and `[process-name].process.md`, and get user
177
+ confirmation before proceeding
178
+ - in non-interactive mode, proceed directly to `run:create`
179
+
180
+ Common mistakes to avoid:
181
+
182
+ - wrong: skipping repo/process-library research before writing the process
183
+ - wrong: bypassing the orchestration model with helper scripts or inline logic
184
+ - wrong: using `kind: 'node'` in generated tasks
185
+ - correct: use `agent` or `skill` tasks for reasoning work, with `shell` only
186
+ for existing CLIs, tests, linters, git, or builds
187
+ - correct: include verification loops, refinement loops, quality gates, and
188
+ breakpoints where appropriate
45
189
 
46
- Use the Babysitter SDK CLI for orchestration:
190
+ ### 2. Create run and bind session
191
+
192
+ For new runs:
193
+
194
+ ```bash
195
+ $CLI run:create \
196
+ --process-id <id> \
197
+ --entry <absolute-path>#<export> \
198
+ --inputs <file> \
199
+ --prompt "$PROMPT" \
200
+ --harness codex \
201
+ --state-dir .a5c \
202
+ --plugin-root "${CODEX_PLUGIN_ROOT}" \
203
+ --json
204
+ ```
205
+
206
+ Required flags:
207
+
208
+ - `--process-id <id>` - unique identifier for the process definition
209
+ - `--entry <absolute-path>#<export>` - process JS file plus named export
210
+ - `--prompt "$PROMPT"` - the user's initial request
211
+ - `--harness codex` - activates Codex session binding
212
+ - `--state-dir .a5c` - required for honest workspace-local Codex session state
213
+ - `--plugin-root "${CODEX_PLUGIN_ROOT}"` - plugin root used for session/state
214
+ resolution
215
+
216
+ Optional flags:
217
+
218
+ - `--inputs <file>` - process input JSON
219
+ - `--run-id <id>` - override the generated run id
220
+ - `--runs-dir <dir>` - override the default runs directory
221
+
222
+ Inside a real Codex hook/session environment, do **not** pass `--session-id`
223
+ explicitly. The Codex adapter auto-resolves the session/thread id from
224
+ `CODEX_THREAD_ID`, `CODEX_SESSION_ID`, or `CODEX_ENV_FILE`. Only pass
225
+ `--session-id` in out-of-band recovery flows where no ambient Codex session
226
+ identity exists.
227
+
228
+ In normal Codex usage, `run:create` must bind the session into the active
229
+ workspace `.a5c`, not the global `~/.a5c`, so the Stop hook can find the same
230
+ session state file in later turns.
231
+
232
+ For resuming existing runs in a manual recovery flow:
47
233
 
48
234
  ```bash
49
- babysitter run:create --process-id <id> --entry <path>#<export> ...
50
- babysitter run:iterate <runDir> --json --iteration <n>
51
- babysitter run:status <runDir> --json
52
- babysitter task:list <runDir> --pending --json
53
- babysitter task:post <runDir> <effectId> --status ok --value <file> --json
235
+ $CLI session:resume \
236
+ --session-id <id> \
237
+ --state-dir .a5c \
238
+ --run-id <runId> \
239
+ --runs-dir .a5c/runs \
240
+ --json
54
241
  ```
55
242
 
56
- When a Codex session ID is available, bind it honestly:
243
+ ### 3. Run iteration
57
244
 
58
245
  ```bash
59
- babysitter run:create ... --harness codex --session-id <id> --state-dir .a5c --json
246
+ $CLI run:iterate .a5c/runs/<runId> --json --iteration <n> --plugin-root "${CODEX_PLUGIN_ROOT}"
60
247
  ```
61
248
 
62
- ## Result Posting Protocol
249
+ Status values:
250
+
251
+ - `"executed"` - tasks executed, continue looping
252
+ - `"waiting"` - breakpoint or sleep is pending
253
+ - `"completed"` - run finished successfully
254
+ - `"failed"` - run failed
255
+ - `"none"` - no runnable effects exist
256
+
257
+ ### 4. Get effects
258
+
259
+ ```bash
260
+ $CLI task:list .a5c/runs/<runId> --pending --json
261
+ ```
262
+
263
+ ### 5. Perform effects
264
+
265
+ Run the effect externally to the SDK, then post the outcome summary with
266
+ `task:post`.
267
+
268
+ Important:
269
+
270
+ - delegate using Codex skills or agent tooling when possible
271
+ - make sure the requested change actually happened
272
+ - do not describe or imply success without verifying the requested effect
273
+ - do not use the `babysit` skill itself inside delegated task execution
274
+
275
+ #### 5.1 Breakpoint handling
276
+
277
+ ##### Interactive mode
63
278
 
64
- 1. Write the result value to `tasks/<effectId>/output.json`
65
- 2. Post it with `babysitter task:post`
66
- 3. Never write `result.json` directly
279
+ Ask the user explicitly for approval. If the Codex environment provides a
280
+ structured question UI, include explicit approve/reject options. If not, ask in
281
+ chat and require an explicit approval response.
282
+
283
+ Never infer approval from silence, ambiguity, or dismissal.
284
+
285
+ Breakpoint rejections must still be posted with `--status ok` and a value such
286
+ as `{"approved": false, "response": "..."}`.
287
+
288
+ ##### Non-interactive mode
289
+
290
+ Choose the best option from context and post the result. Rejections still use
291
+ `--status ok` with `{"approved": false}`.
292
+
293
+ ### 6. Results posting
294
+
295
+ Never write `result.json` directly.
296
+
297
+ Workflow:
298
+
299
+ 1. write the result value to `tasks/<effectId>/output.json`
300
+ 2. call `task:post` with `--value tasks/<effectId>/output.json`
301
+ 3. let the SDK write `result.json`, append the journal event, and update state
302
+
303
+ ### 7. Stop after every phase after run-session association
304
+
305
+ After `run:create` or any posted effect result, end the current assistant turn
306
+ and yield back to the Codex hook loop. Do not run multiple `run:iterate` steps
307
+ in the same turn.
308
+
309
+ ### 8. Completion proof
310
+
311
+ When `run:iterate` or `run:status` returns `completionProof`, return that exact
312
+ value wrapped in `<promise>...</promise>`.
67
313
 
68
314
  ## Hook Loop
69
315
 
70
- Workspace onboarding must install `.codex/hooks.json` and `.codex/config.toml`
71
- so:
316
+ Global install must register the plugin in `~/.agents/plugins/marketplace.json`
317
+ with the plugin bundle at `~/.codex/plugins/babysitter-codex`, and must merge
318
+ `~/.codex/config.toml`.
319
+
320
+ Workspace onboarding may also register the plugin in
321
+ `<workspace>/.agents/plugins/marketplace.json` with the plugin bundle at
322
+ `<workspace>/plugins/babysitter-codex`, and may merge `.codex/config.toml` for
323
+ repo-local pinning.
324
+
325
+ Both levels must provide:
72
326
 
73
327
  1. `SessionStart` seeds `.a5c` session state
74
328
  2. `UserPromptSubmit` performs prompt-time transformations when needed
75
329
  3. `Stop` decides whether the run is complete or Codex should receive the next
76
330
  Babysitter iteration context
77
331
 
78
- ## Process Library Model
332
+ ## Task Kinds
79
333
 
80
- The Codex package does not bundle the process library.
334
+ Never generate `kind: 'node'` effects.
81
335
 
82
- Workspace onboarding must:
336
+ | Kind | When to use |
337
+ |------|-------------|
338
+ | `agent` | default for planning, implementation, analysis, debugging, scoring, research |
339
+ | `skill` | when a matching installed skill exists |
340
+ | `shell` | existing CLI tools, tests, git, linters, builds |
341
+ | `breakpoint` | human approval gates |
342
+ | `sleep` | time gates |
83
343
 
84
- 1. clone or update the upstream Babysitter repo into
85
- `.a5c/process-library/babysitter-repo`
86
- 2. bind `.a5c/process-library/babysitter-repo/library` with
87
- `babysitter process-library:use`
88
- 3. resolve the active binding later with
89
- `babysitter process-library:active --state-dir .a5c --json`
344
+ ## Process Creation Guidelines
90
345
 
91
- Preferred discovery order:
346
+ - always research the repo and the active process library before writing the
347
+ process
348
+ - prefer composing multiple relevant library processes rather than copying just
349
+ one template blindly
350
+ - include verification and refinement loops
351
+ - prefer processes that close the widest practical quality loop
352
+ - add `@skill` and `@agent` discovery markers to generated process files for
353
+ the dependencies you actually selected
354
+ - prefer incremental work that can be tested as you go
92
355
 
93
- 1. project-local `.a5c/processes`
94
- 2. the active SDK-managed process-library binding
356
+ Search for relevant processes, skills, agents, methodologies, and references
357
+ in:
358
+
359
+ 1. `.a5c/processes/`
360
+ 2. the active process-library root from `binding.dir`
361
+ 3. the cloned repo root from `defaultSpec.cloneDir` when adjacent material is
362
+ needed
95
363
 
96
364
  ## Codex-Specific Rules
97
365
 
98
- - Prefer natural-language activation such as `babysitter call ...`
99
- - Legacy `/babysitter:*` aliases may exist only as optional user-installed
100
- prompt sugar; they are not a native Codex plugin feature
101
- - Never fabricate a session ID when none is available from Codex or the caller
102
- - Use `notify` only for monitoring and telemetry, never as the orchestration
366
+ - `$babysit` is the core skill
367
+ - `$call`, `$plan`, `$resume`, `$yolo`, and the other mode skills are thin
368
+ wrappers that must only load `babysit` for the matching mode
369
+ - do not revive prompt aliases as a parallel integration surface
370
+ - do not fabricate a session id
371
+ - use `notify` only for telemetry or monitoring, never as the orchestration
103
372
  control loop
373
+
374
+ ## Critical Rules
375
+
376
+ CRITICAL RULE: The completion proof is emitted only when the run is truly
377
+ completed. Output `<promise>SECRET</promise>` only when the orchestration status
378
+ is completed.
379
+
380
+ CRITICAL RULE: Never bypass the Babysitter orchestration model when this skill
381
+ is active. Do not replace it with ad-hoc direct execution.
382
+
383
+ CRITICAL RULE: Never build helper scripts or wrapper programs to drive the run.
384
+ Use the CLI and the hook loop directly.
385
+
386
+ CRITICAL RULE: In interactive mode, never auto-approve breakpoints.
387
+
388
+ CRITICAL RULE: Do not use `kind: 'node'` in generated process files.