@sockulags/agent-os 0.11.0 → 0.12.1

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 (43) hide show
  1. package/README.md +155 -127
  2. package/cli/index.mjs +1022 -735
  3. package/cli/index.test.mjs +574 -300
  4. package/hooks/hooks.json +17 -0
  5. package/package.json +34 -32
  6. package/policy.md +47 -45
  7. package/skills/batch-work/SKILL.md +43 -43
  8. package/skills/batch-work/agents/openai.yaml +2 -2
  9. package/skills/batch-work/references/manifest.md +100 -100
  10. package/skills/batch-work/scripts/manifest-hash.mjs +263 -263
  11. package/skills/batch-work/scripts/test-manifest-hash.mjs +132 -132
  12. package/skills/chart-work/SKILL.md +37 -37
  13. package/skills/chart-work/references/elicitation.md +25 -25
  14. package/skills/chart-work/references/map.md +84 -84
  15. package/skills/chart-work/references/prototypes.md +21 -21
  16. package/skills/check-work/SKILL.md +61 -0
  17. package/skills/deliver-work/SKILL.md +12 -12
  18. package/skills/deliver-work/workflow.md +119 -113
  19. package/skills/diagnose-before-fix/SKILL.md +24 -24
  20. package/skills/dispatch-next/SKILL.md +28 -28
  21. package/skills/init-agent-os/SKILL.md +54 -39
  22. package/skills/init-agent-os/references/repository-init.md +74 -0
  23. package/skills/init-agent-os/scripts/policy-block.ps1 +87 -87
  24. package/skills/list-skills/SKILL.md +43 -42
  25. package/skills/list-skills/agents/openai.yaml +2 -2
  26. package/skills/plain-voice/SKILL.md +39 -0
  27. package/skills/plain-voice/references/tells.md +82 -0
  28. package/skills/proportional-testing/SKILL.md +30 -30
  29. package/skills/proportional-testing/references/strategy.md +75 -75
  30. package/skills/quality-ratchet/SKILL.md +50 -0
  31. package/skills/quality-ratchet/scripts/quality-delta.mjs +752 -0
  32. package/skills/quality-ratchet/scripts/quality-delta.test.mjs +514 -0
  33. package/skills/scope-guard/SKILL.md +21 -21
  34. package/skills/shape-work/SKILL.md +39 -39
  35. package/skills/shape-work/references/implementation-issues.md +69 -69
  36. package/skills/shape-work/references/mockups.md +23 -23
  37. package/skills/simplifier/SKILL.md +34 -34
  38. package/skills/simplifier/agents/openai.yaml +2 -2
  39. package/skills/simplifier-audit/SKILL.md +28 -28
  40. package/skills/simplifier-audit/agents/openai.yaml +2 -2
  41. package/skills/simplifier-review/SKILL.md +36 -29
  42. package/skills/verify-before-done/SKILL.md +29 -29
  43. package/skills/writing-skills/SKILL.md +68 -68
