skill-analyzer 0.1.0 → 0.1.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.
package/dist/budget.d.ts CHANGED
@@ -1 +1,2 @@
1
+ export declare const OVERHEAD_PER_SKILL = 109;
1
2
  export declare function budgetCommand(args: string[]): void;
package/dist/budget.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import chalk from "chalk";
2
2
  import { getSkillsDir, loadSkillRegistry } from "./registry.js";
3
3
  import { sectionHeader, keyValue, budgetBar, makeTable } from "./formatter.js";
4
- const OVERHEAD_PER_SKILL = 109;
4
+ export const OVERHEAD_PER_SKILL = 109;
5
5
  const DEFAULT_BUDGET = 16_000;
6
6
  export function budgetCommand(args) {
7
7
  const skillsDir = getSkillsDir(args);
@@ -12,34 +12,34 @@ export function budgetCommand(args) {
12
12
  .map((s) => ({
13
13
  name: s.name,
14
14
  descriptionLength: s.descriptionLength,
15
- cost: s.descriptionLength + OVERHEAD_PER_SKILL,
15
+ totalChars: s.descriptionLength + OVERHEAD_PER_SKILL,
16
16
  }))
17
- .sort((a, b) => b.cost - a.cost);
18
- const totalCost = entries.reduce((sum, e) => sum + e.cost, 0);
17
+ .sort((a, b) => b.totalChars - a.totalChars);
18
+ const totalUsed = entries.reduce((sum, e) => sum + e.totalChars, 0);
19
19
  if (isJson) {
20
- console.log(JSON.stringify({ budget, totalCost, entries }, null, 2));
20
+ console.log(JSON.stringify({ budget, totalUsed, entries }, null, 2));
21
21
  return;
22
22
  }
23
- const overBudget = totalCost > budget;
23
+ const overBudget = totalUsed > budget;
24
24
  sectionHeader("Description Budget", overBudget ? "OVER BUDGET" : undefined);
25
25
  keyValue([
26
- ["Budget:", budgetBar(totalCost, budget)],
26
+ ["Budget:", budgetBar(totalUsed, budget)],
27
27
  [
28
28
  "Used:",
29
- `${totalCost.toLocaleString()} / ${budget.toLocaleString()} chars`,
29
+ `${totalUsed.toLocaleString()} / ${budget.toLocaleString()} chars`,
30
30
  ],
31
31
  [
32
32
  "Remaining:",
33
33
  overBudget
34
- ? chalk.red(`-${(totalCost - budget).toLocaleString()} chars`)
35
- : chalk.green(`${(budget - totalCost).toLocaleString()} chars`),
34
+ ? chalk.red(`-${(totalUsed - budget).toLocaleString()} chars`)
35
+ : chalk.green(`${(budget - totalUsed).toLocaleString()} chars`),
36
36
  ],
37
37
  ["Skills:", `${entries.length} (${OVERHEAD_PER_SKILL} chars overhead each)`],
38
38
  ]);
39
39
  makeTable({
40
40
  head: ["#", "Skill", "Description Chars", "Total Chars"],
41
41
  colAligns: ["right", "left", "right", "right"],
42
- rows: entries.map((e, i) => [i + 1, e.name, e.descriptionLength, e.cost]),
42
+ rows: entries.map((e, i) => [i + 1, e.name, e.descriptionLength, e.totalChars]),
43
43
  });
44
44
  console.log();
45
45
  }
package/dist/dead.js CHANGED
@@ -2,6 +2,7 @@ import chalk from "chalk";
2
2
  import { getSkillsDir, loadSkillRegistry } from "./registry.js";
3
3
  import { getLogsDir, scanSessions, aggregateUsage } from "./scanner.js";
4
4
  import { sectionHeader, keyValue, makeTable } from "./formatter.js";
5
+ import { OVERHEAD_PER_SKILL } from "./budget.js";
5
6
  export function deadCommand(args) {
6
7
  const skillsDir = getSkillsDir(args);
7
8
  const logsDir = getLogsDir(args);
@@ -19,7 +20,7 @@ export function deadCommand(args) {
19
20
  }
20
21
  const period = days ? `last ${days} days` : "all time";
21
22
  sectionHeader(`Dead Skills (${period})`);
22
- const totalWaste = deadSkills.reduce((sum, s) => sum + s.descriptionLength + 109, 0);
23
+ const totalWaste = deadSkills.reduce((sum, s) => sum + s.descriptionLength + OVERHEAD_PER_SKILL, 0);
23
24
  keyValue([
24
25
  ["Dead:", `${deadSkills.length} of ${registry.length} local skills`],
25
26
  [
@@ -40,7 +41,7 @@ export function deadCommand(args) {
40
41
  i + 1,
41
42
  chalk.red(s.name),
42
43
  s.descriptionLength,
43
- s.descriptionLength + 109,
44
+ s.descriptionLength + OVERHEAD_PER_SKILL,
44
45
  ]),
45
46
  });
46
47
  console.log();
package/dist/report.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { getSkillsDir, loadSkillRegistry } from "./registry.js";
2
2
  import { getLogsDir, scanSessions, aggregateUsage } from "./scanner.js";
3
- import { budgetCommand } from "./budget.js";
3
+ import { budgetCommand, OVERHEAD_PER_SKILL } from "./budget.js";
4
4
  import { usageCommand } from "./usage.js";
5
5
  import { deadCommand } from "./dead.js";
6
6
  export function reportCommand(args) {
@@ -29,13 +29,13 @@ function reportJson(args) {
29
29
  .map((s) => ({
30
30
  name: s.name,
31
31
  descriptionLength: s.descriptionLength,
32
- cost: s.descriptionLength + 109,
32
+ totalChars: s.descriptionLength + OVERHEAD_PER_SKILL,
33
33
  }))
34
- .sort((a, b) => b.cost - a.cost);
35
- const totalCost = budgetEntries.reduce((sum, e) => sum + e.cost, 0);
34
+ .sort((a, b) => b.totalChars - a.totalChars);
35
+ const totalUsed = budgetEntries.reduce((sum, e) => sum + e.totalChars, 0);
36
36
  console.log(JSON.stringify({
37
37
  usage: { totalInvocations: invocations.length, skills: usage },
38
38
  dead: { count: deadSkills.length, skills: deadSkills },
39
- budget: { limit: budget, totalCost, entries: budgetEntries },
39
+ budget: { limit: budget, totalUsed, entries: budgetEntries },
40
40
  }, null, 2));
41
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skill-analyzer",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Analyze Claude Code skill library: usage frequency, dead skills, description budget consumption",
5
5
  "type": "module",
6
6
  "bin": {