docks-kit 0.23.0 → 0.25.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.
Files changed (59) hide show
  1. package/AGENTS.md +22 -138
  2. package/README.md +38 -23
  3. package/cli/docs/command-guards.md +5 -3
  4. package/cli/docs/flags.md +11 -29
  5. package/cli/docs/install.md +5 -4
  6. package/cli/docs/omp-context.md +79 -7
  7. package/cli/docs/omp-models.md +22 -15
  8. package/cli/docs/overview.md +5 -8
  9. package/cli/docs/sync-layers.md +55 -83
  10. package/cli/docs/toolchain.md +7 -8
  11. package/cli/src/argv.ts +0 -4
  12. package/cli/src/argvValidate.ts +2 -9
  13. package/cli/src/commands/docs.ts +2 -2
  14. package/cli/src/commands/omp.ts +1 -1
  15. package/cli/src/commands/scratch.ts +1 -1
  16. package/cli/src/commands/sync.ts +3 -24
  17. package/cli/src/commands/tidy.ts +1 -1
  18. package/cli/src/commands/update.ts +3 -3
  19. package/cli/src/engine-native/DESIGN.md +24 -35
  20. package/cli/src/engine-native/deps.ts +2 -7
  21. package/cli/src/engine-native/engineCtx.ts +3 -31
  22. package/cli/src/engine-native/failures.ts +2 -2
  23. package/cli/src/engine-native/index.ts +2 -2
  24. package/cli/src/engine-native/kitDb.ts +21 -37
  25. package/cli/src/engine-native/ompChild.ts +1 -1
  26. package/cli/src/engine-native/ompFastMode.ts +1 -1
  27. package/cli/src/engine-native/ompKitPlugin.ts +7 -16
  28. package/cli/src/engine-native/ompOverlay.ts +1 -1
  29. package/cli/src/engine-native/ompPlugins.ts +205 -221
  30. package/cli/src/engine-native/ompRemovals.ts +24 -3
  31. package/cli/src/engine-native/ompSession.ts +67 -0
  32. package/cli/src/engine-native/ompSync.ts +6 -15
  33. package/cli/src/engine-native/os/posix.ts +0 -1
  34. package/cli/src/engine-native/os/types.ts +0 -4
  35. package/cli/src/engine-native/os/windows.ts +0 -1
  36. package/cli/src/engine-native/parseArgs.ts +1 -61
  37. package/cli/src/engine-native/parseHelp.ts +1 -6
  38. package/cli/src/engine-native/scratch.ts +1 -1
  39. package/cli/src/engine-native/sharedTypes.d.ts +1 -1
  40. package/cli/src/engine-native/syncConcurrency.ts +3 -3
  41. package/cli/src/engine-native/syncDispatch.ts +26 -92
  42. package/cli/src/engine-native/toolchain.ts +1 -5
  43. package/cli/src/generated/sotPayload.ts +339 -17
  44. package/cli/src/main.ts +3 -7
  45. package/cli/tsconfig.json +1 -0
  46. package/package.json +2 -2
  47. package/cli/src/checklistPrompt.ts +0 -464
  48. package/cli/src/commands/harnesses.ts +0 -77
  49. package/cli/src/commands/skills.ts +0 -40
  50. package/cli/src/engine-native/harnesses.ts +0 -138
  51. package/cli/src/engine-native/ompMarketplace.ts +0 -140
  52. package/cli/src/engine-native/skillsInstall.ts +0 -135
  53. package/cli/src/engine-native/skillsLinks.ts +0 -216
  54. package/cli/src/engine-native/skillsManifest.ts +0 -36
  55. package/cli/src/engine-native/skillsPrune.ts +0 -117
  56. package/cli/src/engine-native/skillsRecords.ts +0 -138
  57. package/cli/src/engine-native/skillsSync.ts +0 -57
  58. package/cli/src/manifests.ts +0 -53
  59. package/cli/src/terminalCells.ts +0 -191
package/AGENTS.md CHANGED
@@ -2,39 +2,24 @@
2
2
 
