@kulapard/pi-caveman 0.4.0 → 0.4.2
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/AGENTS.md +14 -44
- package/CHANGELOG.md +25 -1
- package/README.md +15 -5
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -1,55 +1,25 @@
|
|
|
1
1
|
# AGENTS.md — pi-caveman conventions
|
|
2
2
|
|
|
3
|
-
Project memory
|
|
3
|
+
Project memory. Non-obvious only.
|
|
4
4
|
|
|
5
5
|
## Architecture (do not rebuild)
|
|
6
6
|
|
|
7
|
-
- `extensions/caveman.ts`
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
session always starts `off`. There is **no** cross-session config file or env var.
|
|
13
|
-
- Activation = `before_agent_start` appends `modeInstructions(mode)` to the
|
|
14
|
-
system prompt. Statusline = `ctx.ui.setStatus("caveman", …)` guarded by `hasUI`.
|
|
15
|
-
- The extension's `modeInstructions` injection is the **canonical** activator;
|
|
16
|
-
the `caveman` skill (`skills/caveman/SKILL.md`) is a standalone fallback for
|
|
17
|
-
hosts that load skills but not this extension. When both are active the model
|
|
18
|
-
may see both rule sets — mild, intentional redundancy. They are not
|
|
19
|
-
programmatically de-duped: skill loading is model-driven and the skill's prose
|
|
20
|
-
differs from `modeInstructions`, so there is no reliable text to match on.
|
|
21
|
-
- Pi 0.80.2 has **no `agents/` subagent mechanism**. The `agents/cavecrew-*.md`
|
|
22
|
-
files are reference personas only and cavecrew is optional/out-of-scope.
|
|
7
|
+
- `extensions/caveman.ts` = Pi extension. `extensions/caveman-core.ts` = pure SDK-free logic (`normalizeMode`, `modeInstructions`, `VALID_MODES`, regexes). Unit-testable without fake SDK.
|
|
8
|
+
- Mode state **session-scoped**: `pi.appendEntry("caveman-mode", …)`, restored from `ctx.sessionManager.getBranch()` on `session_start`. New session always `off`. No cross-session config/env.
|
|
9
|
+
- Activation = `before_agent_start` appends `modeInstructions(mode)`. Statusline = `ctx.ui.setStatus("caveman", …)` guarded by `hasUI`.
|
|
10
|
+
- Extension `modeInstructions` = **canonical** activator. `skills/caveman/SKILL.md` = fallback for hosts loading skills but not extension. If both active, model sees both rule sets — intentional redundancy, no de-dupe.
|
|
11
|
+
- Pi 0.80.2 has **no `agents/` subagent mechanism**. `agents/cavecrew-*.md` = reference personas only; cavecrew optional/out-of-scope.
|
|
23
12
|
|
|
24
13
|
## Invariants
|
|
25
14
|
|
|
26
|
-
- **SDK import
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
would break the tests — `tests/extension.test.mjs` asserts this invariant.
|
|
30
|
-
- **Verbatim preservation**: caveman-compress never alters code blocks, inline
|
|
31
|
-
code, URLs, file paths, commands, or exact error strings. The skill instructs
|
|
32
|
-
the agent to self-validate these against the original and, on any mismatch it
|
|
33
|
-
cannot fix, restore from the `.original` backup that was created during the
|
|
34
|
-
same invocation (stale backups are rejected before compression starts).
|
|
35
|
-
- `caveman-compress` is **prompt-only**: the Pi agent performs the compression
|
|
36
|
-
with its own model and file tools, driven by `SKILL.md`. There is no Python and
|
|
37
|
-
no external model CLI; coverage is the doc-guard test `tests/compress-docs.test.mjs`.
|
|
15
|
+
- **SDK import `import type` only** in `extensions/*.ts`. JS tests run via `--experimental-strip-types`, erases type-only imports. Value import from `@earendil-works/pi-coding-agent` breaks tests — `tests/extension.test.mjs` asserts this.
|
|
16
|
+
- **Verbatim preservation**: caveman-compress never changes code blocks, inline code, URLs, paths, commands, exact error strings. Skill instructs self-validate against original. Mismatch unfixable → restore from `.original` backup created in same invocation (stale backups rejected before compression).
|
|
17
|
+
- `caveman-compress` is **prompt-only**: Pi agent compresses with own model + file tools, driven by `SKILL.md`. No Python, no external model CLI. Coverage = `tests/compress-docs.test.mjs`.
|
|
38
18
|
|
|
39
19
|
## Changelog
|
|
40
20
|
|
|
41
|
-
Every notable change must update `CHANGELOG.md` under `[Unreleased]`. Before
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
- `npm test` runs `pretest` (`npm run typecheck` → `tsc --noEmit`) first, then the
|
|
47
|
-
`node --test` suites under `tests/`. Typecheck failures fail the test run.
|
|
48
|
-
- The JS test glob (`tests/**/*.test.mjs`) is expanded by the Node `--test` runner,
|
|
49
|
-
not the shell. Directory-recursion (`--test tests/`) does **not** work on the
|
|
50
|
-
current Node — keep the glob.
|
|
51
|
-
- Several tests are **phantom-reference guards** (`tests/stats-docs.test.mjs`,
|
|
52
|
-
`tests/cavecrew-docs.test.mjs`, `tests/compress-docs.test.mjs`): they assert the
|
|
53
|
-
docs do **not** mention a Claude-Code hooks layer, a plugin install path, the
|
|
54
|
-
`⛏` badge, Claude-only subagent presets, or broken asset paths. Do not
|
|
55
|
-
reintroduce those references.
|
|
21
|
+
Every notable change must update `CHANGELOG.md` under `[Unreleased]`. Before finishing task, run `npm run changelog:check` to confirm changelog updated for files changed. CI runs same check on every PR.
|
|
22
|
+
|
|
23
|
+
- `npm test` runs `pretest` (`npm run typecheck` → `tsc --noEmit`), then `node --test tests/**/*.test.mjs`. Typecheck failures fail test run.
|
|
24
|
+
- Node `--test` glob expanded by runner, not shell. Directory-recursion `--test tests/` does **not** work on current Node — keep glob.
|
|
25
|
+
- Tests are **phantom-reference guards** (`tests/stats-docs.test.mjs`, `tests/cavecrew-docs.test.mjs`, `tests/compress-docs.test.mjs`): docs must not mention Claude-Code hooks layer, plugin install path, `⛏` badge, Claude-only subagent presets, broken asset paths. Do not reintroduce.
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.4.2] - 2026-06-29
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Compressed `AGENTS.md` with `caveman-compress` to reduce session token load.
|
|
15
|
+
- Added `*.original` and `*.original.*` to `.gitignore` so caveman-compress
|
|
16
|
+
backups are not committed accidentally.
|
|
17
|
+
|
|
18
|
+
## [0.4.1] - 2026-06-29
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- README install instructions now recommend `pi install
|
|
23
|
+
https://github.com/kulapard/pi-caveman` as the primary direct-load method,
|
|
24
|
+
keeping `pi -e` documented as a per-session fallback.
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- Guard tests for `caveman-compress` backup rules, the GitHub install URL in
|
|
29
|
+
the root README, and the `caveman` skill's delegation to `caveman-commit` /
|
|
30
|
+
`caveman-review`.
|
|
31
|
+
|
|
10
32
|
## [0.4.0] - 2026-06-29
|
|
11
33
|
|
|
12
34
|
### Fixed
|
|
@@ -90,7 +112,9 @@ port of [caveman](https://github.com/JuliusBrussee/caveman).
|
|
|
90
112
|
token, automatic provenance, a tag-equals-version guard, and a concurrency
|
|
91
113
|
group).
|
|
92
114
|
|
|
93
|
-
[Unreleased]: https://github.com/kulapard/pi-caveman/compare/v0.4.
|
|
115
|
+
[Unreleased]: https://github.com/kulapard/pi-caveman/compare/v0.4.2...HEAD
|
|
116
|
+
[0.4.2]: https://github.com/kulapard/pi-caveman/compare/v0.4.1...v0.4.2
|
|
117
|
+
[0.4.1]: https://github.com/kulapard/pi-caveman/compare/v0.4.0...v0.4.1
|
|
94
118
|
[0.4.0]: https://github.com/kulapard/pi-caveman/compare/v0.3.0...v0.4.0
|
|
95
119
|
[0.3.0]: https://github.com/kulapard/pi-caveman/compare/v0.2.0...v0.3.0
|
|
96
120
|
[0.2.0]: https://github.com/kulapard/pi-caveman/compare/v0.1.0...v0.2.0
|
package/README.md
CHANGED
|
@@ -20,13 +20,23 @@ Install it into a Pi setup with:
|
|
|
20
20
|
pi install npm:@kulapard/pi-caveman
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
You can also load it straight from a checkout on disk
|
|
24
|
-
|
|
23
|
+
You can also load it straight from a checkout on disk — see the `pi -e`
|
|
24
|
+
mechanism below.
|
|
25
25
|
|
|
26
|
-
###
|
|
26
|
+
### Install from GitHub
|
|
27
27
|
|
|
28
|
-
The simplest
|
|
29
|
-
|
|
28
|
+
The simplest way to load the latest version directly from the repository is:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pi install https://github.com/kulapard/pi-caveman
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Pi resolves the `pi` block in `package.json` and loads both the extension and
|
|
35
|
+
all skills from the cloned directory.
|
|
36
|
+
|
|
37
|
+
### Load the extension directly (per-session)
|
|
38
|
+
|
|
39
|
+
For quick testing without installing, use Pi's `-e` flag for a single session:
|
|
30
40
|
|
|
31
41
|
```bash
|
|
32
42
|
pi -e /path/to/pi-caveman/extensions/caveman.ts --skill /path/to/pi-caveman/skills
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kulapard/pi-caveman",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Caveman for Pi: ultra-compressed agent output that preserves technical substance. Six intensity modes, slash commands, natural-language activation, and a session statusline.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|