skill-stocktake

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

skill-stocktake

skill-stocktake

Slash command (
/skill-stocktake
) that audits all Claude skills and commands using a quality checklist + AI holistic judgment. Supports two modes: Quick Scan for recently changed skills, and Full Stocktake for a complete review.
斜杠命令(
/skill-stocktake
),使用质量检查表+AI整体判断来审核所有Claude技能和命令。支持两种模式:针对最近更改技能的快速扫描,以及全面审查的完整盘点。

Scope

适用范围

The command targets the following paths relative to the directory where it is invoked:
PathDescription
~/.claude/skills/
Global skills (all projects)
{cwd}/.claude/skills/
Project-level skills (if the directory exists)
At the start of Phase 1, the command explicitly lists which paths were found and scanned.
该命令针对以下相对于调用目录的路径
路径描述
~/.claude/skills/
全局技能(所有项目)
{cwd}/.claude/skills/
项目级技能(如果目录存在)
在第一阶段开始时,命令会明确列出已找到并扫描的路径。

Targeting a specific project

针对特定项目

To include project-level skills, run from that project's root directory:
bash
cd ~/path/to/my-project
/skill-stocktake
If the project has no
.claude/skills/
directory, only global skills and commands are evaluated.
要包含项目级技能,请从该项目的根目录运行:
bash
cd ~/path/to/my-project
/skill-stocktake
如果项目没有
.claude/skills/
目录,则仅评估全局技能和命令。

Modes

模式

ModeTriggerDuration
Quick Scan
results.json
exists (default)
5–10 min
Full Stocktake
results.json
absent, or
/skill-stocktake full
20–30 min
Results cache:
~/.claude/skills/skill-stocktake/results.json
模式触发条件耗时
快速扫描
results.json
存在(默认)
5–10分钟
完整盘点
results.json
不存在,或运行
/skill-stocktake full
20–30分钟
结果缓存:
~/.claude/skills/skill-stocktake/results.json

Quick Scan Flow

快速扫描流程

Re-evaluate only skills that have changed since the last run (5–10 min).
  1. Read
    ~/.claude/skills/skill-stocktake/results.json
  2. Run:
    bash ~/.claude/skills/skill-stocktake/scripts/quick-diff.sh \       ~/.claude/skills/skill-stocktake/results.json
    (Project dir is auto-detected from
    $PWD/.claude/skills
    ; pass it explicitly only if needed)
  3. If output is
    []
    : report "No changes since last run." and stop
  4. Re-evaluate only those changed files using the same Phase 2 criteria
  5. Carry forward unchanged skills from previous results
  6. Output only the diff
  7. Run:
    bash ~/.claude/skills/skill-stocktake/scripts/save-results.sh \       ~/.claude/skills/skill-stocktake/results.json <<< "$EVAL_RESULTS"
仅重新评估自上次运行以来已更改的技能(耗时5–10分钟)。
  1. 读取
    ~/.claude/skills/skill-stocktake/results.json
  2. 运行:
    bash ~/.claude/skills/skill-stocktake/scripts/quick-diff.sh \       ~/.claude/skills/skill-stocktake/results.json
    (项目目录会从
    $PWD/.claude/skills
    自动检测;仅在需要时显式传入)
  3. 如果输出为
    []
    :报告“自上次运行以来无更改”并停止
  4. 使用与第二阶段相同的标准仅重新评估那些已更改的文件
  5. 从上一次结果中沿用未更改的技能
  6. 仅输出差异内容
  7. 运行:
    bash ~/.claude/skills/skill-stocktake/scripts/save-results.sh \       ~/.claude/skills/skill-stocktake/results.json <<< "$EVAL_RESULTS"

Full Stocktake Flow

完整盘点流程

Phase 1 — Inventory

第一阶段 — 清单统计

Run:
bash ~/.claude/skills/skill-stocktake/scripts/scan.sh
The script enumerates skill files, extracts frontmatter, and collects UTC mtimes. Project dir is auto-detected from
$PWD/.claude/skills
; pass it explicitly only if needed. Present the scan summary and inventory table from the script output:
Scanning:
  ✓ ~/.claude/skills/         (17 files)
  ✗ {cwd}/.claude/skills/    (not found — global skills only)
Skill7d use30d useDescription
运行:
bash ~/.claude/skills/skill-stocktake/scripts/scan.sh
该脚本会枚举技能文件、提取前置元数据并收集UTC修改时间。项目目录会从
$PWD/.claude/skills
自动检测;仅在需要时显式传入。展示脚本输出的扫描摘要和清单表格:
扫描中:
  ✓ ~/.claude/skills/         (17个文件)
  ✗ {cwd}/.claude/skills/    (未找到 — 仅扫描全局技能)
技能7天使用次数30天使用次数描述

Phase 2 — Quality Evaluation

第二阶段 — 质量评估

