agentwheel 0.8.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,56 +7,78 @@
7
7
  <p align="center"><strong>One source. Every agent.</strong></p>
8
8
 
9
9
  <p align="center">
10
- Weave your skills, rules, and instructions across every AI agent you use
11
- from any source, kept in sync, with your private tweaks intact.
10
+ Weave skills, rules, instructions, commands, subagents, MCP, hooks, settings, and plugins across every AI agent you use,
11
+ from any source, reconciled into each runtime with your private tweaks intact.
12
12
  </p>
13
13
 
14
14
  ---
15
15
 
16
16
  ## Why agentwheel?
17
17
 
18
- Your AI agents are multiplying. Claude here, Codex there, a couple of custom runtimes in the corner — and every one of them wants its skills, its rules, its own little `AGENTS.md`, in its own folder, in its own format.
18
+ Your AI agents are multiplying. OpenClaw, Claude Code, Codex CLI, Copilot, Hermes — and the next
19
+ harness your team adopts. Each one wants its own skills, rules, instructions, commands, subagents,
20
+ MCP servers, hooks, and settings, in its own layout.
19
21
 
20
- So you copy-paste. You forget which agent has the latest version. You tweak a rule for one and it drifts out of sync with the rest. Multiply that by a team, and "keep the agents aligned" quietly becomes a part-time job.
21
-
22
- **agentwheel makes it one job, done once.** Point it at your skills and instructions, tell it which agents you run, and it installs everything where each one expects it — then keeps it that way. Update upstream and your agents update. Make a local tweak and it survives the next update. Add a brand-new runtime nobody's ever heard of? Drop in a small config and it's a first-class target too.
22
+ **agentwheel makes that one declared state.** Add packages to `.agentwheel/config.json`, preview the
23
+ runtime changes, then install the declared state into each target. Updates move tracking sources
24
+ forward explicitly; installs make the current declaration true.
23
25
 
24
26
  ```bash
25
27
  npm i -g agentwheel
26
- agentwheel add github:your-org/agent-pack
27
- cd ~/.openclaw
28
- agentwheel sync --dry-run # show me what would change
29
- agentwheel sync # install into the detected runtime
28
+ agentwheel init
29
+ agentwheel add github:your-org/agent-pack --adapter codex --mode tracking
30
+ agentwheel plan
31
+ agentwheel install
30
32
  ```
31
33
 
32
- No lock-in. No central gatekeeper. Your packages live in plain git repos, your customizations live in your own repo, and anything reachable by a URL just works.
34
+ No lock-in. No central gatekeeper. Packages live in plain git repos or local folders, customizations
35
+ live in your workspace, and runtimes stay generated output.
33
36
 
34
- ---
37
+ > **Status: early (v0.9).** v0.9 switches the public CLI vocabulary to package-manager verbs:
38
+ > `add`, `install`, `update`, and `uninstall`. A hidden `sync` shim remains for one release only
39
+ > so old bootstrapped skills can self-update; use `install` in all new docs and scripts.
40
+
41
+ ## Supported runtimes & resources
35
42
 
36
- > **Status: early (v0.7).** The lifecycle core is real and tested local/git/skillkit/vercel
37
- > sources, optional registry discovery, plan/sync/update/drift/uninstall, overlays, eject/remember,
38
- > profiles, runtime auto-detection, fleet targeting, asset-includes, selective installs,
39
- > update notifications, full Claude/Codex adapters, rich JSON/TOML merge, and pluggable adapters.
40
- > Expect sharp edges.
43
+ agentwheel installs OpenPack resources into five built-in runtimes and into custom harnesses:
41
44
 
42
- ## What it does
45
+ - **OpenClaw** `.openclaw/`
46
+ - **Claude Code** — `.claude/`
47
+ - **Codex CLI** — `.codex/`
48
+ - **GitHub Copilot** — `.github/`
49
+ - **Hermes** — `.hermes/`
50
+ - **Bring your own** — JSONC config adapters with `--adapter-config`, or programmatic adapters with `--adapter-module`
43
51
 
