@kulapard/pi-caveman 0.2.0 → 0.4.0
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 -2
- package/CHANGELOG.md +52 -1
- package/README.md +5 -5
- package/extensions/caveman-core.ts +1 -1
- package/extensions/caveman.ts +8 -9
- package/package.json +5 -4
- package/skills/caveman/SKILL.md +9 -2
- package/skills/caveman-compress/README.md +11 -4
- package/skills/caveman-compress/SKILL.md +13 -7
- package/skills/caveman-help/SKILL.md +3 -2
package/AGENTS.md
CHANGED
|
@@ -12,6 +12,12 @@ Project memory for agents working in this repo. Non-obvious conventions only.
|
|
|
12
12
|
session always starts `off`. There is **no** cross-session config file or env var.
|
|
13
13
|
- Activation = `before_agent_start` appends `modeInstructions(mode)` to the
|
|
14
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.
|
|
15
21
|
- Pi 0.80.2 has **no `agents/` subagent mechanism**. The `agents/cavecrew-*.md`
|
|
16
22
|
files are reference personas only and cavecrew is optional/out-of-scope.
|
|
17
23
|
|
|
@@ -24,12 +30,18 @@ Project memory for agents working in this repo. Non-obvious conventions only.
|
|
|
24
30
|
- **Verbatim preservation**: caveman-compress never alters code blocks, inline
|
|
25
31
|
code, URLs, file paths, commands, or exact error strings. The skill instructs
|
|
26
32
|
the agent to self-validate these against the original and, on any mismatch it
|
|
27
|
-
cannot fix, restore from the `.original` backup
|
|
33
|
+
cannot fix, restore from the `.original` backup that was created during the
|
|
34
|
+
same invocation (stale backups are rejected before compression starts).
|
|
28
35
|
- `caveman-compress` is **prompt-only**: the Pi agent performs the compression
|
|
29
36
|
with its own model and file tools, driven by `SKILL.md`. There is no Python and
|
|
30
37
|
no external model CLI; coverage is the doc-guard test `tests/compress-docs.test.mjs`.
|
|
31
38
|
|
|
32
|
-
##
|
|
39
|
+
## Changelog
|
|
40
|
+
|
|
41
|
+
Every notable change must update `CHANGELOG.md` under `[Unreleased]`. Before
|
|
42
|
+
finishing a task, run `npm run changelog:check` to confirm the changelog was
|
|
43
|
+
updated for the files you changed. CI also runs this check on every pull
|
|
44
|
+
request.
|
|
33
45
|
|
|
34
46
|
- `npm test` runs `pretest` (`npm run typecheck` → `tsc --noEmit`) first, then the
|
|
35
47
|
`node --test` suites under `tests/`. Typecheck failures fail the test run.
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,55 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.4.0] - 2026-06-29
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- `caveman-compress` no longer restores from a potentially stale `.original`
|
|
15
|
+
backup on validation failure; it now aborts if a backup already exists and
|
|
16
|
+
only restores from the backup created during the same invocation.
|
|
17
|
+
- `caveman-compress` README clarified: users should edit the source file and
|
|
18
|
+
remove/rename the old `.original` backup before re-compressing; extensionless
|
|
19
|
+
files now have an explicit `.original` backup rule.
|
|
20
|
+
- Extension command handler tests now `await` async handlers, preventing false
|
|
21
|
+
greens if handlers become asynchronous.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- Workflow test now matches the actual `run: npm publish` step instead of any
|
|
26
|
+
`npm publish` substring.
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- `scripts/check-changelog.mjs` and a CI check (`npm run changelog:check`)
|
|
31
|
+
enforce that `CHANGELOG.md` is updated for any notable file change; the
|
|
32
|
+
project convention also instructs agents to update the changelog under
|
|
33
|
+
`[Unreleased]`.
|
|
34
|
+
|
|
35
|
+
## [0.3.0] - 2026-06-29
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- `/caveman-help` card linked "Full docs" to the upstream `JuliusBrussee/caveman`
|
|
40
|
+
repo; now points to `kulapard/pi-caveman`.
|
|
41
|
+
- `caveman-help` skill table was missing `/caveman-stats`, disagreeing with the
|
|
42
|
+
extension's own `HELP_TEXT`; added the row.
|
|
43
|
+
- `ultra` mode was documented as "Tables over prose" in the README and help
|
|
44
|
+
card, contradicting the injected mode instructions; docs now match behavior
|
|
45
|
+
(abbreviate prose words, arrows for causality).
|
|
46
|
+
- Input handler no longer throws when an input event arrives without `text`
|
|
47
|
+
(`event.text.trim()` → `(event.text ?? "").trim()`).
|
|
48
|
+
- `caveman-compress` docs said the backup is always `FILE.original.md`, but the
|
|
49
|
+
skill preserves the source extension; corrected to `FILE.original.<ext>`.
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
|
|
53
|
+
- `engines.node` floor raised from `>=18` to `>=22.6.0`, matching the
|
|
54
|
+
`node --experimental-strip-types` requirement of the test/typecheck workflow.
|
|
55
|
+
- Natural-language activation now also triggers on `"be brief"` (added to
|
|
56
|
+
`ACTIVATION_RE`, the `caveman` skill description, and the README) so the
|
|
57
|
+
deterministic regex matches the advertised triggers.
|
|
58
|
+
|
|
10
59
|
## [0.2.0] - 2026-06-29
|
|
11
60
|
|
|
12
61
|
### Changed
|
|
@@ -41,6 +90,8 @@ port of [caveman](https://github.com/JuliusBrussee/caveman).
|
|
|
41
90
|
token, automatic provenance, a tag-equals-version guard, and a concurrency
|
|
42
91
|
group).
|
|
43
92
|
|
|
44
|
-
[Unreleased]: https://github.com/kulapard/pi-caveman/compare/v0.
|
|
93
|
+
[Unreleased]: https://github.com/kulapard/pi-caveman/compare/v0.4.0...HEAD
|
|
94
|
+
[0.4.0]: https://github.com/kulapard/pi-caveman/compare/v0.3.0...v0.4.0
|
|
95
|
+
[0.3.0]: https://github.com/kulapard/pi-caveman/compare/v0.2.0...v0.3.0
|
|
45
96
|
[0.2.0]: https://github.com/kulapard/pi-caveman/compare/v0.1.0...v0.2.0
|
|
46
97
|
[0.1.0]: https://github.com/kulapard/pi-caveman/releases/tag/v0.1.0
|
package/README.md
CHANGED
|
@@ -12,9 +12,9 @@ plus a set of skills under `skills/`.
|
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
15
|
-
pi-caveman
|
|
15
|
+
pi-caveman is published to npm as
|
|
16
16
|
[`@kulapard/pi-caveman`](https://www.npmjs.com/package/@kulapard/pi-caveman).
|
|
17
|
-
|
|
17
|
+
Install it into a Pi setup with:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
pi install npm:@kulapard/pi-caveman
|
|
@@ -67,7 +67,7 @@ session ends.
|
|
|
67
67
|
|------|---------|--------|
|
|
68
68
|
| **lite** | `/caveman lite` | Drop filler. Keep sentence structure. |
|
|
69
69
|
| **full** | `/caveman` | Drop articles, filler, pleasantries, hedging. Fragments OK. Default. |
|
|
70
|
-
| **ultra** | `/caveman ultra` | Extreme compression. Bare fragments.
|
|
70
|
+
| **ultra** | `/caveman ultra` | Extreme compression. Bare fragments. Abbreviate prose words; arrows (X → Y). |
|
|
71
71
|
| **wenyan-lite** | `/caveman wenyan-lite` | Classical Chinese (文言文) style, light compression. |
|
|
72
72
|
| **wenyan-full** | `/caveman wenyan` | Full 文言文. Maximum classical terseness. |
|
|
73
73
|
| **wenyan-ultra** | `/caveman wenyan-ultra` | Extreme classical terseness. |
|
|
@@ -91,7 +91,7 @@ You don't have to use a slash command. The extension watches your messages and
|
|
|
91
91
|
switches mode on phrases like:
|
|
92
92
|
|
|
93
93
|
- **Activate:** "caveman mode", "talk like caveman", "use caveman", "less
|
|
94
|
-
tokens", "fewer tokens", "save tokens" → enables **full** mode.
|
|
94
|
+
tokens", "fewer tokens", "save tokens", "be brief" → enables **full** mode.
|
|
95
95
|
- **Deactivate:** "stop caveman", "normal mode", "disable caveman" → turns it
|
|
96
96
|
off.
|
|
97
97
|
|
|
@@ -118,7 +118,7 @@ package — so it does not belong in this extension-plus-skills package.
|
|
|
118
118
|
|
|
119
119
|
The Pi-side equivalent is the `caveman-compress` skill, invoked via the
|
|
120
120
|
`/caveman-compress` command. It is prompt-only: the Pi agent itself compresses a
|
|
121
|
-
prose memory file in place (writing a `FILE.original
|
|
121
|
+
prose memory file in place (writing a `FILE.original.<ext>` backup) using its own
|
|
122
122
|
model and file tools, preserving code, URLs, and paths verbatim. No Python and no
|
|
123
123
|
external Claude CLI are involved — compression is performed by the host Pi agent,
|
|
124
124
|
the same way the other skills work.
|
|
@@ -90,5 +90,5 @@ Auto-clarity:
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
export const ACTIVATION_RE =
|
|
93
|
-
/\b(caveman mode|talk like caveman|use caveman|less tokens|fewer tokens|save tokens)\b/i;
|
|
93
|
+
/\b(caveman mode|talk like caveman|use caveman|less tokens|fewer tokens|save tokens|be brief)\b/i;
|
|
94
94
|
export const DEACTIVATION_RE = /\b(stop caveman|normal mode|disable caveman)\b/i;
|
package/extensions/caveman.ts
CHANGED
|
@@ -133,15 +133,14 @@ export default function cavemanExtension(pi: ExtensionAPI) {
|
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
pi.on("input", (event, ctx) => {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
return { action: "continue" as const };
|
|
136
|
+
// Ignore the extension's own echoed input (self-echo guard).
|
|
137
|
+
if (event.source !== "extension") {
|
|
138
|
+
const text = (event.text ?? "").trim();
|
|
139
|
+
if (DEACTIVATION_RE.test(text)) {
|
|
140
|
+
if (mode !== "off") persistMode("off", ctx);
|
|
141
|
+
} else if (mode === "off" && ACTIVATION_RE.test(text)) {
|
|
142
|
+
persistMode("full", ctx);
|
|
143
|
+
}
|
|
145
144
|
}
|
|
146
145
|
return { action: "continue" as const };
|
|
147
146
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kulapard/pi-caveman",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
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",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"CHANGELOG.md"
|
|
24
24
|
],
|
|
25
25
|
"engines": {
|
|
26
|
-
"node": ">=
|
|
26
|
+
"node": ">=22.6.0"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|
|
29
29
|
"pi-package",
|
|
@@ -45,10 +45,11 @@
|
|
|
45
45
|
"pretest": "npm run typecheck",
|
|
46
46
|
"test": "node --experimental-strip-types --test tests/**/*.test.mjs",
|
|
47
47
|
"typecheck": "tsc --noEmit",
|
|
48
|
-
"prepublishOnly": "npm test"
|
|
48
|
+
"prepublishOnly": "npm test",
|
|
49
|
+
"changelog:check": "node scripts/check-changelog.mjs --base origin/master"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
52
|
"@earendil-works/pi-coding-agent": "^0.80.2",
|
|
52
|
-
"typescript": "^
|
|
53
|
+
"typescript": "^6"
|
|
53
54
|
}
|
|
54
55
|
}
|
package/skills/caveman/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: >
|
|
|
5
5
|
while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra,
|
|
6
6
|
wenyan-lite, wenyan-full, wenyan-ultra.
|
|
7
7
|
Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens",
|
|
8
|
-
"be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
|
|
8
|
+
"fewer tokens", "save tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
Respond terse like smart caveman. All technical substance stay. Only fluff die.
|
|
@@ -41,6 +41,7 @@ Yes: "Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:"
|
|
|
41
41
|
| **wenyan-ultra** | Extreme abbreviation while keeping classical Chinese feel. Maximum compression, ultra terse |
|
|
42
42
|
|
|
43
43
|
Example — "Why React component re-render?"
|
|
44
|
+
|
|
44
45
|
- lite: "Your component re-renders because you create a new object reference each render. Wrap it in `useMemo`."
|
|
45
46
|
- full: "New object ref each render. Inline object prop = new ref = re-render. Wrap in `useMemo`."
|
|
46
47
|
- ultra: "Inline obj prop → new ref → re-render. `useMemo`."
|
|
@@ -49,6 +50,7 @@ Example — "Why React component re-render?"
|
|
|
49
50
|
- wenyan-ultra: "新參照→重繪。useMemo Wrap。"
|
|
50
51
|
|
|
51
52
|
Example — "Explain database connection pooling."
|
|
53
|
+
|
|
52
54
|
- lite: "Connection pooling reuses open connections instead of creating new ones per request. Avoids repeated handshake overhead."
|
|
53
55
|
- full: "Pool reuse open DB connections. No new connection per request. Skip handshake overhead."
|
|
54
56
|
- ultra: "Pool = reuse DB conn. Skip handshake → fast under load."
|
|
@@ -58,6 +60,7 @@ Example — "Explain database connection pooling."
|
|
|
58
60
|
## Auto-Clarity
|
|
59
61
|
|
|
60
62
|
Drop caveman when:
|
|
63
|
+
|
|
61
64
|
- Security warnings
|
|
62
65
|
- Irreversible action confirmations
|
|
63
66
|
- Multi-step sequences where fragment order or omitted conjunctions risk misread
|
|
@@ -68,11 +71,15 @@ Resume caveman after clear part done.
|
|
|
68
71
|
|
|
69
72
|
Example — destructive op:
|
|
70
73
|
> **Warning:** This will permanently delete all rows in the `users` table and cannot be undone.
|
|
74
|
+
>
|
|
71
75
|
> ```sql
|
|
72
76
|
> DROP TABLE users;
|
|
73
77
|
> ```
|
|
78
|
+
>
|
|
74
79
|
> Caveman resume. Verify backup exist first.
|
|
75
80
|
|
|
76
81
|
## Boundaries
|
|
77
82
|
|
|
78
|
-
Code/
|
|
83
|
+
Code explanations / architecture discussion: write normal. "stop caveman" or "normal mode": revert. Level persist until changed or session end.
|
|
84
|
+
|
|
85
|
+
Note: when the user asks for a commit message, use `caveman-commit`. When asked to review a diff/PR, use `caveman-review`. Those skills override this line for their specific output.
|
|
@@ -22,10 +22,10 @@ The agent reads its memory file (`AGENTS.md` / `CLAUDE.md`) on every session sta
|
|
|
22
22
|
|
|
23
23
|
```
|
|
24
24
|
AGENTS.md ← compressed (the agent reads this — fewer tokens every session)
|
|
25
|
-
AGENTS.original.md ← human-readable backup (
|
|
25
|
+
AGENTS.original.md ← human-readable backup (snapshot taken at first compression)
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
Original never lost.
|
|
28
|
+
Original never lost — first compression writes a verbatim backup. To edit and re-compress, **edit `AGENTS.md` itself**, then delete or rename the existing `AGENTS.original.md` so the next `/caveman-compress` can create a fresh backup.
|
|
29
29
|
|
|
30
30
|
## Benchmarks
|
|
31
31
|
|
|
@@ -81,6 +81,7 @@ its own model and file tools — there is no separate tool or language to instal
|
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
Examples:
|
|
84
|
+
|
|
84
85
|
```
|
|
85
86
|
/caveman-compress AGENTS.md
|
|
86
87
|
/caveman-compress CLAUDE.md
|
|
@@ -96,6 +97,7 @@ Examples:
|
|
|
96
97
|
| Extensionless natural language | ✅ Yes |
|
|
97
98
|
| `.py`, `.js`, `.ts`, `.json`, `.yaml` | ❌ Skip (code/config) |
|
|
98
99
|
| `*.original.md` | ❌ Skip (backup files) |
|
|
100
|
+
| `*.original` (extensionless) | ❌ Skip (backup files) |
|
|
99
101
|
|
|
100
102
|
## How It Work
|
|
101
103
|
|
|
@@ -104,15 +106,20 @@ Examples:
|
|
|
104
106
|
↓
|
|
105
107
|
agent detects file type (prose? else skip)
|
|
106
108
|
↓
|
|
107
|
-
agent
|
|
109
|
+
agent checks for existing backup → abort if stale `.original` exists
|
|
110
|
+
↓
|
|
111
|
+
agent backs up original once → AGENTS.original.md (verbatim snapshot)
|
|
108
112
|
↓
|
|
109
113
|
agent rewrites prose to caveman, code/URLs/paths left exact
|
|
110
114
|
↓
|
|
111
115
|
agent self-validates: protected tokens byte-identical to original
|
|
112
116
|
↓
|
|
113
|
-
if a protected token changed: fix it, or restore from backup and report
|
|
117
|
+
if a protected token changed: fix it, or restore from the just-created backup and report
|
|
114
118
|
↓
|
|
115
119
|
write compressed → AGENTS.md
|
|
120
|
+
|
|
121
|
+
To re-compress, edit `AGENTS.md`, then remove/rename the old `AGENTS.original.md`
|
|
122
|
+
so the skill can create a fresh snapshot.
|
|
116
123
|
```
|
|
117
124
|
|
|
118
125
|
The agent does this with its own model and file tools — no external CLI, no separate runtime.
|
|
@@ -3,7 +3,7 @@ name: caveman-compress
|
|
|
3
3
|
description: >
|
|
4
4
|
Compress natural language memory files (AGENTS.md, CLAUDE.md, todos, preferences) into caveman
|
|
5
5
|
format to save input tokens. Preserves all technical substance, code, URLs, and structure.
|
|
6
|
-
Compressed version overwrites the original file. Human-readable backup saved as FILE.original.
|
|
6
|
+
Compressed version overwrites the original file. Human-readable backup saved as FILE.original.<ext> (same extension as the source).
|
|
7
7
|
Trigger: /caveman-compress FILEPATH or "compress memory file"
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ description: >
|
|
|
11
11
|
|
|
12
12
|
## Purpose
|
|
13
13
|
|
|
14
|
-
Compress natural language files (`AGENTS.md`, `CLAUDE.md`, todos, preferences) into caveman-speak to reduce input tokens. Compressed version overwrites original. Human-readable backup saved as `<filename>.original.md
|
|
14
|
+
Compress natural language files (`AGENTS.md`, `CLAUDE.md`, todos, preferences) into caveman-speak to reduce input tokens. Compressed version overwrites original. Human-readable backup saved as `<filename>.original.<ext>` (same extension as the source, e.g. `AGENTS.md` → `AGENTS.original.md`, `notes.txt` → `notes.original.txt`).
|
|
15
15
|
|
|
16
16
|
## Trigger
|
|
17
17
|
|
|
@@ -21,12 +21,12 @@ Compress natural language files (`AGENTS.md`, `CLAUDE.md`, todos, preferences) i
|
|
|
21
21
|
|
|
22
22
|
You (the Pi agent) perform the compression directly — there is no separate tool to run. Given `/caveman-compress <filepath>`:
|
|
23
23
|
|
|
24
|
-
1. **Skip backups.** If the path ends in `.original.<ext>` (e.g. `AGENTS.original.md`), stop — never compress a backup file.
|
|
24
|
+
1. **Skip backups.** If the path ends in `.original.<ext>` or, for extensionless files, in `.original` (e.g. `AGENTS.original.md`, `NOTES.original`), stop — never compress a backup file.
|
|
25
25
|
2. **Check it is compressible** per **Boundaries** below: prose files (`.md`, `.txt`, `.rst`, `.typ`, `.typst`, `.tex`, or extensionless natural language). If it is code/config (`.py`, `.js`, `.ts`, `.json`, `.yaml`, …) or larger than ~500 KB, report it is out of scope and stop.
|
|
26
26
|
3. **Read** the file's full contents.
|
|
27
|
-
4. **Back up the original.**
|
|
27
|
+
4. **Back up the original.** If a `.original`/`.original.<ext>` backup already exists, **abort** and tell the user to remove or rename the stale backup before re-compressing. Otherwise write a verbatim copy to `<filename>.original.<ext>` (or `<filename>.original` for extensionless files) before any rewrite.
|
|
28
28
|
5. **Rewrite** the file in place, applying the **Compression Rules** below. Treat code blocks, inline code, URLs, paths, commands, headings, and table structure as read-only regions.
|
|
29
|
-
6. **Self-validate** against the contents you read in step 3: every protected token — fenced and inline code, URLs, file paths, heading text, table structure, dates/version numbers — must be byte-for-byte identical. If any changed, fix just that region; if you cannot make it identical, restore the file from the
|
|
29
|
+
6. **Self-validate** against the contents you read in step 3: every protected token — fenced and inline code, URLs, file paths, heading text, table structure, dates/version numbers — must be byte-for-byte identical. If any changed, fix just that region; if you cannot make it identical, restore the file from the backup you wrote in step 4 and report the failure rather than leave a corrupted file.
|
|
30
30
|
7. **Report** the result: bytes before/after and the approximate reduction.
|
|
31
31
|
|
|
32
32
|
Only the rewrite needs the model (you); detection, backup, and validation are mechanical.
|
|
@@ -34,6 +34,7 @@ Only the rewrite needs the model (you); detection, backup, and validation are me
|
|
|
34
34
|
## Compression Rules
|
|
35
35
|
|
|
36
36
|
### Remove
|
|
37
|
+
|
|
37
38
|
- Articles: a, an, the
|
|
38
39
|
- Filler: just, really, basically, actually, simply, essentially, generally
|
|
39
40
|
- Pleasantries: "sure", "certainly", "of course", "happy to", "I'd recommend"
|
|
@@ -42,6 +43,7 @@ Only the rewrite needs the model (you); detection, backup, and validation are me
|
|
|
42
43
|
- Connective fluff: "however", "furthermore", "additionally", "in addition"
|
|
43
44
|
|
|
44
45
|
### Preserve EXACTLY (never modify)
|
|
46
|
+
|
|
45
47
|
- Code blocks (fenced ``` and indented)
|
|
46
48
|
- Inline code (`backtick content`)
|
|
47
49
|
- URLs and links (full URLs, markdown links)
|
|
@@ -53,6 +55,7 @@ Only the rewrite needs the model (you); detection, backup, and validation are me
|
|
|
53
55
|
- Environment variables (`$HOME`, `NODE_ENV`)
|
|
54
56
|
|
|
55
57
|
### Preserve Structure
|
|
58
|
+
|
|
56
59
|
- All markdown headings (keep exact heading text, compress body below)
|
|
57
60
|
- Bullet point hierarchy (keep nesting level)
|
|
58
61
|
- Numbered lists (keep numbering)
|
|
@@ -60,6 +63,7 @@ Only the rewrite needs the model (you); detection, backup, and validation are me
|
|
|
60
63
|
- Frontmatter/YAML headers in markdown files
|
|
61
64
|
|
|
62
65
|
### Compress
|
|
66
|
+
|
|
63
67
|
- Use short synonyms: "big" not "extensive", "fix" not "implement a solution for", "use" not "utilize"
|
|
64
68
|
- Fragments OK: "Run tests before commit" not "You should always run tests before committing"
|
|
65
69
|
- Drop "you should", "make sure to", "remember to" — just state the action
|
|
@@ -69,6 +73,7 @@ Only the rewrite needs the model (you); detection, backup, and validation are me
|
|
|
69
73
|
CRITICAL RULE:
|
|
70
74
|
Anything inside ``` ... ``` must be copied EXACTLY.
|
|
71
75
|
Do not:
|
|
76
|
+
|
|
72
77
|
- remove comments
|
|
73
78
|
- remove spacing
|
|
74
79
|
- reorder lines
|
|
@@ -79,6 +84,7 @@ Inline code (`...`) must be preserved EXACTLY.
|
|
|
79
84
|
Do not modify anything inside backticks.
|
|
80
85
|
|
|
81
86
|
If file contains code blocks:
|
|
87
|
+
|
|
82
88
|
- Treat code blocks as read-only regions
|
|
83
89
|
- Only compress text outside them
|
|
84
90
|
- Do not merge sections around code
|
|
@@ -104,5 +110,5 @@ Compressed:
|
|
|
104
110
|
- Skip files larger than ~500 KB (too big to rewrite safely in one pass)
|
|
105
111
|
- If file has mixed content (prose + code), compress ONLY the prose sections
|
|
106
112
|
- If unsure whether something is code or prose, leave it unchanged
|
|
107
|
-
- Original file is backed up as FILE.original
|
|
108
|
-
- Never compress FILE.original
|
|
113
|
+
- Original file is backed up as FILE.original.<ext> (same extension as the source) before overwriting
|
|
114
|
+
- Never compress a FILE.original.<ext> backup (skip it)
|
|
@@ -16,7 +16,7 @@ Display this reference card when invoked. One-shot — do NOT change mode, write
|
|
|
16
16
|
|------|---------|-------------|
|
|
17
17
|
| **Lite** | `/caveman lite` | Drop filler. Keep sentence structure. |
|
|
18
18
|
| **Full** | `/caveman` | Drop articles, filler, pleasantries, hedging. Fragments OK. Default. |
|
|
19
|
-
| **Ultra** | `/caveman ultra` | Extreme compression. Bare fragments.
|
|
19
|
+
| **Ultra** | `/caveman ultra` | Extreme compression. Bare fragments. Abbreviate prose words; arrows (X → Y). |
|
|
20
20
|
| **Wenyan-Lite** | `/caveman wenyan-lite` | Classical Chinese style, light compression. |
|
|
21
21
|
| **Wenyan-Full** | `/caveman wenyan` | Full 文言文. Maximum classical terseness. |
|
|
22
22
|
| **Wenyan-Ultra** | `/caveman wenyan-ultra` | Extreme. Ancient scholar on a budget. |
|
|
@@ -30,6 +30,7 @@ Mode stick until changed or session end.
|
|
|
30
30
|
| **caveman-commit** | `/caveman-commit` | Terse commit messages. Conventional Commits. ≤50 char subject. |
|
|
31
31
|
| **caveman-review** | `/caveman-review` | One-line PR comments: `L42: bug: user null. Add guard.` |
|
|
32
32
|
| **caveman-compress** | `/caveman-compress <file>` | Compress .md files to caveman prose. Saves ~46% input tokens. |
|
|
33
|
+
| **caveman-stats** | `/caveman-stats` | On-demand, model-driven estimate of tokens saved this session. |
|
|
33
34
|
| **caveman-help** | `/caveman-help` | This card. |
|
|
34
35
|
|
|
35
36
|
## Deactivate
|
|
@@ -48,4 +49,4 @@ Mode set per session. New session start → mode `off`; activate again with `/ca
|
|
|
48
49
|
|
|
49
50
|
## More
|
|
50
51
|
|
|
51
|
-
Full docs: https://github.com/
|
|
52
|
+
Full docs: https://github.com/kulapard/pi-caveman
|