agents-handoff 0.0.0-stage → 2.0.3

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 (56) hide show
  1. package/CHANGELOG.md +192 -0
  2. package/LICENSE +21 -0
  3. package/README.md +150 -2
  4. package/SKILL.md +147 -0
  5. package/capability-registry.json +27 -0
  6. package/docs/ARCHITECTURE.md +187 -0
  7. package/docs/CHANGELOG.md +196 -0
  8. package/docs/CLI.md +299 -0
  9. package/docs/COMPATIBILITY.md +124 -0
  10. package/docs/CONTRIBUTING.md +134 -0
  11. package/docs/FORMAT.md +185 -0
  12. package/docs/INSTALL.md +394 -0
  13. package/docs/INTEGRATION.md +188 -0
  14. package/docs/LEVEL4.md +202 -0
  15. package/docs/LEVEL5.md +96 -0
  16. package/docs/PERMISSIONS.md +145 -0
  17. package/docs/PROVENANCE.md +110 -0
  18. package/docs/SECURITY.md +93 -0
  19. package/docs/SESSIONS.md +97 -0
  20. package/docs/TROUBLESHOOTING.md +158 -0
  21. package/docs/UNINSTALL.md +148 -0
  22. package/docs/UPGRADE.md +177 -0
  23. package/docs/_config.yml +18 -0
  24. package/docs/_data/nav.yml +36 -0
  25. package/docs/_layouts/default.html +31 -0
  26. package/docs/assets/style.css +88 -0
  27. package/docs/index.md +92 -0
  28. package/docs/sessions.json +34 -0
  29. package/handoff.config.example.json +35 -0
  30. package/handoff.config.schema.json +117 -0
  31. package/install/CHANGELOG.md +48 -0
  32. package/install/README.md +76 -0
  33. package/install/install.mjs +1455 -0
  34. package/install/package.json +39 -0
  35. package/package.json +66 -4
  36. package/permission-policy.json +33 -0
  37. package/refs/ADAPTERS.md +33 -0
  38. package/refs/bootstrap.md +59 -0
  39. package/refs/brief-checklist.md +79 -0
  40. package/refs/handbook.md +58 -0
  41. package/refs/protocol.md +117 -0
  42. package/refs/roles.md +75 -0
  43. package/refs/validator.md +73 -0
  44. package/schemas/handoff.schema.json +275 -0
  45. package/skill.json +147 -0
  46. package/templates/HANDOFF.llm.schema.json +144 -0
  47. package/templates/HANDOFF.template.md +40 -0
  48. package/tests/acceptance/acceptance.yaml +209 -0
  49. package/tests/fixtures/minimal-transcript.jsonl +2 -0
  50. package/tools/agent-handoff.mjs +22 -0
  51. package/tools/agents-handoff.mjs +410 -0
  52. package/tools/capability-registry.mjs +120 -0
  53. package/tools/handoff.mjs +398 -0
  54. package/tools/handoff.test.mjs +668 -0
  55. package/tools/lib/handoff-root.mjs +161 -0
  56. package/tools/runtime-engine.mjs +330 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,192 @@
