janitor-value

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill Value Report

Skill价值报告

Show whether each installed skill is earning the context-window tokens it costs.
展示每个已安装的Skill是否物有所值,即其消耗的上下文窗口token成本是否匹配其价值。

Overview

概述

Combine token cost and usage tracking into a single view of every installed skill, sorted with the heaviest unused skills at the top. The report splits each skill's cost into what is permanently loaded (the description) and what only loads on demand (the body), then cross-references recent invocations so the user can see which skills are dead weight.
Replaces the v1.2 split between
/janitor-tokens
(cost only) and
/janitor-usage
(usage only).
将token成本与使用情况追踪整合为一个视图,展示所有已安装的Skill,并按未使用程度从高到低排序。该报告将每个Skill的成本分为永久加载部分(描述内容)和按需加载部分(主体内容),然后结合近期调用记录,让用户可以清楚看到哪些Skill是无用累赘。
替代了v1.2版本中
/janitor-tokens
(仅展示成本)和
/janitor-usage
(仅展示使用情况)的拆分功能。

Prerequisites

前提条件

  • Claude Code with the skills-janitor plugin installed (provides
    scripts/value.sh
    )
  • bash 3.2+ (the stock macOS bash works; no external dependencies)
  • Read access to
    ~/.claude/skills
    ,
    ~/.claude/agents
    , and local Claude Code session history
  • No authentication or API keys required — the script reads local files only
  • 安装了skills-janitor插件的Claude Code(提供
    scripts/value.sh
    脚本)
  • bash 3.2及以上版本(macOS自带的bash即可;无需外部依赖)
  • 拥有
    ~/.claude/skills
    ~/.claude/agents
    及本地Claude Code会话历史的读取权限
  • 无需认证或API密钥——脚本仅读取本地文件

Instructions

操作步骤

Step 1: Run the value script

步骤1:运行价值分析脚本

bash
bash ~/.claude/skills/skills-janitor/scripts/value.sh [--weeks N] [--budget N] [--json]
  • --weeks N
    — usage lookback window (default: 4)
  • --budget N
    — context window size for % calculations (default: 200000)
  • --json
    — emit raw JSON
bash
bash ~/.claude/skills/skills-janitor/scripts/value.sh [--weeks N] [--budget N] [--json]
  • --weeks N
    —— 使用情况回溯窗口(默认:4周)
  • --budget N
    —— 用于百分比计算的上下文窗口大小(默认:200000)
  • --json
    —— 输出原始JSON格式数据

Step 2: Present the results

步骤2:展示结果

Show the table and summary to the user. When explaining results, do NOT describe body tokens as permanent context cost — only descriptions are always loaded. Plugin-namespaced skills appear with their full invocation name (e.g.,
marketing-skills:image
,
figma:figma-use
).
向用户展示表格和摘要。解释结果时,请勿将主体token描述为永久上下文成本——只有描述内容会始终加载。插件命名空间的Skill会显示完整调用名称(例如:
marketing-skills:image
figma:figma-use
)。

Step 3: Suggest action when waste is high

步骤3:高浪费情况的行动建议

If "unused skill cost" exceeds 20% of the budget, recommend the user run
/janitor-report
for a full health check or (in v1.4+)
/janitor-swipe
to triage interactively.
如果“未使用Skill成本”超过预算的20%,建议用户运行
/janitor-report
进行全面健康检查,或(v1.4及以上版本)运行
/janitor-swipe
进行交互式筛选。

Output

输出内容

A table of every installed skill with:
  • Always — description tokens, permanently in the system prompt (the real context rent)
  • Body — the rest of SKILL.md, loaded only when the skill triggers (progressive disclosure)
  • Used?
    yes
    if invoked in the lookback window, else
    NO
  • Last Used — date of most recent invocation
Followed by a summary:
  • Total tokens loaded into context (the always-loaded TOTAL includes skills plus subagent descriptions from
    ~/.claude/agents
    , reported as % of budget)
  • Active vs. unused split
  • Top wasters: heavy skills with zero usage
一张包含所有已安装Skill的表格,包含以下列:
  • Always —— 描述内容的token数,永久加载在系统提示中(真正的上下文“租金”)
  • Body —— SKILL.md的剩余内容,仅在Skill触发时加载(渐进式披露)
  • Used? —— 如果在回溯窗口内被调用则显示
    yes
    ,否则显示
    NO
  • Last Used —— 最近一次调用的日期
