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 +29 -90
- package/npm/native/darwin-arm64/be4fter +0 -0
- package/npm/native/darwin-x64/be4fter +0 -0
- package/npm/native/linux-arm64/be4fter +0 -0
- package/npm/native/linux-x64/be4fter +0 -0
- package/npm/native/win32-arm64/be4fter.exe +0 -0
- package/npm/native/win32-x64/be4fter.exe +0 -0
- package/package.json +2 -1
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
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/be4fter) [](https://crates.io/crates/be4fter) [](https://github.com/timeqx/Be4fter/actions/workflows/build.yml?query=branch%3Amain) [](LICENSE)
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
21
|
+
## See a passing check go stale
|
|
33
22
|
|
|
34
|
-
|
|
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
|
-
|
|
25
|
+

|
|
39
26
|
|
|
40
|
-
|
|
27
|
+
## Start a project
|
|
41
28
|
|
|
42
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
|
40
|
+
| When you want to… | Run |
|
|
59
41
|
| --- | --- |
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
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
|
-
|
|
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
|
-
|
|
51
|
+
## Project links
|
|
113
52
|
|
|
114
|
-
|
|
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.
|
|
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" },
|