@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.
@@ -127,6 +127,6 @@ function main() {
127
127
  }
128
128
  }
129
129
 
130
- if (process.argv[1] && process.argv[1].endsWith('adoption-log.mjs')) {
130
+ if (process.argv[1]?.endsWith('adoption-log.mjs')) {
131
131
  main();
132
132
  }
@@ -328,6 +328,6 @@ function main() {
328
328
  }
329
329
  }
330
330
 
331
- if (process.argv[1] && process.argv[1].endsWith('context-reminder.mjs')) {
331
+ if (process.argv[1]?.endsWith('context-reminder.mjs')) {
332
332
  main();
333
333
  }
@@ -102,10 +102,10 @@ export function buildSnapshot(input) {
102
102
  `- cwd: ${cwd}`,
103
103
  branch !== null ? `- branch: ${branch}` : null,
104
104
  '',
105
- status ? '## git status --short\n```\n' + status + '\n```' : null,
106
- log ? '## git log -5 --oneline\n```\n' + log + '\n```' : null,
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') + '\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] && process.argv[1].endsWith('pre-compact-snapshot.mjs')) {
133
+ if (process.argv[1]?.endsWith('pre-compact-snapshot.mjs')) {
134
134
  main();
135
135
  }
@@ -32,9 +32,6 @@ function main() {
32
32
  );
33
33
  }
34
34
 
35
- if (
36
- process.argv[1] &&
37
- process.argv[1].endsWith('session-start-reinject.mjs')
38
- ) {
35
+ if (process.argv[1]?.endsWith('session-start-reinject.mjs')) {
39
36
  main();
40
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bglocation/tune-context",
3
- "version": "2.4.0",
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, `node eval/adoption-report.mjs`
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/adoption-report.mjs` (the `rag-usage` analog). Behavioral proxy only:
160
- no token cost (needs OTEL `claude_code.cost.usage` + a collector) and no
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