be4fter 0.1.0 → 0.1.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/README.md CHANGED
@@ -1,115 +1,54 @@
1
- # Be4fter
1
+ # <img src="docs/mark.svg" width="38" height="38" alt=""> Be4fter
2
2
 
3
- Be4fter gives your coding agent persistent project memory. When it returns tomorrow, one command shows the goal, the current task and what still needs proof. If a later edit invalidates a passing check, the release report marks that evidence stale.
3
+ [![Published npm version](https://img.shields.io/npm/v/be4fter?color=32735c)](https://www.npmjs.com/package/be4fter) [![Published crates.io version](https://img.shields.io/crates/v/be4fter?color=32735c)](https://crates.io/crates/be4fter) [![Build and test status on main](https://github.com/timeqx/Be4fter/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/timeqx/Be4fter/actions/workflows/build.yml?query=branch%3Amain) [![MIT license](https://img.shields.io/badge/license-MIT-4a7162)](LICENSE)
4
4
 
5
- The local Rust CLI makes **zero model calls**. On the greeting example, its task handoff uses **53 tokens** and its status uses **51 tokens** with the `o200k_base` tokenizer. These measurements cover the CLI output for that fixture.
5
+ **Local project memory for AI coding agents.** Run `be4fter context` when a new session starts. It shows the approved goal, the current task and the criterion that task must meet. Later, if a code change invalidates a passing check, Be4fter flags the evidence as stale.
6
6
 
7
- ![A terminal session initializes a greeting project, completes and verifies a task, detects stale evidence after an edit and restores the verified files.](https://raw.githubusercontent.com/timeqx/Be4fter/main/docs/demo.gif)
7
+ Be4fter runs on your machine. It makes zero model calls and needs no server. Codex, OpenCode, Cursor and GitHub Copilot's coding agent can use the shared project instructions. Claude Code and Gemini CLI have dedicated setup options. [Setup and tested clients](docs/agent-compatibility.md)
8
8
 
9
9
  ## Install
10
10
 
11
- ```sh
12
- npx be4fter@0.1.0 init
13
- ```
14
-
15
- For a persistent command use `npm install -g be4fter@0.1.0`. The package includes native binaries for x64 and ARM64 on Windows, macOS and Linux. Linux builds target glibc. [Release downloads](https://github.com/timeqx/Be4fter/releases/tag/v0.1.0)
16
-
17
- ## Run it locally
18
-
19
- From this checkout, build a standalone executable with Rust 1.89 or newer.
20
-
21
- ```powershell
22
- cargo build --release --locked
23
- .\target\release\be4fter.exe --help
24
- ```
25
-
26
- On macOS and Linux, use `./target/release/be4fter`. To put the command on your Cargo bin path, run `cargo install --path . --locked`. Git is needed for checkpoints. Planning and verification also work in an ordinary directory. Check commands use the tools installed in the project environment.
11
+ | Install with | Command |
12
+ | --- | --- |
13
+ | npm (Node.js 18+) | `npm install -g be4fter@latest` |
14
+ | Cargo (Rust 1.89+) | `cargo install be4fter --locked` |
15
+ | GitHub Packages (authenticated npm) | `npm install -g @timeqx/be4fter@latest --registry=https://npm.pkg.github.com` |
27
16
 
28
- The npm launcher supports Node 18 and newer. Build a package for your current machine with `npm run build` followed by `npm pack`. Install the resulting file with `npm install -g ./be4fter-0.1.0.tgz`. A packaged native binary runs directly without a Rust toolchain.
17
+ Run the same command again to update. For GitHub Packages, sign in to its registry with a GitHub personal access token (classic) that has `read:packages`. [GitHub Packages authentication](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages)
29
18
 
30
- ## First project
19
+ Run `be4fter --version` to check the installation. For a one-time setup with npm, run `npx be4fter init`. Standalone executables are available for Windows, macOS and Linux (glibc), on x64 and ARM64. Git enables checkpoints and recovery. [Download binaries and checksums](https://github.com/timeqx/Be4fter/releases/latest)
31
20
 
32
- In the project you want to track, run the following command.
21
+ ## See a passing check go stale
33
22
 
34
- ```sh
35
- be4fter init --goal "Greet the reader by name."
36
- ```
23
+ In this 14-second recording, a greeting passes its test. An edit leaves the task **100% complete** but drops verified requirements to **0/1**. The developer previews a restore and recovers the tested file.
37
24
 
38
- Initialization inspects the repository, appends a small section to `AGENTS.md` and installs the skill at `.agents/skills/be4fter/SKILL.md`. Rerunning it preserves your blueprint, tasks, custom skill and instructions. A Git worktree gets a baseline checkpoint. In a new folder, run `git init` first if you want recovery from the beginning.
25
+ ![Terminal recording of the greeting test passing, its evidence becoming stale after an edit, and a checkpoint restoring the verified file.](https://raw.githubusercontent.com/timeqx/Be4fter/main/docs/demo.gif)
39
26
 
40
- Add more criteria with `be4fter requirement add "A blank name receives a default greeting"`. Link work with `be4fter task add "Handle a blank name" --requirement R002`. When the project has one requirement, you can omit the ID. New requirements start with manual verification. Set `checks` and `inputs` in the blueprint for automated evidence.
27
+ ## Start a project
41
28
 
42
- For a runnable, single-task example, copy `greet.mjs` and `greet.test.mjs` into a fresh project and copy the two example JSON files into its initialized `.be4fter/` directory. [Greeting fixture](examples/greeting)
29
+ Run these commands in the project you want to track. Replace the example goal with one of your own.
43
30
 
44
31
  ```sh
32
+ be4fter init --goal "Greet the reader by name"
45
33
  be4fter plan
46
- be4fter approve "Reviewed the greeting criterion and its Node test"
47
- be4fter before T001
48
- be4fter context
49
- be4fter after T001
50
- be4fter check
51
- be4fter report
52
34
  ```
53
35
 
54
- The example finishes with one completed task, one verified requirement and a ready report. Change `greet.mjs` afterward and the report shows stale evidence. Run `check` again to see the new result.
36
+ This creates a draft requirement and a linked task, installs the project skill and preserves existing `AGENTS.md` instructions. Inspect the criterion and any check commands before approving them. The greeting fixture includes a runnable Node test and the blueprint that maps it to the requirement. [Try the worked example](docs/cli.md#run-the-greeting-example)
55
37
 
56
- ## Everyday commands
38
+ With v0.1.1 or newer, run `be4fter init --agent claude` to enable Claude Code's `/be4fter` skill, or `be4fter init --agent gemini` for Gemini CLI. You can repeat `--agent` to enable both in the same project.
57
39
 
58
- | Command | Effect |
40
+ | When you want to… | Run |
59
41
  | --- | --- |
60
- | `init [--goal TEXT] [--mode MODE]` | Inspect project structure, documentation, stack, Git status and candidate checks. A goal seeds a single task and requirement. |
61
- | `plan`, `approve "reason"` | Review the draft, including check commands and the previous approved scope. Approval appends a dated revision. |
62
- | `requirement add TEXT`, `task add TEXT [--requirement ID]` | Add an observable criterion or link a task to an existing requirement. |
63
- | `decide "text"` | Record a local decision for the report. |
64
- | `status`, `next`, `context` | Show completion, the next actionable task or a compact handoff. Active work comes first. |
65
- | `before T001`, `after T001` | Start work and capture checkpoints. Finishing runs the task's automated checks. Failed checks keep the task in progress. |
66
- | `checkpoint "label"`, `history`, `diff [ID]` | Save or list recovery points and inspect the working-file delta since a checkpoint. The default diff uses the latest point. |
67
- | `restore ID --preview`, `restore ID --apply` | Inspect changes, then explicitly confirm recovery. A bare restore previews. |
68
- | `review R001 pass review.txt` | Record a human-reviewed result with a nonempty evidence file. Use `fail` for an unsuccessful review. |
69
- | `check`, `report` | Run approved checks or print a read-only Markdown readiness report. |
70
-
71
- Commands find the enclosing Be4fter project. New Git projects initialize at the worktree root. Paths in the plan and review commands are relative to that root. Exit code 0 means success, 1 means checks or readiness are incomplete, and 2 indicates an invalid command, invalid project state or operational error.
72
-
73
- ## Verification and project memory
74
-
75
- Each requirement has an ID, title, criterion and a list of command argument arrays. For example, `"checks": [["cargo", "test"], ["cargo", "build", "--release"]]`. An empty list requires human review. An agent records a manual result only when a reviewer has supplied the outcome and evidence. Review commands and their underlying project scripts before executing a blueprint from another source.
76
-
77
- Optional `inputs` entries name eligible files or directories. Include the implementation, tests, relevant configuration and lockfiles. Omitting inputs fingerprints the whole eligible project. Use forward slashes. Fingerprints include file names, content and executable mode, independent of Git commits or file timestamps. The report checks freshness again, including the contents of manual evidence. A check that changes its own inputs needs a clean rerun. Command output goes to the terminal. The local evidence record keeps the argument list, exit result, timestamp and fingerprint.
78
-
79
- A release needs an approved blueprint, all tasks done and current passing evidence for every requirement. Blueprints keep their approval history in `.be4fter/approvals.json`. Editing a criterion or command makes the plan a draft until the revision is approved. Keep the blueprint, approvals, tasks and config under version control. Detection, decisions, verification results and the process lock live under the ignored `.be4fter/local/`. Run `init` after cloning to provision that checkout.
42
+ | Resume in a new agent session | `be4fter context` |
43
+ | Start work with a Git recovery point | `be4fter before T001` |
44
+ | Finish the task and run its automated checks | `be4fter after T001` |
45
+ | See what changed since a checkpoint | `be4fter diff cp-001` |
46
+ | Preview recovery before touching working files | `be4fter restore cp-001 --preview` |
47
+ | Rerun approved checks and see release readiness | `be4fter check` |
80
48
 
81
- Review the blueprint and any referenced project scripts in each fresh checkout, then run `approve` before running automated checks. Approval is stored in the private Git worktree directory, or in the current user's local state directory for projects outside Git. Reconfirming an unchanged blueprint preserves its scope history.
82
-
83
- The default `auto` mode uses quick for at most one task and one requirement, and standard for larger plans. Strict mode also requires task coverage for every requirement, at least one automated check and Git checkpoints for task transitions. Choose a mode during initialization or edit `.be4fter/config.json` later.
84
-
85
- ## Checkpoints and recovery
86
-
87
- Checkpoints capture eligible working files, including staged, unstaged and untracked work from anyone using the repository. Be4fter hashes the working bytes, builds a tree with a temporary Git index and retains it under `refs/worktree/be4fter/`. The normal branch and index stay intact. The default retention is 20 points per worktree. Adjust `keep_checkpoints` in the config. Expiring a ref lets Git reclaim unreferenced objects during its normal garbage collection.
88
-
89
- The file set includes regular files with supported UTF-8 relative paths. Git ignore rules apply even to tracked files. Common credential names, key files, build directories, nested repositories, linked files and Be4fter's own state are excluded. Add project-specific secret locations to Git ignore rules before the first checkpoint. A file with credentials embedded under an ordinary source name can still enter a checkpoint. Outside Git, verification uses built-in exclusions and any explicit requirement inputs.
90
-
91
- Restore lists each creation, replacement and removal. Applying it checkpoints the current files before the first write and checks each destination again. A collision with an ignored file, link or directory stops recovery. File-to-directory replacements need manual resolution. If a write fails partway through, the CLI names the pre-restore point. Unix executable bits and file contents are captured. Empty directories, ACLs and extended metadata are outside the snapshot.
92
-
93
- ## Tests, packaging and token budget
94
-
95
- ```sh
96
- cargo test --locked
97
- cargo clippy --all-targets --locked -- -D warnings
98
- npm run build
99
- npm run test:package
100
- ```
101
-
102
- The package test installs the generated tarball offline and exercises the greeting example through the installed npm command. The CI matrix builds and tests x64 and ARM64 on Windows, macOS and Linux. It collects six standalone binaries and assembles a single npm tarball with a platform-selecting launcher. The workflow produces downloadable artifacts. Registry publication and public releases are separate maintainer actions.
103
-
104
- The greeting fixture measured 83 tokens for the persistent agent instructions, 362 for the installed skill, 51 for status and 53 for current task context with the `o200k_base` tokenizer. These counts cover the text emitted for that fixture. Actual agent context also depends on the client and the project text. Be4fter itself makes zero model calls and starts no background service.
105
-
106
- Reproduce the measurement after a release build. On Windows append `.exe` to the binary path.
107
-
108
- ```sh
109
- cargo run --manifest-path bench/Cargo.toml --locked --target-dir target/bench -- target/release/be4fter
110
- ```
49
+ On the greeting fixture, `context` produced **53 tokens** and `status` produced **51**, measured with `o200k_base`. These counts cover the command output for that example. [Reproduce the benchmark](docs/cli.md#tests-packaging-and-token-budget)
111
50
 
112
- MIT licensed. [License](LICENSE)
51
+ ## Project links
113
52
 
114
- This project tracks its own release in [.be4fter](.be4fter). See the [client compatibility results](docs/agent-compatibility.md), [contributing guide](CONTRIBUTING.md) and [security policy](SECURITY.md).
53
+ [CLI reference](docs/cli.md) · [Be4fter’s own release blueprint](.be4fter/blueprint.json) · [Changelog](CHANGELOG.md) · [Contributing](CONTRIBUTING.md) · [Security](SECURITY.md) · [Share image](docs/social-preview.png)
115
54
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "be4fter",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Local project memory, recovery checkpoints and requirement verification for coding agents",
5
5
  "license": "MIT",
6
6
  "repository": { "type": "git", "url": "git+https://github.com/timeqx/Be4fter.git" },
7
+ "publishConfig": { "registry": "https://registry.npmjs.org" },
7
8
  "bugs": "https://github.com/timeqx/Be4fter/issues",
8
9
  "type": "module",
9
10
  "bin": { "be4fter": "npm/bin/be4fter.js" },