dsh-caveman 0.1.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.
@@ -0,0 +1,38 @@
1
+ # caveman-help
2
+
3
+ Quick-reference card. One shot, no mode change.
4
+
5
+ ## What it does
6
+
7
+ Prints a cheat sheet of all caveman modes, sibling skills, deactivation triggers, and how to set the default mode via env var or config file. One-shot display — does not flip the active mode, write flag files, or persist anything. Use when you forget the slash commands.
8
+
9
+ ## How to invoke
10
+
11
+ ```
12
+ /caveman-help
13
+ ```
14
+
15
+ Also triggers on "caveman help", "what caveman commands", "how do I use caveman".
16
+
17
+ ## Example output
18
+
19
+ ```
20
+ Modes:
21
+ /caveman full (default)
22
+ /caveman lite lighter
23
+ /caveman ultra extreme
24
+ /caveman wenyan classical Chinese
25
+
26
+ Skills:
27
+ /caveman-commit terse Conventional Commits
28
+ /caveman-review one-line PR comments
29
+ /caveman-stats session token savings
30
+
31
+ Deactivate:
32
+ "stop caveman" or "normal mode"
33
+ ```
34
+
35
+ ## See also
36
+
37
+ - [`SKILL.md`](./SKILL.md) — full reference card
38
+ - [Caveman README](../../README.md) — repo overview
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: caveman-help
3
+ description: >
4
+ Quick-reference card for all caveman modes, skills, and commands.
5
+ One-shot display, not a persistent mode. Trigger: /caveman-help,
6
+ "caveman help", "what caveman commands", "how do I use caveman".
7
+ ---
8
+
9
+ # Caveman Help
10
+
11
+ Display this reference card when invoked. One-shot — do NOT change mode, write flag files, or persist anything. Output in caveman style.
12
+
13
+ ## Modes
14
+
15
+ | Mode | Trigger | What change |
16
+ |------|---------|-------------|
17
+ | **Lite** | `/caveman lite` | Drop filler. Keep sentence structure. |
18
+ | **Full** | `/caveman` | Drop articles, filler, pleasantries, hedging. Fragments OK. Default. |
19
+ | **Ultra** | `/caveman ultra` | Extreme compression. Bare fragments. Tables over prose. |
20
+ | **Wenyan-Lite** | `/caveman wenyan-lite` | Classical Chinese style, light compression. |
21
+ | **Wenyan-Full** | `/caveman wenyan` | Full 文言文. Maximum classical terseness. |
22
+ | **Wenyan-Ultra** | `/caveman wenyan-ultra` | Extreme. Ancient scholar on a budget. |
23
+
24
+ Mode stick until changed or session end.
25
+
26
+ ## Skills
27
+
28
+ | Skill | Trigger | What it do |
29
+ |-------|---------|-----------|
30
+ | **caveman-commit** | `/caveman-commit` | Terse commit messages. Conventional Commits. ≤50 char subject. |
31
+ | **caveman-review** | `/caveman-review` | One-line PR comments: `L42: bug: user null. Add guard.` |
32
+ | **caveman-compress** | `/caveman-compress <file>` | Compress .md files to caveman prose. Saves ~46% input tokens. |
33
+ | **caveman-help** | `/caveman-help` | This card. |
34
+
35
+ ## Deactivate
36
+
37
+ Say "stop caveman" or "normal mode". Resume anytime with `/caveman`.
38
+
39
+ ## Language
40
+
41
+ Keep user's language by default. User write Portuguese → reply Portuguese caveman. Compress the style, not the language. Technical terms, code, commands, commit types, and exact error strings stay verbatim unless user ask for translation.
42
+
43
+ ## Configure Default Mode
44
+
45
+ Default mode = `full`. Change it:
46
+
47
+ **Environment variable** (highest priority):
48
+ ```bash
49
+ export CAVEMAN_DEFAULT_MODE=ultra
50
+ ```
51
+
52
+ **Config file** (`~/.config/caveman/config.json`):
53
+ ```json
54
+ { "defaultMode": "lite" }
55
+ ```
56
+
57
+ Set `"off"` to disable auto-activation on session start. User can still activate manually with `/caveman`.
58
+
59
+ Resolution: env var > config file > `full`.
60
+
61
+ ## More
62
+
63
+ Full docs: https://github.com/JuliusBrussee/caveman
@@ -0,0 +1,33 @@
1
+ # caveman-review
2
+
3
+ One-line PR comments. Location, problem, fix. No throat-clearing.
4
+
5
+ ## What it does
6
+
7
+ Generates code review comments in `L<line>: <severity> <problem>. <fix>.` format. One line per finding. Severity emoji: 🔴 bug, 🟡 risk, 🔵 nit, ❓ question. Drops "I noticed that...", hedging, and restating what the diff already shows. Keeps exact line numbers, backticked symbols, and concrete fixes.
8
+
9
+ Auto-clarity: drops terse mode for CVE-class security findings, architectural disagreements, and onboarding contexts where the author needs the *why*. Resumes terse for the rest.
10
+
11
+ Output only — does not approve, request changes, or run linters.
12
+
13
+ ## How to invoke
14
+
15
+ ```
16
+ /caveman-review
17
+ ```
18
+
19
+ Also triggers on "review this PR", "code review", "review the diff".
20
+
21
+ ## Example output
22
+
23
+ ```
24
+ L42: 🔴 bug: user can be null after .find(). Add guard before .email.
25
+ L88-140: 🔵 nit: 50-line fn does 4 things. Extract validate/normalize/persist.
26
+ L23: 🟡 risk: no retry on 429. Wrap in withBackoff(3).
27
+ L107: ❓ q: why drop the cache here? Reads on next request will miss.
28
+ ```
29
+
30
+ ## See also
31
+
32
+ - [`SKILL.md`](./SKILL.md) — full LLM-facing instructions
33
+ - [Caveman README](../../README.md) — repo overview
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: caveman-review
3
+ description: >
4
+ Ultra-compressed code review comments. Cuts noise from PR feedback while preserving
5
+ the actionable signal. Each comment is one line: location, problem, fix. Use when user
6
+ says "review this PR", "code review", "review the diff", "/review", or invokes
7
+ /caveman-review. Auto-triggers when reviewing pull requests.
8
+ ---
9
+
10
+ Write code review comments terse and actionable. One line per finding. Location, problem, fix. No throat-clearing.
11
+
12
+ ## Rules
13
+
14
+ **Format:** `L<line>: <problem>. <fix>.` — or `<file>:L<line>: ...` when reviewing multi-file diffs.
15
+
16
+ **Severity prefix (optional, when mixed):**
17
+ - `🔴 bug:` — broken behavior, will cause incident
18
+ - `🟡 risk:` — works but fragile (race, missing null check, swallowed error)
19
+ - `🔵 nit:` — style, naming, micro-optim. Author can ignore
20
+ - `❓ q:` — genuine question, not a suggestion
21
+
22
+ **Drop:**
23
+ - "I noticed that...", "It seems like...", "You might want to consider..."
24
+ - "This is just a suggestion but..." — use `nit:` instead
25
+ - "Great work!", "Looks good overall but..." — say it once at the top, not per comment
26
+ - Restating what the line does — the reviewer can read the diff
27
+ - Hedging ("perhaps", "maybe", "I think") — if unsure use `q:`
28
+
29
+ **Keep:**
30
+ - Exact line numbers
31
+ - Exact symbol/function/variable names in backticks
32
+ - Concrete fix, not "consider refactoring this"
33
+ - The *why* if the fix isn't obvious from the problem statement
34
+
35
+ ## Examples
36
+
37
+ ❌ "I noticed that on line 42 you're not checking if the user object is null before accessing the email property. This could potentially cause a crash if the user is not found in the database. You might want to add a null check here."
38
+
39
+ ✅ `L42: 🔴 bug: user can be null after .find(). Add guard before .email.`
40
+
41
+ ❌ "It looks like this function is doing a lot of things and might benefit from being broken up into smaller functions for readability."
42
+
43
+ ✅ `L88-140: 🔵 nit: 50-line fn does 4 things. Extract validate/normalize/persist.`
44
+
45
+ ❌ "Have you considered what happens if the API returns a 429? I think we should probably handle that case."
46
+
47
+ ✅ `L23: 🟡 risk: no retry on 429. Wrap in withBackoff(3).`
48
+
49
+ ## Auto-Clarity
50
+
51
+ Drop terse mode for: security findings (CVE-class bugs need full explanation + reference), architectural disagreements (need rationale, not just a one-liner), and onboarding contexts where the author is new and needs the "why". In those cases write a normal paragraph, then resume terse for the rest.
52
+
53
+ ## Boundaries
54
+
55
+ Reviews only — does not write the code fix, does not approve/request-changes, does not run linters. Output the comment(s) ready to paste into the PR. "stop caveman-review" or "normal mode": revert to verbose review style.
@@ -0,0 +1,30 @@
1
+ # caveman-stats
2
+
3
+ Real session token receipts. No AI estimation.
4
+
5
+ ## What it does
6
+
7
+ Reads the current Claude Code session log directly and reports actual input/output token usage plus estimated savings versus a non-caveman baseline. Numbers come from the JSONL session log on disk — the model itself does not compute or estimate them. Output is injected by the `caveman-mode-tracker` hook, which intercepts `/caveman-stats` and returns the formatted stats as a blocked-decision reason.
8
+
9
+ Each run also writes a lifetime-savings suffix file used by the statusline badge (`⛏ 12.4k`).
10
+
11
+ ## How to invoke
12
+
13
+ ```
14
+ /caveman-stats
15
+ ```
16
+
17
+ ## Example output
18
+
19
+ ```
20
+ Session: 47 turns
21
+ Input: 12,304 tokens
22
+ Output: 3,891 tokens (caveman)
23
+ Baseline: 11,247 tokens (estimated without caveman)
24
+ Saved: 7,356 tokens (~65%)
25
+ ```
26
+
27
+ ## See also
28
+
29
+ - [`SKILL.md`](./SKILL.md) — hook contract and mechanics
30
+ - [Caveman README](../../README.md) — repo overview
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: caveman-stats
3
+ description: >
4
+ Show real token usage and estimated savings for the current session.
5
+ Reads directly from the Claude Code session log — no AI estimation.
6
+ Triggers on /caveman-stats. Output is injected by the mode-tracker hook;
7
+ the model itself does not compute the numbers.
8
+ ---
9
+
10
+ This skill is delivered by `hooks/caveman-stats.js` (read by `hooks/caveman-mode-tracker.js` on `/caveman-stats`). The model does not need to do anything when this skill fires — the hook returns `decision: "block"` with the formatted stats as the reason. The user sees the numbers immediately.