Launch an Agent tool subagent (general-purpose agent) with the full inventory and checklist:
text
Agent(
  subagent_type="general-purpose",
  prompt="
Evaluate the following skill inventory against the checklist.

[INVENTORY]

[CHECKLIST]

Return JSON for each skill:
{ \"verdict\": \"Keep\"|\"Improve\"|\"Update\"|\"Retire\"|\"Merge into [X]\", \"reason\": \"...\" }
"
)
The subagent reads each skill, applies the checklist, and returns per-skill JSON:
{ "verdict": "Keep"|"Improve"|"Update"|"Retire"|"Merge into [X]", "reason": "..." }
Chunk guidance: Process ~20 skills per subagent invocation to keep context manageable. Save intermediate results to
results.json
(
status: "in_progress"
) after each chunk.
After all skills are evaluated: set
status: "completed"
, proceed to Phase 3.
Resume detection: If
status: "in_progress"
is found on startup, resume from the first unevaluated skill.
Each skill is evaluated against this checklist:
- [ ] Content overlap with other skills checked
- [ ] Overlap with MEMORY.md / CLAUDE.md checked
- [ ] Freshness of technical references verified (use WebSearch if tool names / CLI flags / APIs are present)
- [ ] Usage frequency considered
Verdict criteria:
VerdictMeaning
KeepUseful and current
ImproveWorth keeping, but specific improvements needed
UpdateReferenced technology is outdated (verify with WebSearch)
RetireLow quality, stale, or cost-asymmetric
Merge into [X]Substantial overlap with another skill; name the merge target
Evaluation is holistic AI judgment — not a numeric rubric. Guiding dimensions:
  • Actionability: code examples, commands, or steps that let you act immediately
  • Scope fit: name, trigger, and content are aligned; not too broad or narrow
  • Uniqueness: value not replaceable by MEMORY.md / CLAUDE.md / another skill
  • Currency: technical references work in the current environment
Reason quality requirements — the
reason
field must be self-contained and decision-enabling:
  • Do NOT write "unchanged" alone — always restate the core evidence
  • For Retire: state (1) what specific defect was found, (2) what covers the same need instead
    • Bad:
      "Superseded"
    • Good:
      "disable-model-invocation: true already set; superseded by continuous-learning-v2 which covers all the same patterns plus confidence scoring. No unique content remains."
  • For Merge: name the target and describe what content to integrate
    • Bad:
      "Overlaps with X"
    • Good:
      "42-line thin content; Step 4 of chatlog-to-article already covers the same workflow. Integrate the 'article angle' tip as a note in that skill."
  • For Improve: describe the specific change needed (what section, what action, target size if relevant)
    • Bad:
      "Too long"
    • Good:
      "276 lines; Section 'Framework Comparison' (L80–140) duplicates ai-era-architecture-principles; delete it to reach ~150 lines."
  • For Keep (mtime-only change in Quick Scan): restate the original verdict rationale, do not write "unchanged"
    • Bad:
      "Unchanged"
    • Good:
      "mtime updated but content unchanged. Unique Python reference explicitly imported by rules/python/; no overlap found."
启动一个Agent工具子代理(通用代理),传入完整清单和检查表:
text
Agent(
  subagent_type="general-purpose",
  prompt="
根据检查表评估以下技能清单。

[清单]

[检查表]

为每个技能返回JSON:
{ \"verdict\": \"Keep\"|\"Improve\"|\"Update\"|\"Retire\"|\"Merge into [X]\", \"reason\": \"...\" }
"
)
子代理会读取每个技能,应用检查表,并返回每个技能的JSON结果:
{ "verdict": "Keep"|"Improve"|"Update"|"Retire"|"Merge into [X]", "reason": "..." }
分块处理指南: 每次子代理调用处理约20个技能,以保持上下文可控。每个分块处理后将中间结果保存到
results.json
(设置
status: "in_progress"
)。
所有技能评估完成后:设置
status: "completed"
,进入第三阶段。
续检测: 如果启动时发现
status: "in_progress"
,则从第一个未评估的技能开始继续。
每个技能会根据以下检查表进行评估:
- [ ] 已检查与其他技能的内容重叠情况
- [ ] 已检查与MEMORY.md / CLAUDE.md的重叠情况
- [ ] 已验证技术参考的时效性(如果存在工具名称/CLI标志/API,使用WebSearch)
- [ ] 已考虑使用频率
判定标准:
判定结果含义
Keep有用且内容最新
Improve值得保留,但需要特定改进
Update引用的技术已过时(通过WebSearch验证)
Retire质量低、过时或投入产出比失衡
Merge into [X]与另一技能存在大量重叠;指定合并目标
评估采用AI整体判断 — 而非数值评分表。评估维度包括:
  • 可操作性:提供代码示例、命令或可立即执行的步骤
  • 范围匹配:名称、触发条件和内容保持一致;不过于宽泛或狭窄
  • 独特性:价值无法被MEMORY.md / CLAUDE.md / 其他技能替代
  • 时效性:技术参考在当前环境中可用
理由质量要求
reason
字段必须独立且可支撑决策:
  • 不要仅写“未更改” — 始终重申核心依据
  • 对于Retire:说明(1)发现的具体缺陷,(2)替代方案
    • 错误示例:
      "Superseded"
    • 正确示例:
      "已设置disable-model-invocation: true;被continuous-learning-v2替代,后者涵盖所有相同模式及置信度评分,无独特内容剩余。"
  • 对于Merge:指定目标技能并描述要整合的内容
    • 错误示例:
      "与X重叠"
    • 正确示例:
      "仅42行精简内容;chatlog-to-article的第4步已涵盖相同流程。将'文章角度'提示作为注释整合到该技能中。"
  • 对于Improve:描述具体需要修改的内容(哪个章节、操作、目标篇幅等)
    • 错误示例:
      "太长"
    • 正确示例:
      "共276行;'框架对比'章节(第80–140行)与ai-era-architecture-principles重复;删除该章节以将篇幅缩减至约150行。"
  • 对于Keep(快速扫描中仅修改时间变化):重申原始判定理由,不要写“未更改”
    • 错误示例:
      "未更改"
    • 正确示例:
      "修改时间更新但内容未变。是rules/python/明确引用的独特Python参考;未发现重叠内容。"

Phase 3 — Summary Table

第三阶段 — 汇总表格

Skill7d useVerdictReason
技能7天使用次数判定结果理由

Phase 4 — Consolidation

第四阶段 — 整合处理

  1. Retire / Merge: present detailed justification per file before confirming with user:
    • What specific problem was found (overlap, staleness, broken references, etc.)
    • What alternative covers the same functionality (for Retire: which existing skill/rule; for Merge: the target file and what content to integrate)
    • Impact of removal (any dependent skills, MEMORY.md references, or workflows affected)
  2. Improve: present specific improvement suggestions with rationale:
    • What to change and why (e.g., "trim 430→200 lines because sections X/Y duplicate python-patterns")
    • User decides whether to act
  3. Update: present updated content with sources checked
  4. Check MEMORY.md line count; propose compression if >100 lines
  1. Retire / Merge:在获得用户确认前,为每个文件提供详细理由:
    • 发现的具体问题(重叠、过时、无效引用等)
    • 替代方案(Retire:现有技能/规则;Merge:目标文件及要整合的内容)
    • 删除影响(是否有依赖技能、MEMORY.md引用或工作流受影响)
  2. Improve:提供具体改进建议及理由:
    • 修改内容及原因(例如:"将430行精简至200行,因为X/Y章节与python-patterns重复")
    • 由用户决定是否执行
  3. Update:提供经过验证来源的更新内容
  4. 检查MEMORY.md的行数;如果超过100行,建议压缩

Results File Schema

结果文件 Schema

~/.claude/skills/skill-stocktake/results.json
:
evaluated_at
: Must be set to the actual UTC time of evaluation completion. Obtain via Bash:
date -u +%Y-%m-%dT%H:%M:%SZ
. Never use a date-only approximation like
T00:00:00Z
.
json
{
  "evaluated_at": "2026-02-21T10:00:00Z",
  "mode": "full",
  "batch_progress": {
    "total": 80,
    "evaluated": 80,
    "status": "completed"
  },
  "skills": {
    "skill-name": {
      "path": "~/.claude/skills/skill-name/SKILL.md",
      "verdict": "Keep",
      "reason": "Concrete, actionable, unique value for X workflow",
      "mtime": "2026-01-15T08:30:00Z"
    }
  }
}
~/.claude/skills/skill-stocktake/results.json
evaluated_at
:必须设置为评估完成的实际UTC时间。通过Bash获取:
date -u +%Y-%m-%dT%H:%M:%SZ
。切勿使用仅日期的近似值如
T00:00:00Z
json
{
  "evaluated_at": "2026-02-21T10:00:00Z",
  "mode": "full",
  "batch_progress": {
    "total": 80,
    "evaluated": 80,
    "status": "completed"
  },
  "skills": {
    "skill-name": {
      "path": "~/.claude/skills/skill-name/SKILL.md",
      "verdict": "Keep",
      "reason": "为X工作流提供具体、可操作的独特价值",
      "mtime": "2026-01-15T08:30:00Z"
    }
  }
}

Notes

注意事项

  • Evaluation is blind: the same checklist applies to all skills regardless of origin (ECC, self-authored, auto-extracted)
  • Archive / delete operations always require explicit user confirmation
  • No verdict branching by skill origin
  • 评估无差别:无论技能来源(ECC、自行编写、自动提取),均适用同一检查表
  • 归档/删除操作始终需要用户明确确认
  • 不会根据技能来源进行差异化判定