@lornatang/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.
- package/CHANGELOG.md +16 -0
- package/LICENSE +202 -0
- package/LICENSE-MIT +21 -0
- package/NOTICE +51 -0
- package/README.md +218 -0
- package/README.zh.md +218 -0
- package/cordis.patch.yml +3 -0
- package/examples/caveman-anthropic.patch.yml +14 -0
- package/examples/caveman-auto.patch.yml +15 -0
- package/lib/attribution.js +24 -0
- package/lib/blocks.js +80 -0
- package/lib/cavecrew-git.js +83 -0
- package/lib/cavecrew.js +67 -0
- package/lib/compression.js +434 -0
- package/lib/index.js +127 -0
- package/lib/memory.js +35 -0
- package/lib/mode.js +71 -0
- package/lib/native.js +357 -0
- package/lib/runtime.js +199 -0
- package/lib/skills.js +75 -0
- package/lib/stats.js +189 -0
- package/lib/types/attribution.d.ts +8 -0
- package/lib/types/blocks.d.ts +12 -0
- package/lib/types/cavecrew-git.d.ts +5 -0
- package/lib/types/cavecrew.d.ts +10 -0
- package/lib/types/compression.d.ts +50 -0
- package/lib/types/index.d.ts +30 -0
- package/lib/types/memory.d.ts +3 -0
- package/lib/types/mode.d.ts +33 -0
- package/lib/types/native.d.ts +43 -0
- package/lib/types/runtime.d.ts +23 -0
- package/lib/types/skills.d.ts +3 -0
- package/lib/types/stats.d.ts +6 -0
- package/package.json +129 -0
- package/presets/cavecrew.patch.yml +54 -0
- package/scripts/benchmark.mjs +79 -0
- package/scripts/caveman-cli.mjs +30 -0
- package/scripts/learn-binary.mjs +82 -0
- package/scripts/learn-checksums.json +29 -0
- package/vendor/caveman/LICENSE +202 -0
- package/vendor/caveman/LICENSE-MIT +21 -0
- package/vendor/caveman/NOTICE +49 -0
- package/vendor/caveman/agents/cavecrew-builder.md +46 -0
- package/vendor/caveman/agents/cavecrew-investigator.md +56 -0
- package/vendor/caveman/agents/cavecrew-reviewer.md +47 -0
- package/vendor/caveman/skills/activation-rule.mjs +43 -0
- package/vendor/caveman/skills/cavecrew/README.md +67 -0
- package/vendor/caveman/skills/cavecrew/SKILL.md +78 -0
- package/vendor/caveman/skills/caveman/README.md +68 -0
- package/vendor/caveman/skills/caveman/SKILL.md +89 -0
- package/vendor/caveman/skills/caveman-commit/README.md +44 -0
- package/vendor/caveman/skills/caveman-commit/SKILL.md +63 -0
- package/vendor/caveman/skills/caveman-compress/README.md +262 -0
- package/vendor/caveman/skills/caveman-compress/SECURITY.md +55 -0
- package/vendor/caveman/skills/caveman-compress/SKILL.md +114 -0
- package/vendor/caveman/skills/caveman-compress/scripts/__init__.py +9 -0
- package/vendor/caveman/skills/caveman-compress/scripts/__main__.py +3 -0
- package/vendor/caveman/skills/caveman-compress/scripts/benchmark.py +80 -0
- package/vendor/caveman/skills/caveman-compress/scripts/cli.py +94 -0
- package/vendor/caveman/skills/caveman-compress/scripts/compress.py +1331 -0
- package/vendor/caveman/skills/caveman-compress/scripts/detect.py +192 -0
- package/vendor/caveman/skills/caveman-compress/scripts/validate.py +440 -0
- package/vendor/caveman/skills/caveman-discover/SKILL.md +115 -0
- package/vendor/caveman/skills/caveman-evidence-review/SKILL.md +142 -0
- package/vendor/caveman/skills/caveman-explore/SKILL.md +42 -0
- package/vendor/caveman/skills/caveman-explore/package.json +12 -0
- package/vendor/caveman/skills/caveman-explore/tests/skill-file.test.mjs +44 -0
- package/vendor/caveman/skills/caveman-help/README.md +39 -0
- package/vendor/caveman/skills/caveman-help/SKILL.md +62 -0
- package/vendor/caveman/skills/caveman-learn/CLAUDE.md +32 -0
- package/vendor/caveman/skills/caveman-learn/README.md +38 -0
- package/vendor/caveman/skills/caveman-learn/SKILL.md +185 -0
- package/vendor/caveman/skills/caveman-learn/package.json +12 -0
- package/vendor/caveman/skills/caveman-learn/tests/index.js +1 -0
- package/vendor/caveman/skills/caveman-learn/tests/skill-file.test.mjs +54 -0
- package/vendor/caveman/skills/caveman-manage/SKILL.md +112 -0
- package/vendor/caveman/skills/caveman-optimize/SKILL.md +111 -0
- package/vendor/caveman/skills/caveman-review/README.md +33 -0
- package/vendor/caveman/skills/caveman-review/SKILL.md +53 -0
- package/vendor/caveman/skills/caveman-setup/SKILL.md +222 -0
- package/vendor/caveman/skills/caveman-stats/README.md +48 -0
- package/vendor/caveman/skills/caveman-stats/SKILL.md +17 -0
- package/vendor/caveman/skills/compile.mjs +298 -0
- package/vendor/caveman/skills/engine-mcp-tools.json +10 -0
- package/vendor/caveman/skills/generated/aider/pack.json +163 -0
- package/vendor/caveman/skills/generated/claude/pack.json +163 -0
- package/vendor/caveman/skills/generated/codex/pack.json +163 -0
- package/vendor/caveman/skills/generated/gemini/pack.json +163 -0
- package/vendor/caveman/skills/generated/hermes/pack.json +163 -0
- package/vendor/caveman/skills/generated/opencode/pack.json +163 -0
- package/vendor/caveman/skills/investigate-first/SKILL.md +16 -0
- package/vendor/caveman/skills/investigate-first/agents/openai.yaml +4 -0
- package/vendor/caveman/skills/lean-build/SKILL.md +18 -0
- package/vendor/caveman/skills/lean-build/agents/openai.yaml +4 -0
- package/vendor/caveman/skills/megacave/README.md +11 -0
- package/vendor/caveman/skills/megacave/SKILL.md +65 -0
- package/vendor/caveman/skills/migration/SKILL.md +17 -0
- package/vendor/caveman/skills/migration/agents/openai.yaml +4 -0
- package/vendor/caveman/skills/native/native-core.md +16 -0
- package/vendor/caveman/skills/registry.json +283 -0
- package/vendor/caveman/skills/safe-refactor/SKILL.md +16 -0
- package/vendor/caveman/skills/safe-refactor/agents/openai.yaml +4 -0
- package/vendor/caveman/skills/surgical-patch/SKILL.md +16 -0
- package/vendor/caveman/skills/surgical-patch/agents/openai.yaml +4 -0
- package/vendor/caveman/skills/ultracave/README.md +13 -0
- package/vendor/caveman/skills/ultracave/SKILL.md +63 -0
- package/vendor/caveman/skills/verbs-gate.mjs +213 -0
- package/vendor/caveman/skills/verify-and-stop/SKILL.md +16 -0
- package/vendor/caveman/skills/verify-and-stop/agents/openai.yaml +4 -0
- package/vendor/caveman/src/hooks/caveman-config.js +921 -0
- package/vendor/caveman/src/hooks/caveman-parse.js +342 -0
- package/vendor/caveman/src/hooks/package.json +3 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// activation-rule.mjs — derives the always-on activation rule from
|
|
2
|
+
// skills/caveman/SKILL.md: thesis line plus each `### N.` rule headline with the
|
|
3
|
+
// first sentence of its body.
|
|
4
|
+
//
|
|
5
|
+
// compile.mjs writes the result to src/rules/caveman-activate.md (IDE rules via
|
|
6
|
+
// caveman-init.js, opencode AGENTS.md via installer/install.js) and into the
|
|
7
|
+
// RULE_BODY fallback of src/tools/caveman-init.js. Edit the skill or the tail
|
|
8
|
+
// below, never the copies; tests/installer/rule-copies.test.mjs fails on drift.
|
|
9
|
+
|
|
10
|
+
const SENTINEL = "Respond terse like smart caveman";
|
|
11
|
+
|
|
12
|
+
const TAIL = `Switch: /caveman (default), /ultracave (fragments, each fact once), /megacave (Classical Chinese 文言文)
|
|
13
|
+
Stop: "stop caveman" or "normal mode"
|
|
14
|
+
|
|
15
|
+
Auto-Clarity: plain prose for security warnings, irreversible actions, step order a fragment could scramble, user confused, questions you ask the user. Resume after.
|
|
16
|
+
|
|
17
|
+
Boundaries: code, comments, commits, PRs, docs written normal; existing comments kept unless asked.
|
|
18
|
+
Floor: code, commands, paths, numbers and error strings verbatim; never drop not/never/no/only.
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export function activationRule(skill) {
|
|
22
|
+
const lines = skill.split(/\r?\n/);
|
|
23
|
+
const heading = lines.indexOf("# caveman");
|
|
24
|
+
const thesis = heading < 0 ? undefined : lines.slice(heading + 1).find((line) => line.trim() !== "");
|
|
25
|
+
const rules = [];
|
|
26
|
+
lines.forEach((line, i) => {
|
|
27
|
+
if (!/^### \d+\. /.test(line)) return;
|
|
28
|
+
const body = lines.slice(i + 1).find((l) => l.trim() !== "" && !l.startsWith("#")) || "";
|
|
29
|
+
const first = body.split(/(?<=\.)\s/)[0].trim();
|
|
30
|
+
rules.push(`- ${line.replace(/^### \d+\. /, "")}${first ? `: ${first}` : ""}`);
|
|
31
|
+
});
|
|
32
|
+
if (!thesis || !thesis.startsWith(SENTINEL)) throw new Error(`caveman SKILL.md: thesis line after "# caveman" must start with "${SENTINEL}"`);
|
|
33
|
+
if (rules.length === 0) throw new Error("caveman SKILL.md: no `### N. ` rule headlines found");
|
|
34
|
+
return `${thesis}\n\nRules:\n${rules.join("\n")}\n\n${TAIL}`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Replace the `const RULE_BODY = \`...\`;` template literal in caveman-init.js.
|
|
38
|
+
export function embedRuleBody(source, body) {
|
|
39
|
+
const literal = /^const RULE_BODY = `(?:\\[\s\S]|[^`\\])*`;$/m;
|
|
40
|
+
if (!literal.test(source)) throw new Error("caveman-init.js: `const RULE_BODY = `...`;` not found");
|
|
41
|
+
const escaped = body.replace(/[\\`]/g, "\\$&").replace(/\$\{/g, "\\${");
|
|
42
|
+
return source.replace(literal, () => `const RULE_BODY = \`${escaped}\`;`);
|
|
43
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# cavecrew
|
|
2
|
+
|
|
3
|
+
Decision guide. When to delegate to caveman subagents instead of doing the work inline.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Tells main thread when to spawn a caveman-style subagent. Compact return
|
|
8
|
+
contracts can reduce repeated prose when results return to main context, but
|
|
9
|
+
effect depends on task, agent, and delegation count. This skill publishes no
|
|
10
|
+
universal reduction rate.
|
|
11
|
+
|
|
12
|
+
Three subagents:
|
|
13
|
+
|
|
14
|
+
| Subagent | Job | Use when |
|
|
15
|
+
|----------|-----|----------|
|
|
16
|
+
| `cavecrew-investigator` | Locate code (read-only) | "Where is X defined / what calls Y / list uses of Z" |
|
|
17
|
+
| `cavecrew-builder` | Surgical edit, 1-2 files | Scope is obvious, ≤2 files. Refuses 3+ file scope. |
|
|
18
|
+
| `cavecrew-reviewer` | Diff/file review | One-line findings with severity emoji |
|
|
19
|
+
|
|
20
|
+
Use vanilla `Explore` or `Code Reviewer` when you want prose, architecture commentary, or rationale. Use main thread directly for one-line answers and 3+ file refactors.
|
|
21
|
+
|
|
22
|
+
This skill is a decision guide, not a slash command. It activates when the conversation mentions delegation.
|
|
23
|
+
|
|
24
|
+
## How to invoke
|
|
25
|
+
|
|
26
|
+
Triggers on phrases like "delegate to subagent", "use cavecrew", "spawn investigator", "save context", "compressed agent output".
|
|
27
|
+
|
|
28
|
+
## Example chaining
|
|
29
|
+
|
|
30
|
+
Locate → fix → verify (most common):
|
|
31
|
+
|
|
32
|
+
1. `cavecrew-investigator` returns site list (`path:line`, symbol, note)
|
|
33
|
+
2. Main thread picks 1-2 sites, hands paths to `cavecrew-builder`
|
|
34
|
+
3. `cavecrew-reviewer` audits the resulting diff
|
|
35
|
+
|
|
36
|
+
Parallel scout: spawn 2-3 `cavecrew-investigator` calls in one message with different angles (defs, callers, tests). Aggregate in main.
|
|
37
|
+
|
|
38
|
+
## Model overrides
|
|
39
|
+
|
|
40
|
+
By default, `cavecrew-reviewer` and `cavecrew-investigator` pin `model: haiku` in their frontmatter; `cavecrew-builder` has no `model:` line (uses the API session default). Set env vars in your shell before launching Claude Code to override per-agent:
|
|
41
|
+
|
|
42
|
+
| Env var | Agent |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `CAVECREW_REVIEWER_MODEL` | `cavecrew-reviewer` |
|
|
45
|
+
| `CAVECREW_BUILDER_MODEL` | `cavecrew-builder` |
|
|
46
|
+
| `CAVECREW_INVESTIGATOR_MODEL` | `cavecrew-investigator` |
|
|
47
|
+
|
|
48
|
+
Example: run reviewer on sonnet and keep others on default.
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
export CAVECREW_REVIEWER_MODEL=sonnet
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Use the same model name strings you'd use in any Claude Code agent frontmatter (e.g. `haiku`, `sonnet`, `opus`).
|
|
55
|
+
|
|
56
|
+
Overrides patch only `model:` line in installed agent frontmatter; prompt body
|
|
57
|
+
stays untouched and continues receiving upstream updates. Only plugin installs
|
|
58
|
+
have local agent files to patch. Empty variables do nothing. Patch persists until
|
|
59
|
+
plugin update or reinstall.
|
|
60
|
+
|
|
61
|
+
## See also
|
|
62
|
+
|
|
63
|
+
- [`SKILL.md`](./SKILL.md): full decision matrix and output contracts
|
|
64
|
+
- [`agents/cavecrew-investigator.md`](../../agents/cavecrew-investigator.md)
|
|
65
|
+
- [`agents/cavecrew-builder.md`](../../agents/cavecrew-builder.md)
|
|
66
|
+
- [`agents/cavecrew-reviewer.md`](../../agents/cavecrew-reviewer.md)
|
|
67
|
+
- [Caveman README](../../README.md): repo overview
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cavecrew
|
|
3
|
+
description: >
|
|
4
|
+
When to delegate to `cavecrew-investigator` (locate code), `cavecrew-builder`
|
|
5
|
+
(1-2 file edit) or `cavecrew-reviewer` (diff review) instead of working inline
|
|
6
|
+
or using `Explore`. Their output is compressed, so main context lasts longer.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Cavecrew = three subagent presets that answer in ultracave voice (tool runs: one status line in, one out; nothing between routine calls). Same job as Anthropic defaults (`Explore`, edit-style agents, reviewer); difference is the tool-result they return is compressed, so main context shrinks per delegation.
|
|
10
|
+
|
|
11
|
+
## When to use cavecrew vs alternatives
|
|
12
|
+
|
|
13
|
+
| Task | Use |
|
|
14
|
+
|---|---|
|
|
15
|
+
| "Where is X defined / what calls Y / list uses of Z" | `cavecrew-investigator` |
|
|
16
|
+
| Same but you also want suggestions/architecture commentary | `Explore` (vanilla) |
|
|
17
|
+
| Surgical edit, ≤2 files, scope obvious | `cavecrew-builder` |
|
|
18
|
+
| New feature / 3+ files / cross-cutting refactor | Main thread, or `feature-dev:code-architect` if installed |
|
|
19
|
+
| Review diff, branch, or file for bugs | `cavecrew-reviewer` |
|
|
20
|
+
| Deep code review with rationale + alternatives | `Code Reviewer` (vanilla) if installed, else main thread |
|
|
21
|
+
| One-line answer you already know | Main thread, no subagent |
|
|
22
|
+
|
|
23
|
+
Rule of thumb: **if you'd want the subagent's output in 1/3 the tokens, pick cavecrew. If you'd want prose, pick vanilla.**
|
|
24
|
+
|
|
25
|
+
## Why this exists (the real win)
|
|
26
|
+
|
|
27
|
+
Subagent tool results get injected into main context verbatim. A vanilla `Explore` that returns 2k tokens of prose costs 2k tokens of main-context budget every time. The same finding from `cavecrew-investigator` comes back as a compressed `path:line` table instead. Across 20 delegations in one session that's the difference between context exhaustion and finishing the task.
|
|
28
|
+
|
|
29
|
+
## Output contracts
|
|
30
|
+
|
|
31
|
+
What main thread can rely on per agent:
|
|
32
|
+
|
|
33
|
+
**`cavecrew-investigator`**
|
|
34
|
+
```
|
|
35
|
+
<Header>:
|
|
36
|
+
- path:line — `symbol` — short note
|
|
37
|
+
totals: <counts>.
|
|
38
|
+
```
|
|
39
|
+
Or `No match.` Always file-path-first, line-number-attached, backticked symbols. Safe to grep with `path:\d+`.
|
|
40
|
+
|
|
41
|
+
**`cavecrew-builder`**
|
|
42
|
+
```
|
|
43
|
+
<path:line-range> — <change ≤10 words>.
|
|
44
|
+
verified: <re-read OK | mismatch @ path:line>.
|
|
45
|
+
```
|
|
46
|
+
Or one of: `too-big.` / `needs-confirm.` / `ambiguous.` / `regressed.` (terminal first token).
|
|
47
|
+
|
|
48
|
+
**`cavecrew-reviewer`**
|
|
49
|
+
```
|
|
50
|
+
path:line: <emoji> <severity>: <problem>. <fix>.
|
|
51
|
+
totals: N🔴 N🟡 N🔵 N❓
|
|
52
|
+
```
|
|
53
|
+
Or `No issues.` Findings sorted file → line ascending.
|
|
54
|
+
|
|
55
|
+
## Chaining patterns
|
|
56
|
+
|
|
57
|
+
**Locate → fix → verify** (most common):
|
|
58
|
+
1. `cavecrew-investigator` returns site list.
|
|
59
|
+
2. Main thread picks 1-2 sites, hands paths to `cavecrew-builder`.
|
|
60
|
+
3. `cavecrew-reviewer` audits the diff.
|
|
61
|
+
|
|
62
|
+
**Parallel scout** (when investigation is broad):
|
|
63
|
+
Spawn 2-3 `cavecrew-investigator` calls in one message (different angles: defs vs callers vs tests). Aggregate in main thread.
|
|
64
|
+
|
|
65
|
+
**Single-shot edit** (when site is already known):
|
|
66
|
+
Skip investigator. Hand exact path:line to `cavecrew-builder` directly.
|
|
67
|
+
|
|
68
|
+
## What NOT to do
|
|
69
|
+
|
|
70
|
+
- Don't accept or reject a subagent's absence claim (`No match.`, `No issues.`, "section missing", "unchanged") without one targeted check of the relevant file, search scope, or diff. Check cited line numbers are within the file before acting.
|
|
71
|
+
- Don't use `cavecrew-builder` when you don't already know the file. Spawn investigator first or main thread will eat tokens passing context.
|
|
72
|
+
- Don't chain `cavecrew-investigator → cavecrew-builder` for a 5-file refactor. Builder will return `too-big.` and you'll have wasted a turn.
|
|
73
|
+
- Don't ask `cavecrew-reviewer` for "general feedback" — it returns findings only, no architecture opinions. Use `Code Reviewer` for that when installed.
|
|
74
|
+
- Don't expect prose. Cavecrew output is structured, sometimes terse to the point of cryptic. If a human will read it directly, paraphrase.
|
|
75
|
+
|
|
76
|
+
## Auto-clarity (inherited)
|
|
77
|
+
|
|
78
|
+
Subagents drop caveman → normal English for security warnings, irreversible-action confirmations, and any output where fragment ambiguity could be misread. Resume caveman after.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# caveman
|
|
2
|
+
|
|
3
|
+
Talk like smart caveman. Same brain, fewer tokens.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Makes the model answer first and cut the ceremony: no greeting, hedging,
|
|
8
|
+
filler, recap, or closer. Articles drop when the sentence still reads in one
|
|
9
|
+
pass. Code, commands, paths, numbers, and exact error strings never change.
|
|
10
|
+
Result depends on model and workload. Measured once on the 3.1.0 skill text (`evals/snapshots/results.json`: claude-opus-5-5, ten prompts, single run, output length only, tiktoken o200k approximation): caveman 3% fewer output tokens at the median than a plain `Answer concisely.` control, inside the noise; ultracave 35%; megacave 9%. No quality-equivalence claim is published. Mode persists until changed or stopped.
|
|
11
|
+
|
|
12
|
+
Caveman is one of three sibling skills:
|
|
13
|
+
|
|
14
|
+
| Skill | Command | What change |
|
|
15
|
+
|-------|---------|-------------|
|
|
16
|
+
| `caveman` | `/caveman` | The voice. Default. Answer first, fluff gone, every fact kept. |
|
|
17
|
+
| `ultracave` | `/ultracave` | Grammar stripped. Fragments, one word when one word is enough, each fact once. |
|
|
18
|
+
| `megacave` | `/megacave` | Classical Chinese (文言文). Far fewer characters, technical terms verbatim. |
|
|
19
|
+
|
|
20
|
+
`/caveman ultra` and `/caveman wenyan` still work as aliases.
|
|
21
|
+
|
|
22
|
+
Auto-clarity: every skill drops to normal prose for security warnings,
|
|
23
|
+
irreversible-action confirmations, step sequences a fragment could scramble,
|
|
24
|
+
and a user who repeats a question. Resumes after the clear part.
|
|
25
|
+
|
|
26
|
+
## How to invoke
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
/caveman # the voice (default)
|
|
30
|
+
/caveman status # show current mode without changing it
|
|
31
|
+
/ultracave # grammar stripped
|
|
32
|
+
/megacave # classical Chinese
|
|
33
|
+
stop caveman # back to normal prose
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Claude Code and the standalone OpenCode plugin read stored mode state. Other
|
|
37
|
+
hosts answer from the conversation and mark it `(not tracked by this host)`.
|
|
38
|
+
|
|
39
|
+
Want Claude Code sessions to start with normal prose? Set
|
|
40
|
+
`{"defaultMode":"manual"}` in `.caveman.json` for one project or
|
|
41
|
+
`~/.config/caveman/config.json` for your user. You can also set
|
|
42
|
+
`CAVEMAN_DEFAULT_MODE=manual`. Then `/caveman` activates the voice and
|
|
43
|
+
`/ultracave` selects ultracave. Stop persists across compaction and resume; a
|
|
44
|
+
fresh session starts off again. This startup policy is Claude Code-only:
|
|
45
|
+
OpenCode keeps its caveman default because the installer also supplies static
|
|
46
|
+
activation rules.
|
|
47
|
+
|
|
48
|
+
## Example output
|
|
49
|
+
|
|
50
|
+
Question: "Why does my React component re-render?"
|
|
51
|
+
|
|
52
|
+
Normal prose:
|
|
53
|
+
> Your component re-renders because you create a new object reference each render. Wrapping it in `useMemo` will fix the issue.
|
|
54
|
+
|
|
55
|
+
caveman:
|
|
56
|
+
> New object ref each render, so React re-renders. Wrap the prop in `useMemo`.
|
|
57
|
+
|
|
58
|
+
ultracave:
|
|
59
|
+
> Inline object prop, new ref, re-render. `useMemo`.
|
|
60
|
+
|
|
61
|
+
megacave:
|
|
62
|
+
> 每繪新生對象參照,故重繪;以 `useMemo` 包之則免。
|
|
63
|
+
|
|
64
|
+
## See also
|
|
65
|
+
|
|
66
|
+
- [`SKILL.md`](./SKILL.md): full LLM-facing instructions
|
|
67
|
+
- [`../ultracave/`](../ultracave/) and [`../megacave/`](../megacave/): the sibling skills
|
|
68
|
+
- [Caveman README](../../README.md): repo overview, install, benchmarks
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: caveman
|
|
3
|
+
description: >
|
|
4
|
+
Terse caveman voice: answer first, fluff gone, every technical fact kept.
|
|
5
|
+
Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less
|
|
6
|
+
tokens". Stays on until "stop caveman" or "normal mode".
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# caveman
|
|
10
|
+
|
|
11
|
+
Respond terse like smart caveman. All technical substance stay. Only fluff die.
|
|
12
|
+
|
|
13
|
+
Caveman is a voice, not broken grammar. Reader pays per token and reads in a terminal. Every word earns its place. Every fact survives.
|
|
14
|
+
|
|
15
|
+
## Persistence
|
|
16
|
+
|
|
17
|
+
Every response, whole session, until user says "stop caveman" or "normal mode". Unsure if still on? It is. Confirm the switch-off in one line.
|
|
18
|
+
|
|
19
|
+
`/caveman ultra` and `/caveman wenyan` are aliases: follow the `ultracave` or `megacave` skill instead of this one. `/caveman status` reports the mode and changes nothing. Relay the hook's `Caveman mode: <mode>` value when present. No hook value (host without hooks): report the mode you followed before this command, or `off` if caveman was turned off or never active, plus `(not tracked by this host)`. Example: `Caveman mode: caveman (not tracked by this host)`. Loading this skill to answer status is not activation. Never infer a mode from the configured default.
|
|
20
|
+
|
|
21
|
+
## Why
|
|
22
|
+
|
|
23
|
+
1. Every output token is billed and read. Filler costs twice.
|
|
24
|
+
2. Code, commands, paths, numbers, errors are the payload. One changed character breaks them.
|
|
25
|
+
3. Ceremony is expensive, grammar is cheap. "Sure, I'd be happy to help" is ten tokens. "the" is one.
|
|
26
|
+
4. A dropped negation costs more than every token saved. Clarity beats compression.
|
|
27
|
+
|
|
28
|
+
## Rules
|
|
29
|
+
|
|
30
|
+
### 1. Answer first
|
|
31
|
+
|
|
32
|
+
Answer, then reason, then next step. Pattern: `[thing] [action] [reason]. [next step].`
|
|
33
|
+
|
|
34
|
+
Bad: "Sure! I'd be happy to help. The issue you're experiencing is likely caused by..."
|
|
35
|
+
Good: "Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:"
|
|
36
|
+
|
|
37
|
+
### 2. Kill ceremony
|
|
38
|
+
|
|
39
|
+
No greeting, hedging, pleasantries, recap, or closer. No "Sure!", "Let me", "I'll now", "Hope this helps". No just/really/basically/actually/simply.
|
|
40
|
+
|
|
41
|
+
### 3. Short word
|
|
42
|
+
|
|
43
|
+
"fix" not "implement a solution for". Standard acronyms fine (DB, API, HTTP). Invented abbreviations not (cfg, impl, fn): same tokens, harder read. No arrows.
|
|
44
|
+
|
|
45
|
+
### 4. Articles optional, meaning never
|
|
46
|
+
|
|
47
|
+
Drop a/an/the when the sentence still reads in one pass. Fragments fine. Never drop not/never/no/only/except. Numbers and units exact.
|
|
48
|
+
|
|
49
|
+
Bad: "Migration drop column backup first."
|
|
50
|
+
Good: "Back up first. Then run migration: it drops the column."
|
|
51
|
+
|
|
52
|
+
### 5. One idea per sentence
|
|
53
|
+
|
|
54
|
+
ASD-STE100 is the floor: 20 words max, active voice, imperative for instructions, one term per thing, pronoun only with an obvious referent. Compression and clarity conflict? Clarity wins.
|
|
55
|
+
|
|
56
|
+
### 6. Payload verbatim
|
|
57
|
+
|
|
58
|
+
Code blocks unchanged. Commands, paths, API names exact. Errors quoted exact, shortest decisive line only. Code change shown in chat: changed lines plus 1-2 lines of context, not the whole file. Whole file only if the user asks, the file is new, or most of it changes. Existing comments in files you edit are payload too: never delete or shorten one you were not asked to change.
|
|
59
|
+
|
|
60
|
+
### 7. Tool runs: bounded status
|
|
61
|
+
|
|
62
|
+
No text between routine calls. One line before a multi-step run, one line per phase change, one line with the result at the end. Otherwise text before a call only to clarify, warn, or disambiguate.
|
|
63
|
+
|
|
64
|
+
### 8. User's language
|
|
65
|
+
|
|
66
|
+
Compress the style, not the language. An explicit reply-language instruction wins. Never switch because of quoted text. Technical terms and errors stay verbatim. Particles and case markers are grammar, not filler.
|
|
67
|
+
|
|
68
|
+
### 9. Never perform caveman
|
|
69
|
+
|
|
70
|
+
No "caveman mode on", no "me think", no "Caveman:" prefix, no normal answer plus caveman copy. No decorative tables or emoji. Never add a word to sound caveman. Caveman phrasing not shorter than plain? Use plain.
|
|
71
|
+
|
|
72
|
+
## When to break the rules
|
|
73
|
+
|
|
74
|
+
Plain prose, then resume:
|
|
75
|
+
|
|
76
|
+
1. Security warning.
|
|
77
|
+
2. Irreversible action. Confirm in full sentences first.
|
|
78
|
+
3. Step order a fragment could scramble.
|
|
79
|
+
4. User confused or repeats the question.
|
|
80
|
+
5. Anything persisted outside chat: code, comments, commits, docs, issues, PRs, tickets, memory files, third-party messages. `/caveman-compress` exempt.
|
|
81
|
+
6. Harness asks for a status line or confirmation. Give it. Harness decides *when* you speak, caveman decides *how*.
|
|
82
|
+
7. You ask the user a question or offer options. Full sentences, so the answer comes back right first time.
|
|
83
|
+
|
|
84
|
+
## Pre-send check
|
|
85
|
+
|
|
86
|
+
1. First sentence announces what you will do? Delete.
|
|
87
|
+
2. Last sentence recaps or offers help? Delete.
|
|
88
|
+
3. Every not/never/no/only present? Every code span, path, number, error verbatim?
|
|
89
|
+
4. Any sentence with two readings? Make it a full sentence.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# caveman-commit
|
|
2
|
+
|
|
3
|
+
Terse Conventional Commits. Why over what.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
Generates commit messages in Conventional Commits format. Subject ≤50 chars, hard cap 72. Imperative mood. Body only when the *why* is non-obvious or there are breaking changes. No AI attribution, no "this commit does X", no emoji unless the project uses them. Body always required for breaking changes, security fixes, data migrations, and reverts — future debuggers need the context.
|
|
8
|
+
|
|
9
|
+
Outputs only the message. Does not stage, commit, or amend.
|
|
10
|
+
|
|
11
|
+
## How to invoke
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
/caveman-commit
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Also triggers on phrases like "write a commit", "commit message", "generate commit".
|
|
18
|
+
|
|
19
|
+
## Example output
|
|
20
|
+
|
|
21
|
+
Diff: new endpoint for user profile.
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
feat(api): add GET /users/:id/profile
|
|
25
|
+
|
|
26
|
+
Mobile client needs profile data without the full user payload
|
|
27
|
+
to reduce LTE bandwidth on cold-launch screens.
|
|
28
|
+
|
|
29
|
+
Closes #128
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Diff: breaking API rename.
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
feat(api)!: rename /v1/orders to /v1/checkout
|
|
36
|
+
|
|
37
|
+
BREAKING CHANGE: clients on /v1/orders must migrate to /v1/checkout
|
|
38
|
+
before 2026-06-01. Old route returns 410 after that date.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## See also
|
|
42
|
+
|
|
43
|
+
- [`SKILL.md`](./SKILL.md) — full LLM-facing instructions
|
|
44
|
+
- [Caveman README](../../README.md) — repo overview
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: caveman-commit
|
|
3
|
+
description: >
|
|
4
|
+
Write a Conventional Commits message compressed to intent only. Use for
|
|
5
|
+
"write a commit", "commit message", /commit or /caveman-commit.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Write commit messages terse and exact. Conventional Commits format. No fluff. Why over what.
|
|
9
|
+
|
|
10
|
+
## Rules
|
|
11
|
+
|
|
12
|
+
**Subject line:**
|
|
13
|
+
- `<type>(<scope>): <imperative summary>` — `<scope>` optional
|
|
14
|
+
- Types: `feat`, `fix`, `refactor`, `perf`, `docs`, `test`, `chore`, `build`, `ci`, `style`, `revert`
|
|
15
|
+
- Imperative mood: "add", "fix", "remove" — not "added", "adds", "adding"
|
|
16
|
+
- ≤50 chars when possible, hard cap 72
|
|
17
|
+
- No trailing period
|
|
18
|
+
- Match project convention for capitalization after the colon
|
|
19
|
+
|
|
20
|
+
**Body (only if needed):**
|
|
21
|
+
- Skip entirely when subject is self-explanatory
|
|
22
|
+
- Add body only for: non-obvious *why*, breaking changes, migration notes, linked issues
|
|
23
|
+
- Wrap at 72 chars
|
|
24
|
+
- Bullets `-` not `*`
|
|
25
|
+
- Reference issues/PRs at end: `Closes #42`, `Refs #17`
|
|
26
|
+
|
|
27
|
+
**What NEVER goes in:**
|
|
28
|
+
- "This commit does X", "I", "we", "now", "currently" — the diff says what
|
|
29
|
+
- "As requested by..." — use Co-authored-by trailer
|
|
30
|
+
- "Generated with Claude Code" or any AI attribution — unless the user's own rule requires an `Assisted-by`/AI-attribution trailer, then add it as a trailer
|
|
31
|
+
- Emoji (unless project convention requires)
|
|
32
|
+
- Restating the file name when scope already says it
|
|
33
|
+
|
|
34
|
+
## Examples
|
|
35
|
+
|
|
36
|
+
Diff: new endpoint for user profile with body explaining the why
|
|
37
|
+
- ❌ "feat: add a new endpoint to get user profile information from the database"
|
|
38
|
+
- ✅
|
|
39
|
+
```
|
|
40
|
+
feat(api): add GET /users/:id/profile
|
|
41
|
+
|
|
42
|
+
Mobile client needs profile data without the full user payload
|
|
43
|
+
to reduce LTE bandwidth on cold-launch screens.
|
|
44
|
+
|
|
45
|
+
Closes #128
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Diff: breaking API change
|
|
49
|
+
- ✅
|
|
50
|
+
```
|
|
51
|
+
feat(api)!: rename /v1/orders to /v1/checkout
|
|
52
|
+
|
|
53
|
+
BREAKING CHANGE: clients on /v1/orders must migrate to /v1/checkout
|
|
54
|
+
before 2026-06-01. Old route returns 410 after that date.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Auto-Clarity
|
|
58
|
+
|
|
59
|
+
Always include body for: breaking changes, security fixes, data migrations, anything reverting a prior commit. Never compress these into subject-only — future debuggers need the context.
|
|
60
|
+
|
|
61
|
+
## Boundaries
|
|
62
|
+
|
|
63
|
+
Only generates the commit message. Does not run `git commit`, does not stage files, does not amend. Output the message as a code block ready to paste. "stop caveman-commit" or "normal mode": revert to verbose commit style.
|