44
- - **Installs** skills, rules, and instructions into each runtime's native location.
45
- - **Keeps them in sync** — re-runnable, idempotent, with a manifest and drift detection so nothing silently clobbers your work.
46
- - **Pluggable adapters** — each runtime is described by a small config; add your own without forking.
47
- - **Pluggable sources** — pull packages from local paths, git, or skill ecosystems.
48
- - **Your customizations are first-class** — layer, extend, override, or take full ownership, and survive updates.
52
+ Supported resource types include instructions, rules, skills, commands, subagents, MCP, hooks,
53
+ settings, plugins, and fragments; see the full per-runtime target table below.
49
54
 
50
- ## Quick start
55
+ ## Core Commands
56
+
57
+ | Command | Meaning |
58
+ |---|---|
59
+ | `agentwheel add <source>` | Validate and save a package entry in `.agentwheel/config.json`; does not touch runtimes. |
60
+ | `agentwheel plan [name-or-source]` | Preview what `install` would reconcile without writing. |
61
+ | `agentwheel install` | Reconcile configured packages into the current target or selected fleet. Uses the graph lock as input by default. |
62
+ | `agentwheel install <name-or-source>` | Ensure semantics: configured name/source scopes the install; a new source is added and installed. |
63
+ | `agentwheel update [name]` | Re-resolve tracking packages, then apply. Pinned packages stay locked. |
64
+ | `agentwheel uninstall <name-or-source>` | Remove a configured package from runtimes and config. |
65
+ | `agentwheel uninstall <name> --keep-files` | Remove from config/manifest while leaving runtime files unmanaged. |
66
+ | `agentwheel status` | Show configured packages, manifest/lock presence, and install state. |
67
+
68
+ Mental model: **`install` = make what is declared true. `update` = move tracking declarations forward,
69
+ then make them true.**
70
+ Scoped installs do not remove files owned only by other configured packages; run a full `agentwheel install`
71
+ to reconcile those removals.
72
+
73
+ ## Quick Start
51
74
 
52
75
  ```bash
53
76
  npm i -g agentwheel
54
77
 
55
78
  agentwheel init
56
79
  agentwheel add github:your-org/agent-pack --adapter openclaw --mode tracking
57
- cd ~/.openclaw
58
- agentwheel sync --dry-run
59
- agentwheel sync
80
+ agentwheel plan
81
+ agentwheel install
60
82
  ```
61
83
 
62
84
  Prefer pnpm? `pnpm add -g agentwheel` works too.
@@ -71,23 +93,22 @@ pnpm build
71
93
  pnpm link --global
72
94
  ```
73
95
 
74
- `plan`, `sync --dry-run`, and `update --dry-run` show exactly what would change before anything is written. They're the commands to trust.
75
-
76
- `uninstall` removes clean managed files by default and keeps drifted files in place with a warning.
77
- Use `agentwheel uninstall --force` only when you also want to remove drifted managed files.
96
+ `plan`, `install --dry-run`, and `update --dry-run` show what would change before runtime files are
97
+ written. `uninstall` removes clean managed files and keeps drifted files by default; use
98
+ `agentwheel uninstall --force` only when you also want to remove drifted managed files.
78
99
 
79
100
  agentwheel checks npm for newer versions at most once every 24 hours and prints a non-blocking
80
101
  stderr warning when an update is available. Disable it with `--no-update-check` or
81
102
  `AGENTWHEEL_NO_UPDATE_CHECK=1`.
82
103
 
83
- ## Runtime targeting
104
+ ## Runtime Targeting
84
105
 
85
- Normal use no longer needs `--target-root`. Run agentwheel inside a runtime folder and it detects
86
- the target:
106
+ Normal use does not need `--target-root`. Run agentwheel inside a runtime folder and it detects the
107
+ target:
87
108
 
88
109
  ```bash
89
110
  cd ~/.openclaw
