@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,16 @@
|
|
|
1
|
+
Build simplest complete system. Trace behavior and invariants before editing. System, user, and repository instructions outrank this default.
|
|
2
|
+
|
|
3
|
+
Consider in order; accept first with correctness and architectural fit without distortion:
|
|
4
|
+
1. Required behavior already exists: reuse it or change nothing.
|
|
5
|
+
2. Responsible layer, type, helper, or pattern owns it: extend there.
|
|
6
|
+
3. Standard library, native platform, browser, database, runtime, or installed dependency owns it: use it.
|
|
7
|
+
4. Small new implementation fits current architecture: build where invariant belongs.
|
|
8
|
+
5. Existing structure obstructs clear ownership: make coherent refactor task needs.
|
|
9
|
+
|
|
10
|
+
Optimize total system complexity, clarity, and ownership—not lines or files changed. Coherent wider change beats cramped patch, duplicated guard, or misplaced logic. Reuse fitting abstractions; do not contort code to avoid abstraction. Prefer consolidation. Fix root cause.
|
|
11
|
+
|
|
12
|
+
Avoid speculative features and extension points, single-implementation interfaces, configuration for fixed values, premature services, and imagined scaffolding. Dependency or public surface is valid for correct design or lower lifecycle cost; explain material tradeoff.
|
|
13
|
+
|
|
14
|
+
Simplicity never removes trust-boundary validation, authorization, security, data-loss prevention, error handling, accessibility, migration or rollback safety, concurrency protection, compatibility, required tests, or explicitly requested behavior. Ask only for material public, security, data, billing, or hard-to-reverse choices.
|
|
15
|
+
|
|
16
|
+
Run smallest sufficient proof. Report material changes, proof, unresolved risks, and only material omissions. Stop when task is satisfied.
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "2",
|
|
3
|
+
"native_pack": {
|
|
4
|
+
"id": "caveman-local",
|
|
5
|
+
"version": "2.2.0",
|
|
6
|
+
"protocol": 1,
|
|
7
|
+
"core_source": "native/native-core.md",
|
|
8
|
+
"core_prompt_token_budget": 560,
|
|
9
|
+
"targets": [
|
|
10
|
+
"claude",
|
|
11
|
+
"codex",
|
|
12
|
+
"hermes",
|
|
13
|
+
"gemini",
|
|
14
|
+
"opencode",
|
|
15
|
+
"aider"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"preserved_skill_ids": [
|
|
19
|
+
"cavecrew",
|
|
20
|
+
"caveman-commit",
|
|
21
|
+
"caveman-compress",
|
|
22
|
+
"caveman-help",
|
|
23
|
+
"caveman-review",
|
|
24
|
+
"caveman-stats"
|
|
25
|
+
],
|
|
26
|
+
"skills": [
|
|
27
|
+
{
|
|
28
|
+
"id": "caveman",
|
|
29
|
+
"summary": "Compress agent output style without changing technical literals.",
|
|
30
|
+
"delivery": [
|
|
31
|
+
"cli"
|
|
32
|
+
],
|
|
33
|
+
"suites": [
|
|
34
|
+
"output"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "caveman-discover",
|
|
39
|
+
"summary": "Find and label every LLM workflow in a repository.",
|
|
40
|
+
"delivery": [
|
|
41
|
+
"cli",
|
|
42
|
+
"web"
|
|
43
|
+
],
|
|
44
|
+
"suites": [
|
|
45
|
+
"agent-native"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "caveman-explore",
|
|
50
|
+
"summary": "Explore repositories read-only with compact file citations.",
|
|
51
|
+
"delivery": [
|
|
52
|
+
"cli"
|
|
53
|
+
],
|
|
54
|
+
"suites": [
|
|
55
|
+
"local"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "caveman-learn",
|
|
60
|
+
"summary": "Apply consent-gated fixes from a local Caveman learn report.",
|
|
61
|
+
"delivery": [
|
|
62
|
+
"cli"
|
|
63
|
+
],
|
|
64
|
+
"suites": [
|
|
65
|
+
"local"
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "caveman-manage",
|
|
70
|
+
"summary": "Review eval-gated experiments and block unsafe lifecycle actions.",
|
|
71
|
+
"delivery": [
|
|
72
|
+
"cli"
|
|
73
|
+
],
|
|
74
|
+
"suites": [
|
|
75
|
+
"agent-native"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "caveman-optimize",
|
|
80
|
+
"summary": "Evaluate an operator-chosen report-only observation with paired evidence.",
|
|
81
|
+
"delivery": [
|
|
82
|
+
"cli",
|
|
83
|
+
"web"
|
|
84
|
+
],
|
|
85
|
+
"suites": [
|
|
86
|
+
"agent-native"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"id": "caveman-evidence-review",
|
|
91
|
+
"summary": "Review costs, quality, workflows, traces, and savings evidence.",
|
|
92
|
+
"delivery": [
|
|
93
|
+
"cli"
|
|
94
|
+
],
|
|
95
|
+
"suites": [
|
|
96
|
+
"agent-native"
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "caveman-setup",
|
|
101
|
+
"summary": "Wire a repository through Caveman in record mode and verify it.",
|
|
102
|
+
"delivery": [
|
|
103
|
+
"cli",
|
|
104
|
+
"web"
|
|
105
|
+
],
|
|
106
|
+
"suites": [
|
|
107
|
+
"agent-native"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"id": "investigate-first",
|
|
112
|
+
"summary": "Gather evidence and establish a credible mechanism before editing.",
|
|
113
|
+
"delivery": [
|
|
114
|
+
"native"
|
|
115
|
+
],
|
|
116
|
+
"suites": [],
|
|
117
|
+
"activation": "classified",
|
|
118
|
+
"task_types": [
|
|
119
|
+
"investigation"
|
|
120
|
+
],
|
|
121
|
+
"evidence_status": "structural-test-only",
|
|
122
|
+
"prompt_byte_budget": 900,
|
|
123
|
+
"conflicts": [],
|
|
124
|
+
"precedence": 100,
|
|
125
|
+
"guardrails": [
|
|
126
|
+
"no_edit_before_credible_hypothesis",
|
|
127
|
+
"diagnosis_does_not_authorize_fix"
|
|
128
|
+
],
|
|
129
|
+
"entry_condition": "cause is ambiguous",
|
|
130
|
+
"stop_condition": "cause or exact blocker is evidence-backed"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"id": "lean-build",
|
|
134
|
+
"summary": "Deliver narrow complete feature outcomes with architectural fit on top of mandatory simplicity Core.",
|
|
135
|
+
"delivery": [
|
|
136
|
+
"native"
|
|
137
|
+
],
|
|
138
|
+
"suites": [],
|
|
139
|
+
"activation": "classified",
|
|
140
|
+
"task_types": [
|
|
141
|
+
"feature"
|
|
142
|
+
],
|
|
143
|
+
"evidence_status": "structural-test-only",
|
|
144
|
+
"prompt_byte_budget": 900,
|
|
145
|
+
"conflicts": [],
|
|
146
|
+
"precedence": 100,
|
|
147
|
+
"guardrails": [
|
|
148
|
+
"core_architecture_first_simplicity",
|
|
149
|
+
"preserve_correctness_controls",
|
|
150
|
+
"justify_material_tradeoffs"
|
|
151
|
+
],
|
|
152
|
+
"entry_condition": "task adds product behavior",
|
|
153
|
+
"stop_condition": "focused acceptance proof passes"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"id": "migration",
|
|
157
|
+
"summary": "Execute a reversible compatibility-safe transition without hidden destruction.",
|
|
158
|
+
"delivery": [
|
|
159
|
+
"native"
|
|
160
|
+
],
|
|
161
|
+
"suites": [],
|
|
162
|
+
"activation": "classified",
|
|
163
|
+
"task_types": [
|
|
164
|
+
"migration"
|
|
165
|
+
],
|
|
166
|
+
"evidence_status": "structural-test-only",
|
|
167
|
+
"prompt_byte_budget": 950,
|
|
168
|
+
"conflicts": [],
|
|
169
|
+
"precedence": 100,
|
|
170
|
+
"guardrails": [
|
|
171
|
+
"preserve_rollback",
|
|
172
|
+
"preserve_data",
|
|
173
|
+
"verify_compatibility"
|
|
174
|
+
],
|
|
175
|
+
"entry_condition": "task changes persisted or public shape",
|
|
176
|
+
"stop_condition": "requested migration stage passes without implicit contraction"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"id": "safe-refactor",
|
|
180
|
+
"summary": "Restructure code while preserving observable behavior.",
|
|
181
|
+
"delivery": [
|
|
182
|
+
"native"
|
|
183
|
+
],
|
|
184
|
+
"suites": [],
|
|
185
|
+
"activation": "classified",
|
|
186
|
+
"task_types": [
|
|
187
|
+
"refactor"
|
|
188
|
+
],
|
|
189
|
+
"evidence_status": "structural-test-only",
|
|
190
|
+
"prompt_byte_budget": 900,
|
|
191
|
+
"conflicts": [],
|
|
192
|
+
"precedence": 100,
|
|
193
|
+
"guardrails": [
|
|
194
|
+
"preserve_behavior",
|
|
195
|
+
"keep_intermediate_states_testable"
|
|
196
|
+
],
|
|
197
|
+
"entry_condition": "task requests structural change without behavior change",
|
|
198
|
+
"stop_condition": "before-and-after proof matches"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"id": "surgical-patch",
|
|
202
|
+
"summary": "Fix the narrowest responsible layer with regression proof.",
|
|
203
|
+
"delivery": [
|
|
204
|
+
"native"
|
|
205
|
+
],
|
|
206
|
+
"suites": [],
|
|
207
|
+
"activation": "classified",
|
|
208
|
+
"task_types": [
|
|
209
|
+
"bugfix"
|
|
210
|
+
],
|
|
211
|
+
"evidence_status": "structural-test-only",
|
|
212
|
+
"prompt_byte_budget": 850,
|
|
213
|
+
"conflicts": [],
|
|
214
|
+
"precedence": 100,
|
|
215
|
+
"guardrails": [
|
|
216
|
+
"avoid_unrelated_cleanup",
|
|
217
|
+
"preserve_surrounding_behavior"
|
|
218
|
+
],
|
|
219
|
+
"entry_condition": "task fixes incorrect behavior",
|
|
220
|
+
"stop_condition": "failure is fixed and regression proof passes"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"id": "verify-and-stop",
|
|
224
|
+
"summary": "Run the smallest sufficient proof set and stop without scope growth.",
|
|
225
|
+
"delivery": [
|
|
226
|
+
"native"
|
|
227
|
+
],
|
|
228
|
+
"suites": [],
|
|
229
|
+
"activation": "classified",
|
|
230
|
+
"task_types": [
|
|
231
|
+
"verification"
|
|
232
|
+
],
|
|
233
|
+
"evidence_status": "structural-test-only",
|
|
234
|
+
"prompt_byte_budget": 850,
|
|
235
|
+
"conflicts": [],
|
|
236
|
+
"precedence": 100,
|
|
237
|
+
"guardrails": [
|
|
238
|
+
"no_unrequested_product_edit",
|
|
239
|
+
"report_unavailable_proof_exactly"
|
|
240
|
+
],
|
|
241
|
+
"entry_condition": "task asks for proof or completion validation",
|
|
242
|
+
"stop_condition": "acceptance proof is complete"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"id": "ultracave",
|
|
246
|
+
"summary": "Caveman at maximum compression: fragments, one word when one word is enough, each fact once.",
|
|
247
|
+
"delivery": [
|
|
248
|
+
"cli"
|
|
249
|
+
],
|
|
250
|
+
"suites": [
|
|
251
|
+
"output"
|
|
252
|
+
]
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"id": "megacave",
|
|
256
|
+
"summary": "Caveman in Classical Chinese: wenyan register, technical terms verbatim.",
|
|
257
|
+
"delivery": [
|
|
258
|
+
"cli"
|
|
259
|
+
],
|
|
260
|
+
"suites": [
|
|
261
|
+
"output"
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
],
|
|
265
|
+
"suites": {
|
|
266
|
+
"agent-native": [
|
|
267
|
+
"caveman-setup",
|
|
268
|
+
"caveman-discover",
|
|
269
|
+
"caveman-evidence-review",
|
|
270
|
+
"caveman-optimize",
|
|
271
|
+
"caveman-manage"
|
|
272
|
+
],
|
|
273
|
+
"local": [
|
|
274
|
+
"caveman-explore",
|
|
275
|
+
"caveman-learn"
|
|
276
|
+
],
|
|
277
|
+
"output": [
|
|
278
|
+
"caveman",
|
|
279
|
+
"ultracave",
|
|
280
|
+
"megacave"
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: safe-refactor
|
|
3
|
+
description: Restructure code while preserving behavior. Use for extraction, consolidation, ownership moves, or cleanup where verification must bracket structural edits.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Safe refactor
|
|
7
|
+
|
|
8
|
+
Define behavior-preservation boundary and establish verification before structural edits.
|
|
9
|
+
|
|
10
|
+
- Keep feature changes outside refactor.
|
|
11
|
+
- Move one ownership boundary at a time.
|
|
12
|
+
- Preserve public interfaces, failure behavior, ordering, and compatibility unless explicitly scoped.
|
|
13
|
+
- Keep intermediate states buildable and testable.
|
|
14
|
+
- Avoid dependency or configuration growth without correctness need.
|
|
15
|
+
|
|
16
|
+
Run same proof after change. Stop when behavior matches and requested structure is achieved.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: surgical-patch
|
|
3
|
+
description: Fix bugs and small behavior changes at the narrowest responsible layer. Use when regression proof, preserved surrounding behavior, and task-relevant tests matter.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Surgical patch
|
|
7
|
+
|
|
8
|
+
Reproduce failure first when economical; otherwise capture strongest available evidence.
|
|
9
|
+
|
|
10
|
+
- Trace symptom to responsible mechanism.
|
|
11
|
+
- Change narrowest layer that owns incorrect behavior.
|
|
12
|
+
- Preserve unrelated behavior and user changes.
|
|
13
|
+
- Avoid cleanup, renaming, and abstraction outside fix.
|
|
14
|
+
- Add only regression proof relevant to task.
|
|
15
|
+
|
|
16
|
+
Run focused proof plus nearest affected gate. Stop when failure is fixed and regression proof passes.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# ultracave
|
|
2
|
+
|
|
3
|
+
Caveman with the grammar stripped. Fragments. One word when one word is enough. Each fact once.
|
|
4
|
+
|
|
5
|
+
Same floor as caveman: code, commands, paths, errors, numbers, and negations are never touched. The difference is everything around them.
|
|
6
|
+
|
|
7
|
+
**Invoke:** `/ultracave` in Claude Code. `/caveman ultra` still works as an alias.
|
|
8
|
+
|
|
9
|
+
**Use it when** you read fast and want payload only.
|
|
10
|
+
|
|
11
|
+
**Skip it for** onboarding, security review, and anything other humans will read. Ultracave drops to plain prose on its own for warnings and irreversible actions.
|
|
12
|
+
|
|
13
|
+
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): 35% fewer output tokens at the median than a plain `Answer concisely.` control. Length only, not correctness. See [docs/HONEST-NUMBERS.md](../../docs/HONEST-NUMBERS.md).
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ultracave
|
|
3
|
+
description: >
|
|
4
|
+
Caveman at maximum compression: fragments, one word when one word is enough,
|
|
5
|
+
each fact once. Invoke only with /ultracave or /caveman ultra. Stays on until
|
|
6
|
+
"stop caveman" or "normal mode".
|
|
7
|
+
disable-model-invocation: true
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# ultracave
|
|
11
|
+
|
|
12
|
+
Respond terse like smart caveman. All technical substance stay. Only fluff die. Then cut again.
|
|
13
|
+
|
|
14
|
+
Ultracave is caveman with the grammar stripped. Payload only.
|
|
15
|
+
|
|
16
|
+
## Persistence
|
|
17
|
+
|
|
18
|
+
Every response, whole session, until "stop caveman" or "normal mode". Unsure? Still on. `/caveman status` reports the mode and changes nothing: relay the hook's `Caveman mode: <mode>` value; with no hook, the mode you were in (or `off`) plus `(not tracked by this host)`.
|
|
19
|
+
|
|
20
|
+
## Floor
|
|
21
|
+
|
|
22
|
+
Never cut: code, commands, paths, API names, error strings (verbatim). not/never/no/only/except. Numbers and units. The user's language. One term per thing. No invented abbreviations, no arrows. Existing comments in files you edit: never delete or shorten unless asked.
|
|
23
|
+
|
|
24
|
+
## Rules
|
|
25
|
+
|
|
26
|
+
### 1. Fragments
|
|
27
|
+
|
|
28
|
+
Drop articles, copulas, connectives when order stays clear.
|
|
29
|
+
|
|
30
|
+
Bad: "The component re-renders because an inline object prop creates a new reference each render."
|
|
31
|
+
Good: "Inline object prop, new ref, re-render. `useMemo`."
|
|
32
|
+
|
|
33
|
+
### 2. One word when one word is enough
|
|
34
|
+
|
|
35
|
+
Bad: "Yes, that should work, though you'll want a null check first."
|
|
36
|
+
Good: "Yes. Null check first."
|
|
37
|
+
|
|
38
|
+
### 3. Each fact once
|
|
39
|
+
|
|
40
|
+
No restating, no summary after a list. Code change: changed lines plus context, not the whole file.
|
|
41
|
+
|
|
42
|
+
Good: "Pool reuses open DB connections. No per-request handshake."
|
|
43
|
+
|
|
44
|
+
### 4. Cut conjunctions only when order survives
|
|
45
|
+
|
|
46
|
+
Bad: "Migrate table drop column backup first."
|
|
47
|
+
Good: "Back up first. Then migrate: drops column."
|
|
48
|
+
|
|
49
|
+
### 5. Tool runs
|
|
50
|
+
|
|
51
|
+
One line in, one line out. Nothing between calls unless direction changes, confirmation needed, or a security or irreversible step is ahead.
|
|
52
|
+
|
|
53
|
+
### 6. Never perform
|
|
54
|
+
|
|
55
|
+
No prefix, no announcement, no mangled verbs for flavor. Fragment not shorter than the sentence? Use the sentence.
|
|
56
|
+
|
|
57
|
+
## When to break the rules
|
|
58
|
+
|
|
59
|
+
Plain prose, then resume: security warning. Irreversible action, confirm first. Any fragment with two readings. User confused. Question to the user, with its options. Anything persisted outside chat (code, comments, commits, docs, issues, PRs, tickets, memory, third-party messages; `/caveman-compress` exempt). Harness asks for a status line.
|
|
60
|
+
|
|
61
|
+
## Pre-send check
|
|
62
|
+
|
|
63
|
+
Two readings? Full sentence. Negations present? Payload verbatim? Flavor word? Cut.
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
// verbs-gate.mjs — the skills-verbs drift gate (fail-closed, deterministic).
|
|
2
|
+
//
|
|
3
|
+
// Invariant: a skill can never document a CLI command, MCP tool, or SDK call
|
|
4
|
+
// the shipped surfaces do not expose. This module derives the real surfaces
|
|
5
|
+
// from source — the CLI verb tables (TOOL_DISCOVERY/CLOUD_DISCOVERY + the
|
|
6
|
+
// reserved-verbs registry), both MCP servers' tool names (engine Go + the
|
|
7
|
+
// agent-native TS server), and the two SDKs' method definitions — then scans
|
|
8
|
+
// each canonical SKILL.md for references and reports anything that does not
|
|
9
|
+
// resolve. It is pure (returns a list of violations; it never exits), so the
|
|
10
|
+
// compiler and the tests share one implementation.
|
|
11
|
+
//
|
|
12
|
+
// Recognition rule: commands/tools/API calls are recognized inside code
|
|
13
|
+
// contexts (fenced blocks and inline `code` spans). An unknown token inside a
|
|
14
|
+
// code context fails closed. An unknown top-level word in prose is treated as
|
|
15
|
+
// ordinary prose (the `caveman` persona skill legitimately says "like caveman
|
|
16
|
+
// while ...") and ignored — but the unambiguous command markers `caveman tools`
|
|
17
|
+
// and `caveman cloud`, MCP `caveman_*` tokens, and the required `source`
|
|
18
|
+
// argument on `artifacts.page` are enforced wherever they appear.
|
|
19
|
+
|
|
20
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
21
|
+
import { join } from "node:path";
|
|
22
|
+
|
|
23
|
+
function readOptional(path) {
|
|
24
|
+
return existsSync(path) ? readFileSync(path, "utf8") : "";
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Pull the { verb: "x" } tokens out of one DiscoveryGroup[] literal in the CLI.
|
|
28
|
+
function discoveryVerbs(src, marker) {
|
|
29
|
+
const start = src.indexOf(marker);
|
|
30
|
+
if (start < 0) return new Set();
|
|
31
|
+
const end = src.indexOf("\n];", start);
|
|
32
|
+
if (end < 0) return new Set();
|
|
33
|
+
const block = src.slice(start, end);
|
|
34
|
+
const verbs = new Set();
|
|
35
|
+
for (const m of block.matchAll(/verb:\s*"([a-z0-9-]+)"/g)) verbs.add(m[1]);
|
|
36
|
+
return verbs;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Derive every surface a skill may reference. `errors` is non-empty when a
|
|
40
|
+
// source could not be parsed — the caller must fail closed rather than scan
|
|
41
|
+
// against an empty surface (which would pass everything).
|
|
42
|
+
export function loadSurfaces({ skillsDir, cliDir }) {
|
|
43
|
+
const errors = [];
|
|
44
|
+
const publicRoot = join(skillsDir, "..");
|
|
45
|
+
const packageRoot = existsSync(join(publicRoot, "sdk"))
|
|
46
|
+
? publicRoot
|
|
47
|
+
: join(publicRoot, "packages");
|
|
48
|
+
|
|
49
|
+
// Top-level CLI verbs: the reserved-verbs registry is the canonical source
|
|
50
|
+
// (it already drives reserved-verbs.generated.ts).
|
|
51
|
+
let topLevel = new Set();
|
|
52
|
+
try {
|
|
53
|
+
const doc = JSON.parse(readFileSync(join(skillsDir, "..", "agents", "reserved-verbs.json"), "utf8"));
|
|
54
|
+
if (!Array.isArray(doc.verbs)) throw new Error("verbs is not an array");
|
|
55
|
+
topLevel = new Set(doc.verbs);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
errors.push(`reserved-verbs.json: ${error.message}`);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// `caveman tools <verb>` / `caveman cloud <verb>` namespaces.
|
|
61
|
+
const indexSrc = readOptional(join(cliDir, "src", "index.ts"));
|
|
62
|
+
const toolVerbs = discoveryVerbs(indexSrc, "const TOOL_DISCOVERY");
|
|
63
|
+
const cloudVerbs = discoveryVerbs(indexSrc, "const CLOUD_DISCOVERY");
|
|
64
|
+
if (toolVerbs.size === 0) errors.push("could not parse TOOL_DISCOVERY verbs from CLI index.ts");
|
|
65
|
+
if (cloudVerbs.size === 0) errors.push("could not parse CLOUD_DISCOVERY verbs from CLI index.ts");
|
|
66
|
+
|
|
67
|
+
// MCP tool names: engine server (Go) + agent-native server (TS).
|
|
68
|
+
const mcpTools = new Set();
|
|
69
|
+
let declaredEngineTools = [];
|
|
70
|
+
try {
|
|
71
|
+
const manifest = JSON.parse(readFileSync(join(skillsDir, "engine-mcp-tools.json"), "utf8"));
|
|
72
|
+
if (manifest.schema_version !== "1" || !Array.isArray(manifest.tools)) {
|
|
73
|
+
throw new Error('schema_version must be "1" and tools must be an array');
|
|
74
|
+
}
|
|
75
|
+
declaredEngineTools = [...manifest.tools];
|
|
76
|
+
if (
|
|
77
|
+
declaredEngineTools.length === 0
|
|
78
|
+
|| new Set(declaredEngineTools).size !== declaredEngineTools.length
|
|
79
|
+
|| declaredEngineTools.some((name) => typeof name !== "string" || !/^caveman_[a-z_]+$/.test(name))
|
|
80
|
+
) {
|
|
81
|
+
throw new Error("tools must be unique caveman_* names");
|
|
82
|
+
}
|
|
83
|
+
for (const name of declaredEngineTools) mcpTools.add(name);
|
|
84
|
+
} catch (error) {
|
|
85
|
+
errors.push(`engine-mcp-tools.json: ${error.message}`);
|
|
86
|
+
}
|
|
87
|
+
const engineSrc = readOptional(join(skillsDir, "..", "mcp", "engine_tools.go"));
|
|
88
|
+
const sourceEngineTools = [...engineSrc.matchAll(/Tool\w+\s*=\s*"(caveman_[a-z_]+)"/g)].map((match) => match[1]);
|
|
89
|
+
if (sourceEngineTools.length > 0) {
|
|
90
|
+
const declared = [...declaredEngineTools].sort();
|
|
91
|
+
const source = [...new Set(sourceEngineTools)].sort();
|
|
92
|
+
if (JSON.stringify(declared) !== JSON.stringify(source)) {
|
|
93
|
+
errors.push("engine-mcp-tools.json drifted from public/mcp/engine_tools.go");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const agentMcpSrc = readOptional(join(cliDir, "src", "agent-mcp.ts"));
|
|
97
|
+
for (const m of agentMcpSrc.matchAll(/name:\s*"(caveman_[a-z_]+)"/g)) mcpTools.add(m[1]);
|
|
98
|
+
if (mcpTools.size === 0) errors.push("could not parse MCP tool names");
|
|
99
|
+
|
|
100
|
+
// SDK method/property surface: TS + Python definitions.
|
|
101
|
+
const sdkMembers = new Set();
|
|
102
|
+
const tsSrc = readOptional(join(packageRoot, "sdk", "typescript", "src", "index.ts"));
|
|
103
|
+
for (const re of [
|
|
104
|
+
/^\s+(?:public\s+|private\s+|readonly\s+|static\s+)*(?:async\s+)?([a-zA-Z_$][\w$]*)\s*\(/gm, // method defs
|
|
105
|
+
/^\s+([a-zA-Z_$][\w$]*)\s*=\s*/gm, // class fields (e.g. artifacts = { ... })
|
|
106
|
+
/^\s+([a-zA-Z_$][\w$]*)\s*:\s*(?:async\s*)?\(/gm, // object-literal methods (page: async ( ... ))
|
|
107
|
+
]) {
|
|
108
|
+
for (const m of tsSrc.matchAll(re)) sdkMembers.add(m[1]);
|
|
109
|
+
}
|
|
110
|
+
const pySrc = readOptional(join(packageRoot, "sdk", "python", "caveman_cloud", "core.py"));
|
|
111
|
+
for (const m of pySrc.matchAll(/^\s+def\s+([a-zA-Z_]\w*)\s*\(/gm)) sdkMembers.add(m[1]);
|
|
112
|
+
if (!sdkMembers.has("compress") || !sdkMembers.has("page") || !sdkMembers.has("tools")) {
|
|
113
|
+
errors.push("could not parse the SDK member surface");
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Assert the required-`source` contract against the live TS signature so the
|
|
117
|
+
// gate can never enforce a stale requirement.
|
|
118
|
+
const pageRequiresSource = /page:\s*async\s*\([^)]*options:\s*\{[^}]*\bsource:\s*string\b/.test(tsSrc);
|
|
119
|
+
if (!pageRequiresSource) {
|
|
120
|
+
errors.push("artifacts.page no longer declares a required `source` — refresh the gate");
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// caveman_-prefixed identifiers that are NOT MCP tools: the Python SDK package.
|
|
124
|
+
const sdkPackages = new Set();
|
|
125
|
+
if (existsSync(join(packageRoot, "sdk", "python", "caveman_cloud"))) sdkPackages.add("caveman_cloud");
|
|
126
|
+
|
|
127
|
+
return { topLevel, toolVerbs, cloudVerbs, mcpTools, sdkMembers, sdkPackages, pageRequiresSource, errors };
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Character ranges covered by a fenced code block or an inline `code` span.
|
|
131
|
+
// Fenced regions are masked before inline matching so an inline span can never
|
|
132
|
+
// straddle a fence; inline spans may cross a single line break (Markdown renders
|
|
133
|
+
// an inline `code` span containing a newline as a space).
|
|
134
|
+
function codeIntervals(body) {
|
|
135
|
+
const intervals = [];
|
|
136
|
+
const fence = /^```[^\n]*\n([\s\S]*?)^```/gm;
|
|
137
|
+
let m;
|
|
138
|
+
while ((m = fence.exec(body))) intervals.push([m.index, fence.lastIndex]);
|
|
139
|
+
const masked = body.split("");
|
|
140
|
+
for (const [start, end] of intervals) {
|
|
141
|
+
for (let i = start; i < end; i++) masked[i] = " ";
|
|
142
|
+
}
|
|
143
|
+
const inline = /`[^`]+`/g;
|
|
144
|
+
const maskedText = masked.join("");
|
|
145
|
+
while ((m = inline.exec(maskedText))) intervals.push([m.index, inline.lastIndex]);
|
|
146
|
+
return intervals;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function inCode(intervals, idx) {
|
|
150
|
+
return intervals.some(([start, end]) => idx >= start && idx < end);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Smallest code context containing idx (the inline span for an inline call).
|
|
154
|
+
function enclosingCode(intervals, body, idx) {
|
|
155
|
+
let best = null;
|
|
156
|
+
for (const [start, end] of intervals) {
|
|
157
|
+
if (idx >= start && idx < end && (!best || end - start < best[1] - best[0])) best = [start, end];
|
|
158
|
+
}
|
|
159
|
+
return best ? body.slice(best[0], best[1]) : "";
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Scan one SKILL.md body against the derived surfaces. Returns violation
|
|
163
|
+
// strings (empty = clean). Never throws, never exits.
|
|
164
|
+
export function scanSkillBody(id, body, surfaces) {
|
|
165
|
+
const violations = [];
|
|
166
|
+
const intervals = codeIntervals(body);
|
|
167
|
+
const V = (message) => violations.push(`${id}: ${message}`);
|
|
168
|
+
|
|
169
|
+
// CLI commands: `caveman <verb> [<sub>]` / `cave <verb> [<sub>]`. The lookbehind
|
|
170
|
+
// rejects `/caveman` (slash command), `@caveman-ai/sdk`, `caveman-learn`, and
|
|
171
|
+
// `foo.cave`.
|
|
172
|
+
const cliRe = /(?<![\w/@.\-])(caveman|cave)[ \t]+([a-z][\w-]*)(?:[ \t]+([a-z][\w-]*))?/g;
|
|
173
|
+
for (const m of body.matchAll(cliRe)) {
|
|
174
|
+
const [, bin, verb, sub] = m;
|
|
175
|
+
const code = inCode(intervals, m.index);
|
|
176
|
+
if (verb === "tools") {
|
|
177
|
+
if (sub && !surfaces.toolVerbs.has(sub)) V(`unknown \`${bin} tools ${sub}\` — not a TOOL_VERBS verb`);
|
|
178
|
+
else if (!sub && code) V(`\`${bin} tools\` without a verb`);
|
|
179
|
+
} else if (verb === "cloud") {
|
|
180
|
+
if (sub && !surfaces.cloudVerbs.has(sub)) V(`unknown \`${bin} cloud ${sub}\` — not a CLOUD_VERBS verb`);
|
|
181
|
+
else if (!sub && code) V(`\`${bin} cloud\` without a verb`);
|
|
182
|
+
} else if (surfaces.topLevel.has(verb)) {
|
|
183
|
+
// known top-level command
|
|
184
|
+
} else if (code) {
|
|
185
|
+
V(`unknown command \`${bin} ${verb}\` — not a reserved top-level verb`);
|
|
186
|
+
}
|
|
187
|
+
// unknown verb in prose = ordinary word (the caveman persona) → ignore
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// MCP tool tokens: caveman_<name>. Snake-case is never English prose, so an
|
|
191
|
+
// unknown one fails wherever it appears (except the Python SDK package name).
|
|
192
|
+
const mcpRe = /(?<![\w/@.\-])(caveman_[a-z_]+)/g;
|
|
193
|
+
for (const m of body.matchAll(mcpRe)) {
|
|
194
|
+
const name = m[1];
|
|
195
|
+
if (surfaces.sdkPackages.has(name) || surfaces.mcpTools.has(name)) continue;
|
|
196
|
+
V(`unknown MCP tool / caveman_ identifier \`${name}\``);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// SDK calls: cave./trace./handle.<member>[.<member>]( — only inside code.
|
|
200
|
+
const sdkRe = /(?<![\w$.])(cave|trace|handle)\.([a-zA-Z_$][\w$]*)(?:\.([a-zA-Z_$][\w$]*))?[ \t\n]*\(/g;
|
|
201
|
+
for (const m of body.matchAll(sdkRe)) {
|
|
202
|
+
if (!inCode(intervals, m.index)) continue;
|
|
203
|
+
const [, recv, first, second] = m;
|
|
204
|
+
if (!surfaces.sdkMembers.has(first)) { V(`unknown SDK member \`${recv}.${first}\``); continue; }
|
|
205
|
+
if (second && !surfaces.sdkMembers.has(second)) { V(`unknown SDK member \`${recv}.${first}.${second}\``); continue; }
|
|
206
|
+
if (first === "artifacts" && second === "page") {
|
|
207
|
+
const ctx = enclosingCode(intervals, body, m.index);
|
|
208
|
+
if (!/\bsource\b/.test(ctx)) V("`artifacts.page` call omits the required `source` argument");
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return violations;
|
|
213
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verify-and-stop
|
|
3
|
+
description: Prove existing work meets acceptance conditions without expanding scope. Use for validation-only tasks, completion checks, focused gate runs, and last-mile proof.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Verify and stop
|
|
7
|
+
|
|
8
|
+
Translate acceptance conditions into smallest sufficient proof set.
|
|
9
|
+
|
|
10
|
+
- Reuse still-current results with matching repository state.
|
|
11
|
+
- Run focused checks before wider gates.
|
|
12
|
+
- Distinguish pass, fail, unavailable, and blocked exactly.
|
|
13
|
+
- Do not edit product code unless verification request includes fixes.
|
|
14
|
+
- Do not add polish, cleanup, or unrelated tests after criteria pass.
|
|
15
|
+
|
|
16
|
+
Stop immediately when acceptance proof is complete. Report commands, results, and unresolved risk only.
|