be4fter 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +53 -2
- package/examples/greeting/blueprint.json +12 -0
- package/examples/greeting/greet.mjs +4 -0
- package/examples/greeting/greet.test.mjs +7 -0
- package/examples/greeting/tasks.json +8 -0
- package/npm/bin/be4fter.js +17 -0
- 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/npm/stage.mjs +24 -0
- package/package.json +18 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Be4fter contributors
|
|
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,54 @@
|
|
|
1
|
-
#
|
|
1
|
+
# <img src="docs/mark.svg" width="38" height="38" alt=""> Be4fter
|
|
2
|
+
|
|
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
|
+
|
|
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
|
+
|
|
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
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
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` |
|
|
16
|
+
|
|
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)
|
|
18
|
+
|
|
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)
|
|
20
|
+
|
|
21
|
+
## See a passing check go stale
|
|
22
|
+
|
|
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.
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
## Start a project
|
|
28
|
+
|
|
29
|
+
Run these commands in the project you want to track. Replace the example goal with one of your own.
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
be4fter init --goal "Greet the reader by name"
|
|
33
|
+
be4fter plan
|
|
34
|
+
```
|
|
35
|
+
|
|
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)
|
|
37
|
+
|
|
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.
|
|
39
|
+
|
|
40
|
+
| When you want to… | Run |
|
|
41
|
+
| --- | --- |
|
|
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` |
|
|
48
|
+
|
|
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)
|
|
50
|
+
|
|
51
|
+
## Project links
|
|
52
|
+
|
|
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)
|
|
2
54
|
|
|
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.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"goal": "Greet the reader by name.",
|
|
3
|
+
"constraints": ["Run offline."],
|
|
4
|
+
"non_goals": ["Account management"],
|
|
5
|
+
"requirements": [{
|
|
6
|
+
"id": "R001",
|
|
7
|
+
"title": "Personal greeting",
|
|
8
|
+
"criterion": "Calling greet('Ada') returns 'Hello, Ada!'.",
|
|
9
|
+
"checks": [["node", "--test", "greet.test.mjs"]],
|
|
10
|
+
"inputs": ["greet.mjs", "greet.test.mjs"]
|
|
11
|
+
}]
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
const target = process.platform + '-' + process.arch;
|
|
6
|
+
const name = process.platform === 'win32' ? 'be4fter.exe' : 'be4fter';
|
|
7
|
+
const binary = fileURLToPath(new URL('../native/' + target + '/' + name, import.meta.url));
|
|
8
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit' });
|
|
9
|
+
|
|
10
|
+
if (result.error) {
|
|
11
|
+
console.error('be4fter: cannot launch ' + target + ' binary (' + result.error.message + ').');
|
|
12
|
+
process.exitCode = 2;
|
|
13
|
+
} else if (result.signal) {
|
|
14
|
+
process.kill(process.pid, result.signal);
|
|
15
|
+
} else {
|
|
16
|
+
process.exitCode = result.status;
|
|
17
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/npm/stage.mjs
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { accessSync, chmodSync, constants, copyFileSync, mkdirSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
const root = fileURLToPath(new URL('../', import.meta.url));
|
|
6
|
+
const host = process.platform + '-' + process.arch;
|
|
7
|
+
const targets = ['win32-x64', 'win32-arm64', 'darwin-x64', 'darwin-arm64', 'linux-x64', 'linux-arm64'];
|
|
8
|
+
const flag = process.argv[2];
|
|
9
|
+
|
|
10
|
+
for (const target of flag === '--check-all' ? targets : [host]) {
|
|
11
|
+
const binary = target.startsWith('win32-') ? 'be4fter.exe' : 'be4fter';
|
|
12
|
+
const dest = join(root, 'npm', 'native', target, binary);
|
|
13
|
+
if (!flag) {
|
|
14
|
+
mkdirSync(dirname(dest), { recursive: true });
|
|
15
|
+
copyFileSync(join(root, 'target', 'release', binary), dest);
|
|
16
|
+
chmodSync(dest, 0o755);
|
|
17
|
+
} else {
|
|
18
|
+
try {
|
|
19
|
+
accessSync(dest, !target.startsWith('win32-') && process.platform !== 'win32' ? constants.X_OK : constants.R_OK);
|
|
20
|
+
} catch {
|
|
21
|
+
throw new Error('Missing or non-executable ' + target + ' binary. Build and stage the native artifacts before packaging.');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "be4fter",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
}
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Local project memory, recovery checkpoints and requirement verification for coding agents",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": { "type": "git", "url": "git+https://github.com/timeqx/Be4fter.git" },
|
|
7
|
+
"publishConfig": { "registry": "https://registry.npmjs.org" },
|
|
8
|
+
"bugs": "https://github.com/timeqx/Be4fter/issues",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"bin": { "be4fter": "npm/bin/be4fter.js" },
|
|
11
|
+
"engines": { "node": ">=18" },
|
|
12
|
+
"files": ["npm/bin", "npm/native", "npm/stage.mjs", "examples/greeting", "LICENSE", "README.md"],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "cargo build --release --locked && node npm/stage.mjs",
|
|
15
|
+
"test": "cargo test --locked",
|
|
16
|
+
"test:package": "node --test tests/package.test.mjs",
|
|
17
|
+
"prepack": "node npm/stage.mjs --check-host",
|
|
18
|
+
"prepublishOnly": "node npm/stage.mjs --check-all"
|
|
19
|
+
}
|
|
20
|
+
}
|