表格后附有摘要:
  • 加载到上下文中的总token数(始终加载的总token数包括Skill以及
    ~/.claude/agents
    中的子Agent描述,以占预算的百分比形式呈现)
  • 活跃Skill与未使用Skill的占比
  • 顶级浪费者:零使用的高token消耗Skill

Error Handling

错误处理

  1. Error:
    value.sh: No such file or directory
    Solution: The plugin is installed under a different root. Locate it with
    ls ~/.claude/skills
    or check the plugin cache, then run the script from its actual location.
  2. Error: Every skill shows
    NO
    in the Used? column Solution: The lookback window may be too short or session history is empty. Re-run with a longer window, e.g.
    --weeks 12
    .
  3. Error: A skill shows 0 tokens Solution: Its SKILL.md is missing or unreadable. Run
    /janitor-report
    to surface broken skills, then
    /janitor-fix --prune
    to clean them up.
  4. Error: Percentages look wrong for a non-default model Solution: Pass the correct context size explicitly, e.g.
    --budget 500000
    .
  1. 错误
    value.sh: No such file or directory
    解决方案:插件安装在不同的根目录下。使用
    ls ~/.claude/skills
    定位插件或检查插件缓存,然后从实际位置运行脚本。
  2. 错误:所有Skill的Used?列均显示
    NO
    解决方案:回溯窗口可能过短或会话历史为空。使用更长的窗口重新运行,例如
    --weeks 12
  3. 错误:某个Skill显示0 token 解决方案:其SKILL.md文件缺失或无法读取。运行
    /janitor-report
    找出损坏的Skill,然后运行
    /janitor-fix --prune
    清理它们。
  4. 错误:非默认模型的百分比显示异常 解决方案:明确传入正确的上下文大小,例如
    --budget 500000

Examples

示例

Example 1: Standard value check

示例1:标准价值检查

Input: "Are my skills worth their token cost?"
Output: Run
bash ~/.claude/skills/skills-janitor/scripts/value.sh
, then present the table sorted by waste and the summary line, e.g. "Always-loaded total: 8,420 tokens (4.2% of 200k budget). 6 of 31 skills unused in 4 weeks; top waster:
heavy-skill
(1,900 tokens, never used)."
输入:"我的Skill是否值得其token成本?"
输出:运行
bash ~/.claude/skills/skills-janitor/scripts/value.sh
,然后展示按浪费程度排序的表格和摘要行,例如:"始终加载的总token数:8,420个(占20万预算的4.2%)。31个Skill中有6个在4周内未使用;顶级浪费者:
heavy-skill
(1,900个token,从未使用)。"

Example 2: Longer lookback, custom budget

示例2:更长回溯窗口与自定义预算

Input: "Check skill usage over the last quarter against a 500k window."
Output: Run
bash ~/.claude/skills/skills-janitor/scripts/value.sh --weeks 12 --budget 500000
and present the same table with the adjusted lookback and percentages.
输入:"检查过去一个季度的Skill使用情况,对照50万token的上下文窗口。"
输出:运行
bash ~/.claude/skills/skills-janitor/scripts/value.sh --weeks 12 --budget 500000
,并展示调整回溯窗口和百分比后的相同表格。

Example 3: Machine-readable output

示例3:机器可读输出

Input: "Give me the raw skill value data."
Output: Run the script with
--json
and return the JSON payload unmodified.
输入:"给我原始的Skill价值数据。"
输出:运行带
--json
参数的脚本,并返回未修改的JSON payload。

Resources

资源

  • Report script (plugin-relative):
    {baseDir}/../../scripts/value.sh
  • /janitor-report
    — full health check including duplicates and broken skills
  • /janitor-fix --prune
    — remove broken symlinks and empty skill dirs
  • /janitor-discover
    — find new skills or check one before installing
  • 报告脚本(插件相对路径):
    {baseDir}/../../scripts/value.sh
  • /janitor-report
    —— 全面健康检查,包括重复和损坏的Skill
  • /janitor-fix --prune
    —— 移除损坏的符号链接和空Skill目录
  • /janitor-discover
    —— 查找新Skill或在安装前检查某个Skill