@convesoft/zban 0.0.0-stage → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE-APACHE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/LICENSE-MIT ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Aliaksei Raketski
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,184 @@
1
- # Temporary Holding Version
1
+ # zban
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
+ **zban is a file-based issue tracker for you and your coding agents.** Issues are
4
+ Markdown files in your repository, managed through a CLI and an MCP server.
5
+
6
+ > **Status:** the v1 specification is agreed and implemented. Releases are
7
+ > published on [npm](https://www.npmjs.com/package/@convesoft/zban) and
8
+ > [GitHub Releases](https://github.com/convesoft/zban/releases), and progress is
9
+ > tracked in [`.zban/`](.zban/).
10
+
11
+ ## Why
12
+
13
+ Coding agents lose track of work between sessions, after context compaction and
14
+ when they hand work to each other. zban gives agents and humans one shared backlog
15
+ that lives next to the code and is versioned with it:
16
+
17
+ - **Plain files.** One Markdown file per issue in `.zban/`, readable and editable
18
+ without zban.
19
+ - **Branches and merges like code.** No server, no database. zban never runs Git,
20
+ so issue changes travel with your commits.
21
+ - **Built for agents.** JSON output for every command, the same operations as MCP
22
+ tools, a computed list of ready work, and a built-in agent guide (`zban prime`).
23
+ - **Small on purpose.** Fixed types, statuses and priorities, and a short command
24
+ set. See what zban [deliberately does not do](docs/product.mara.md#what-zban-deliberately-does-not-do).
25
+
26
+ ## What an issue looks like
27
+
28
+ `.zban/zb-n938cw.md`:
29
+
30
+ ```markdown
31
+ ---
32
+ title: Parse issue files
33
+ status: in-progress
34
+ type: feature
35
+ priority: high
36
+ parent: zb-9jra34
37
+ blocked_by:
38
+ - zb-naex76
39
+ created_at: 2026-11-11T20:00:00Z
40
+ ---
41
+
42
+ - [x] Read frontmatter
43
+ - [ ] Preserve unknown keys
44
+ ```
45
+
46
+ ## Installation
47
+
48
+ zban runs on Linux and macOS, on x86_64 and aarch64. It is distributed through
49
+ [npm](https://www.npmjs.com/package/@convesoft/zban) and
50
+ [GitHub Releases](https://github.com/convesoft/zban/releases), not through
51
+ crates.io.
52
+
53
+ ### npm
54
+
55
+ Install globally with npm (or pnpm), or run directly with `npx`:
56
+
57
+ ```sh
58
+ npm install -g @convesoft/zban
59
+ zban --version
60
+ ```
61
+
62
+ or without a global install:
63
+
64
+ ```sh
65
+ npx @convesoft/zban --version
66
+ ```
67
+
68
+ `@convesoft/zban` installs only the native binary package for your platform via
69
+ `optionalDependencies`, with no postinstall script.
70
+
71
+ ### Prebuilt binary
72
+
73
+ Each release attaches a `SHA256SUMS` file and one archive per platform. An
74
+ archive holds the `zban` binary, this README, zban's license files and
75
+ `THIRD-PARTY-LICENSES`, the licenses of the Rust crates built into the binary:
76
+
77
+ | Platform | Archive |
78
+ | --- | --- |
79
+ | Linux, x86_64 | `zban-x86_64-unknown-linux-musl.tar.gz` |
80
+ | Linux, aarch64 | `zban-aarch64-unknown-linux-musl.tar.gz` |
81
+ | macOS, Apple silicon | `zban-aarch64-apple-darwin.tar.gz` |
82
+ | macOS, Intel | `zban-x86_64-apple-darwin.tar.gz` |
83
+
84
+ The Linux binaries are statically linked and run on any distribution. To install
85
+ the latest release into `~/.local/bin`, set `target` to your platform's archive
86
+ name:
87
+
88
+ ```sh
89
+ target=x86_64-unknown-linux-musl
90
+ curl -fsSLO "https://github.com/convesoft/zban/releases/latest/download/zban-$target.tar.gz"
91
+ curl -fsSLO https://github.com/convesoft/zban/releases/latest/download/SHA256SUMS
92
+ sha256sum -c --ignore-missing SHA256SUMS # macOS: shasum -a 256 -c --ignore-missing SHA256SUMS
93
+ mkdir -p ~/.local/bin
94
+ tar -xzf "zban-$target.tar.gz" -C ~/.local/bin zban
95
+ zban --version
96
+ ```
97
+
98
+ Make sure `~/.local/bin` is on your `PATH`. The macOS binaries are not notarized
99
+ by Apple. If you downloaded the archive with a browser instead of `curl`, macOS
100
+ blocks the binary until you run `xattr -d com.apple.quarantine ~/.local/bin/zban`.
101
+
102
+ ### From source
103
+
104
+ With Rust 1.89 or later, build a release tag, replacing `vX.Y.Z` with the
105
+ release you want, such as `v0.1.0`:
106
+
107
+ ```sh
108
+ cargo install --locked --git https://github.com/convesoft/zban --tag vX.Y.Z
109
+ ```
110
+
111
+ ## Usage
112
+
113
+ ```sh
114
+ zban init
115
+ zban create "Parse issue files" -t feature -p high
116
+ zban list --ready
117
+ zban update zb-n938cw -s in-progress
118
+ zban show zb-n938cw --json
119
+ zban mcp # MCP server over stdio
120
+ zban prime # agent guide for CLI-only agents and hooks
121
+ ```
122
+
123
+ ## Documentation
124
+
125
+ The [documentation](docs/index.mara.md) is both the user guide and the engineering
126
+ specification:
127
+
128
+ - [What zban is](docs/product.mara.md)
129
+ - [Issues](docs/issues.mara.md)
130
+ - [Command line](docs/cli.mara.md)
131
+ - [MCP server](docs/mcp.mara.md)
132
+ - [Using zban with agents](docs/agents.mara.md)
133
+ - [Decisions and risks](docs/decisions.mara.md)
134
+ - [Verification](docs/verification.mara.md)
135
+
136
+ The `@convesoft/zban` npm package carries these pages for its own version, in
137
+ `node_modules/@convesoft/zban/docs/`, so agents and developers can read them
138
+ without the repository.
139
+
140
+ ## Development
141
+
142
+ zban is written in Rust. The specification is maintained with
143
+ [Mara](https://github.com/convesoft/mara); see [`.mara/README.md`](.mara/README.md)
144
+ for setup. Contributors and coding agents start with [AGENTS.md](AGENTS.md).
145
+
146
+ [`rust-toolchain.toml`](rust-toolchain.toml) pins the exact Rust version that
147
+ CI and the release builds use, and `rustup toolchain install` in the checkout
148
+ installs it. The pin moves only in a pull request of its own. Mara's code links
149
+ need the `rust-analyzer` component of that toolchain, so run
150
+ `rustup component add rust-analyzer` again after the pin changes. The checks
151
+ include a test run with the oldest supported Rust, the `rust-version` in
152
+ `Cargo.toml`, which CI runs too:
153
+
154
+ ```sh
155
+ cargo fmt --all -- --check
156
+ cargo clippy --all-targets -- -D warnings
157
+ cargo test
158
+ cargo +1.89 test --locked # the rust-version in Cargo.toml
159
+ mara schema validate && mara project validate
160
+ ```
161
+
162
+ To cut a release, bump `Cargo.toml` and `Cargo.lock` with Nx release in a
163
+ release pull request and merge it to `main`, then dispatch
164
+ [`release.yml`](.github/workflows/release.yml) (defaulting to `dry_run: true`):
165
+
166
+ ```sh
167
+ pnpm install
168
+ pnpm nx release version
169
+ ```
170
+
171
+ The workflow runs the tests, builds the four targets, packs the release archives
172
+ and npm packages, runs local smoke tests, publishes `@convesoft/zban` and its
173
+ four platform packages to npm via OIDC Trusted Publishing, creates the `vX.Y.Z`
174
+ tag and GitHub Release from Conventional Commits via `pnpm nx release changelog`,
175
+ and attaches the release archives and `SHA256SUMS`.
176
+
177
+ ## License
178
+
179
+ zban is available under your choice of the [MIT license](LICENSE-MIT) or the
180
+ [Apache License 2.0](LICENSE-APACHE).
181
+
182
+ Unless you explicitly state otherwise, any contribution intentionally submitted
183
+ for inclusion in zban by you, as defined in the Apache-2.0 license, shall be dual
184
+ licensed as above, without any additional terms or conditions.
package/bin/zban.cjs ADDED
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env node
2
+
3
+ "use strict";
4
+
5
+ const path = require("node:path");
6
+ const { spawn } = require("node:child_process");
7
+
8
+ const packages = new Map([
9
+ ["linux:x64", "@convesoft/zban-linux-x64"],
10
+ ["linux:arm64", "@convesoft/zban-linux-arm64"],
11
+ ["darwin:arm64", "@convesoft/zban-darwin-arm64"],
12
+ ["darwin:x64", "@convesoft/zban-darwin-x64"],
13
+ ]);
14
+
15
+ const packageName = packages.get(`${process.platform}:${process.arch}`);
16
+ if (packageName === undefined) {
17
+ console.error(
18
+ `zban does not provide an npm binary for ${process.platform}/${process.arch}. ` +
19
+ "Supported targets are Linux (x64, arm64) and macOS (arm64, x64).",
20
+ );
21
+ process.exitCode = 1;
22
+ } else {
23
+ let binary;
24
+ try {
25
+ const manifest = require.resolve(`${packageName}/package.json`);
26
+ binary = path.join(path.dirname(manifest), "bin", "zban");
27
+ } catch {
28
+ console.error(
29
+ `The optional package ${packageName} is missing. ` +
30
+ "Reinstall @convesoft/zban with optional dependencies enabled.",
31
+ );
32
+ process.exitCode = 1;
33
+ }
34
+
35
+ if (binary !== undefined) {
36
+ const child = spawn(binary, process.argv.slice(2), { stdio: "inherit" });
37
+ const handlers = new Map();
38
+ for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
39
+ const handler = () => child.kill(signal);
40
+ handlers.set(signal, handler);
41
+ process.on(signal, handler);
42
+ }
43
+
44
+ child.once("error", (error) => {
45
+ console.error(`Could not start ${packageName}: ${error.message}`);
46
+ process.exitCode = 1;
47
+ });
48
+
49
+ child.once("exit", (code, signal) => {
50
+ for (const [name, handler] of handlers) {
51
+ process.off(name, handler);
52
+ }
53
+ if (signal !== null) {
54
+ process.kill(process.pid, signal);
55
+ } else {
56
+ process.exitCode = code ?? 1;
57
+ }
58
+ });
59
+ }
60
+ }
@@ -0,0 +1,163 @@
1
+ # Using zban with agents
2
+
3
+ zban teaches agents its workflow itself, so a project needs very little setup.
4
+
5
+ ## Setup
6
+
7
+ **With MCP** (recommended where supported): configure the [MCP server](mcp.mara.md).
8
+ The server's instructions carry the agent guide, and clients such as Claude Code
9
+ keep them in context across compaction. Started outside a zban project, the
10
+ server sends only a short note instead of the full guide.
11
+
12
+ **In your agent instructions**: add this line to your `AGENTS.md` or `CLAUDE.md`,
13
+ so that agents without the guide read it from `zban prime`:
14
+
15
+ ```markdown
16
+ **IMPORTANT**: this project tracks its work with zban. If your instructions already
17
+ contain the zban workflow guide (it starts with `# zban workflow`), for example from
18
+ the zban MCP server, follow it and use the zban tools. Otherwise, before anything
19
+ else, run `zban prime` and follow its output.
20
+ ```
21
+
22
+ An agent with the MCP server finds the guide in its instructions and skips
23
+ `zban prime`, so it does not read the guide twice. CLI-only agents, CI jobs and
24
+ clients that ignore server instructions run `zban prime`.
25
+
26
+ **Without MCP**, Claude Code can instead inject the guide with hooks in
27
+ `.claude/settings.json`:
28
+
29
+ ```json
30
+ {
31
+ "hooks": {
32
+ "SessionStart": [{ "hooks": [{ "type": "command", "command": "zban prime" }] }],
33
+ "PreCompact": [{ "hooks": [{ "type": "command", "command": "zban prime" }] }]
34
+ }
35
+ }
36
+ ```
37
+
38
+ `zban prime` prints nothing outside a zban project, so these hooks can also go in
39
+ your user-level settings. A hook adds the guide even when the MCP server has sent
40
+ it, so do not combine the hooks with the server.
41
+
42
+ > **Known limitation:** zban decides whether to deliver the guide from the
43
+ > directory where the session starts. If you start your agent in a folder above
44
+ > the project, such as a folder holding several repositories, or the top of a
45
+ > monorepo whose `.zban/` lives in a subfolder, the agent gets no guide from
46
+ > `zban prime`, and only the short note over MCP. Start the session inside the
47
+ > project, or ask the agent to run `zban prime -C <project>`.
48
+
49
+ Project-specific rules belong in your own `AGENTS.md`, for example "include the
50
+ issue ID in commit messages as `Refs: zb-xxxxxx`". zban does not configure them.
51
+
52
+ ## Things to ask your agent
53
+
54
+ - "Are there tasks we should be tracking? Create issues for them."
55
+ - "What should we work on next?"
56
+ - "Start on zb-n938cw."
57
+ - "Break the export feature into an epic with tasks and dependencies."
58
+ - "Write a handoff for zb-n938cw."
59
+ - "Continue where we left off on zb-n938cw."
60
+
61
+ ## Handoffs
62
+
63
+ A handoff is a short note on an issue that lets a new session continue
64
+ unfinished work without rereading the old conversation. Ask your agent to write
65
+ one while it still has the conversation, for example before you clear a long
66
+ session and start fresh instead of relying on compaction. The agent writes it
67
+ with `update --handoff`, which replaces any earlier note, so the issue always
68
+ holds the current state; Git keeps the history.
69
+
70
+ ```markdown
71
+ ## Handoff (2026-11-12T18:40:00Z)
72
+
73
+ - At 5b93272 on feat/parser, working tree clean.
74
+ - Done: reader and canonical writer.
75
+ - Next: preserve unknown keys.
76
+ - Uncertain: flow-style lists written by hand.
77
+ - Rejected: round-tripping through a generic YAML value, which loses key order.
78
+ - Files: src/store.rs, tests/files.rs
79
+ ```
80
+
81
+ zban stamps the heading with the time the note was written, and `list` and
82
+ `show` report its age. zban cannot see Git, so the agent records the commit and
83
+ branch itself. A new session reads a handoff only when you ask it to continue;
84
+ it then checks the note against the repository before acting on it, because a
85
+ stale note can mislead. When the issue is done, the agent replaces the handoff
86
+ with `## Summary of Changes` and keeps the approaches it rejected.
87
+
88
+ zban does not load handoffs into new sessions by itself: notes belong to
89
+ issues, and zban cannot tell which issue a new session is about.
90
+
91
+ ## Requirements
92
+
93
+ :::mara requirement REQ-AGENT-GUIDE
94
+ :mid: 01M764FJ3Z4GXPTR8FHAF3XX7E
95
+ :title: Teach agents the zban workflow
96
+ :status: accepted
97
+ :satisfies: NEED-AGENT-ONBOARDING
98
+
99
+ zban provides an agent workflow guide through `zban prime` and through the MCP server instructions. Both deliver the full guide only when a project is found, so sessions outside zban projects carry almost none of it. Both come from one source text and name the operations the way the surface does: commands for the CLI, tools for MCP. An agent can tell from its own context whether it already has the guide, so a project's agent instructions can load it through `zban prime` only where it is missing. The vocabulary in the guide comes from the binary itself, so it cannot disagree with the binary.
100
+ :::
101
+
102
+ :::mara requirement REQ-HANDOFF
103
+ :mid: 01M777QQGMEKBF23H6FN17YY39
104
+ :title: Hand off unfinished work through the issue
105
+ :status: accepted
106
+ :satisfies: NEED-SESSION-CONTINUITY
107
+
108
+ An issue can hold one handoff note in its body. An update writes the note, replacing any previous one, or removes it, and zban records when the note was written. Showing an issue returns the note and its time, and listing reports the time for each issue that has one. zban never writes, removes or delivers a handoff note on its own; the guide tells agents to write and read notes when the developer asks.
109
+ :::
110
+
111
+ ## Design
112
+
113
+ :::mara design DES-AGENT-GUIDE
114
+ :mid: 01M764FJ3ZPFMKF31AGPP8X9PA
115
+ :title: Agent guide content
116
+ :status: accepted
117
+ :satisfies: REQ-AGENT-GUIDE
118
+ :mitigates: RISK-SESSION-ABOVE-PROJECT
119
+
120
+ The guide is one template compiled into the binary and kept under about 150 lines, because it is paid for in every agent context. The MCP rendering also stays within 3,800 characters, a margin under the 4,096 at which Claude Code truncates server instructions. It leaves out what the tool schemas carry, such as each tool's parameters, and both renderings share tight wording rather than diverging text. Its sections are:
121
+
122
+ 1. **Track work in zban.** Use issues instead of ad-hoc todo lists. Park planned epics, backlog and work only a human can do as `draft`, which keeps them and everything under them out of ready work ([[ADR-DRAFT-HOLDS-DESCENDANTS]]).
123
+ 2. **Before starting.** Look for an existing issue, otherwise create one; set it `in-progress`.
124
+ 3. **While working.** Keep the body's checklist current. File newly discovered work as separate issues with `discovered_from` rather than widening the current one. On a `conflict` error, show the issue again and retry.
125
+ 4. **Finishing.** Add `## Summary of Changes` and set `done`. If unchecked items or open children remain, finish them, close them or move them into follow-up issues; force only when the user agrees. To abandon work, add `## Reasons for Cancelling` and set `cancelled`.
126
+ 5. **Committing.** Commit issue files together with the code they describe.
127
+ 6. **Handoffs.** Writing and resuming handoff notes, as in [[DES-HANDOFF]].
128
+ 7. **Finding work.** Use the ready list and offer the top candidates; show an issue before starting it.
129
+ 8. **Reference.** Types, statuses, priorities, relations and the readiness rule. The command-line rendering also lists every command with its options, such as `list --not-tag`, and says that it leaves out issues carrying any of its tags; the MCP rendering leaves the tools' parameters, such as `not_tags` of `list_issues`, to their schemas.
130
+
131
+ The MCP rendering also tells agents to pass `directory` on every call when they work in a worktree or outside the directory the server started in.
132
+
133
+ Delivery depends on the project found where the surface starts: from the working directory or `-C` for `prime`, and from the server's `-C` or working directory at startup for MCP. With a project, both deliver the full guide; a project whose configuration is invalid still counts, because the guide does not depend on it. Without one, `prime` prints nothing, and the MCP server sends a short note of a few lines instead: zban tracks issues in `.zban/` directories, no project was found where the server started, tools take `directory`, and `zban prime -C <dir>` prints the full guide.
134
+
135
+ Both renderings open with the heading `# zban workflow`, and the line that the setup guidance recommends for a project's agent instructions names it: an agent whose instructions already hold the guide, for example from the MCP server, follows it and uses the tools, and any other agent runs `zban prime`. An agent with both the server and the line therefore reads the guide once, with the operations of the surface it has.
136
+
137
+ Project-specific conventions are deliberately left out; projects add them in their own agent instructions.
138
+ :::
139
+
140
+ :::mara design DES-HANDOFF
141
+ :mid: 01M777QQGMQNB89NDDMPGRTTFA
142
+ :title: Handoff section
143
+ :status: accepted
144
+ :satisfies: REQ-HANDOFF
145
+
146
+ The handoff is the body section whose heading line is `## Handoff` or `## Handoff (<timestamp>)`, with a timestamp as in [[DES-ISSUE-FILE]]. It runs to the next level 1 or 2 heading or to the end of the body. Headings inside fenced code blocks, as [[DES-LIFECYCLE]] defines them, are ignored: a fence opens only when indented by at most three columns more than the content of the list item holding it, or than the line start outside list items.
147
+
148
+ - **Writing.** `update --handoff TEXT|-` writes `## Handoff (<now>)`, a blank line and the text. It replaces an existing section in place, or appends the section after a blank line. Text that contains a level 1 or 2 heading outside a fenced code block is rejected, because it would end the section early, and so is text that leaves a fenced code block open, because it would carry the section past the next heading. `update --no-handoff` removes the section, together with the blank lines before it when it ends the body. Both fail when the body has more than one handoff section, which must then be fixed by hand. Otherwise, bytes outside the section are unchanged. Writing also fails, changing nothing, when the new body would not give back the note just written, for example because the body leaves a fenced code block open before it.
149
+ - **Reading.** In JSON, `show` adds `handoff` as `{written_at, text}`, or `null` without a section, and `list` adds `handoff_at`. A heading without a timestamp gives `written_at: null`. With several sections, reading uses the first. Human output shows the age of the note.
150
+ - **Guide.** The guide section on handoffs says: write a handoff only when the developer asks, while the conversation is still available, and overwrite rather than append. Record the commit, the branch and whether the working tree is clean; what is done; what is next; what is blocked or uncertain; approaches tried and rejected; and the files touched. Use plain bullets, not task items, and no diffs. Resume only when asked to continue: show the matching in-progress issue, asking the developer if several could match, and check the note against the repository before acting on it. On `done`, replace the handoff with `## Summary of Changes` and keep the rejected approaches.
151
+
152
+ `prime` and the MCP instructions never include handoff notes ([[ADR-HANDOFF-ON-ISSUE]]).
153
+ :::
154
+
155
+ ## Scenario
156
+
157
+ :::mara scenario SCN-AGENT-SESSION
158
+ :mid: 01M764FJ3ZRJ3Q9GY8PMXWG7PF
159
+ :title: An agent works through an issue
160
+ :status: accepted
161
+
162
+ A developer starts a coding-agent session in a repository that uses zban. The agent receives the zban guide through MCP instructions or a `zban prime` hook. Asked what to do next, it lists ready work and proposes the highest-priority issue. With the developer's agreement it sets the issue `in-progress`, reads its body and the documents it references, and does the work while checking off task items. On noticing an unrelated bug, it files a bug with `discovered_from` pointing at the current issue and carries on. At the end it appends a summary, sets the issue `done`, which archives it, and commits the code together with the changed issue files. A later session, or a different agent, can see what was done and pick up the bug.
163
+ :::