package/README.md CHANGED
@@ -1,127 +1,155 @@
1
- # agent-os
2
-
3
- A lightweight personal agent operating system — an Agent Skills framework shared between
4
- Claude Code and Codex. One skill source, two platforms, ceremony proportional to the work.
5
-
6
- **Documentation: [sockulags.github.io/agent-os](https://sockulags.github.io/agent-os/)**
7
-
8
- ## Skills
9
-
10
- Reading order: the planning foundation (`shape-work`, then `chart-work`, which hands off into it),
11
- the on-ramp in front of both (`guide-me`), the remaining workflows, then the component skills the
12
- workflows compose (`understand-work`, `explain-work`), the disciplines, and the meta skills.
13
-
14
- | Skill | Bucket | Invocation | Purpose |
15
- |---|---|---|---|
16
- | `shape-work` | workflow | manual | Turn bounded choices into implementation-ready issues |
17
- | `chart-work` | workflow | manual | Chart broad work as a parallel graph of decision tickets |
18
- | `guide-me` | workflow | manual | Guide a vague desire to an approved goal and into planning |
19
- | `deliver-work` | workflow | manual | Implement one change against boundaries and ground truth |
20
- | `batch-work` | workflow | manual | Run isolated ready units and verify the integrated result |
21
- | `dispatch-next` | workflow | manual | Pick or dispatch one action according to the request |
22
- | `init-agent-os` | workflow | manual | Managed policy setup or repository defaults |
23
- | `record-lesson` | workflow | manual | Record a durable lesson in repo or global policy |
24
- | `simplifier` | workflow | manual | Remove unnecessary code and solution layers |
25
- | `simplifier-audit` | workflow | manual | Audit a repository for simplification opportunities |
26
- | `understand-work` | workflow | manual | Question out the need behind a stated wish |
27
- | `explain-work` | workflow | manual | Explain the task in plain language for approval |
28
- | `verify-before-done` | discipline | automatic | Fresh evidence before any completion claim |
29
- | `diagnose-before-fix` | discipline | automatic | Reproduce and root-cause before patching |
30
- | `proportional-testing` | discipline | automatic | Minimum meaningful regression coverage |
31
- | `scope-guard` | discipline | automatic | Keep work inside the task; flag drift |
32
- | `simplifier-review` | discipline | automatic | Review a diff for unnecessary complexity |
33
- | `notice-lesson` | discipline | automatic | Treat interruptions as misunderstanding signals |
34
- | `list-skills` | meta | manual | List installed skills and how to invoke them |
35
- | `writing-skills` | meta | manual | Doctrine and definition of done for agent-os skills |
36
-
37
- Manual skills carry `disable-model-invocation: true` (Claude) and `agents/openai.yaml` with
38
- `policy.allow_implicit_invocation: false` (Codex). Retired skills move to root `deprecated/`
39
- (outside the plugin's `skills/`, so they are never distributed).
40
-
41
- ## Install
42
-
43
- ### Guided npm installer
44
-
45
- The recommended setup is a guided command that asks which host skill directories to configure and
46
- whether to sync the shared global policy:
47
-
48
- ~~~bash
49
- npx @sockulags/agent-os install
50
- ~~~
51
-
52
- It supports Codex, Claude Code, or both without requiring either host CLI. By default it copies the
53
- packaged skills into the selected user-level directories (`~/.codex/skills` and/or
54
- `~/.claude/skills`). For a non-interactive install, make the choices explicit:
55
-
56
- ~~~bash
57
- npx @sockulags/agent-os install --platform both --scope user --yes
58
- ~~~
59
-
60
- To refresh an existing installation:
61
-
62
- ~~~bash
63
- npx @sockulags/agent-os update
64
- npx @sockulags/agent-os update --platform codex --no-policy
65
- ~~~
66
-
67
- Updates replace only skill directories recorded in `.agent-os-install.json` and preserve unrelated
68
- skills. Use `--scope project` to install into the current project's skill directories. The first
69
- command always downloads the current npm CLI; use `npx @sockulags/agent-os@latest update` to force
70
- the newest published installer.
71
-
72
- Direct Claude skills appear as `/<skill>` and direct Codex skills as `$<skill>`.
73
-
74
- Native marketplace installation remains available with `--method plugin`. It requires the selected
75
- host CLI. Claude plugin skills appear as `/agent-os:<skill>`; Codex plugin skills remain
76
- `$<skill>`.
77
-
78
- For development against this clone, Claude can still use `claude --plugin-dir .`, and Codex can
79
- register the local `.agents/plugins/marketplace.json` marketplace.
80
-
81
- ## Release routine
82
-
83
- 1. Run `node scripts/validate-agent-os.mjs`, `npm test`, its red-case suite, and the live evals in `evals/`.
84
- 2. Bump `version` in `.claude-plugin/plugin.json`, `.codex-plugin/plugin.json`, and `package.json`.
85
- 3. Add a dedicated changelog heading, commit and push, merge the green pull request to `main`, and
86
- create the matching tag before publishing. Never publish npm from a dirty worktree.
87
- 4. Pack the npm artifact and verify a clean direct install for both hosts, then publish it.
88
- 5. Create the non-draft GitHub Release, confirm the newest stable release is marked `Latest`, wait
89
- for Validate and Docs/Pages on current `main`, and run `node scripts/verify-release.mjs <version>`.
90
- A release is incomplete until source, npm, GitHub, changelog, and live docs all pass that gate.
91
-
92
- ## Documentation site
93
-
94
- `docs-site/` is a [VitePress](https://vitepress.dev) site published to GitHub Pages by
95
- `.github/workflows/docs.yml` on every push to `main` that touches `docs-site/**`.
96
-
97
- ```bash
98
- npm --prefix docs-site install
99
- npm --prefix docs-site run dev
100
- ```
101
-
102
- The base path in `docs-site/.vitepress/config.mjs` is `/agent-os/` and must match the repository
103
- name. A skill edit and its documentation page are one change — the pages under `skills/` and
104
- `reference/` mirror the skill files and go stale first.
105
-
106
- ## Evals
107
-
108
- - `evals/cases/` — versioned trigger and behavior cases plus `manifest.json`, which indexes at least
109
- 2 positive and 2 negative cases per skill.
110
- - `evals/RESULTS.md` — historical forward-test results. New results evaluate observable contracts,
111
- not approval ceremony or reasoning traces.
112
- - `evals/runs/` — raw logs, gitignored.
113
-
114
- ## Experiments
115
-
116
- Experimental work is kept outside the installable package until evidence supports promotion. The
117
- first recorded Codex experiment replaces a large shared GPT-5.6 prompt with smaller
118
- risk-calibrated core and Auto Review prompts, including exact text, eval evidence, local
119
- installation, and rollback:
120
-
121
- - [Codex custom instructions](https://github.com/sockulags/agent-os/blob/main/experimental/codex/custom_instructions.md)
122
-
123
- ## Global policy
124
-
125
- `policy.md` is the source of truth. The npm installer and `init-agent-os global` install it as a
126
- managed block (`<!-- BEGIN/END AGENT OS -->`) in `~/.claude/CLAUDE.md` and
127
- `~/.codex/AGENTS.md`. Edit `policy.md`, never the installed blocks.
1
+ # agent-os
2
+
3
+ A lightweight personal agent operating system — an Agent Skills framework shared between
4
+ Claude Code and Codex. One skill source, two platforms, ceremony proportional to the work.
5
+
6
+ **Documentation: [sockulags.github.io/agent-os](https://sockulags.github.io/agent-os/)**
7
+
8
+ ## Skills
9
+
10
+ Reading order: the planning foundation (`shape-work`, then `chart-work`, which hands off into it),
11
+ the on-ramp in front of both (`guide-me`), the remaining workflows, then the component skills the
12
+ workflows compose (`understand-work`, `explain-work`), the disciplines, and the meta skills.
13
+
14
+ | Skill | Bucket | Invocation | Purpose |
15
+ |---|---|---|---|
16
+ | `shape-work` | workflow | manual | Turn bounded choices into implementation-ready issues |
17
+ | `chart-work` | workflow | manual | Chart broad work as a parallel graph of decision tickets |
18
+ | `guide-me` | workflow | manual | Guide a vague desire to an approved goal and into planning |
19
+ | `deliver-work` | workflow | manual | Implement one change against boundaries and ground truth |
20
+ | `batch-work` | workflow | manual | Run isolated ready units and verify the integrated result |
21
+ | `dispatch-next` | workflow | manual | Pick or dispatch one action according to the request |
22
+ | `init-agent-os` | workflow | manual | Managed policy setup or repository defaults |
23
+ | `record-lesson` | workflow | manual | Record a durable lesson in repo or global policy |
24
+ | `simplifier` | workflow | manual | Remove unnecessary code and solution layers |
25
+ | `simplifier-audit` | workflow | manual | Audit a repository for simplification opportunities |
26
+ | `check-work` | workflow | automatic | Independently review a candidate and report or fix supported findings |
27
+ | `understand-work` | workflow | manual | Question out the need behind a stated wish |
28
+ | `explain-work` | workflow | manual | Explain the task in plain language for approval |
29
+ | `verify-before-done` | discipline | automatic | Fresh evidence before any completion claim |
30
+ | `diagnose-before-fix` | discipline | automatic | Reproduce and root-cause before patching |
31
+ | `proportional-testing` | discipline | automatic | Minimum meaningful regression coverage |
32
+ | `scope-guard` | discipline | automatic | Keep work inside the task; flag drift |
33
+ | `simplifier-review` | discipline | automatic | Review a diff for unnecessary complexity |
34
+ | `quality-ratchet` | discipline | automatic | Compare exact entry and candidate evidence without score gates |
35
+ | `notice-lesson` | discipline | automatic | Treat interruptions as misunderstanding signals |
36
+ | `plain-voice` | discipline | automatic | Apply plain voice to every agent-authored text response |
37
+ | `list-skills` | meta | manual | List installed skills and how to invoke them |
38
+ | `writing-skills` | meta | manual | Doctrine and definition of done for agent-os skills |
39
+
40
+ Manual skills carry `disable-model-invocation: true` (Claude) and `agents/openai.yaml` with
41
+ `policy.allow_implicit_invocation: false` (Codex). Automatic skills carry neither gate; their
42
+ descriptions define when they trigger, and they may still be explicitly named. Retired skills move to root `deprecated/`
43
+ (outside the plugin's `skills/`, so they are never distributed).
44
+
45
+ ## Install
46
+
47
+ ### Guided npm installer
48
+
49
+ The recommended setup is a guided command that asks which host skill directories to configure and
50
+ whether to sync the shared global policy:
51
+
52
+ ~~~bash
53
+ npx @sockulags/agent-os install
54
+ ~~~
55
+
56
+ It supports Codex, Claude Code, or both without requiring either host CLI. By default it copies the
57
+ packaged skills into the selected user-level directories (`~/.codex/skills` and/or
58
+ `~/.claude/skills`). For a non-interactive install, make the choices explicit:
59
+
60
+ ~~~bash
61
+ npx @sockulags/agent-os install --platform both --scope user --yes
62
+ ~~~
63
+
64
+ To refresh an existing installation:
65
+
66
+ ~~~bash
67
+ npx @sockulags/agent-os update
68
+ npx @sockulags/agent-os update --platform codex --no-policy
69
+ ~~~
70
+
71
+ Updates replace only skill directories recorded in `.agent-os-install.json` and preserve unrelated
72
+ skills. Use `--scope project` to install into the current project's skill directories. The first
73
+ command always downloads the current npm CLI; use `npx @sockulags/agent-os@latest update` to force
74
+ the newest published installer.
75
+
76
+ Direct Claude skills appear as `/<skill>` and direct Codex skills as `$<skill>`. Direct installation
77
+ also merges the managed quality-ratchet `Stop` hook into the selected host configuration without
78
+ replacing unrelated hooks. The user and project paths are `~/.claude/settings.json` or
79
+ `<project>/.claude/settings.json` for Claude Code, and `~/.codex/hooks.json` or
80
+ `<project>/.codex/hooks.json` for Codex. Node must be available to native plugin hooks. The
81
+ packaged hook keeps one logical command source: Claude and Unix-like Codex use
82
+ `${CLAUDE_PLUGIN_ROOT}`, while Windows Codex uses a quote-free `commandWindows` with a UTF-16LE
83
+ PowerShell `-EncodedCommand` payload that resolves `$env:PLUGIN_ROOT` at runtime.
84
+
85
+ The ratchet begins an exact worktree- and host-session-local baseline before the first mutation when `deliver-work`
86
+ can run it, checks the candidate before `simplifier-review`, and reports source-file/NLOC,
87
+ legacy-before/after, dependency, and optional-analyzer evidence. These are signals for semantic
88
+ judgment, not score or raw-count thresholds. Missing Lizard or jscpd is reported as unavailable,
89
+ never clean. A Stop hook blocks a missing, corrupt, or stale active lifecycle check until the same
90
+ host session records a fresh check; `stop_hook_active` does not bypass that requirement. Without a
91
+ baseline for the current host session it is a no-op. Resolve
92
+ `scripts/quality-delta.mjs` relative to the installed `quality-ratchet/SKILL.md` and run its `clear`
93
+ command from that same host session to abandon an active attempt. Standalone/manual use without a
94
+ host session ID uses a deterministic fallback state. `begin`, `check`, and `clear` read the host ID
95
+ from `CODEX_THREAD_ID` or `CLAUDE_CODE_SESSION_ID`, with Codex taking precedence when both exist;
96
+ native Stop resolves the same identity from its `session_id` payload, using non-empty `turn_id` to
97
+ identify Codex. There is no uninstall command yet.
98
+
99
+ Native marketplace installation remains available with `--method plugin`. It requires the selected
100
+ host CLI. Claude plugin skills appear as `/agent-os:<skill>`; Codex plugin skills remain
101
+ `$<skill>`.
102
+
103
+ For development against this clone, Claude can still use `claude --plugin-dir .`, and Codex can
104
+ register the local `.agents/plugins/marketplace.json` marketplace.
105
+
106
+ ## Release routine
107
+
108
+ 1. Run `node scripts/validate-agent-os.mjs`, `npm test`, its red-case suite, and the live evals in `evals/`.
109
+ 2. Bump `version` in `.claude-plugin/plugin.json`, `.codex-plugin/plugin.json`, and `package.json`.
110
+ 3. Add a dedicated changelog heading, commit and push, merge the green pull request to `main`, and
111
+ create the matching tag before publishing. Never publish npm from a dirty worktree.
112
+ 4. Pack the npm artifact and verify a clean direct install for both hosts, then publish it.
113
+ 5. Create the non-draft GitHub Release, confirm the newest stable release is marked `Latest`, wait
114
+ for Validate and Docs/Pages on current `main`, and run `node scripts/verify-release.mjs <version>`.
115
+ A release is incomplete until source, npm, GitHub, changelog, and live docs all pass that gate.
116
+
117
+ ## Documentation site
118
+
119
+ `docs-site/` is a [VitePress](https://vitepress.dev) site published to GitHub Pages by
120
+ `.github/workflows/docs.yml` on every push to `main` that touches `docs-site/**`.
121
+
122
+ ```bash
123
+ npm --prefix docs-site install
124
+ npm --prefix docs-site run dev
125
+ ```
126
+
127
+ The base path in `docs-site/.vitepress/config.mjs` is `/agent-os/` and must match the repository
128
+ name. A skill edit and its documentation page are one change — the pages under `skills/` and
129
+ `reference/` mirror the skill files and go stale first.
130
+
131
+ ## Evals
132
+
133
+ - `evals/cases/` — versioned trigger and behavior cases plus `manifest.json`, which indexes at least
134
+ 2 positive and 2 negative cases per skill.
135
+ - `evals/RESULTS.md` — historical forward-test results. New results evaluate observable contracts,
136
+ not approval ceremony or reasoning traces.
137
+ - `evals/behavior/` — runner-independent behavior cases, normalized run records, deterministic
138
+ scorecard graders, and explicit human/model judgments.
139
+ - `evals/runners/` — thin Promptfoo and Inspect AI adapters around the Agent OS scorecard.
140
+ - `evals/runs/` — raw logs, gitignored.
141
+
142
+ ## Experiments
143
+
144
+ Experimental work is kept outside the installable package until evidence supports promotion. The
145
+ first recorded Codex experiment replaces a large shared GPT-5.6 prompt with smaller
146
+ risk-calibrated core and Auto Review prompts, including exact text, eval evidence, local
147
+ installation, and rollback:
148
+
149
+ - [Codex custom instructions](https://github.com/sockulags/agent-os/blob/main/experimental/codex/custom_instructions.md)
150
+
151
+ ## Global policy
152
+
153
+ `policy.md` is the source of truth. The npm installer and `init-agent-os global` install it as a
154
+ managed block (`<!-- BEGIN/END AGENT OS -->`) in `~/.claude/CLAUDE.md` and
155
+ `~/.codex/AGENTS.md`. Edit `policy.md`, never the installed blocks.