3
3
  Canonical instructions for coding agents working on this project. Compatible with Oh My Pi (`omp`), OpenCode, VS Code Copilot, and any other [agents.md](https://agents.md/)-aware tool.
4
4
 
5
- Pointers here name concepts, not coordinates — if a path or symbol moved,
6
- trust the stated purpose and re-locate it (grep the symbol) before acting.
5
+ Pointers here name concepts, not coordinates — if a path or symbol moved, trust the stated purpose and re-locate it (grep the symbol) before acting.
7
6
 
8
7
  ## Repository purpose
9
8
 
10
- Portable configuration kit for AI coding agents. The kit manages one coding
11
- harness, Oh My Pi (`omp`). Its Single Source of Truth (SoT) directory deploys
12
- to omp's user-config location through
13
- `./docks-kit sync`. The kit also deploys shared [agentskills.io](https://agentskills.io)
14
- skills. Clone once to get a consistent AI-assisted environment on supported
15
- Linux, macOS, and Windows hosts. The kit focuses on **token efficiency without
16
- sacrificing quality**. Every setting and hook minimizes token use while
17
- preserving rigorous output. When you add or edit anything, ask: *does this
18
- change reduce tokens without weakening correctness?*
9
+ Portable configuration kit for AI coding agents. The kit manages one coding harness, Oh My Pi (`omp`). Its Single Source of Truth (SoT) directory deploys to omp's user-config location through `./docks-kit sync`. Sync writes no `.agents` or `.claude` folder of its own; omp's folders follow `PI_CONFIG_DIR`, `PI_CODING_AGENT_DIR`, and `XDG_DATA_HOME`, so an override that points into one of those folders makes omp's files go there. Sync also writes the kit plugin to `~/.docks-kit/omp-plugin`. Clone once to get a consistent AI-assisted environment on supported Linux, macOS, and Windows hosts. The kit focuses on **token efficiency without sacrificing quality**. Every setting and hook minimizes token use while preserving rigorous output. When you add or edit anything, ask: *does this change reduce tokens without weakening correctness?*
19
10
 
20
11
  omp uses this `AGENTS.md` file plus the omp SoT under `SoT/.omp/`.
21
12
 
22
- docks-kit runtime and standalone binary support covers Linux x64/arm64, macOS
23
- arm64, and Windows x64. Hosts outside this matrix fail before either
24
- launcher can fall back to Bun source.
13
+ docks-kit runtime and standalone binary support covers Linux x64/arm64, macOS arm64, and Windows x64. Hosts outside this matrix fail before either launcher can fall back to Bun source.
25
14
 
26
15
  ## Context tree
27
16
 
28
- Per-folder conventions live in nested `AGENTS.md` nodes. An agent can load
29
- only the nodes from the root down to its working directory, so open the node
30
- for the folder you edit from this table. Edit the node, not this list, when a
31
- folder's rules change. `context-tree audit` checks this table against the
32
- AGENTS.md files on disk.
17
+ Per-folder conventions live in nested `AGENTS.md` nodes. An agent can load only the nodes from the root down to its working directory, so open the node for the folder you edit from this table. Edit the node, not this list, when a folder's rules change. `context-tree audit` checks this table against the AGENTS.md files on disk.
33
18
 
34
19
  | Node | Governs |
35
20
  |---|---|
36
21
  | `docs/AGENTS.md` | Plan-record routing to `docs/PLAN.md` |
37
- | `cli/AGENTS.md` | Effect CLI, EngineNative sync engine, bundled docs topics, build scripts, unit and golden suites |
22
+ | `cli/AGENTS.md` | Effect CLI, EngineNative sync engine, bundled docs topics, build scripts, unit and golden suites, SoT notes |
38
23
  | `.agents/skills/AGENTS.md` | Project skills; omp reads `.agents/skills/` directly |
39
24
 
40
25
  ## Repository layout (cross-cutting)
@@ -50,47 +35,22 @@ AGENTS.md files on disk.
50
35
  | `.github/workflows/release-cli.yml` | `cli-v*` release: four binaries (Linux x64 and arm64, macOS arm64, Windows x64), plus `SHA256SUMS` and npm publish |
51
36
  | `README.md` | Front door |
52
37
  | `package.json` / `bun.lock` | npm package: `bin` = `cli/src/main.ts`; bundles `cli/` with the generated in-memory SoT payload |
53
- | `SoT/.agents/skills.txt` | Universal-skill manifest, intentionally empty by default. Adding an [agentskills.io](https://agentskills.io/specification) slug opts it into EngineNative's shared `~/.agents/skills/` bootstrap. |
54
- | `docs/PLAN.md` | Plan record standard. The plan record is a GitHub issue; no plan markdown is tracked. `docs/AGENTS.md` routes to it. |
38
+ | `docs/PLAN.md` | Plan pointer and project plan rules. The plan record is a GitHub issue; no plan markdown is tracked. `docs/AGENTS.md` routes to it. |
55
39
  | `AGENTS.md` | This file — tool-agnostic instructions |
56
40
 
57
41
  Module map for `cli/` (engine axes, commands, kit store, test fixtures, and the release-binary build `bun run build:binaries`): `cli/AGENTS.md`.
58
42
 
59
- Shared SoT notes:
60
- - The global prompt SoTs carry the owner's standing authorization for Docks cross-company plan review, which never overrides host or platform denial.
61
-
62
- omp SoT notes:
63
- - `SoT/.omp/AGENTS.md`, `config.yml`, `models.yml`, and `mcp.json` deploy to `~/.omp/agent/`. omp loads `~/.omp/agent/AGENTS.md` only into main sessions and advisors, never into task subagents (`omp://context-files.md`). So `SoT/.omp/AGENTS.md` holds only main-session rules, and a command rule that subagents need goes into a kit plugin trigger rule.
64
- - `SoT/.omp/intercom.json` deploys to `$PI_CODING_AGENT_DIR/intercom/config.json`. The default root is `~/.pi/agent`. Under a named omp profile (`OMP_PROFILE` or `PI_PROFILE`), it deploys to `<profile agentDir>/intercom/config.json`, because omp exports `PI_CODING_AGENT_DIR` as the profile agent directory.
65
- - `ompFileDeploy.ts syncMergedYaml` deep-merges `config.yml` through `ompYaml.ts mergeOmpConfig` and `models.yml` through `mergeOmpModels`. Both wrap one generic mapping merge; only the config wrapper prunes stale `retry.fallbackChains` wildcards and merges `bash.patterns`.
66
- - `SoT/.omp/config.yml` `bash.patterns` holds the destructive-command guards. omp 19.0.0 checks a deny rule, then a prompt rule, then its `CRITICAL_BASH_PATTERNS`, then an allow rule (`BashTool.approval` in the v19.0.0 source; `omp://approval-mode.md` still describes the 18.17.0 order, in which the critical check came before a prompt rule). A critical command that no deny or prompt rule matches gets a bare safety override, which replaces a matching allow, and omp's default `tools.approvalMode: yolo` ignores a bare override, so the command runs, in subagents too. A prompt rule asks a person, also on a critical command, but a subagent rejects every prompt. Every `rm` shape that the critical check can flag is therefore a deny: recursive `rm`, `sudo` anywhere before `rm` (also by path), any `rm` with an `r` or `f` option before an absolute path, and `--no-preserve-root`. By owner decision (0.20.9), the recursive-`rm` deny also covers any prefix (a `* rm ` copy of each bare cluster rule, so `env X=1 rm -rf b`, `xargs rm -rf`, `find . -exec rm -rf {} +`, and `git rm -r dir` are denied) and the `-ri`, `-ir`, `-Ri`, and `-iR` clusters for bare `rm`, `*/rm`, and `* rm`. By owner decision (0.21.0), 17 more denies cover bulk removal that can empty the home directory: `find -delete` (bare, `*/find`, `* find`), `-exec`, `-execdir`, `-ok`, and `-okdir` with `rm` or `*/rm`, and `xargs rm` in six shapes. No glob can express "inside the temporary directory", so `docks-kit scratch remove` checks that path in code. A `$` or a backtick anywhere after `git push` in the same command is a deny, not a prompt (0.22.5, #120). A variable can expand to a `+` refspec or `--force`, and the matcher reads the text before the shell expands it. The agent reads the refusal and writes the ref literally, so no person is asked. The two rules are `*git push *$*` and ``*git push *`*``. Their leading `*` keeps a shell keyword such as `do`, a wrapper such as `env`, or a path before `git` from hiding the push. By owner decision (0.22.8, #126), the kit ships no omp prompt rule: `bash.patterns` holds only the denies plus the `trash *` allow, so every command that no deny matches runs without a question, in subagents too. Since 0.20.9 this run-without-question behavior covers a non-denied `rm`, `git rm`, `git worktree remove`, and `gio trash`. Since 0.21.0 it also covers `docks-kit scratch remove`. Since 0.22.8 it also covers `git clean`, `git reset --hard`, a hook skip, and every `git push` that no deny matches. The force-push denies match only `git push --force` or `-f` directly before `origin main` or `origin master`, so another spelling, such as `git push origin main --force`, runs. A prompt rule that the user adds survives sync and still asks. The kit plugin trigger rules in `SoT/.omp/plugin/rules/` carry the agent rules for these commands. `git-safety.md` tells the agent to write each `git push` ref literally and to push the current branch with `git push -u origin HEAD`. The list order is deny, then `trash *`. For a command without shell control, omp takes the first matching rule. For a command with shell control, such as `;` or `|`, each segment takes its first matching deny or prompt rule, a deny chosen for one segment wins over a prompt chosen for another segment, and an allow never matches. A segment also matches without its leading `NAME=value` words. `ompYaml.ts mergeBashPatterns, grouped rule merge` keeps user rules and groups all rules as kit deny, user deny, user prompt, kit prompt, other user rules, kit allow, so a user deny or prompt precedes every kit allow. It treats a deployed rule equal to a kit rule (approval case-folded, `match` whitespace collapsed) as the kit copy, so a re-sync is a no-op. A rule the kit stops shipping stays as a user rule, so retire one through `ompRemovals.ts OMP_RETIRED_BASH_RULES`. `cli/test/lib/ompBashPatterns.ts` ports omp 19.0.0's matcher, critical patterns, and yolo resolution; `cli/test/unit/ompBashPatterns.test.ts` asserts each command's final outcome and the merge. omp subagents reject every `prompt`, and the `eval` tool stays unrestricted by owner decision.
67
- - `ompSync.ts` runs `ompRemovals.ts syncOmpRemovals, retired-key inventory` right after the config merge, and that pass force-prunes retired kit-owned keys from `~/.omp/agent/config.yml` on every sync, with no flag. The pass is required because `mergeOmpConfig` is additive, so removing a key from the SoT alone never removes it from a deployed file. A key retired with a recorded value is pruned only while the deployed value still matches that value, so a user edit survives; a key retired outright, such as `providers.webSearchOrder`, is pruned at any value. The same pass removes each `bash.patterns` rule listed in `OMP_RETIRED_BASH_RULES`: the 39 file-removal rules retired in 0.20.9, the four `git push` prompts for a `$` or backtick word that 0.22.5 replaced with denies, and the 492 prompt rules retired in 0.22.8 (`RETIRED_PROMPT_MATCHES`). It compares with the merge's kit-rule normalization (approval case-folded, `match` whitespace collapsed), so a user rule with a different `match` or `approval` survives.
68
- - `cycleOrder` ends with `astra` as its fifth stop. `modelRoles.astra` is `openai-codex/gpt-6.2-astra:xhigh`, and `modelTags.astra` (`GPT-6.2 Astra`) is visible. Astra and Fable fall back to each other through concrete selectors: `retry.fallbackChains.astra` holds `anthropic/claude-fable-5-2:medium`, and `retry.fallbackChains.fable` holds `openai-codex/gpt-6.2-astra:xhigh`. `modelRoles.fable` is `anthropic/claude-fable-5-2:medium`, with visible `modelTags.fable`. The hidden `switch_fable` role uses the same Fable selector and keeps an empty fallback chain.
69
- - `modelRoles.task` is `anthropic/claude-opus-5-5:high`, and `retry.fallbackChains.task` falls back to `openai-codex/gpt-6.2-sol:high`. The kit relies on omp's default `task.enableEffort: false`: a caller `effort` outranks the role's level suffix, and `hi` maps to the top of the model ladder, so with the field on, `hi` spawns ran at `task.maxEffort` (`xhigh`) instead of the role level. With the field off, every spawn runs its role level, and `task.maxEffort` bounds only a per-call `model` with a `:level` suffix. By owner decision (0.22.22), the omp advisor is removed: the SoT has no `advisor` block, `advisor` role, or `advisor` fallback chain. The plan-lifecycle verification loop replaces a second model on every turn. A session that runs `/advisor on` takes its advisor model from the `slow` role. `smol`, `commit`, and `tiny` use `openai-codex/gpt-6-luna`. The kit-defined hidden `reviewer` role is `openai-codex/gpt-6.1-terra:high`. Its retry fallback is `anthropic/claude-opus-5-5:high`. All four reviewer entries in `task.agentModelOverrides` point to `@reviewer`. `task.agentServiceTierOverrides` sets the same four agents to `inherit`, so they take the live tier of the main session for each provider. The user set the effort `high` and chose to follow the fast toggle (#134); the review benchmark of #130 chose the model. `ompOverlay.ts ROLE_ORDER, FALLBACK_ORDER` list `reviewer`, so a free session also replaces it. omp bundles the `reviewer` and `security-reviewer` agents, and the `plan-lifecycle` plugin ships `code-reviewer` and `plan-reviewer`. The `SoT/toolchain.json` omp floor and verified pin are 19.0.0, the release the kit tested on 2026-11-19: its `omp models --json` catalog lists each model selector of `modelRoles` and `retry.fallbackChains` exactly, every `SoT/.omp/config.yml` key is a key of `omp config list --json`, and `cli/test/lib/ompBashPatterns.ts` ports its approval source. The floor is doctor visibility only. Sync does not check the omp catalog, so an older omp can fuzzy-match a missing id to another model. `cli/docs/omp-models.md` records the checks.
70
- - The six Opus 5.5 roles (`default`, `slow`, `plan`, `designer`, `vision`, `task`) and the `smol`, `tiny`, `commit`, and `reviewer` retry chains use `anthropic/claude-opus-5-5` at the levels the role map records. `cli/docs/omp-models.md` carries the Artificial Analysis capture behind the role map, read 2026-09-29 at Intelligence Index v4.3.2 and Coding Agent Index v1.5 from the AA comparison-page metric tables. The `astra`, `reviewer`, `fable`, and `switch_fable` rows are the exceptions: they come from v5.0.1 captures read 2026-11-18 (GPT-6.2 Astra), 2026-11-05 (GPT-6.1 Terra), and 2026-11-12 (Fable 5.2), and they compare only with other v5.0.1 figures. Opus 5.5 max has the highest v4.3.2 index in that topic, at 58. AA has measured speed and latency for every Opus 5.5 level and every GPT-6.2 Sol and GPT-6.2 Astra row in that topic. GPT-6 Luna medium is the only unmeasured speed and latency row.
71
- - `modelRoles.web` is `web/firecrawl` and `retry.fallbackChains.web` carries the explicit 20-entry provider order. The kit declares both keys because the legacy `providers.webSearchOrder` key is retired: omp expands it in memory into these two keys and then drops it, and never writes that expansion back to disk. An explicit chain replaces omp's built-in web order wholesale, so every entry left out is a provider omp never tries. The owner removed the seven entries that named older models (Gemini 2.5 Flash, Claude Haiku 4.5, GPT-5.6, GPT-5.5, and Grok 4.5); keep every other provider.
72
- - `SoT/.omp/models.yml` declares Astra's full `low, medium, high, xhigh, max` ladder with `defaultLevel: xhigh` as the worked provider ladder-override example. The override is keyed `gpt-6.2-astra`, the model id of the `astra` role. `ompRemovals.ts syncOmpModelRemovals` prunes the old `gpt-6-astra` block from `~/.omp/agent/models.yml` while it equals the shipped block. The temporary `anthropic.modelOverrides.claude-opus-5-5` block is gone, because the shared catalog now publishes the same limits, ladder, and prices. The removal switches omp from the block's `thinking.mode: effort` (a `budget_tokens` value per level from `ANTHROPIC_THINKING`, no effort value) to the catalog's `anthropic-adaptive` (adaptive thinking with the role's effort level); every kit Opus selector names its level, so the block's bare-selector `defaultLevel: high` is not needed. `ompRemovals.ts syncOmpModelRemovals, retired-block inventory` prunes it from `~/.omp/agent/models.yml` after the models merge, but only while the deployed block still equals the shipped one. `ompYaml.ts mergeOmpModels` preserves deployed-only keys in `~/.omp/agent/models.yml`, because a user file may carry provider credentials. Whole-file replacement is wrong.
73
- - `SoT/.omp/AGENTS.md` carries the rule `Please remove all mannered prose.` Anthropic's Fable 5.1 prompting guide documents mannered prose as a Fable 5.1 behavior and gives that sentence as its short-version fix: https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5-1
74
- - `cli/docs/omp-models.md` (topic `omp-models`) records the role map rationale and the Artificial Analysis snapshot behind it. Model choices change with published benchmarks, so update that topic in the same commit as a role change. For each model that an omp role or retry chain uses, the topic keeps AA rows at `high` and `xhigh` at least, with the index version and the capture date.
75
- - `SoT/.omp/config.yml` carries only keys whose value differs from the omp default. When a kit value equals the omp default, remove the key from the SoT. Add it with its shipped value to `ompRemovals.ts OMP_RETIRED_VALUES`, because `ompYaml.ts mergeOmpConfig` is additive and only that pass prunes the deployed copy. For example, the kit ships no `compaction.thresholdTokens`, and sync prunes a deployed `-1` and the former `231200` pin. `cli/docs/omp-context.md` (topic `omp-context`) carries the reserve-based derivation and the measured evidence, so update that topic in the same commit as any compaction-setting change.
76
- - Sync materializes the kit omp plugin `docks-kit-omp` from `SoT/.omp/plugin/` to `~/.docks-kit/omp-plugin` (`ompKitPlugin.ts syncKitPlugin`). It sets directories to 0700, files to 0600, and the `package.json` `version` to the kit version, and it removes stale files. It keeps no backups, because the directory is kit-owned. `ompPlugins.ts syncPlugins, kit plugin link` then runs `omp plugin link <dir>`. It skips the link when the `omp plugin list --json` npm row `docks-kit-omp` already has a `path` that resolves to that directory. `--skip-plugin-refresh` does not skip the link. The `hygiene.ts` extension registers `scratch_new`, `scratch_remove`, and `tidy_report`. It adds a reminder after each bash command that created a resource, and it checks at session stop that those resources are gone. At a main-session start, it claims `~/.cache/docks-kit/tidy.stamp.claim` and runs `docks-kit tidy --apply` in the background at most once per 12 hours. Every extension subprocess runs without a shell. The `pluginUpgrades.ts` extension reads the omp plugin upgrade log. In a tool result of each main session, it adds one reminder for the logged upgrades that the session did not get before. It names only the upgrades that finished after its omp process started. The reminder tells the agent to ask the user to run `/reload-plugins`. It then tells the agent to read each plugin skill again through `skill://` before it runs a skill script. It asks for a restart instead when an upgraded plugin ships hooks, extension modules, or non-MCP tools. omp imports extensions only at startup. An omp process that started before a sync deployed `pluginUpgrades.ts` did not load it, so its sessions get no reminder. The plugin also ships the `workspace-hygiene` skill, the `/cleanup` command, and six omp Time Traveling Stream Rules (TTSR, trigger rules) in `rules/`: `file-removal.md`, `git-safety.md`, `temp-and-background.md`, `worktree-location.md`, `literal-paths.md`, and `remote-cleanup.md`. omp's `omp-plugins` provider loads `rules/*.md` from the linked plugin root (`omp://plugin-manager-installer-plumbing.md`). Each rule has a regex `condition` scoped to `tool:bash, tool:eval` that aims at the wrong form; eval is in scope because eval code can run a shell command through `sh()`. A condition reads text, not a parsed command, so it has known false positives: a quoted command word (`echo "rm x"`, or a commit message that starts with `rm`) and eval code after the closing quote of a `sh()` string. `worktree-location.md` fires on each `git worktree add`, also at the correct path, because a condition cannot read `$XDG_DATA_HOME` or the home directory. omp aborts the matching tool call before it runs, injects the rule, and retries (`omp://ttsr-injection-lifecycle.md`). Each rule has `repeatMode: always`: it fires at each later wrong form, but not on the retry that its own reminder starts. The rules reach subagents and cost no prompt tokens until they fire. They teach the correct form; the `bash.patterns` denies still enforce. omp tests each condition on the partial argument buffer after each streamed delta, so a condition must not match a prefix of a correct command: it needs a delimiter after each token it checks, never the end anchor `$`. The buffer is the argument JSON text, the intent field `i` can come before or after `command`, and a provider can put JSON white space around the colon (`{"command": "ls"}`). So each condition starts its match with the forward key prefix `"(?:command|code)"\s*:\s*"[^"\\]*?` and an escape loop that takes up to 8 escape pairs per step; `cli/docs/command-guards.md` shows the full prefix. Only the key prefix is sure to stay inside the `command` or `code` string. The rest of a condition can cross the closing quote: the `Bun.file` condition of `file-removal.md` matches `{"code":"Bun.file(","i":").delete("}`. omp's `Matched:` excerpt is a bounded window around the match start: up to 60 characters before it, and a long match is cut at 180 characters from its start, so in a long call the trigger can be outside the excerpt. A scan stops at an unescaped `"` and at a newline (`\n`), a tab (`\t` in the buffer) counts as shell white space, and a scan that looks for an option stops at a ` -- ` word. omp runs each test on its main thread, in JavaScriptCore. Up to 0.22.29, each condition started with an unbounded lookbehind, which walked back over the buffer from every position. A 20 KB call then froze the session for seconds, and past the JavaScriptCore match limit the rule did not fire. So never start a condition with an unbounded lookbehind. Make each scan after a command start one lazy walk that stops at its first event: `(?=(?<w>[\s\S]*?)(?=EVENT)BOUNDARY)\k<w>`. The events are the flag of the condition, a terminator, the end of the run, and the next command start, each at a real token boundary. The lookahead does not backtrack after it matches, so the walk stays frozen. The stop at the next command start keeps a line that repeats a command start linear. Never put a group loop inside a lookaround over text of unbounded length, because JavaScriptCore then keeps each loop step until the match attempt ends and drops out of the JIT. omp tests open buffers that stop before the closing quote, so a scan must not rely on that quote to stop. `cli/test/unit/ompTriggerRules.test.ts` pins every condition through bash and through Python and JavaScript eval `sh()` calls, in the compact and the spaced JSON layouts, with some rows in the pretty layout and trigger words in the intent before and after the command. It checks that each condition has a wrong row that fires it and that each rule has `repeatMode: always`. Its shape guard checks only the key prefix and that no `|` stands outside every group. Its backstop runs `cli/test/lib/ompTriggerBackstop.ts` under Bun and proves linear time by measurement: a time budget, a fire check, scaling with the JIT off, and dense and head-and-run lines with the JIT on, in bash, open bash, and Python. Run `bunx vitest run cli/test/unit/ompTriggerRules.test.ts` after each condition change; it runs both guards. When you rewrite a condition, run the old and the new condition on each buffer of the test table and compare the results. `cli/docs/command-guards.md` (topic `command-guards`) lists the rules, the false positives, and the input families that a forward key prefix alone does not make linear. The plugin, the deployed rules, and the sweep call `docks-kit scratch` and `docks-kit tidy`. So a checkout sync must not run before the global `docks-kit` carries those commands.
77
- - `task.agentIdleTtlMs` is `120000`, so omp parks an idle subagent after 2 minutes instead of 7. `browser.idleCloseSec` is `600`.
78
- - By owner decision (0.21.0), resources on the workstation are always development, so `docks-kit tidy` sweeps them without a question. The omp `remote-cleanup.md` trigger rule, the `workspace-hygiene` skill, `/cleanup`, and the extension reminders limit the cleanup of a remote resource (reached through SSH, a database client, or a provider CLI such as `wrangler`, `vercel`, `kubectl`, `aws`, or a remote Docker host) to targets named local, development, dev, test, homolog, homologation, staging, or preview, the plan-lifecycle non-production definition. A production cleanup needs an `ask` immediately before it, must be rare, and a `yolo` invocation does not answer that ask. Prompt rules cannot force an agent to ask, so this rule has no `bash.patterns` guard.
79
- - The omp CLI is upstream-owned. It updates through `omp update`, or through the external manager that owns the install, such as Tern or Nix. `omp update` refuses to run on an install that an external manager owns. Sync never installs or upgrades the CLI.
80
- - omp plugin upgrade flow, the `pi-intercom` install, and the `docks-kit omp` free-model launcher: `cli/AGENTS.md`.
81
-
82
- For the omp SoT layout (`SoT/.omp/`), see that directory.
43
+ SoT notes (the shared prompt authorization, the omp deploy targets, the config and model merges, the retired inventories, the role map, the kit plugin sync, and the cleanup scope): `cli/AGENTS.md` (`### SoT notes`).
83
44
 
84
45
  ## Engineering rules
85
46
 
86
- - **EngineNative and CLI rules** (idempotency, failure ledger, removed bash engine, Effect stack and skill routing, harness-selection store, module boundaries): `cli/AGENTS.md`.
87
- - **Targeted syncs.** `./docks-kit sync` accepts positional targets: `agents` and `omp`. Use the narrowest target that matches the SoT change (for example, `./docks-kit sync omp` for omp-only config edits); targets can be combined with `--dry-run`, `--skip-plugin-refresh` (install missing omp plugins without refreshing existing ones), `--prune`, and `--verbose`.
88
- - **Additive by default.** Keys present in deployed config but absent from SoT are preserved on default sync. This protects user-only additions, but means drift accumulates. The exceptions are the omp retired inventories: `ompRemovals.ts` force-prunes retired kit-owned keys, `bash.patterns` rules, and model blocks on every sync (see the omp SoT notes above).
89
- - **`--prune` is the one kit-owned removal flag.** It removes the `~/.agents/skills/*` entries named in `~/.agents/.kit-owned-skills` that SoT no longer lists. A slug enters that record only when an install of the kit created its directory, so a directory that existed before is never recorded. `--prune` removes it only while the directory keeps the `<dev>:<ino>` that the record names; else it prints `keep <slug>: the directory is not the one that the kit installed`. The legacy `~/.agents/.kit-managed-skills` of an older kit is read only and never authorizes a removal. `--prune` prints a `keep <slug>` line for each of its dropped slugs whose directory exists. Manually installed skills are always preserved.
47
+ - **EngineNative and CLI rules** (idempotency, failure ledger, removed bash engine, Effect stack and skill routing, kit store, module boundaries): `cli/AGENTS.md`.
48
+ - **One sync.** `./docks-kit sync` deploys the omp SoT and takes no positional target. Combine it with `--dry-run`, `--skip-plugin-refresh` (install missing omp plugins without refreshing existing ones), and `--verbose`.
49
+ - **Additive by default.** Keys present in deployed config but absent from SoT are preserved on default sync. This protects user-only additions, but means drift accumulates. The exceptions are the omp retired inventories: `ompRemovals.ts` force-prunes retired kit-owned keys, `bash.patterns` rules, and model blocks on every sync (see the omp SoT notes in `cli/AGENTS.md`). Sync has no removal flag.
90
50
  - **Small, reviewable changes.** Bundled multi-concern PRs are harder to review and revert. Split an engine/CLI change and a per-tool config change unless the change requires atomicity.
91
51
  - **Version bumps.** Bump `package.json` on user-visible behavior change; bump a `SoT/toolchain.json` `verified` pin only after testing that release. Refactors, splits, and doc edits bump nothing.
92
52
  - **Regenerate the payload.** After `SoT/` or `package.json` changes, run `bun cli/scripts/generate-sot-payload.ts`; `bun run check:generated` verifies it. After file moves, clamp cited `metadata.source_files[].lines` ranges so `skillMetadata.test.ts` passes.
93
- - **Dry-run before destructive flags.** Always preview with `./docks-kit sync --prune --dry-run`, with the same targets as the intended run, before invoking `--prune`. Only that preview lists the kit-recorded skills that SoT no longer lists, which `--prune` removes.
53
+ - **Dry-run before a real sync.** Preview a change to the omp SoT with `./docks-kit sync --dry-run` before you run `./docks-kit sync`.
94
54
  - **SoT prompt files are rules, not explanation.** `SoT/.omp/AGENTS.md` is loaded into agent sessions' prompt context — every line costs prompt tokens on every turn for every user. Restrict its content to rules, heuristics, and `<constraint>` blocks the agent must *act on* during a turn. Do NOT add inline source citations (`Source: …`, attributed quotes), "why this rule exists" preface text, version-watermarking trivia (e.g. "Distilled from X v2.0, captured 2025-11-07"), per-bug workarounds, or installation instructions. Provenance, motivation, and historical context belong in `AGENTS.md` (humans read once) or in commit messages — never in the SoT. For every line, apply the official test: …
95
55
  - **Cache-invariance for kit-authored prompt surfaces.** Never put timestamps, counters, or mutable state into SoT prompt files, extension output that lands in the cached prefix, or tool definitions — cache breaks force cold-start writes. Dynamic context belongs in runtime-injected messages, such as the reminders that the kit omp plugin adds to tool results.
96
56
 
@@ -103,8 +63,8 @@ For the omp SoT layout (`SoT/.omp/`), see that directory.
103
63
 
104
64
  - No secrets in SoT. The kit's SoT directories are committed; treat them as declarative config only.
105
65
  - Treat external plugin marketplaces and installer downloads as untrusted input. Prefer download-then-run over `curl … | bash` so a truncated stream cannot execute a partial script.
106
- - **Pin, never float.** Every kit-driven install of third-party software is pinned to a `SoT/toolchain.json` `verified` version, except the exemptions in the next item — no `@latest` npm/bun installs (Shai-Hulud-class worm surface), no mutable action tags in workflows (commit SHAs only), installer scripts fetched from version tags where upstream supports it. New third-party install surface ⇒ manifest pin first. The rule also covers a transitive dependency whose declared range is a caret or tilde over a prerelease: `^4.0.0-rc.109` admits every later prerelease of the same version tuple, and a published install resolves that range fresh because `bun.lock` is not packaged, so a runtime pinned in `package.json` meets a newer sibling and the process fails at startup. The fix is an exact root pin plus both guards: the offline `cli/test/unit/dependencyPins.test.ts` and the clean-room `bun run smoke:package`. Moving the Effect release is therefore one lockstep commit: set `effect`, `@effect/platform-bun`, and `@effect/platform-node-shared` to the same version together, then run `bun run smoke:package`. The offline guard fails when a lag breaks a declared range. Its peer-range check fails when the installed `effect` is outside a non-optional peer range of the runtime closure. Its nested-copy check fails when `@effect/platform-node-shared` lags. A lagging `@effect/platform-bun` can keep every declared range satisfied (4.1.1 accepts `@effect/platform-node-shared` `^4.1.1`), so only the lockstep commit keeps it in step. Details: the `toolchain-context` skill and `cli/docs/toolchain.md`.
107
- - **Exemptions: the kit's own package and the existing marketplace plugins.** `install.sh` and `install.ps1` end with `bun add -g docks-kit@latest`, because a global installer that pinned itself would install a fixed old kit forever, and pinning it to `package.json` would request an unpublished version between the release-prep commit and the npm publish. The `@latest` exemption covers `docks-kit` alone. Both installers still pin the Bun installer they download to the manifest's verified version. `cli/test/unit/hostTargets.test.ts` asserts that pin in all four launcher and installer scripts, and `cli/test/unit/install.test.ts` proves `install.sh` passes it to the Bun installer. The existing omp marketplace plugin installs have no manifest pin: sync installs and refreshes those plugins at the version that their marketplace publishes. Any new install surface, a new marketplace or plugin source included, still needs a manifest pin first.
66
+ - **Pin, never float.** Every kit-driven install of third-party software is pinned to a `SoT/toolchain.json` `verified` version, except the exemption in the next item — no `@latest` npm/bun installs (Shai-Hulud-class worm surface), no mutable action tags in workflows (commit SHAs only), installer scripts fetched from version tags where upstream supports it. New third-party install surface ⇒ manifest pin first. The rule also covers a transitive dependency whose declared range is a caret or tilde over a prerelease: `^4.0.0-rc.109` admits every later prerelease of the same version tuple, and a published install resolves that range fresh because `bun.lock` is not packaged, so a runtime pinned in `package.json` meets a newer sibling and the process fails at startup. The fix is an exact root pin plus both guards: the offline `cli/test/unit/dependencyPins.test.ts` and the clean-room `bun run smoke:package`. Moving the Effect release is therefore one lockstep commit: set `effect`, `@effect/platform-bun`, and `@effect/platform-node-shared` to the same version together, then run `bun run smoke:package`. The offline guard fails when a lag breaks a declared range. Its peer-range check fails when the installed `effect` is outside a non-optional peer range of the runtime closure. Its nested-copy check fails when `@effect/platform-node-shared` lags. A lagging `@effect/platform-bun` can keep every declared range satisfied (4.1.1 accepts `@effect/platform-node-shared` `^4.1.1`), so only the lockstep commit keeps it in step. Details: the `toolchain-context` skill and `cli/docs/toolchain.md`.
67
+ - **Exemption: the kit's own package.** `install.sh` and `install.ps1` end with `bun add -g docks-kit@latest`, because a global installer that pinned itself would install a fixed old kit forever, and pinning it to `package.json` would request an unpublished version between the release-prep commit and the npm publish. The `@latest` exemption covers `docks-kit` alone. Both installers still pin the Bun installer they download to the manifest's verified version. `cli/test/unit/hostTargets.test.ts` asserts that pin in all four launcher and installer scripts, and `cli/test/unit/install.test.ts` proves `install.sh` passes it to the Bun installer. Any new install surface, a new marketplace or plugin source included, needs a manifest pin first.
108
68
  ## Testing
109
69
 
110
70
  Run `bun run check` before and after each change: oxlint, `lint:effect` (Effect rules through `effect-tsgo diagnostics --strict`), `bun fmt --check`, `bun check`, the generated-payload check (`check:generated`), unit tests, and both golden suites. Scripts: `lint`, `lint:effect`, `format:check`, `typecheck`, `check:generated`, `test:unit`, `test:integration` (goldens), `test`, `format`; CI runs `check` on pushes to `main` and on pull requests with Bun 1.4.4. Prove-red modes must exit non-zero after detecting planted mismatches. The golden writer emits two-space JSON that `bun fmt` re-serializes, so run `bun run format` after `--update-goldens` or `format:check` fails. For Effect diagnostics in the editor, set the TypeScript language server command to `node_modules/.bin/effect-tsgo tsc --lsp --stdio`. Keep the `@effect/language-service` plugin entry in `cli/tsconfig.json`: without it, `lint:effect` checks no file and passes. Also verify user-facing changes via `./docks-kit sync --dry-run` and `bun run smoke:native`.
@@ -123,89 +83,16 @@ Never rewrite published `main` history to correct a routing mistake. Use a follo
123
83
 
124
84
  Project-skill authoring rules (scope, canonical layout, vendored `unslop`, citation constraint): `.agents/skills/AGENTS.md`.
125
85
 
126
- **Universal-skill bootstrap.** `SoT/.agents/skills.txt` is intentionally empty, so the default sync exposes no universal skills. The generic opt-in contract remains: each [agentskills.io](https://agentskills.io/specification) slug is installed by `skillsInstall.ts syncUniversal` with `npx --yes skills@<verified> add <slug> -g -y -a claude-code codex`, where `<verified>` is the `skills-cli` pin in `SoT/toolchain.json`. The slug comes first because `-a/--agent` is variadic; naming both supported agents preserves the canonical `~/.agents/skills/<name>/SKILL.md` plus Claude's `~/.claude/skills/<name>` symlink. Existing canonical directories are reused idempotently and are never recorded as kit-owned. When no record names a reused directory, sync warns that `--prune` keeps it. Before an install, sync records the slug in `~/.agents/.kit-pending-skills`, and only when the canonical directory does not exist. After the install, the slug moves to `~/.agents/.kit-owned-skills` when its directory exists. `--prune` removes only entries in `~/.agents/.kit-owned-skills`; the legacy `~/.agents/.kit-managed-skills` is read only and never authorizes a removal (`skillsRecords.ts`).
86
+ **Vendored `unslop`.** The kit never runs the skills CLI. Only a maintainer refreshes the vendored `.agents/skills/unslop/` copy, with `npx skills@1.7.0 add cursor/plugins -s unslop -y -a universal`. The skills CLI 1.7.0 installs the `universal` agent into the project path `.agents/skills/`, which omp reads.
87
+
88
+ ## Kit plugin content
89
+
90
+ `SoT/.omp/plugin/` holds skills at `skills/<name>/SKILL.md`, task agents at `agents/<name>.md`, and the extensions that `package.json` `omp.extensions` names. It ships the 32 docks and plan-lifecycle skills, the `workspace-hygiene` skill, the `code-reviewer` and `plan-reviewer` agents, the `hygiene`, `verify-gate`, and `context-tree-nudge` extensions, the trigger rules in `rules/`, and the `/cleanup` command. A skill reports a problem in DocksDocks/public. `bun run check` checks this content with four tests in `cli/test/unit/plugin/`: `skills.test.ts` (layout and name, frontmatter, report section, shared copies, references, durable anchors, transform guard, trigger collisions, score floor), `contentHash.test.ts`, `agents.test.ts` (agent rules, score floor), and `extensions.test.ts` (each entry imports and has a default function export).
91
+ After a skill edit, run `bun cli/scripts/skill-content-hash.ts --write` to refresh its `metadata.content_hash` and `metadata.updated`; `--check` names each stale skill. The check code and its data (floors, report section, shared-copy groups, transform list) are in `cli/scripts/pluginContent/`.
127
92
 
128
93
  ## Plans
129
94
 
130
- Use direct implementation for one clear, reversible, low-risk local diff with one
131
- bounded acceptance path; it creates no plan issue, reviewer, or automatic
132
- commit. Use a canonical plan for explicit planning, multi-commit or
133
- cross-repository work, cold handoff, an unresolved decision, a cross-subsystem or
134
- public-contract change, security-sensitive or destructive work, or any
135
- non-`local` effect.
136
-
137
- <constraint>
138
- The plan record is a GitHub issue. Its body starts with
139
- `<!-- plan-contract: v4 -->`, followed by one blank line and seven `##`
140
- sections. It has no frontmatter. GitHub owns the title, open-work phase, owner,
141
- timestamps, and completion. The repository tracks no plan markdown.
142
- Three skills own the workflow. `plan-workspace` maintains the workspace.
143
- Main-context `plan-manager` runs six phases: decide, draft, research, plan
144
- review, implement, and code review. It uses bounded repair and fresh re-review
145
- in both review phases, then archives. Internal `plan-reviewer` returns one
146
- readable pre-implementation verdict block per round. Two read-only reviewer
147
- wrappers ship: `plan-reviewer` and `code-reviewer`.
148
- The explicit-only `yolo` skill runs the same workflow. It still asks before merge, on a review stall, before a production cleanup, and before a step after the landing merge, as the contract's Yolo runs section says.
149
- </constraint>
150
-
151
- After the marker and blank line, the record carries exactly seven sections.
152
- They appear once each in this order: `## Goal`, `## Research`, `## Steps`,
153
- `## Acceptance`, `## Do not touch`, `## Open questions`, and
154
- `## Verification Results`. `## Goal` carries exactly one mode line.
155
- Open-work phase is `drafting`, `planned`, `ongoing`, or `blocked`.
156
- Every plan carries `plan`. A `plan:<phase>` label stores the open phase.
157
- A blocked plan starts `## Open questions` with `Blocked: <one-line reason>`.
158
- GitHub `state` and `stateReason` determine closed status. Review records live
159
- only in issue comments. Each reviewer returns one markdown block.
160
- The manager posts that block as one issue comment. The latest trusted eligible
161
- comment per review kind wins. Its author must equal the plan's sole assignee.
162
- Both review phases use fresh inputs for each round. They stop on
163
- pass. Ask the user to continue or block when a round makes no progress, the
164
- same finding returns after a repair, round 5 does not pass, or dispatch fails
165
- again without a relevant change. If no answer is available, record the reason
166
- and block. A yolo run uses the round ceiling of the contract's Yolo runs
167
- section instead.
168
- A plan-review `blocked` verdict routes its user-only decision through
169
- `## Open questions` and `ask`.
170
-
171
- The record carries no hash, permit, run identity, lock, or bundle, and the
172
- `plan.mjs` shipped inside the installed `plan-lifecycle` plugin is the only
173
- lifecycle tool. An `export` writes the sha256 of the body it copied beside the
174
- copy so a stale copy cannot revert the record; that digest detects staleness and
175
- authorizes nothing. Routine plan issue publication, implement-start linked
176
- branch creation, commits, normal pushes, and the closing pull request carry the
177
- settled mode's authorization and need no repeated prompt. Before any branch
178
- checkout, including `gh issue develop --checkout`, require
179
- `git status --porcelain` to be empty. If it is dirty, never stash, move, or
180
- commit ambient work; set the plan `blocked` and name the dirty paths, or use an
181
- authorized clean worktree.
182
- Immediately after setting the plan `ongoing`, every `gh issue develop` call uses
183
- `--repo`; the manager reuses a linked branch or creates one with
184
- `--base <default> --checkout`, then re-lists and recovers after failure.
185
- Implementation stops when no linked branch can be verified; there is no local
186
- fallback. After the checks policy passes, the manager asks immediately before
187
- merge. Without a fresh `Merge now` answer, it leaves the pull request and issue
188
- open. `plan.mjs archive` verifies the latest trusted code-review result and
189
- merged closing pull request after landing.
190
-
191
- Every Steps row carries an `Effect` of exactly
192
- `local|probe|production_access|publish|push|release|deploy`. A step whose
193
- `Effect` is not `local` requires an in-session `ask` confirmation immediately
194
- before it runs; when `ask` is unavailable the step is set `blocked` and the plan
195
- reason becomes the first `## Open questions` line, `Blocked: <reason>`.
196
- Persisted effects record intent only. Routine issue publication and landing
197
- actions are outside the Steps table.
198
- A user-invoked `yolo` run replaces these asks, the continue-or-block question of the review loop, and the `blocked`-verdict question with the Yolo runs section of the installed `plan-lifecycle` contract.
199
-
200
- Render a plan body verbatim only when the user names that plan and asks to see it. After a write, report the one-line header strip and the changed lines only; a write never re-renders the body.
201
-
202
- No plan markdown is tracked. The pre-GitHub records under
203
- `docs/plans/finished/` were deleted; `git log -- docs/plans/finished/` recovers
204
- them as history, and no lifecycle command restores them. The complete contract
205
- lives in `docs/PLAN.md`; `docs/AGENTS.md` routes to it.
206
-
207
- Plugin-internal work (skills, commands, agents) belongs in each plugin's
208
- own repo, not here.
95
+ Read `docs/PLAN.md` before plan work; `docs/AGENTS.md` holds the docs-folder rules. The canonical contract is `skill://plan-manager/references/plan-contract.md` in the docks-kit kit plugin. Use `plan-workspace` for setup, main-context `plan-manager` for the six phases, and read-only `plan-reviewer` and `code-reviewer` wrappers for review. Use direct implementation only for a clear, reversible, low-risk local diff with one bounded acceptance path. Otherwise follow the plan-manager decision. Plan issues are the live records. Leave `docs/plans/finished/` frozen.
209
96
 
210
97
  ## Notes for nested overrides
211
98
 
@@ -217,12 +104,9 @@ Per the agents.md open standard, place an `AGENTS.md` inside any subdirectory th
217
104
  # Clone and sync the kit
218
105
  git clone <this-repo> ~/projects/public
219
106
  cd ~/projects/public
220
- ./docks-kit harnesses # view or change this machine's flag-less sync selection
221
- ./docks-kit sync # sync this machine's harness selection (additive)
222
107
  ./docks-kit sync --dry-run # preview before applying
223
- ./docks-kit sync --prune # remove kit-recorded universal skills that SoT no longer lists
108
+ ./docks-kit sync # deploy the omp SoT (additive)
224
109
  ./docks-kit toolchain check # verify installed tools against SoT/toolchain.json floors
225
110
  ```
226
111
 
227
- On Windows, replace `./docks-kit` with `.\docks-kit.ps1` in these checkout
228
- commands.
112
+ On Windows, replace `./docks-kit` with `.\docks-kit.ps1` in these checkout commands.
package/README.md CHANGED
@@ -1,21 +1,20 @@
1
1
  # docks-kit
2
2
 
3
- Portable configuration kit for AI coding agents. Per-tool **Single Source of
4
- Truth (SoT)** directories deploy to each tool's user-config location. Clone
5
- once to get a consistent AI-assisted environment on supported Linux, macOS,
6
- and Windows machines. Tuned for **token efficiency without sacrificing quality**.
3
+ Portable configuration kit for AI coding agents. The **Single Source of
4
+ Truth (SoT)** directory `SoT/.omp/` deploys to the omp user-config location.
5
+ Clone once to get a consistent AI-assisted environment on supported Linux,
6
+ macOS, and Windows machines. Tuned for **token efficiency without sacrificing
7
+ quality**.
7
8
 
8
9
  Supported harness: **Oh My Pi (`omp`)**.
9
- The kit also deploys [agentskills.io](https://agentskills.io) universal skills.
10
10
 
11
11
  ## Quick start
12
12
 
13
13
  ```bash
14
14
  git clone https://github.com/DocksDocks/public.git ~/projects/public
15
15
  cd ~/projects/public
16
- ./docks-kit harnesses # choose this machine's flag-less sync harnesses
17
- ./docks-kit sync # deploy this machine's harness selection
18
- ./docks-kit sync omp # deploy omp explicitly
16
+ ./docks-kit sync # deploy the omp SoT
17
+ ./docks-kit sync --dry-run # preview the sync without a write
19
18
  ./docks-kit toolchain # doctor view: verified-version floors for external tools
20
19
  ```
21
20
 
@@ -35,7 +34,7 @@ Download the platform release binary from GitHub Releases and run it directly.
35
34
  The executable carries the generated sync payload; no checkout or adjacent
36
35
  `SoT/` directory is required.
37
36
 
38
- Source and global installs require Bun. npm-global tools require Node/npm.
37
+ Source and global installs require Bun. An npm-global install needs npm.
39
38
  `jq` is optional doctor/test tooling. `curl` is needed only to download Bun's
40
39
  upstream installer when Bun is absent: by the POSIX launcher and installer, and
41
40
  by sync's Bun bootstrap, which a release binary can also run. The Windows
@@ -44,13 +43,11 @@ launcher and installer use Invoke-WebRequest.
44
43
  ## CLI
45
44
 
46
45
  ```text
47
- docks-kit sync [agents] [omp] deploy explicit targets or the machine selection
48
- docks-kit harnesses view or change this machine's selection
46
+ docks-kit sync [--dry-run] deploy the omp SoT to this machine
49
47
  docks-kit update [--no-sync] self-update the kit (autodetects checkout vs global install), then sync
50
48
  docks-kit omp [--model <m>|--pick] [args...] one omp session on a free model, nothing deployed changes
51
49
  docks-kit omp --fast toggle omp fast mode for OpenAI/Codex models, then exit
52
50
  docks-kit toolchain [check|ensure <tool>|outdated] verified-version floors for external tools
53
- docks-kit skills list [--json] universal skills vs manifest
54
51
  docks-kit scratch new|remove agent temporary files and directories
55
52
  docks-kit tidy [--apply] [--report] remove safe agent leftovers
56
53
  docks-kit docs [topic] self-documentation (9 topics)
@@ -75,21 +72,15 @@ here.
75
72
  | Flag | Effect |
76
73
  |------|--------|
77
74
  | `--dry-run` | Preview without applying |
78
- | `--prune` | Remove kit-managed universal skills not in `SoT/.agents/skills.txt` |
79
75
  | `--skip-plugin-refresh` | Install missing omp plugins but skip refresh-only updates |
80
76
  | `--verbose` | Also print no-op confirmations |
81
77
 
82
- Full reference: `docks-kit docs flags` (includes the old→new rename table for
83
- the pre-CLI `sync.sh` flags).
78
+ Full reference: `docks-kit docs flags`.
84
79
 
85
80
  ## How syncing works
86
81
 
87
- - **Additive by default** — user-only settings keys, plugins, and skills
88
- survive a plain sync. Removing kit-managed universal skills that left the
89
- SoT is explicit (`--prune`).
90
- - **Per-machine selection** — `~/.docks-kit/kit.db` drives a flag-less sync.
91
- A missing selection selects universal skills and omp. Use
92
- `docks-kit harnesses` to view or change the selection.
82
+ - **Additive by default** — user-only settings keys and plugins survive a
83
+ plain sync.
93
84
  - **Idempotent** — every step is safe to re-run; no-change syncs are no-ops.
94
85
  - **Toolchain floors** — `SoT/toolchain.json` records the kit-verified version
95
86
  floors for external tools (bun, omp, …). `docks-kit toolchain check` prints
@@ -111,19 +102,43 @@ the pre-CLI `sync.sh` flags).
111
102
  omp plugin `docks-kit-omp` exposes these as tools, reminds the agent of
112
103
  what it created, and runs the sweep at most once per 12 hours.
113
104
 
105
+ ## Kit plugin
106
+
107
+ Sync writes the kit plugin `docks-kit-omp` to `~/.docks-kit/omp-plugin` and
108
+ links it into omp. The kit plugin content comes from `SoT/.omp/plugin/`:
109
+
110
+ - **Skills** — the 32 docks and plan-lifecycle skills, for example
111
+ `plan-manager`, `plan-workspace`, `code-review`, `security`, and
112
+ `refactor`, plus the `workspace-hygiene` skill.
113
+ - **Agents** — the `code-reviewer` and `plan-reviewer` task agents.
114
+ - **Extensions** — `verify-gate` checks that each `git commit` carries a
115
+ `Verified:` trailer, `context-tree-nudge` names the context-tree node of
116
+ each edited file, and `hygiene` gives the agent cleanup tools and
117
+ reminders.
118
+ - **Rules and commands** — six trigger rules that teach the safe form of a
119
+ risky command, and the `/cleanup` command.
120
+
121
+ The kit plugin replaces the former `docks` and `plan-lifecycle` plugins of
122
+ the `docks` marketplace. `docks-kit sync` uninstalls their user-scope installs
123
+ when it can read the omp plugin inventory, and then removes the `docks`
124
+ marketplace when no uninstall failed and it can read the marketplace registry.
125
+ It only warns about a project-scope install, with the manual command. When a
126
+ read fails, sync warns and skips that step, and a later sync tries again.
127
+ Report a problem with a skill, an agent, or the kit in
128
+ [DocksDocks/public](https://github.com/DocksDocks/public/issues).
129
+
114
130
  ## Repository map
115
131
 
116
132
  | Path | Purpose |
117
133
  |------|---------|
118
134
  | `SoT/.omp/` | omp SoT (AGENTS.md, config.yml, models.yml, mcp.json, intercom.json, and the `plugin/` source of `docks-kit-omp`) |
119
- | `SoT/.agents/` | Universal-skill manifest |
120
135
  | `SoT/toolchain.json` | Verified-version floors |
121
136
  | `cli/src/engine-native/` | EngineNative sync/toolchain implementation |
122
137
  | `cli/src/generated/sotPayload.ts` | Generated in-memory payload used by standalone and npm installs |
123
138
  | `cli/` | docks-kit CLI (Effect 4 on Bun) + bundled docs topics |
124
139
  | `docks-kit` / `docks-kit.ps1` | POSIX and Windows launchers (binary → Bun-from-source) |
125
140
  | `install.sh` / `install.ps1` | POSIX and Windows global installers |
126
- | `docs/PLAN.md` | Plan record standard; plans are GitHub issues |
141
+ | `docs/PLAN.md` | Plan pointer and project plan rules; plans are GitHub issues |
127
142
  | `AGENTS.md` | Agent-facing engineering rules |
128
143
 
129
144
  ## Platform support
@@ -313,9 +313,11 @@ Its shape guard checks only what a static check can prove. Each condition
313
313
  must start with the forward key prefix, and this rejects the leading
314
314
  lookbehind that froze omp. No `|` can stand outside every group, because the
315
315
  alternative after it needs no key prefix. The shape guard cannot prove
316
- linear time. The backstop proves it by measurement: the test runs
317
- `cli/test/lib/ompTriggerBackstop.ts` under Bun, because the unit tests run on
318
- V8, which does not show the JavaScriptCore cost. The backstop has these
316
+ linear time. The backstop tests the measured input families for linear
317
+ time: the test runs `cli/test/lib/ompTriggerBackstop.ts` under Bun, because
318
+ the unit tests run on V8, which does not show the JavaScriptCore cost. A
319
+ condition can still backtrack on a run that no generator holds, so a new
320
+ condition needs a new family when its shape is new. The backstop has these
319
321
  checks:
320
322
 
321
323
  - Time budget, with the regex JIT on: one pass of all conditions over a
package/cli/docs/flags.md CHANGED
@@ -3,29 +3,22 @@
3
3
  Convention: global flags are unprefixed; a flag that touches one tool's
4
4
  deployed config is `--<tool>-<setting>`.
5
5
 
6
- ## Targets (positional)
6
+ ## Sync
7
7
 
8
8
  ```
9
- docks-kit sync # stored harness selection
10
- docks-kit sync omp # one
11
- docks-kit sync agents omp # two
9
+ docks-kit sync # deploy the omp SoT
10
+ docks-kit sync --dry-run # preview it
12
11
  ```
13
12
 
14
- Positional targets are `agents` and `omp`. A flag-less `sync` deploys the
15
- per-machine harness selection stored in `~/.docks-kit/kit.db`. A missing
16
- selection or an unreadable store selects `agents` and `omp`. Choose the stored
17
- selection with `docks-kit harnesses`. With no stored selection, its picker
18
- pre-ticks both harnesses; a flag-less `sync` does not change until the picker
19
- saves a selection. In the picker, Enter or Space ticks or unticks the harness
20
- under the cursor, Enter on the Save row stores the selection, and Escape
21
- leaves it unchanged.
13
+ `sync` deploys the omp SoT and takes no positional argument. A word after
14
+ `sync`, such as `omp`, stops it with `Unexpected positional argument` and
15
+ exit 1.
22
16
 
23
17
  ## Global flags
24
18
 
25
19
  | Flag | Effect |
26
20
  |------|--------|
27
21
  | `--dry-run` | Preview without applying; takes no sync lock and no folder lock |
28
- | `--prune` | Remove the kit-managed universal skills that `~/.agents/.kit-owned-skills` names and SoT no longer lists |
29
22
  | `--skip-plugin-refresh` | Install missing omp plugins but skip refresh-only updates |
30
23
  | `--verbose` / `-v` | Also print no-op confirmations (already in sync, up to date, left as-is); accepted on `sync` and `toolchain` |
31
24
 
@@ -33,7 +26,6 @@ leaves it unchanged.
33
26
 
34
27
  | Variable | Effect |
35
28
  |----------|--------|
36
- | `DOCKS_KIT_SYNC_CONCURRENCY=1\|2\|3` | Maximum selected sync pipelines running at once. Default `3`; use `1` for serial golden/debug execution. Invalid values fail `sync` with exit 2 but do not affect `toolchain`. |
37
29
  | `DOCKS_KIT_SYNC_LOCK_WAIT_MS=<ms>` | Time that `sync` and `omp --fast` wait for another sync to release a sync lock. A non-negative safe integer in milliseconds (at most `9007199254740991`); unset or empty means `120000` (120 s). Any other value prints `DOCKS_KIT_SYNC_LOCK_WAIT_MS must be a non-negative safe integer` and exits 2. |
38
30
 
39
31
  ## Sync lock
@@ -45,12 +37,11 @@ runs never write the same files at once.
45
37
  (`DOCKS_KIT_SYNC_LOCK_WAIT_MS` changes the wait). It then prints
46
38
  `another docks-kit sync holds <path>; run sync again after it ends` and
47
39
  exits 1 with no change.
48
- - Two homes can share an agents folder (`AGENTS_DIR`) or an omp folder
49
- (`PI_CODING_AGENT_DIR`, `PI_CONFIG_DIR`, `XDG_DATA_HOME`, or a symlink). So a
50
- writing sync also holds `.docks-kit-sync-lock.db` inside each such folder
51
- that it writes. For `agents` this is the agents folder. For `omp` it is the
52
- omp agent folder, the intercom folder, and the omp data root. The held line
53
- then names that lock file.
40
+ - Two homes can share an omp folder (`PI_CODING_AGENT_DIR`, `PI_CONFIG_DIR`,
41
+ `XDG_DATA_HOME`, or a symlink). So a writing sync also holds
42
+ `.docks-kit-sync-lock.db` inside each such folder that it writes: the omp
43
+ agent folder, the intercom folder, and the omp data root. The held line then
44
+ names that lock file.
54
45
  - A writing sync creates a missing folder of this set just before it takes the
55
46
  lock of that folder, after the locks of its ancestors in the set. Each folder
56
47
  that it creates gets mode 0700. The lock step does not change the mode of an
@@ -132,12 +123,3 @@ forwarded `--model` stops the launcher with exit 2, also behind `--`.
132
123
  | `tidy --apply` | Take the lock `~/.cache/docks-kit/tidy-lock.db`, then plan, perform those actions, and append the outcomes to `~/.cache/docks-kit/tidy.log`; exit 1 when an action fails. When another run holds the lock, print only `another docks-kit tidy run holds <path>`, with no plan and no report, and exit 0. A dry run (`tidy` without `--apply`) and the `--report` sections take no lock |
133
124
  | `tidy --repo <path>` | Take the worktree candidates only from that repository, at any location |
134
125
  | `tidy --report` | After the plan, print read-only sections on memory, temporary directories, processes, Docker, caches, Trash, git, agent histories, scheduled jobs, and global installs |
135
-
136
- ## Renamed legacy flags (pre-CLI sync.sh)
137
-
138
- Old flags exit with a rename hint — there is no compat behavior.
139
-
140
- | Old | New |
141
- |-----|-----|
142
- | `--agents` / `--omp` | positional `agents` / `omp` |
143
- | `--remove-plugins` | `--prune` |
@@ -108,9 +108,10 @@ worktree and an upstream; `git pull --ff-only`, then re-runs
108
108
  `bun install --frozen-lockfile` when the pull changed `bun.lock` or
109
109
  `package.json`); a kit home under `node_modules` is a global package
110
110
  (`bun add -g` / `npm install -g docks-kit@latest`). The chained sync is a
111
- plain flag-less `docks-kit sync`. It refreshes plugin marketplaces and
112
- installed plugins even when the kit is already current. Pass `--no-sync`, then
113
- run `docks-kit sync --skip-plugin-refresh` to skip the refresh-only work.
111
+ plain flag-less `docks-kit sync`. It also refreshes plugins, even when the kit
112
+ is already current: it moves `pi-intercom` to its pinned version. Pass
113
+ `--no-sync`, then run `docks-kit sync --skip-plugin-refresh` to keep a present
114
+ `pi-intercom` at its installed version.
114
115
  A compiled binary inside a checkout updates the checkout; on the next invocation
115
116
  the launcher bypasses that now-stale binary and uses updated source until rebuilt.
116
117
  Every `docks-kit sync` except `--dry-run` also does a best-effort behind-upstream
@@ -159,7 +160,7 @@ sync/config reads.
159
160
  ## Prerequisites
160
161
 
161
162
  - Bun for source/global installs; release binaries embed the runtime
162
- - Node/npm for `npx` (the skills CLI) and for an npm-installed kit
163
+ - npm for an npm-installed kit
163
164
  - jq is optional doctor/test tooling; sync has no jq runtime dependency
164
165
  - curl is needed only to download Bun's upstream installer when Bun is absent:
165
166
  by the POSIX `docks-kit` launcher, by the POSIX `install.sh`, and by sync's