janitor-report

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Health Report

健康报告

Generate a comprehensive health report combining inventory, quality checks, duplicate detection, and broken skill findings.
生成一份结合清单、质量检查、重复项检测和失效技能排查的综合健康报告。

Overview

概述

One report covering every place a skill lives: user, project, codex, plugin, and source scopes. Plugin skills appear with their full invocation name (e.g.
marketing-skills:image
,
figma:figma-use
) — these were invisible to the v1.2 report. The scan JSON also includes an
agents
array (subagents from
~/.claude/agents
— their descriptions are always-loaded too) and per-plugin
update_available
(installed commit vs marketplace HEAD) — surface stale plugins and heavy agents in the report.
Modes:
  • /janitor-report
    (default) — full health check: inventory + lint + duplicates + broken
  • /janitor-report --brief
    — inventory only (replaces the old
    /janitor-audit
    )
一份报告覆盖技能所在的所有位置:用户、项目、代码库、插件和源范围。插件技能会显示完整调用名称(例如
marketing-skills:image
figma:figma-use
)——这些在v1.2版本的报告中是不可见的。扫描JSON还包含一个
agents
数组(来自
~/.claude/agents
的子代理——它们的描述也会始终加载)以及每个插件的
update_available
字段(已安装提交版本 vs 市场最新版本)——在报告中显示过时插件和占用资源较多的代理。
模式:
  • /janitor-report
    (默认)——全面健康检查:清单 + 代码检查 + 重复项检测 + 失效技能排查
  • /janitor-report --brief
    ——仅生成清单(替代旧的
    /janitor-audit

Prerequisites

前提条件

  • Claude Code with the skills-janitor plugin installed (provides
    scripts/scan.sh
    ,
    lint.sh
    ,
    detect_dupes.sh
    )
  • bash 3.2+ (the stock macOS bash works; no external dependencies)
  • Read access to
    ~/.claude/skills
    ,
    ~/.claude/agents
    , and installed plugin metadata
  • No authentication or API keys required — the scripts read local files only
  • 安装了skills-janitor插件的Claude Code(提供
    scripts/scan.sh
    lint.sh
    detect_dupes.sh
  • bash 3.2+(macOS自带的bash即可;无需外部依赖)
  • 拥有
    ~/.claude/skills
    ~/.claude/agents
    和已安装插件元数据的读取权限
  • 无需身份验证或API密钥——脚本仅读取本地文件

Instructions

操作步骤

Step 1: Run the scripts

步骤1:运行脚本

Full report:
bash
bash ~/.claude/skills/skills-janitor/scripts/scan.sh
bash ~/.claude/skills/skills-janitor/scripts/lint.sh
bash ~/.claude/skills/skills-janitor/scripts/detect_dupes.sh
Brief mode (inventory only):
bash
bash ~/.claude/skills/skills-janitor/scripts/scan.sh
完整报告:
bash
bash ~/.claude/skills/skills-janitor/scripts/scan.sh
bash ~/.claude/skills/skills-janitor/scripts/lint.sh
bash ~/.claude/skills/skills-janitor/scripts/detect_dupes.sh
简洁模式(仅清单):
bash
bash ~/.claude/skills/skills-janitor/scripts/scan.sh

Step 2: What each script covers

步骤2:各脚本覆盖范围

  • Inventory (scan.sh) — all skills across scopes, symlink status, frontmatter fields, line counts;
    agents
    and
    plugins
    (with
    update_available
    ) arrays;
    broken_symlinks
    count.
  • Quality checks (lint.sh) — Critical: broken symlinks, missing SKILL.md, missing frontmatter. Warning: missing/empty name or description, description too short/long, missing version. Info: no body content, no Gotchas section, large files.
  • Duplicate detection (detect_dupes.sh) — name collisions (two distinct skills with the same qualified name at different paths) and description overlap (Jaccard similarity >30%), with cross-scope user-vs-plugin pairs explicitly surfaced (e.g.
    marketing-seo-audit
    (user) ↔
    marketing-skills:seo-audit
    (plugin)).
  • 清单(scan.sh)——所有范围的技能、符号链接状态、前置元数据字段、行数;
    agents
    plugins
    (包含
    update_available
    )数组;
    broken_symlinks
    计数。
  • 质量检查(lint.sh)——严重问题:失效符号链接、缺失SKILL.md、缺失前置元数据。警告:名称或描述缺失/为空、描述过短/过长、缺失版本。信息:无主体内容、无Gotchas章节、文件过大。
  • 重复项检测(detect_dupes.sh)——名称冲突(不同路径下两个不同技能具有相同限定名称)和描述重叠(杰卡德相似度>30%),同时明确显示跨范围的用户与插件配对(例如
    marketing-seo-audit
    (用户)↔
    marketing-skills:seo-audit
    (插件))。

Step 3: Present a unified report

步骤3:生成统一报告

Merge the three outputs into one table with severity levels, then recommend actions.
将三个输出合并为一个带有严重级别的表格,然后给出操作建议。

Output

输出示例

| Skill                            | Scope    | Status      | Issues                                   |
|----------------------------------|----------|-------------|------------------------------------------|
| marketing-copywriting            | user     | DUPLICATE?  | 90% overlap with marketing-skills:copywriting |
| seo-audit                        | user     | WARNING     | Description too short                    |
| old-deploy-helper                | user     | CRITICAL    | Broken symlink                           |
| figma:figma-use                  | plugin   | OK          | -                                        |
Recommended actions per issue type:
  • Broken symlinks →
    /janitor-fix --prune
  • Quality issues →
    /janitor-fix
  • User-vs-plugin duplicates → uninstall the user-scope copy and rely on the plugin (or vice versa)
  • Stale plugins (
    update_available: true
    ) →
    /plugin update <name>
  • Token waste →
    /janitor-value
  • Suspicious content (injection phrases, dangerous scripts) →
    /janitor-security
| 技能名称                         | 范围     | 状态        | 问题描述                                 |
|----------------------------------|----------|-------------|------------------------------------------|
| marketing-copywriting            | user     | 疑似重复?  | 与marketing-skills:copywriting有90%内容重叠 |
| seo-audit                        | user     | 警告        | 描述过短                                 |
| old-deploy-helper                | user     | 严重        | 符号链接失效                             |
| figma:figma-use                  | plugin   | 正常        | -                                        |
针对不同问题类型的建议操作:
  • 失效符号链接 →
    /janitor-fix --prune
  • 质量问题 →
    /janitor-fix
  • 用户与插件重复项 → 卸载用户范围的副本,使用插件版本(反之亦然)
  • 过时插件(
    update_available: true
    )→
    /plugin update <name>
  • 令牌浪费 →
    /janitor-value
  • 可疑内容(注入语句、危险脚本)→
    /janitor-security

Error Handling

错误处理

  1. Error:
    scan.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 scripts from their actual location.
  2. Error: Scan output is not valid JSON Solution: Re-run with stderr visible (drop any
    2>/dev/null
    ) and report the failing line; a skill directory with unusual characters is the usual cause.
  3. Error:
    plugins
    array is empty despite installed plugins Solution:
    ~/.claude/plugins/installed_plugins.json
    is missing or in an unknown format — report which Claude Code version is in use.
  1. 错误
    scan.sh: No such file or directory
    解决方案:插件安装在不同根目录下。使用
    ls ~/.claude/skills
    定位或检查插件缓存,然后从实际位置运行脚本。
  2. 错误:扫描输出不是有效的JSON 解决方案:重新运行并显示stderr(移除任何
    2>/dev/null
    ),报告出错行;通常是包含特殊字符的技能目录导致的。
  3. 错误:已安装插件但
    plugins
    数组为空 解决方案
    ~/.claude/plugins/installed_plugins.json
    缺失或格式未知——报告当前使用的Claude Code版本。

Examples

示例

Example 1: Full health check

示例1:全面健康检查

Input: "Check my skills for problems."
Output: Run all three scripts, merge into the severity table, and lead with counts: "175 skills scanned: 2 critical (broken symlinks), 5 warnings, 3 likely duplicates, 2 plugins have updates available."
输入:"检查我的技能是否存在问题。"
输出:运行所有三个脚本,合并为严重级别表格,并以统计数据开头:"已扫描175个技能:2个严重问题(失效符号链接),5个警告,3个疑似重复项,2个插件有可用更新。"

Example 2: Inventory only

示例2:仅生成清单

Input: "/janitor-report --brief"
Output: Run
scan.sh
only and present the inventory grouped by scope with per-scope counts.
输入
/janitor-report --brief
输出:仅运行
scan.sh
,按范围分组展示清单并显示各范围的技能数量。

Resources

相关资源

  • Scripts (plugin-relative):
    {baseDir}/../../scripts/scan.sh
    ,
    lint.sh
    ,
    detect_dupes.sh
  • /janitor-fix
    — auto-fix the issues this report finds
  • /janitor-value
    — token cost + usage (combined)
  • /janitor-discover
    — find or evaluate new skills
  • 脚本(插件相对路径):
    {baseDir}/../../scripts/scan.sh
    lint.sh
    detect_dupes.sh
  • /janitor-fix
    ——自动修复此报告发现的问题
  • /janitor-value
    ——令牌成本 + 使用情况(合并统计)
  • /janitor-discover
    ——查找或评估新技能