skilltally 1.0.0 → 1.0.1

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.
@@ -10,7 +10,7 @@
10
10
  {
11
11
  "name": "skilltally",
12
12
  "description": "Track skill activations and identify unused skills eating context.",
13
- "version": "1.0.0",
13
+ "version": "1.0.1",
14
14
  "source": "./",
15
15
  "category": "productivity"
16
16
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skilltally",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Real-time skill usage tracking via hooks for Antigravity, Claude Code, Codex & Gemini CLI.",
5
5
  "author": {
6
6
  "name": "112516101106",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skilltally",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Real-time skill usage tracking via hooks for Antigravity, Claude Code, Codex & Gemini CLI.",
5
5
  "author": {
6
6
  "name": "112516101106",
package/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.1] - 2026-11-19
9
+
10
+ ### Fixed
11
+ - Ignore third-party hooks in `skilltally doctor` when inspecting `~/.codex/hooks.json`, `~/.claude/settings.json`, `~/.gemini/settings.json`, and `~/.gemini/config/hooks.json` instead of flagging unrelated commands as broken paths.
12
+ - Match the exact `[hooks.state."...hooks.json:post_tool_use:<group>:<handler>"]` index in `~/.codex/config.toml` when checking Codex hook trust so third-party hooks at index `0:0` do not produce false positives.
13
+
8
14
  ## [1.0.0] - 2026-11-19
9
15
 
10
16
  ### Added
package/bin/cli.mjs CHANGED
@@ -32,7 +32,7 @@ function getVersion() {
32
32
  try {
33
33
  return JSON.parse(readFileSync(join(pkgDir, 'package.json'), 'utf8')).version;
34
34
  } catch {
35
- return '1.0.0';
35
+ return '1.0.1';
36
36
  }
37
37
  }
38
38
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "skilltally",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Real-time skill usage tracking via hooks for Antigravity, Claude Code, Codex & Gemini CLI."
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skilltally",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Real-time skill usage tracking via hooks for Antigravity, Claude Code, Codex & Gemini CLI.",
5
5
  "type": "module",
6
6
  "bin": {
package/plugin.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "skilltally",
3
3
  "displayName": "SkillTally",
4
4
  "description": "Real-time skill usage tracking via hooks for Antigravity, Claude Code, Codex & Gemini CLI. See which skills you actually use and which eat context.",
5
- "version": "1.0.0",
5
+ "version": "1.0.1",
6
6
  "author": {
7
7
  "name": "112516101106",
8
8
  "url": "https://github.com/112516101106"
@@ -88,7 +88,7 @@ export function installAntigravity({
88
88
 
89
89
  writeJsonAtomic(join(target, 'hooks.json'), buildAntigravityHooksJson(), 0o644);
90
90
 
91
- let version = '1.0.0';
91
+ let version = '1.0.1';
92
92
  try {
93
93
  version = JSON.parse(readFileSync(join(pkgRoot, 'package.json'), 'utf8')).version || version;
94
94
  } catch {}
@@ -56,20 +56,32 @@ export function hasCodexPluginInstalled(homeDir = homedir()) {
56
56
  }
57
57
 
58
58
  export function checkCodexHookTrust(homeDir = homedir()) {
59
- const raw = readCodexToml(homeDir);
60
59
  const hooksPath = join(homeDir, '.codex', 'hooks.json');
61
- let hasUserHook = false;
60
+ let userHookPos = null;
62
61
  try {
63
62
  const doc = readJsonObject(hooksPath);
64
- for (const g of doc?.hooks?.PostToolUse || []) {
65
- if (Array.isArray(g?.hooks) && g.hooks.some(isSkilltallyHandler)) {
66
- hasUserHook = true;
67
- break;
63
+ const groups = doc?.hooks?.PostToolUse || [];
64
+ for (let gi = 0; gi < groups.length && !userHookPos; gi++) {
65
+ const handlers = groups[gi]?.hooks;
66
+ if (!Array.isArray(handlers)) continue;
67
+ for (let hi = 0; hi < handlers.length; hi++) {
68
+ if (isSkilltallyHandler(handlers[hi])) {
69
+ userHookPos = { groupIdx: gi, handlerIdx: hi };
70
+ break;
71
+ }
68
72
  }
69
73
  }
70
74
  } catch {}
71
75
 
72
- if (!raw) return hasUserHook ? 'untrusted' : 'unknown';
76
+ const hasPlugin = hasCodexPluginInstalled(homeDir);
77
+ if (!userHookPos && !hasPlugin) return 'unknown';
78
+
79
+ const raw = readCodexToml(homeDir);
80
+ if (!raw) return userHookPos ? 'untrusted' : 'unknown';
81
+
82
+ const exactHookKey = userHookPos
83
+ ? `hooks.json:post_tool_use:${userHookPos.groupIdx}:${userHookPos.handlerIdx}`
84
+ : null;
73
85
 
74
86
  let inRelevantState = false;
75
87
  let sawSection = false;
@@ -79,7 +91,11 @@ export function checkCodexHookTrust(homeDir = homedir()) {
79
91
  const trimmed = line.replace(/#.*$/, '').trim();
80
92
  if (!trimmed) continue;
81
93
  if (trimmed.startsWith('[')) {
82
- if (/^\[hooks\.state\./.test(trimmed) && (trimmed.includes('skilltally') || trimmed.includes('hooks.json:post_tool_use'))) {
94
+ const matchesSkilltally = trimmed.includes('skilltally');
95
+ const matchesUserHook =
96
+ exactHookKey !== null &&
97
+ (trimmed.includes(exactHookKey) || /:hooks\.json:post_tool_use(?:"|'|])/.test(trimmed));
98
+ if (/^\[hooks\.state\./.test(trimmed) && (matchesSkilltally || matchesUserHook)) {
83
99
  inRelevantState = true;
84
100
  sawSection = true;
85
101
  } else {
@@ -93,7 +109,7 @@ export function checkCodexHookTrust(homeDir = homedir()) {
93
109
  }
94
110
 
95
111
  if (sawSection) return sawTrustedHash ? 'trusted' : 'untrusted';
96
- return hasUserHook ? 'untrusted' : 'unknown';
112
+ return userHookPos ? 'untrusted' : 'unknown';
97
113
  }
98
114
 
99
115
  export function installCodex({
@@ -11,29 +11,36 @@ import { checkCodexHookTrust, detectCodex, hasCodexPluginInstalled } from './cod
11
11
  import { detectGemini } from './gemini.mjs';
12
12
  import { extractHookCommandPath, getPackageRoot, isSkilltallyHandler, readJsonObject } from './runtime.mjs';
13
13
 
14
- function collectSkilltallyHookCommands(hooksJsonObj) {
14
+ function collectAntigravityHookCommands(hooksJsonObj) {
15
15
  const commands = [];
16
16
  if (!hooksJsonObj || typeof hooksJsonObj !== 'object') return commands;
17
17
 
18
- // Antigravity root hooks.json style: { "<name>": { PostToolUse: [...] } }
19
- for (const val of Object.values(hooksJsonObj)) {
20
- if (val && typeof val === 'object' && Array.isArray(val.PostToolUse)) {
21
- for (const group of val.PostToolUse) {
22
- for (const h of group?.hooks || []) {
23
- if (typeof h?.command === 'string') commands.push(h.command);
18
+ for (const [key, val] of Object.entries(hooksJsonObj)) {
19
+ if (key === 'hooks' || !val || typeof val !== 'object') continue;
20
+ if (!Array.isArray(val.PostToolUse)) continue;
21
+ for (const group of val.PostToolUse) {
22
+ for (const h of group?.hooks || []) {
23
+ if ((key === 'skilltally' || isSkilltallyHandler(h)) && typeof h?.command === 'string') {
24
+ commands.push(h.command);
24
25
  }
25
26
  }
26
27
  }
27
28
  }
28
29
 
29
- // Claude / Codex / Gemini style: { hooks: { PostToolUse: [...], AfterTool: [...] } }
30
+ return commands;
31
+ }
32
+
33
+ function collectNestedHookCommands(hooksJsonObj) {
34
+ const commands = [];
35
+ if (!hooksJsonObj || typeof hooksJsonObj !== 'object') return commands;
36
+
30
37
  for (const eventName of ['PostToolUse', 'AfterTool']) {
31
- if (Array.isArray(hooksJsonObj?.hooks?.[eventName])) {
32
- for (const group of hooksJsonObj.hooks[eventName]) {
33
- for (const h of group?.hooks || []) {
34
- if (isSkilltallyHandler(h) && typeof h.command === 'string') {
35
- commands.push(h.command);
36
- }
38
+ const groups = hooksJsonObj?.hooks?.[eventName];
39
+ if (!Array.isArray(groups)) continue;
40
+ for (const group of groups) {
41
+ for (const h of group?.hooks || []) {
42
+ if (isSkilltallyHandler(h) && typeof h?.command === 'string') {
43
+ commands.push(h.command);
37
44
  }
38
45
  }
39
46
  }
@@ -146,14 +153,14 @@ export function runDoctor({
146
153
  let agyPluginCmds = [];
147
154
  if (agyPluginExists && existsSync(join(agyPluginDir, 'hooks.json'))) {
148
155
  try {
149
- agyPluginCmds = collectSkilltallyHookCommands(readJsonObject(join(agyPluginDir, 'hooks.json')));
156
+ agyPluginCmds = collectAntigravityHookCommands(readJsonObject(join(agyPluginDir, 'hooks.json')));
150
157
  } catch {}
151
158
  }
152
159
  let agyGlobalCmds = [];
153
160
  const agyGlobalHooksPath = join(homeDir, '.gemini', 'config', 'hooks.json');
154
161
  if (existsSync(agyGlobalHooksPath)) {
155
162
  try {
156
- agyGlobalCmds = collectSkilltallyHookCommands(readJsonObject(agyGlobalHooksPath));
163
+ agyGlobalCmds = collectAntigravityHookCommands(readJsonObject(agyGlobalHooksPath));
157
164
  } catch {}
158
165
  }
159
166
 
@@ -183,7 +190,7 @@ export function runDoctor({
183
190
  let claudeCmds = [];
184
191
  if (existsSync(claudeSettingsPath)) {
185
192
  try {
186
- claudeCmds = collectSkilltallyHookCommands(readJsonObject(claudeSettingsPath));
193
+ claudeCmds = collectNestedHookCommands(readJsonObject(claudeSettingsPath));
187
194
  } catch {}
188
195
  }
189
196
  const claudeSettingsInstalled = claudeCmds.length > 0;
@@ -204,7 +211,7 @@ export function runDoctor({
204
211
  let codexCmds = [];
205
212
  if (existsSync(codexHooksPath)) {
206
213
  try {
207
- codexCmds = collectSkilltallyHookCommands(readJsonObject(codexHooksPath));
214
+ codexCmds = collectNestedHookCommands(readJsonObject(codexHooksPath));
208
215
  } catch {}
209
216
  }
210
217
  const codexHooksInstalled = codexCmds.length > 0;
@@ -227,7 +234,7 @@ export function runDoctor({
227
234
  if (existsSync(geminiSettingsPath)) {
228
235
  try {
229
236
  const geminiDoc = readJsonObject(geminiSettingsPath);
230
- geminiCmds = collectSkilltallyHookCommands(geminiDoc);
237
+ geminiCmds = collectNestedHookCommands(geminiDoc);
231
238
  geminiHooksDisabled = geminiDoc?.hooksConfig?.enabled === false;
232
239
  } catch {}
233
240
  }