1
+ # Changelog
2
+
3
+ All notable changes to agents-handoff are recorded here.
4
+
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
6
+ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Releases before 2.0.0
7
+ were development builds and were never published, so they are not listed.
8
+
9
+ The version in [package.json](https://github.com/Alot1z/agent-handoff/blob/main/package.json)
10
+ and [skill.json](https://github.com/Alot1z/agent-handoff/blob/main/skill.json) is the release
11
+ version, and it is the version published to npm: the repository root is the
12
+ [`agents-handoff`](https://www.npmjs.com/package/agents-handoff) package.
13
+
14
+ ## [Unreleased]
15
+
16
+ Add entries under the matching heading as changes land.
17
+
18
+ ## [2.0.3] - 2026-10-09
19
+
20
+ ### Added
21
+
22
+ - **Named harness targets.** One run can install the skill into Claude Code, Codex CLI and the
23
+ harness-neutral `~/.agents/skills` at once: `--claude`, `--codex`, `--agents`,
24
+ `--harness claude,codex` (repeatable), `--all` for every harness whose directory exists on
25
+ this machine, `--skills-dir <dir>` for any other stack, and `--project` for the
26
+ per-repository form. Every target gets its own copy and its own install record.
27
+ - **`verify-package`**, a verb that checks an installation against the package npm is actually
28
+ serving for its version: it verifies the downloaded tarball against the registry's own
29
+ `integrity` and `shasum`, compares the published file set with the installed one file by
30
+ file, and compares the tarball sha256 with the value recorded for that install. `--record`
31
+ stores the tarball hashes in the install record, so later runs compare with a stored value.
32
+ - The install record (`.agents-handoff-install.json`) now carries a `package` block — name,
33
+ version, registry, tarball URL, and the sha256/sha512/integrity/shasum filled in by
34
+ `verify-package` — so an installation can be checked against the published artifact rather
35
+ than only against itself.
36
+ - Installing from the repository without publishing: `npx github:Alot1z/agent-handoff` runs the
37
+ same installer straight from GitHub, and the installation guide documents both that and the
38
+ clone-and-run path.
39
+ - Five installer behaviour tests — multi-harness install with a record per target, `--update`
40
+ over every installation, `--verify` failing on a tampered copy, `remove` keeping user data,
41
+ and `verify-package` refusing a version npm does not serve. The suite is 34 tests.
42
+
43
+ ### Changed
44
+
45
+ - `--update` and `--verify` with no harness flag now act on **every** installation found on the
46
+ machine instead of the one resolved target. A machine holding the skill in `~/.claude/skills`
47
+ and in `~/.agents/skills` has two copies, and updating only the resolved one left the other
48
+ silently stale; both verbs print a per-target summary.
49
+ - The runtime layer's entry point is `tools/agents-handoff.mjs`, matching the product name.
50
+ `tools/agent-handoff.mjs` is installed alongside it as a forwarder, so notes and scripts that
51
+ name the old path keep working.
52
+
53
+ ### Fixed
54
+
55
+ - `remove` deleted anything that was not one of three expected directory names, which meant a
56
+ handoff store kept under any other name was destroyed by `remove --force`. Removal is now
57
+ driven by the install manifest — what an install owns is what it copied — and the run prints
58
+ the entries it deliberately kept, including the store and `handoff.config.json`.
59
+
60
+ ## [2.0.2] - 2026-10-09
61
+
62
+ ### Added
63
+
64
+ - **[Session index](https://alot1z.github.io/agent-handoff/SESSIONS.html)** (`docs/SESSIONS.md`):
65
+ a page rendered from a real handoff store, listing the captured sessions in
66
+ `examples/sessions/` with their project, harness, turn count, revision, manifest hash and
67
+ integrity verdict, plus the commands that reproduce each check. The sample store is built by
68
+ the engine from the two transcripts this repository ships, and
69
+ `.github/scripts/build-sessions-index.mjs --check` fails the build when the page and the store
70
+ disagree.
71
+ - The skill is published to npm as
72
+ [`agents-handoff`](https://www.npmjs.com/package/agents-handoff), from the repository root,
73
+ and the release workflow publishes it on a tag: it skips a version npm already has, and
74
+ reports — without failing the release — when `NPM_TOKEN` is not configured. The package
75
+ carries the skill tree, so `npx agents-handoff` installs with no download.
76
+ - `npm test`, `npm run check:docs` and `npm run check:session-index` are wired into
77
+ `prepublishOnly`, so a tree whose suite, links or session index are stale cannot be published.
78
+
79
+ ### Changed
80
+
81
+ - `npx agents-handoff` now installs the skill as documented. It previously looked for the skill
82
+ files beside itself, found none, and reported success while installing nothing; a bare copy of
83
+ `install/` still falls back to downloading the archive for the requested version.
84
+ - The clean-checkout suite builds its fixture from the shipped projection rather than the
85
+ development tree, which is what let the installer's broken source paths pass every local test.
86
+
87
+ ### Fixed
88
+
89
+ - The installer lost fourteen files whenever it ran outside the development tree: `README.md`,
90
+ `LICENSE` and the twelve guides were addressed under `repo-upstream/<path>`, a directory only
91
+ the development tree has. Sources are written in the shipped tree's terms and resolved against
92
+ both layouts, and an install that cannot resolve a source now fails with the missing paths
93
+ instead of warning and continuing.
94
+ - CI failed on every run: the runtime-layer smoke test ran `agents-handoff.mjs list`, which is not
95
+ a verb of that tool (it exits 2). The step builds a handoff into a scratch store and runs
96
+ `index`, a verb that exists.
97
+ - The shipped version disagreed across files: `SKILL.md` said 2.0.0 while `skill.json` and
98
+ `package.json` said 2.0.1, and the installer carried its own 2.0.0 constant, so every install
99
+ reported the previous version. `SKILL.md` is now the single source of truth, the installer
100
+ reads it, and the suite asserts the two agree.
101
+ - `install/package.json` pointed `repository` at a different repository from the one serving the
102
+ package; it now names this repository, with `homepage` and `bugs`.
103
+ - `handoff.config.schema.json` declared its `$id` under a path that does not serve the schema.
104
+ - `examples/demo/example-usage.md` addressed the engine as `../../../tools/handoff.mjs`, one
105
+ directory above the repository root, so every command in it failed when pasted.
106
+ - `tests/acceptance/acceptance.yaml` described the development tree: it listed documents that
107
+ are not published, scanned a directory that is not published, and asserted two behaviours the
108
+ shipped CLI does not have (`--help` exiting 0, `list` succeeding on an empty store). Every
109
+ entry was re-run against a clean checkout and now states what was observed.
110
+ - Documentation stopped describing files that are not published: `src/` was listed as part of an
111
+ installation in `INSTALL.md`, `UNINSTALL.md` and `UPGRADE.md`, and documented as a repository
112
+ directory in `CONTRIBUTING.md`.
113
+ - `ARCHITECTURE.md` claimed nothing in the repository makes a network call, which stopped being
114
+ true once the installer fetched archives.
115
+
116
+ ## [2.0.1] — 2026-10-09
117
+
118
+ Documentation release. No behaviour changed; no public interface changed.
119
+
120
+ ### Added
121
+
122
+ - **[Command reference](https://github.com/Alot1z/agent-handoff/blob/main/docs/CLI.md)**
123
+ (`docs/CLI.md`): every executable, verb, flag, exit code, environment variable and file
124
+ written, in one place.
125
+ - **[Architecture](https://github.com/Alot1z/agent-handoff/blob/main/docs/ARCHITECTURE.md)**
126
+ (`docs/ARCHITECTURE.md`): the five layers, the data flow, store-root resolution, the
127
+ write-safety discipline, and the boundaries the tool does not cross.
128
+ - **[Troubleshooting](https://github.com/Alot1z/agent-handoff/blob/main/docs/TROUBLESHOOTING.md)**
129
+ (`docs/TROUBLESHOOTING.md`): symptom, cause and fix, keyed to the real exit codes.
130
+ - This changelog, and a Changelog page on the site rendered from it, so the repository file
131
+ and the published page cannot drift apart.
132
+ - A docs-consistency check (`.github/scripts/check-docs.mjs`) run in CI: every page under
133
+ `docs/` must appear in the navigation, and every relative link must resolve where it is
134
+ read.
135
+
136
+ ### Changed
137
+
138
+ - README now links the published [installation guide](https://alot1z.github.io/agent-handoff/INSTALL.html)
139
+ and the [documentation site](https://alot1z.github.io/agent-handoff/) at the top, and its
140
+ documentation table covers every page.
141
+ - Links in `docs/` that pointed outside the published site are absolute URLs, so they resolve
142
+ for a reader of the documentation instead of returning 404.
143
+ - `package.json` homepage points at the documentation site.
144
+
145
+ ## [2.0.0] — 2026-10-08
146
+
147
+ The first public release: a capture engine, a runtime layer over it, an installer, and the
148
+ documentation site.
149
+
150
+ ### Added
151
+
152
+ - **Capture engine** (`tools/handoff.mjs`, published as the `agents-handoff` bin). `build`
153
+ reads a JSONL or plain-text transcript and writes a handoff directory:
154
+ `HANDOFF.md`, `HANDOFF.summary.json`, `HANDOFF.llm.json`, `timeline.jsonl`, `TOOLS.md`,
155
+ `manifest.json`. Also `list`, `show`, `verify`, `rename`, `retitle` and `config`.
156
+ - **Incremental builds.** Each build appends only the turns above the recorded `watermark`
157
+ and leaves `timeline.jsonl` untouched, so re-running over a longer transcript extends the
158
+ handoff instead of duplicating it. A rebuild with no new turns and an unchanged source hash
159
+ prints `handoff: up-to-date` and writes nothing.
160
+ - **sha256 provenance.** `manifest.json` carries `raw_sha256` over the source bytes and a
161
+ self-hash `manifest_sha256` over itself. `verify` recomputes the self-hash, checks the
162
+ `timeline.jsonl` line count against `turn_count`, and parses `HANDOFF.llm.json`.
163
+ - **Store-root resolution** (`tools/lib/handoff-root.mjs`): `HANDOFFS_ROOT`, then
164
+ `handoff.config.json` found by walking up, then a `handoffs/` directory on the same walk,
165
+ then the skill directory. Reported by `handoff.mjs config`.
166
+ - **Runtime layer** (`tools/agents-handoff.mjs`): `auto`, `verify-gate`, `promote`, `merge`,
167
+ `federated-merge`, `self-improve`, `index`. Every mutating command takes a lock, backs up
168
+ before writing, verifies after applying, and rolls back on failure.
169
+ - **Bounded execution** (`tools/runtime-engine.mjs`): risk classes `R0`–`R4` evaluated against
170
+ `permission-policy.json` before any operation runs, resumable jobs with sealed checkpoints,
171
+ and a per-decision record in the state directory.
172
+ - **Capability probes** (`tools/capability-registry.mjs`): `file-exists`, `dir-writable` and
173
+ `command` probes that report `healthy` / `unhealthy` / `unknown` with the evidence behind
174
+ each verdict.
175
+ - **Installer** (`install/`, package `agents-handoff`): `install`, `update`, `remove`,
176
+ `verify`, `list`, `where`, targeting a resolved global root, `./local/skills/agents-handoff`,
177
+ or `./skills/agents-handoff`.
178
+ - **Documentation site** at <https://alot1z.github.io/agent-handoff/>, built by GitHub Pages
179
+ from `docs/`.
180
+ - **CI** (`.github/workflows/ci.yml`): the test suite on Node 18, 20 and 22, a runtime-layer
181
+ smoke test, installer help, and a required-file and JSON-validity check.
182
+
183
+ ### Security
184
+
185
+ - The engine reads transcripts and writes handoff files. It makes no network calls, and it
186
+ never writes secrets. The limits of what the provenance chain proves are stated in
187
+ [docs/PROVENANCE.md](https://github.com/Alot1z/agent-handoff/blob/main/docs/PROVENANCE.md),
188
+ not implied.
189
+
190
+ [Unreleased]: https://github.com/Alot1z/agent-handoff/compare/v2.0.1...main
191
+ [2.0.1]: https://github.com/Alot1z/agent-handoff/compare/v2.0.0...v2.0.1
192
+ [2.0.0]: https://github.com/Alot1z/agent-handoff/tree/v2.0.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alot1z
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,151 @@
1
- # Temporary Holding Version
1
+ # agents-handoff
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **[Installation guide →](https://alot1z.github.io/agent-handoff/INSTALL.html)** · **[Documentation →](https://alot1z.github.io/agent-handoff/)** · **[Changelog](CHANGELOG.md)**
4
+
5
+ [![CI](https://github.com/Alot1z/agent-handoff/actions/workflows/ci.yml/badge.svg)](https://github.com/Alot1z/agent-handoff/actions/workflows/ci.yml)
6
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7
+ [![Node](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg)](#requirements)
8
+
9
+ One handoff format for every AI coding harness. A working session — messages, tool calls,
10
+ reasoning, and the provenance to prove where each byte came from — is captured as a folder
11
+ that a fresh agent can continue from with zero shared memory. Zero runtime dependencies,
12
+ Node.js 18 or newer, nothing read from the network at run time.
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ npx agents-handoff --all # every harness found on this machine, in one run
18
+ ```
19
+
20
+ That is the whole install. Choose your stack instead — one harness, several, or a skills
21
+ directory of your own:
22
+
23
+ | Command | Installs into |
24
+ |---|---|
25
+ | `npx agents-handoff --claude` | `~/.claude/skills` — Claude Code |
26
+ | `npx agents-handoff --codex` | `~/.codex/skills` — Codex CLI |
27
+ | `npx agents-handoff --agents` | `~/.agents/skills` — the harness-neutral store |
28
+ | `npx agents-handoff --harness claude,codex` | the named harnesses, in one run |
29
+ | `npx agents-handoff --project --claude` | `./.claude/skills` — this repository only |
30
+ | `npx agents-handoff --skills-dir <dir>` | any other stack, exactly |
31
+
32
+ Without a harness flag the installer resolves the global root rather than hard-coding one and
33
+ reports which it chose — `npx agents-handoff where` prints the same decision on its own.
34
+
35
+ ### Or straight from the repository
36
+
37
+ ```bash
38
+ npx github:Alot1z/agent-handoff --claude # run the installer from GitHub, no npm
39
+ ```
40
+
41
+ ```bash
42
+ git clone https://github.com/Alot1z/agent-handoff.git
43
+ cd agent-handoff
44
+ node install/install.mjs --all # the same installer, run from the tree
45
+ ```
46
+
47
+ ### Update it, and check it against the published package
48
+
49
+ ```bash
50
+ npx agents-handoff --update # every installation found, one run
51
+ npx agents-handoff --verify --provenance # every installation, against its own record
52
+ npx agents-handoff --verify-package --record # against the tarball npm is serving
53
+ npx agents-handoff --doctor # what is here, and is it intact
54
+ npx agents-handoff --remove # removes the skill; your store is kept
55
+ ```
56
+
57
+ Every install writes `.agents-handoff-install.json` beside the skill: a sha256 over the
58
+ installed file set, what it was installed from, and a `package` block naming the version it
59
+ should match. `verify` recomputes that hash and fails when a file changed, so an installation
60
+ is checkable rather than merely present; `verify-package` fetches the published tarball,
61
+ checks it against the registry's own integrity and shasum, and compares the installed files
62
+ with the package file by file — `--record` stores the tarball hashes in the install record.
63
+ `update` and `verify` with no harness flag act on **every** installation found, and `remove`
64
+ deletes only what the install manifest owns, printing what it kept, so a store survives under
65
+ any name. The resolution order, the location targets and the requirements are in the
66
+ **[installation guide](https://alot1z.github.io/agent-handoff/INSTALL.html)** and
67
+ [docs/INSTALL.md](docs/INSTALL.md).
68
+
69
+ ## Quick start
70
+
71
+ ```bash
72
+ # Capture a session
73
+ node tools/handoff.mjs build --source session.jsonl --harness claude-code --project my-project
74
+
75
+ # List, inspect and verify what you captured
76
+ node tools/handoff.mjs list
77
+ node tools/handoff.mjs show <id-prefix>
78
+ node tools/handoff.mjs verify <id-prefix>
79
+ ```
80
+
81
+ `build` is incremental: re-running it over a longer transcript merges past the recorded
82
+ watermark instead of creating a second handoff. `verify` exits non-zero when the manifest
83
+ hash, the timeline line count or the LLM payload no longer match what was written.
84
+
85
+ ## What a handoff folder contains
86
+
87
+ | File | Contents |
88
+ |---|---|
89
+ | `HANDOFF.md` | The brief a reader picks up cold: objective, current state, open loops, recent timeline |
90
+ | `HANDOFF.summary.json` | The same brief as structured fields |
91
+ | `HANDOFF.llm.json` | Payload shaped for a model to consume |
92
+ | `timeline.jsonl` | Every turn, one per line, appended and never paraphrased |
93
+ | `TOOLS.md` | The full tool-call log |
94
+ | `manifest.json` | Counts, classes, source paths, and the sha256 provenance chain |
95
+
96
+ The field-by-field contract is in [docs/FORMAT.md](docs/FORMAT.md).
97
+
98
+ ## Documentation
99
+
100
+ Full documentation is published at **<https://alot1z.github.io/agent-handoff/>**.
101
+
102
+ | Document | Covers |
103
+ |---|---|
104
+ | [docs/index.md](docs/index.md) | Start here: what the tool does and how the docs fit together |
105
+ | [docs/INSTALL.md](docs/INSTALL.md) · [site](https://alot1z.github.io/agent-handoff/INSTALL.html) | Install, locations, install options, troubleshooting |
106
+ | [docs/UPGRADE.md](docs/UPGRADE.md) | Updating an install, and what an update leaves alone |
107
+ | [docs/UNINSTALL.md](docs/UNINSTALL.md) | Removing an install, and what is kept |
108
+ | [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) | How the layers fit together, the data flow, and the boundaries |
109
+ | [docs/CLI.md](docs/CLI.md) | Every executable, verb, flag, exit code and state file |
110
+ | [docs/FORMAT.md](docs/FORMAT.md) | Handoff folder layout, manifest fields, provenance chain |
111
+ | [docs/SESSIONS.md](docs/SESSIONS.md) · [site](https://alot1z.github.io/agent-handoff/SESSIONS.html) | Session index: a sample store, its sessions, and the commands that verify them |
112
+ | [docs/INTEGRATION.md](docs/INTEGRATION.md) | Feeding a transcript in from another program or a CI job |
113
+ | [docs/LEVEL4.md](docs/LEVEL4.md) | The runtime layer: verbs, the evidence gate, bounded execution |
114
+ | [docs/LEVEL5.md](docs/LEVEL5.md) | Dispatching a verified handoff to a worker |
115
+ | [docs/PERMISSIONS.md](docs/PERMISSIONS.md) | Permission levels, risk classes, and what is enforced |
116
+ | [docs/SECURITY.md](docs/SECURITY.md) | What is read and written, and the guarantees that are not made |
117
+ | [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md) | Platforms, Node versions, transcript formats |
118
+ | [docs/PROVENANCE.md](docs/PROVENANCE.md) | The hash chain, what it detects, what it cannot |
119
+ | [docs/TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md) | Symptom, cause and fix, keyed to the real exit codes |
120
+ | [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md) | Running the tests and adding an adapter |
121
+ | [CHANGELOG.md](CHANGELOG.md) | What changed in each release |
122
+ | [refs/ADAPTERS.md](refs/ADAPTERS.md) | The canonical input shape and how each store maps onto it |
123
+
124
+ ## Repository layout
125
+
126
+ ```
127
+ tools/handoff.mjs capture engine (the CLI above)
128
+ tools/agents-handoff.mjs runtime layer: auto, verify-gate, promote, merge, self-improve, index, dispatch
129
+ tools/agent-handoff.mjs forwarder to the above, kept so older notes keep working
130
+ tools/runtime-engine.mjs bounded execution and the permission gate
131
+ tools/capability-registry.mjs capability health probes
132
+ tools/lib/ shared store-root resolution
133
+ docs/ refs/ templates/ documentation, reference material, output templates
134
+ schemas/ handoff payload and configuration schemas
135
+ install/ the installer behind the agents-handoff npx package
136
+ tests/ acceptance fixture and a minimal transcript
137
+ ```
138
+
139
+ ## Requirements
140
+
141
+ Node.js 18 or newer. No dependencies, no build step, no network access at runtime. See
142
+ [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md).
143
+
144
+ ## Contributing
145
+
146
+ Run the suite with `node tools/handoff.test.mjs`. It is hermetic — it writes to a scratch
147
+ directory and needs no network. See [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md).
148
+
149
+ ## License
150
+
151
+ MIT — see [LICENSE](LICENSE).
package/SKILL.md ADDED
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: agents-handoff
3
+ description: >-
4
+ Write, verify, and hand off complete AI working sessions across any harness
5
+ (Claude Code, Codex, DeepSeek Harness, plain JSONL or text logs). Captures a
6
+ session as a portable, sha256-proven handoff folder a fresh agent can continue
7
+ from with zero shared memory, with versioned contracts, an evidence gate, and
8
+ backup/verify/rollback on every write. Zero runtime dependencies, no network.
9
+ version: 2.0.3
10
+ domain: orchestration
11
+ tokens: 900
12
+ allowed-tools: Bash(node:*), Read, Edit, Write
13
+ ---
14
+
15
+ # Agent Handoff v2 — cross-harness session capture + verified continuation
16
+
17
+ ONE handoff system for every harness, every project, every model — backed by versioned
18
+ contracts, an evidence gate, and backup/verify/rollback on every write. Pick up any
19
+ conversation anywhere, with provenance for every artifact.
20
+
21
+ ## Level map (progressive disclosure)
22
+
23
+ | Level | When loaded | Token cost | Content |
24
+ |-------|-------------|-----------|---------|
25
+ | **L1 Metadata** | Always (frontmatter above) | ~100 | name + description |
26
+ | **L2 Instructions** | This file, when triggered | <5k | core workflow + commands below |
27
+ | **L3 Resources** | As needed | none until read | `docs/`, `templates/`, `refs/`, `tools/handoff.mjs` |
28
+ | **L4 Dynamic** | When you need runtime/self-adapting | none until run | `tools/agents-handoff.mjs`: auto, verify-gate, promote, merge, self-improve |
29
+ | **L5 Collaborative** | Verified handoff dispatches a worker | none until run | `tools/agents-handoff.mjs` dispatch + `docs/LEVEL5.md` |
30
+
31
+ ## What this skill is (capabilities + contracts)
32
+
33
+ 1. **Capture engine** (`tools/handoff.mjs`, zero deps) — builds
34
+ `projects/<project>/<session>/{HANDOFF.md, HANDOFF.summary.json, HANDOFF.llm.json,
35
+ timeline.jsonl, TOOLS.md, manifest.json}` with sha256 watermark-provenance; update-not-recreate.
36
+ 2. **Brief discipline** — lossless operational compression (10k-30k token briefs,
37
+ TASK / USER SPECIFICATION / CURRENT STATE / DONE / IN PROGRESS / PLANNED / FAILED / FILES /
38
+ VERIFICATION / ENVIRONMENT / NEXT / DO NOT), with length floors and a bootstrap text.
39
+ 3. **Evidence contract** — every handoff states RESULT/WHAT_CHANGED/VALIDATION/
40
+ EVIDENCE/BLOCKERS/RISKS/FOLLOW_UP; no evidence = no verified transition.
41
+ 4. **Write safety** — trigger on staleness, lock-guard, backup before write,
42
+ verify after write, rollback on failure, idempotent re-run.
43
+ 5. **Pipeline principles**:
44
+ - **Lossless raw**: rawInput/objective is verbatim, never replaced or paraphrased
45
+ (PromptIR rule). Matches handoff "objectives verbatim".
46
+ - **Versioned contracts**: every handoff artifact is a contract (schema v1, sha256);
47
+ re-run merges past watermark. No unversioned writes.
48
+ - **DecisionTrace**: record route/selection stages + provenance on every handoff
49
+ (stages: capture → brief → verify.gate → promote → dispatch).
50
+ - **Evidence-gated completion (ORC-1)**: state transitions only on evidence;
51
+ a worker-DONE is never a verified transition. verify.gate runs before promote/dispatch.
52
+ - **ContextPlan buckets (CTX-1)**: in the brief, classify context as required |
53
+ historical | authoritative | retrievable | sensitive | deferred with budget caps.
54
+ - **EVIDENCE_LEVELS ladder (KNOW-1)**: VERIFIED > OBSERVED > DERIVED > PREDICTED > UNKNOWN;
55
+ never silently upgrade; supersede rather than stack.
56
+ - **Autonomy ladder (CTL-1)**: observe → suggest → request-approval → constrained-execute →
57
+ workflow-execute → autonomous-within-policy. Handoff writes default to constrained-execute;
58
+ dispatch default dry-run.
59
+ - **Honesty rule (FINAL-1)**: oracle registry + success-criteria evaluator; RESULT is
60
+ DONE|PARTIAL|BLOCKED|FAILED — never fabricated.
61
+
62
+ ## Doctrine (unchanged + corpus-backed)
63
+
64
+ 1. Prompts are advisory; validators are authoritative. Fail closed on ambiguity (BLOCKED).
65
+ 2. Portability over compression: fidelity lives verbatim in the fileset (TOOLS.md, timeline.jsonl,
66
+ HANDOFF.llm.json); briefs reference by pointer.
67
+ 3. Downgrade unverified claims to their true evidence level — never upgrade.
68
+ 4. Handoff is prior knowledge, not ground truth: re-verify against the cheapest available
69
+ oracle, and keep instructions self-contained so a fresh agent can act cold.
70
+ 5. Max-local: every engine here runs with zero network deps; harness adapters are
71
+ probe-absent-safe (Claude Code, Codex, DeepSeek Harness, plain JSONL, plain text).
72
+
73
+ ## Core workflow
74
+
75
+ ### A. Capture (any harness)
76
+ ```bash
77
+ cd <handoffs-store> # or set HANDOFFS_ROOT
78
+ node tools/handoff.mjs build --source <transcript.jsonl|.txt|.md> \
79
+ --session <id> --harness claude-code|codex|dsh|generic \
80
+ --model <name> --project <project> [--objective "text"]
81
+ ```
82
+ Re-run merges past watermark. `verify <id-prefix>` checks manifest sha + turn-count + JSON parse.
83
+
84
+ ### B. Write the lossless brief (COS rules + CTX buckets)
85
+ Headings TASK / USER SPECIFICATION / CURRENT STATE / DONE / IN PROGRESS / PLANNED-DECIDED /
86
+ FAILED-UNRESOLVED / FILES / VERIFICATION / ENVIRONMENT / NEXT / DO NOT. Enforce floors
87
+ (>=200 chars any session; >=1000 chars for >=20k recorded tokens). Preserve exact
88
+ paths/ids/commands/error text. Mark context provenance: required | sensitive | deferred.
89
+
90
+ ### C. Gate with evidence (orchestrator + ORC-1)
91
+ ```
92
+ RESULT: DONE | PARTIAL | BLOCKED | FAILED
93
+ WHAT_CHANGED:
94
+ VALIDATION:
95
+ EVIDENCE: # artifact + sha; must match pending dispatch (phaseId + dispatchId)
96
+ BLOCKERS:
97
+ RISKS:
98
+ FOLLOW_UP:
99
+ ```
100
+
101
+ ### D. Level 4 runtime + L5 dispatch
102
+ ```bash
103
+ HANDOFFS_ROOT=<store> node tools/agents-handoff.mjs auto --source <file> --session <id> --harness <h> --project <p>
104
+ HANDOFFS_ROOT=<store> node tools/agents-handoff.mjs verify-gate <id-prefix>
105
+ HANDOFFS_ROOT=<store> node tools/agents-handoff.mjs promote <id-prefix>
106
+ HANDOFFS_ROOT=<store> node tools/agents-handoff.mjs merge <a> <b>
107
+ HANDOFFS_ROOT=<store> node tools/agents-handoff.mjs self-improve
108
+ HANDOFFS_ROOT=<store> node tools/agents-handoff.mjs index
109
+ HANDOFFS_ROOT=<store> node tools/agents-handoff.mjs dispatch <id-prefix> --task "<objective>" [--broker <orchestrator-root> --live]
110
+ ```
111
+ Dispatch re-runs the evidence gate first; carries manifest sha256; dry-run by default
112
+ (autonomy ladder: workflow-execute requires explicit --live).
113
+
114
+ ## Rules
115
+
116
+ 1. Never dump the whole corpus — load only what the task needs.
117
+ 2. Preserve provenance — every artifact carries raw + manifest sha256.
118
+ 3. Verbatim objectives (PromptIR lossless).
119
+ 4. Evidence gates — RESULT without EVIDENCE never becomes VERIFIED.
120
+ 5. Update, never duplicate (watermark merge).
121
+ 6. No secrets.
122
+ 7. Safety on writes (backup → apply → verify → rollback).
123
+ 8. User messages are the highest authority in any brief.
124
+ 9. Raw is never altered — handoffs render from canonical data.
125
+ 10. Self-improve — a refused/truncated brief is a knowledge candidate.
126
+ 11. Max-local: zero external-dependency engines; adapters absent-safe.
127
+ 12. Versioned contracts — every artifact has a schema version, a sha256 and a decided autonomy level.
128
+
129
+ ## Level map (L3 resources — read on demand)
130
+
131
+ | Need | File |
132
+ |------|------|
133
+ | Live dispatch protocol | `refs/protocol.md` |
134
+ | Role ladder | `refs/roles.md` |
135
+ | Validator gate (12-point) | `refs/validator.md` |
136
+ | Shared operating rules | `refs/handbook.md` |
137
+ | Fresh-session bootstrap | `refs/bootstrap.md` |
138
+ | Brief discipline | `refs/brief-checklist.md` |
139
+ | Engine source | `tools/handoff.mjs` |
140
+ | L4 runtime | `tools/agents-handoff.mjs` |
141
+ | L4/L5 design | `docs/LEVEL4.md`, `docs/LEVEL5.md` |
142
+ | Cross-harness adapters | `refs/ADAPTERS.md` |
143
+ | Handoff format + schema | `docs/FORMAT.md`, `templates/` |
144
+ | Installation | `docs/INSTALL.md` |
145
+
146
+ **Version**: 2.0.0
147
+ **Last Updated**: 2026-10-08
@@ -0,0 +1,27 @@
1
+ {
2
+ "schema_version": "1.0-capability-registry",
3
+ "capabilities": [
4
+ {
5
+ "id": "filesystem.read",
6
+ "kind": "file-exists",
7
+ "target": "tests/fixtures/minimal-transcript.jsonl",
8
+ "required": true,
9
+ "purpose": "read transcript sources for handoff builds"
10
+ },
11
+ {
12
+ "id": "filesystem.write",
13
+ "kind": "dir-writable",
14
+ "target": ".agents-handoff",
15
+ "required": true,
16
+ "purpose": "persist runtime state and checkpoints"
17
+ },
18
+ {
19
+ "id": "process.execute",
20
+ "kind": "command",
21
+ "command": "<node>",
22
+ "args": ["-e", "process.exit(0)"],
23
+ "required": true,
24
+ "purpose": "execute bounded engine subcommands"
25
+ }
26
+ ]
27
+ }