90
- agentwheel sync github:your-org/agent-pack
111
+ agentwheel install
91
112
  ```
92
113
 
93
114
  If the current directory is already the runtime directory (`~/.openclaw`), agentwheel uses its
@@ -124,14 +145,15 @@ For a control-plane setup, define named agents in config. Global config lives at
124
145
  ```
125
146
 
126
147
  ```bash
127
- agentwheel sync --agent lab-openclaw
128
- agentwheel sync --all
129
- agentwheel sync --profile daily
148
+ agentwheel install --agent lab-openclaw
149
+ agentwheel install --all
150
+ agentwheel install --profile daily
151
+ agentwheel install --all-detected
130
152
  ```
131
153
 
132
- SSH targets use the same manifest and drift model as local targets. `plan --dry-run` reads the
133
- remote install manifest and hashes remote files before deciding whether a file is up to date,
134
- drifted, or conflicting. SSH hosts need `ssh`, `tar`, and `node` available on `PATH`.
154
+ SSH targets use the same manifest and drift model as local targets. Planning reads the remote
155
+ install manifest and hashes remote files before deciding whether a file is up to date, drifted, or
156
+ conflicting. SSH hosts need `ssh`, `tar`, and `node` available on `PATH`.
135
157
 
136
158
  To scaffold a control-plane example:
137
159
 
@@ -140,51 +162,52 @@ agentwheel init --fleet-example
140
162
  ```
141
163
 
142
164
  Target resolution order is exact: `--target-root` wins, then `--agent`, then auto-detect from the
143
- current directory, then fallback to the current directory.
165
+ current directory, then fallback to the current directory. `--all-detected` is an explicit escape hatch
166
+ for applying to every runtime marker found in the current directory or `--target-root`; `--all` remains
167
+ reserved for configured agents.
144
168
 
145
- ## Core ideas
169
+ ## Core Ideas
146
170
 
147
171
  **Three places, one direction:**
148
172
 
149
173
  | | Where | What |
150
174
  |---|---|---|
151
- | **Author** | the package's git repo | upstream content never edited in place |
152
- | **Workspace** | your repo, under `.agentwheel/` | your config, locks, and customizations |
153
- | **Runtime** | `.openclaw/`, `~/.claude/`, | generated output — never hand-edited |
175
+ | **Author** | the package's git repo | upstream content, never edited in place |
176
+ | **Workspace** | your repo, under `.agentwheel/` | config, locks, trust decisions, and customizations |
177
+ | **Runtime** | `.openclaw/`, `~/.claude/`, `.codex/`, ... | generated output |
154
178
 
155
- Flow: **author + your workspace → `sync` → runtime**.
179
+ Flow: **author + workspace → `install` → runtime**.
156
180
 
157
181
  ## Packages
158
182
 
159
- A package is a git repo (or folder) with a JSON manifest and a canonical layout:
183
+ A package is a git repo or folder with an OpenPack manifest and a canonical layout:
160
184
 
161
185
  ```jsonc
162
- // openpack.json (plain JSON or JSONC — both work; agentwheel.json remains a legacy alias)
186
+ // openpack.json
163
187
  {
164
188
  "schemaVersion": 2,
165
189
  "name": "your-org/agent-pack",
166
190
  "version": "0.1.0",
167
191
  "provides": [
168
192
  { "type": "instructions", "path": "instructions/AGENTS.md" },
169
- { "type": "rules", "path": "rules" },
170
- { "type": "skills", "path": "skills" }
193
+ { "type": "rules", "path": "rules" },
194
+ { "type": "skills", "path": "skills" }
171
195
  ]
172
196
  }
173
197
  ```
174
198
 
175
199
  Install only part of a package with `--select <type>/<name>`. `--skill <name>` is a shortcut for
176
- `--select skills/<name>`, and selections saved during `add` are reused by later `sync` and `update`
177
- runs.
200
+ `--select skills/<name>`, and selections saved during `add` are reused by later `install` and
201
+ `update` runs.
178
202
 
179
203
  ```bash
