@bglocation/tune-context 2.4.0 → 3.0.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +195 -0
- package/README.md +211 -18
- package/bin/tune-context +1 -1
- package/bin/tune-context.mjs +167 -51
- package/cli/archive.mjs +322 -0
- package/cli/entry-point.mjs +73 -0
- package/cli/experiment.mjs +35 -3
- package/cli/version.mjs +118 -0
- package/eval/adoption-report.mjs +11 -5
- package/eval/analyze.mjs +792 -0
- package/eval/arm.mjs +9 -5
- package/eval/pricing.mjs +32 -1
- package/eval/prompt-metrics.mjs +395 -46
- package/eval/report.mjs +881 -0
- package/eval/verdict.mjs +963 -0
- package/hooks/adoption-log.mjs +1 -1
- package/hooks/context-reminder.mjs +1 -1
- package/hooks/pre-compact-snapshot.mjs +4 -4
- package/hooks/session-start-reinject.mjs +1 -4
- package/package.json +7 -2
- package/skills/token-efficiency/SKILL.md +1 -1
- package/skills/tune-context/SKILL.md +4 -2
package/hooks/adoption-log.mjs
CHANGED
|
@@ -102,10 +102,10 @@ export function buildSnapshot(input) {
|
|
|
102
102
|
`- cwd: ${cwd}`,
|
|
103
103
|
branch !== null ? `- branch: ${branch}` : null,
|
|
104
104
|
'',
|
|
105
|
-
status ?
|
|
106
|
-
log ?
|
|
105
|
+
status ? `## git status --short\n\`\`\`\n${status}\n\`\`\`` : null,
|
|
106
|
+
log ? `## git log -5 --oneline\n\`\`\`\n${log}\n\`\`\`` : null,
|
|
107
107
|
].filter((l) => l !== null);
|
|
108
|
-
return lines.join('\n')
|
|
108
|
+
return `${lines.join('\n')}\n`;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
// Never fails the host tool call: this snapshot is a safety net for a
|
|
@@ -130,6 +130,6 @@ function main() {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
if (process.argv[1]
|
|
133
|
+
if (process.argv[1]?.endsWith('pre-compact-snapshot.mjs')) {
|
|
134
134
|
main();
|
|
135
135
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bglocation/tune-context",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Context-efficiency configurator for Claude Code — token-saving doctrine packaged as skills, plus a tune-context configurator that scaffolds a lean CLAUDE.md, doctrine skills, subagents, settings, hooks and MCP wiring.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,12 +37,17 @@
|
|
|
37
37
|
],
|
|
38
38
|
"scripts": {
|
|
39
39
|
"test": "node --test",
|
|
40
|
+
"lint": "biome lint .",
|
|
41
|
+
"lint:fix": "biome lint --write .",
|
|
40
42
|
"verify:pack": "node scripts/verify-pack.mjs",
|
|
41
43
|
"verify:plugin": "node scripts/verify-plugin.mjs",
|
|
42
44
|
"smoke:init": "node scripts/smoke-init.mjs",
|
|
43
|
-
"prepublishOnly": "npm test && npm run verify:pack && npm run verify:plugin && npm run smoke:init"
|
|
45
|
+
"prepublishOnly": "npm run lint && npm test && npm run verify:pack && npm run verify:plugin && npm run smoke:init"
|
|
44
46
|
},
|
|
45
47
|
"publishConfig": {
|
|
46
48
|
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@biomejs/biome": "^2.5.6"
|
|
47
52
|
}
|
|
48
53
|
}
|
|
@@ -45,7 +45,7 @@ comments in the domain vocabulary someone would *search* with — better contrac
|
|
|
45
45
|
## 6. Measure, don't believe
|
|
46
46
|
If the tool logs usage (`.rag/usage.jsonl` → `rag-usage`), review it
|
|
47
47
|
periodically: is semantic search actually replacing grep? Promote or drop levers
|
|
48
|
-
on data, not faith. If `tune-context` is set up, `
|
|
48
|
+
on data, not faith. If `tune-context` is set up, `tune-context eval adoption-report`
|
|
49
49
|
covers the rest of this doctrine the same way — search lever, skills, subagents,
|
|
50
50
|
re-read churn — as a behavioral proxy (tool calls), not token cost.
|
|
51
51
|
|
|
@@ -156,8 +156,10 @@ covering the detected build/test/lint commands.
|
|
|
156
156
|
they fire their own event carrying `agent_type`). It appends one line per
|
|
157
157
|
event to `~/.claude/tune-context/adoption.jsonl` by default — which lever the
|
|
158
158
|
model reached for (RAG vs grep, Skill, subagent, re-reads). Read it with
|
|
159
|
-
`eval
|
|
160
|
-
|
|
159
|
+
`tune-context eval adoption-report` (module `eval/adoption-report.mjs`; the
|
|
160
|
+
`rag-usage` analog). Behavioral proxy only:
|
|
161
|
+
no token cost (that is `tune-context eval prompt-metrics`, from the session
|
|
162
|
+
transcripts; OTEL `claude_code.cost.usage` is Anthropic's own figure) and no
|
|
161
163
|
caveman (an output style, not a tool call). Doctrine-as-method (narrow reads,
|
|
162
164
|
contracts-first edits) is likewise not `Skill`-call-visible — the verdict
|
|
163
165
|
reports zero `Skill` calls as a neutral note, not "unused", and points at the
|