@izhimu/pi-caveman 0.2.1 → 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/CHANGELOG.md CHANGED
@@ -2,6 +2,48 @@
2
2
 
3
3
  All notable changes to `@izhimu/pi-caveman` will be documented in this file.
4
4
 
5
+ ## [0.4.0] - 2026-10-10
6
+
7
+ ### Added & Changed
8
+ - **Three Skills, One Mode Model (Upstream 3.2.0 Sync)**:
9
+ - Replaced the 6 intensity levels with 3 dedicated standalone skills:
10
+ - `caveman`: Default smart terse voice, adhering to 9 core rules.
11
+ - `ultracave`: Grammar stripped, fragments only, each fact once.
12
+ - `megacave`: Classical Chinese (文言文) register with character minimization.
13
+ - Shipped `skills/ultracave/` and `skills/megacave/` skills directories alongside `skills/caveman/`.
14
+ - Added `canonicalMode()` to seamlessly map legacy mode names (`full`, `lite`, `ultra`, `wenyan*`) to the new three-skill architecture.
15
+ - **Upstream 3.2.0 Core Rules**:
16
+ - Rule 6: Retain existing file comments in full unless explicitly asked to modify them.
17
+ - Rule 7: Bounded tool runs — no narration between routine tool calls; single-line phase notices.
18
+ - Exceptions: Always use full sentences when offering options or asking clarifying questions to the user.
19
+ - Updated reinforcement thesis line extraction to synchronize with skill definitions.
20
+ - **Commands & UX**:
21
+ - Added dedicated `/ultracave` and `/megacave` slash commands.
22
+ - Supported `/caveman status` as a first-class subcommand.
23
+ - Non-permanent status bar: clears status bar on mode changes and session start while providing clean transient toast notifications (`ui.notify`).
24
+ - **Testing**:
25
+ - Comprehensive unit test suite covering mode canonicalization, three-skill loading, negation boundaries, and slash command parsing without logic duplication.
26
+
27
+ ## [0.3.0] - 2026-09-17
28
+
29
+ ### Changed & Improved
30
+ - **Upstream Core Sync**: Synchronized `skills/caveman/SKILL.md` with upstream Caveman ruleset:
31
+ - Added ASD-STE100 Simplified Technical English clarity register (sentences ≤20 words, imperative instructions, unambiguous terms).
32
+ - Added explicit reply-language precedence (honoring user/project language directives while preserving technical terms).
33
+ - Removed meta-announcements and boilerplate prefixes (`me caveman think`, `Caveman:` tags).
34
+ - Shortened skill description and token-optimized punctuation.
35
+ - **Host Adaptation (pi & oh-my-pi)**:
36
+ - Dynamic host directory resolution (`~/.pi` vs `~/.omp`) for flags and logs.
37
+ - Gated prompt reinforcement: injects full ruleset on activation or mode change; subsequent turns use lightweight one-line reminders to save tokens and avoid prompt cache misses.
38
+ - Session persistence: preserves mid-session modes across compactions, reloads, and forks.
39
+ - Removed unsupported `attribution: "system"` property from injected custom messages.
40
+ - Added `"omp"` manifest and optional peer dependencies in `package.json`.
41
+ - **Robust Mode Parsing**:
42
+ - Integrated upstream gap whitelist (`ACTIVATION_GAP`) to prevent false positives on phrases like "i want to start building a caveman-themed game".
43
+ - Added clause-bounded negation detection (`don't activate caveman` won't trigger; `don't use vim, activate caveman` works).
44
+ - **Pruning**:
45
+ - Removed `caveman-compress` skill and Python scripts to keep the package lightweight and focused purely on core caveman communication.
46
+
5
47
  ## [0.2.1] - 2026-08-21
6
48
 
7
49
  ### Changed & Improved
package/README.md CHANGED
@@ -10,82 +10,76 @@ Upstream: [JuliusBrussee/caveman](https://github.com/JuliusBrussee/caveman)
10
10
 
11
11
  ## Features
12
12
 
13
- - **Auto-activates** on every pi / oh-my-pi session (default: `full` intensity)
14
- - **6 intensity levels** — from `lite` (professional, no filler) to `wenyan-ultra` (extreme classical Chinese compression)
15
- - **Per-turn reinforcement** keeps the model concise even as context grows
16
- - **Memory file compression** (`/caveman-compress`) — shrinks `AGENTS.md`, `CLAUDE.md`, and project notes with atomic backup and validation
17
- - **Natural language triggers** — "talk like caveman", "be brief", "stop caveman", "normal mode" (with quote disambiguation)
18
- - **Direct persistence** — `/caveman <mode>` instantly applies and saves default mode across sessions
19
- - **Token savings stats** — tracks session output tokens and estimated savings via `/caveman-status`
20
-
13
+ - **Auto-activates** on every pi / oh-my-pi session (default: `caveman` mode)
14
+ - **3 dedicated skills** — `caveman` (smart concise voice), `ultracave` (payload only, fragments), and `megacave` (文言文 Classical Chinese)
15
+ - **9 core upstream 3.2.0 rules** — answer first, kill ceremony, STE clarity, preserved comments, bounded tool runs
16
+ - **Per-turn reinforcement** keeps the model concise without prompt bloat or cache misses
17
+ - **Natural language triggers** — "talk like caveman", "be brief", "stop caveman", "normal mode" (with negation guard and gap whitelist)
18
+ - **Direct persistence & aliases** — `/caveman`, `/ultracave`, `/megacave` instantly apply and persist; legacy aliases (`full`, `lite`, `ultra`, `wenyan`) seamlessly mapped
19
+ - **Token savings stats** — tracks session output tokens and estimated savings via `/caveman status` or `/caveman-status`
21
20
  ## Install
22
21
 
23
22
  ### npm (recommended)
24
23
 
24
+ For pi:
25
25
  ```bash
26
26
  pi install @izhimu/pi-caveman
27
27
  ```
28
28
 
29
+ For oh-my-pi (omp):
30
+ ```bash
31
+ omp plugin install @izhimu/pi-caveman
32
+ ```
33
+
29
34
  ### From git
30
35
 
31
36
  ```bash
32
- # Global
37
+ # Global (pi)
33
38
  pi install git:github.com/izhimu/pi-caveman
34
39
 
35
- # Project-local (shared with team via .pi/settings.json)
40
+ # Project-local (pi)
36
41
  pi install git:github.com/izhimu/pi-caveman -l
37
42
  ```
38
43
 
39
- ### From local path
40
-
41
- ```bash
42
- pi install /path/to/pi-caveman
43
- pi install ./relative/path/to/pi-caveman
44
- ```
45
-
46
44
  ### Quick test (no install)
47
45
 
48
46
  ```bash
49
47
  pi -e ./extensions/caveman.ts
48
+ # or
49
+ omp -e ./extensions/caveman.ts
50
50
  ```
51
51
 
52
52
  ## Commands
53
53
 
54
54
  | Command | Effect |
55
55
  |---------|--------|
56
- | `/caveman` | Activate with default mode (persists) |
57
- | `/caveman lite` | Lite mode — no filler/hedging, keep articles (persists) |
58
- | `/caveman full` | Full mode — fragments OK, short synonyms (default, persists) |
59
- | `/caveman ultra` | Ultra mode — one word when one word enough (persists) |
60
- | `/caveman wenyan` | 文言文 mode (classical Chinese terseness, persists) |
56
+ | `/caveman` | Activate default caveman mode (persists) |
57
+ | `/caveman <mode>` | Switch mode: `caveman`, `ultracave`, `megacave`, `off`, `status` (persists) |
58
+ | `/ultracave` | Switch directly to ultracave mode (maximum compression, fragments only) |
59
+ | `/megacave` | Switch directly to megacave mode (Classical Chinese 文言文) |
60
+ | `/caveman status` | Show current mode, session token usage, and config paths |
61
+ | `/caveman-status` | Alias for `/caveman status` |
61
62
  | `/caveman off` | Deactivate caveman mode (persists) |
62
- | `/caveman-compress <file>` | Compress memory file (`AGENTS.md`, `todos.md`, etc.) |
63
- | `/caveman-status` | Show current mode, session tokens, and config paths |
64
63
 
65
- All `/caveman <mode>` commands automatically persist to user config (`~/.config/caveman/config.json` or `%APPDATA%\caveman\config.json`).
64
+ All `/caveman <mode>`, `/ultracave`, and `/megacave` commands automatically persist to user config (`~/.config/caveman/config.json` or `%APPDATA%\caveman\config.json`). Legacy aliases (`full`, `lite`, `ultra`, `wenyan*`) are transparently mapped.
66
65
 
67
- Natural-language triggers also work: "talk like caveman", "stop caveman", "normal mode".
66
+ Natural-language triggers also work: "talk like caveman", "be brief", "less tokens", "stop caveman", "normal mode".
68
67
 
69
- ## Intensity Levels
68
+ ## Skills & Modes
70
69
 
71
- | Level | Description |
72
- |-------|-------------|
73
- | **lite** | No filler/hedging. Keep articles + full sentences. Professional but tight |
74
- | **full** | Drop articles, fragments OK, short synonyms. Classic caveman (default) |
75
- | **ultra** | Strip conjunctions. One word when one word enough |
76
- | **wenyan-lite** | Semi-classical Chinese. Drop filler but keep grammar structure |
77
- | **wenyan-full** | Maximum classical Chinese terseness. 80-90% character reduction |
78
- | **wenyan-ultra** | Extreme abbreviation with classical Chinese feel |
70
+ | Skill / Mode | Description | Savings |
71
+ |--------------|-------------|---------|
72
+ | **`caveman`** | Smart caveman voice. Terse, active voice, 9 upstream 3.2.0 rules (default) | ~65% tokens |
73
+ | **`ultracave`** | Maximum compression. Grammar stripped, payload only, fragments | ~75% tokens |
74
+ | **`megacave`** | Classical Chinese (文言文). Drastically fewer characters on screen | ~80% tokens |
79
75
 
80
76
  ### Examples
81
77
 
82
- **Q: "Why React component re-render?"**
83
-
84
- - **lite:** "Your component re-renders because you create a new object reference each render. Wrap it in `useMemo`."
85
- - **full:** "New object ref each render. Inline object prop = new ref = re-render. Wrap in `useMemo`."
86
- - **ultra:** "Inline obj prop, new ref, re-render. `useMemo`."
87
- - **wenyan-full:** "每繪新生對象參照,故重繪;以 useMemo 包之則免。"
78
+ **Q: "Why does my React component re-render?"**
88
79
 
80
+ - **caveman:** "New object ref each render. Inline object prop = new ref = re-render. Wrap in `useMemo`."
81
+ - **ultracave:** "Inline obj prop, new ref, re-render. `useMemo`."
82
+ - **megacave:** "每繪新生對象參照,故重繪;以 `useMemo` 包之則免。"
89
83
  ## Configuration
90
84
 
91
85
  Switch and persist directly with `/caveman <mode>` (e.g. `/caveman ultra`).
@@ -95,22 +89,22 @@ Default mode resolution order:
95
89
  1. `CAVEMAN_DEFAULT_MODE` environment variable
96
90
  2. Repo-local: `.caveman/config.json` or `.caveman.json` (walks up to root)
97
91
  3. User config: `~/.config/caveman/config.json` (or `%APPDATA%\caveman\config.json` on Windows)
98
- 4. `full` (fallback default)
92
+ 4. `caveman` (fallback default)
99
93
 
100
94
  Manual config file format:
101
95
  ```json
102
96
  {
103
- "defaultMode": "ultra"
97
+ "defaultMode": "ultracave"
104
98
  }
105
99
  ```
106
100
 
107
101
  ## How It Works
108
102
 
109
- pi loads extensions and skills declared in `package.json#pi`. This extension hooks into four lifecycle events:
103
+ pi and oh-my-pi load extensions and skills declared in `package.json` (`pi` / `omp`). This extension hooks into four lifecycle events:
110
104
 
111
- 1. **`session_start`** — writes mode flag, notifies user
112
- 2. **`before_agent_start`** — injects filtered caveman rules per turn
113
- 3. **`input`** — intercepts `/caveman` commands and natural-language triggers (with quoted-span protection)
105
+ 1. **`session_start`** — writes mode flag, notifies user via toast, preserves mid-session modes across compactions/reloads
106
+ 2. **`before_agent_start`** — injects full skill ruleset on activation/mode-switch, and lightweight reminders on subsequent turns
107
+ 3. **`input`** — intercepts `/caveman`, `/ultracave`, `/megacave` commands and natural-language triggers (with negation and clause-boundary guards)
114
108
  4. **`turn_end`** — accumulates token usage and savings stats
115
109
 
116
110
  ## Project Structure
@@ -118,13 +112,13 @@ pi loads extensions and skills declared in `package.json#pi`. This extension hoo
118
112
  ```
119
113
  pi-caveman/
120
114
  ├── extensions/
121
- │ └── caveman.ts # pi ExtensionAPI integration & mode manager
115
+ │ └── caveman.ts # pi & omp ExtensionAPI integration & mode manager
122
116
  ├── skills/
123
- │ ├── caveman/ # Core compression rules (SKILL.md)
124
- │ └── caveman-compress/ # Local memory file compression engine
125
- ├── tests/ # Validation test suite
117
+ │ ├── caveman/ # Standard caveman voice (SKILL.md)
118
+ │ ├── ultracave/ # Grammar-stripped fragments (SKILL.md)
119
+ │ └── megacave/ # Classical Chinese 文言文 (SKILL.md)
126
120
  ├── CHANGELOG.md
127
- ├── package.json # pi package manifest
121
+ ├── package.json # pi & omp package manifest
128
122
  ├── tsconfig.json
129
123
  ├── LICENSE
130
124
  └── README.md