180
- agentwheel add github:NestDevLab/agent-mesh --skill codex-tmux --adapter openclaw
181
- agentwheel sync --dry-run
182
-
183
- agentwheel sync github:your-org/agent-pack --select rules/safe-actions.md --select commands/build.md
204
+ agentwheel add github:NestDevLab/agent-mesh --skill codex-tmux --adapter codex
205
+ agentwheel plan
206
+ agentwheel install
184
207
  ```
185
208
 
186
- Package authors can mark dependencies as required. Required artifacts are always installed and
187
- cannot be deselected:
209
+ Package authors can mark artifacts as required. Required artifacts are always installed and cannot
210
+ be deselected:
188
211
 
189
212
  ```jsonc
190
213
  {
@@ -194,124 +217,120 @@ cannot be deselected:
194
217
  }
195
218
  ```
196
219
 
197
- Packages can compose shared files into each directory artifact at staging time. This keeps one
198
- canonical copy in the package repo while installing self-contained skills:
220
+ ## Dependencies And Composition
221
+
222
+ OpenPack packages can depend on other packages and compose shared markdown fragments:
199
223
 
200
224
  ```jsonc
201
225
  {
202
- "type": "skills",
203
- "path": "skills",
204
- "assets": [
205
- {
206
- "from": "packages/tmux-bridge/bin",
207
- "into": "bin",
208
- "include": ["*.sh"],
209
- "mode": "preserve"
226
+ "schemaVersion": 2,
227
+ "name": "your-org/agent-pack",
228
+ "version": "1.0.0",
229
+ "requires": {
230
+ "core": {
231
+ "source": "github:your-org/core-pack",
232
+ "version": "^1.2.0",
233
+ "select": ["rules/safe-actions.md", "fragments/risk.md"]
210
234
  }
235
+ },
236
+ "provides": [
237
+ { "type": "fragments", "path": "fragments" },
238
+ { "type": "skills", "path": "skills" }
211
239
  ]
212
240
  }
213
241
  ```
214
242
 
215
- `mode: "preserve"` keeps executable bits on copied scripts. The composed files are included in
216
- the skill directory hash, so idempotency and drift detection work as if the assets had always
217
- belonged to the skill.
218
-
219
- Publish by pushing to any git host. A registry exists only for short names and discovery — it's
220
- optional, and `agentwheel add <url|path>` always works without it.
221
-
222
- ## How to add a package
223
-
224
- The public package registry lives at
225
- [`NestDevLab/agentwheel-registry`](https://github.com/NestDevLab/agentwheel-registry).
226
-
227
- 1. Create a public repo with `openpack.json` and a standard layout such as `instructions/`, `rules/`, `skills/`, `commands/`, `mcp/`, or `hooks/`.
228
- 2. Open a pull request to `agentwheel-registry` that adds an entry to `index.json`.
229
- 3. Users install by short name:
230
-
231
- ```bash
232
- agentwheel registry update
233
- agentwheel add your-package-name --adapter openclaw
234
- agentwheel update --dry-run
235
- agentwheel update
236
- ```
237
-
238
- Example registry entry:
243
+ - **Recursive resolution, locked.** `install` reads the existing graph lock when present; newly
244
+ added packages resolve fresh and then write a deterministic lock.
245
+ - **Explicit updates.** `update` re-resolves tracking sources and applies the new graph. Pinned
246
+ packages stay on the locked graph unless their declaration changes.
247
+ - **Fragment composition.** Markdown files can transclude shared fragments with
248
+ `<!-- openpack:include fragments/review-style.md -->` or cross-package aliases such as
249
+ `core:fragments/risk.md`.
250
+ - **Trust.** New transitive sources prompt before install. Pre-approve with `--trust <glob>` or
251
+ `--yes`, set a workspace trust policy, and manage persisted decisions with `agentwheel trust`.
252
+ - **Offline & frozen installs.** `--offline` guarantees zero network; `--frozen-lock` hard-fails if
253
+ resolution would differ from the lock.
254
+ - **Introspection.** `agentwheel deps tree` prints the resolved graph; `agentwheel deps why
255
+ <selector>` explains why an artifact is installed.
256
+
257
+ ### Meta-packages (packs)
258
+
259
+ OpenPack v2 packages can omit `provides` when they declare at least one dependency. These
260
+ meta-packages install nothing of their own; they aggregate curated selections from other packages.
261
+ Uninstalling a meta-package removes the dependencies it pulled in unless those dependencies are
262
+ still owned by another configured package.
239
263
 
240
264
  ```json
241
265
  {
242
- "name": "your-package-name",
243
- "source": "github:your-org/your-agent-package",
244
- "type": "package",
245
- "description": "Reusable skills, rules, and instructions for agentwheel.",
246
- "tags": ["skills", "rules", "instructions"]
266
+ "schemaVersion": 2,
267
+ "name": "test/meta-pack",
268
+ "version": "0.1.0",
269
+ "requires": {
270
+ "dep": { "source": "../dep-a", "select": ["rules/a.md"] }
271
+ }
247
272
  }
248
273
  ```
249
274
 
250
- ## Customizing without getting overwritten
275
+ Migrating an existing legacy package takes one command:
276
+
277
+ ```bash
278
+ agentwheel package migrate
279
+ ```
280
+
281
+ ## Customizing Without Getting Overwritten
251
282
 
252
- Drift detection blocks *accidental* edits to generated files. *Intentional* changes have four channels,
253
- all stored in your `.agentwheel/` (never in the runtime dir, never in the author's repo):
283
+ Drift detection blocks accidental edits to generated runtime files. Intentional changes live under
284
+ `.agentwheel/`:
254
285
 
255
- - **Layer** an editable region in your instructions that updates never touch. (This is how an agent can "remember X durably" without fighting drift.)
256
- - **Add** extra rule files composed alongside upstream.
257
- - **Override** replace a specific upstream item, visibly, in the plan.
258
- - **Eject** — take an item into local ownership; updates leave it alone.
286
+ - **Layer** local instructions with `agentwheel remember`.
287
+ - **Add** separate local artifacts under `.agentwheel/additions`.
288
+ - **Override** an upstream item under `.agentwheel/overrides`.
289
+ - **Eject** an item into `.agentwheel/ejected` when you want local ownership.
259
290
 
260
- ## Custom & private runtimes
291
+ ## Custom And Private Runtimes
261
292
 
262
- A runtime adapter is just a config (capabilities + paths). Have an internal runtime you can't publish?
263
- Write a `.jsonc` adapter and point at it — it's a first-class target, and nothing leaves your machine:
293
+ A runtime adapter is a config with capabilities and paths. Internal runtimes do not need to be
294
+ published:
264
295
 
265
296
  ```jsonc
266
297
  {
267
298
  "name": "myco-internal",
268
299
  "targets": {
269
300
  "instructions": { "dest": ".myco/context/AGENTS.md" },
270
- "rules": { "dest": ".myco/policy/rules" },
271
- "skills": { "dest": ".myco/lib/skills" }
301
+ "rules": { "dest": ".myco/policy/rules" },
302
+ "skills": { "dest": ".myco/lib/skills" }
272
303
  }
273
304
  }
274
305
  ```
275
306
 
276
307
  ```bash
277
- agentwheel sync ./my-pack --adapter-config ./myco-internal.jsonc
308
+ agentwheel install ./my-pack --adapter-config ./myco-internal.jsonc
278
309
  ```
279
310
 
280
- Built-in adapters ship for common runtimes; declarative adapters need no code and stay private.
281
- Programmatic adapters, for private runtime logic beyond file placement, require explicit `--allow-adapter-code`.
311
+ For adapter behavior that needs code, load a programmatic adapter module:
312
+
313
+ ```bash
314
+ agentwheel install ./my-pack --adapter-module ./myco-adapter.js
315
+ ```
282
316
 
283
317
  Built-in runtime targets:
284
318
 
285
319
  | Runtime | Main targets |
286
320
  |---|---|
287
- | **OpenClaw** | `.openclaw/AGENTS.md`, `.openclaw/skills`, `.openclaw/rules`, `.openclaw/commands`, MCP/hooks/settings, semantic plugin planning |
321
+ | **OpenClaw** | `.openclaw/AGENTS.md`, `.openclaw/skills`, `.openclaw/rules`, `.openclaw/commands`, `.openclaw/agents`, MCP/hooks/settings, semantic plugin planning |
288
322
  | **Claude Code** | `.claude/CLAUDE.md`, `.claude/skills`, `.claude/commands`, `.claude/agents`, `.claude/rules`, `.claude/.mcp.json`, `.claude/settings.json` |
289
323
  | **Codex CLI** | `.codex/AGENTS.md`, `.codex/skills`, `.codex/commands`, `.codex/agents`, `.codex/rules`, `.codex/config.toml`, `.codex/hooks.json` |
290
- | **Hermes** | `.hermes/AGENTS.md`, `.hermes/skills`, `.hermes/rules`, `.hermes/commands`, MCP/hooks/settings |
291
- | **GitHub Copilot** | `.github/copilot-instructions.md`, `.github/instructions`, `.github/prompts` |
292
-
293
- Claude MCP and hooks/settings are merged as JSON. Codex MCP entries are merged into
294
- `[mcp_servers]` in `.codex/config.toml` without deleting unrelated user config; hooks use
295
- `.codex/hooks.json`.
296
-
297
- Copilot support is intentionally file-drop only: instructions, rules, and prompt/command files are
298
- placed in GitHub-native locations, while raw `SKILL.md` directories stay disabled until there is a
299
- clear conversion format.
300
-
301
- ## Roadmap
302
-
303
- - [x] **v0.1** — install spine: local sources; openclaw/claude/codex adapters; skills/rules/instructions; `plan` · `sync` · `--dry-run` · `uninstall`; manifest + drift + idempotency.
304
- - [x] **v0.2** — git source driver; `update` (pinned & tracking); overlays/additive/override/eject; `init`; hermes + copilot adapters; commands/mcp/hooks artifacts; OpenClaw semantic plugin planning.
305
- - [x] **v0.3** — skillkit/vercel source drivers; optional registry & federation; programmatic adapters behind `--allow-adapter-code`; rich JSON merge for mcp/hooks/settings; profiles.
306
- - [x] **v0.4** — runtime auto-detection; no `--target-root` needed for normal use; fleet config with named agents; global + project config merge; `--agent` and `--all`.
307
- - [x] **v0.5** — asset-includes compose shared files into skills at install time; executable bits preserved; hashes include composed assets.
308
- - [x] **v0.6** — selective installs with `--select`/`--skill`; required artifacts; cached npm update notifier.
309
- - [x] **v0.7** — full Claude/Codex adapters; Codex TOML MCP merge; subagent enumeration; `--skill` selector fix.
324
+ | **Hermes** | `.hermes/AGENTS.md`, `.hermes/skills`, `.hermes/rules`, `.hermes/commands`, `.hermes/agents`, MCP/hooks/settings |
325
+ | **GitHub Copilot** | `.github/copilot-instructions.md`, `.github/instructions`, `.github/prompts`, `.github/skills`, `.github/agents`, `.vscode/mcp.json` |
310
326
 
311
- ## Design docs
327
+ ## Docs
312
328
 
313
- - [`DESIGN.md`](DESIGN.md) — architecture & module layout.
314
- - [`LIFECYCLE.md`](LIFECYCLE.md) — publish / install / update / customize model.
329
+ - [`docs/spec/openpack.md`](docs/spec/openpack.md) — OpenPack package spec.
330
+ - [`docs/fleet-config.md`](docs/fleet-config.md) — named agents, SSH targets, and profiles.
331
+ - Resource catalogue: https://nestdevlab.github.io/agentwheel/catalogue.html.
332
+ - [`DESIGN.md`](DESIGN.md) — architecture and module layout.
333
+ - [`LIFECYCLE.md`](LIFECYCLE.md) — publish, install, update, and customization model.
315
334
 
316
335
  ## License
317
336