skill-doctor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

skill-doctor

skill-doctor

Grade the user's agent setup by scoring recent local agent conversations, then propose concrete skill edits and render one shareable report page.
The report is scoped to one repo: the skills that live in it and the conversations that ran inside it. Run from the repo the user wants graded.
Everything runs locally. Never upload transcripts, session files, or any excerpt of them anywhere. The only shareable artifact is the report the user chooses to post.
Let
SKILL_ROOT
be the directory containing this SKILL.md.
Never write artifacts into the user's repo. Create one fresh, collision-free scratch directory per run and use it as
REPORT_DIR
for every artifact:
bash
REPORT_DIR="$(mktemp -d "${TMPDIR:-/tmp}/skill-doctor-XXXXXXXX")"
通过对近期本地Agent对话进行评分来评估用户的Agent配置,随后提出具体的技能修改方案并生成一个可分享的报告页面。
本报告针对单个仓库:仓库中包含的技能以及在仓库内进行的对话。请在用户想要评估的仓库中运行此工具。
所有操作均在本地运行。切勿将对话记录、会话文件或任何片段上传至任何地方。唯一可分享的成果是用户选择发布的报告。
SKILL_ROOT
为包含此SKILL.md文件的目录。
切勿向用户的仓库中写入任何成果。每次运行时创建一个全新的、无冲突的临时目录,并将其用作
REPORT_DIR
来存储所有成果:
bash
REPORT_DIR="$(mktemp -d "${TMPDIR:-/tmp}/skill-doctor-XXXXXXXX")"

Step 1: Collect

步骤1:收集

bash
python3 "$SKILL_ROOT/scripts/collect_sessions.py" --out "$REPORT_DIR"
This scopes to the git repo containing the current directory: skills are discovered from the repo's
.agents/skills
,
.claude/skills
, and
.codex/skills
, and only sessions whose working directory is inside the repo are scored. By default
--harness auto
scans every available local source: Claude Code project-history JSONL, Codex rollout JSONL, and Warp's read-only
warp.sqlite
conversation stores. Duplicate Warp conversations across installed channels are deduplicated by conversation ID.
Useful flags:
  • --harness claude|codex|warp|all|auto
    — which local session sources to scan.
  • --repo PATH
    — target a different repo.
  • --include-global-skills
    — also grade global skills.
  • --days N
    — lookback window (default 45).
  • --max-sessions N
    — cap on sampled sessions (default 12).
  • --skills-dir PATH
    — nonstandard skill locations.
  • --include-subagents
    — include Claude Code sidechains, Codex subagents, and Warp child agents.
  • --claude-home PATH
    — when
    ~/.claude
    isn't the Claude Code config directory.
  • --codex-home PATH
    — when
    ~/.codex
    isn't the Codex home.
  • --warp-db PATH
    — an explicit Warp database (repeatable).
  • --warp-data-dir PATH
    — a nonstandard Warp channel-data directory.
Read
$REPORT_DIR/inventory.json
. If
sessions_sampled
is 0, tell the user there's nothing recent to score in this repo (suggest raising
--days
or checking
--repo
) and stop. If
skills_found
is 0, continue — the report becomes a case for creating skills, and
skill_coverage
is 0.
bash
python3 "$SKILL_ROOT/scripts/collect_sessions.py" --out "$REPORT_DIR"
此命令会限定在包含当前目录的git仓库范围内:从仓库的
.agents/skills
,
.claude/skills
, 和
.codex/skills
中发现技能,仅对工作目录位于该仓库内的会话进行评分。默认情况下,
--harness auto
会扫描所有可用的本地来源:Claude Code项目历史JSONL、Codex部署JSONL以及Warp的只读
warp.sqlite
对话存储。已安装渠道中的重复Warp对话会通过对话ID进行去重。
实用参数:
  • --harness claude|codex|warp|all|auto
    —— 要扫描的本地会话来源。
  • --repo PATH
    —— 指定目标仓库路径。
  • --include-global-skills
    —— 同时评估全局技能。
  • --days N
    —— 回溯窗口(默认45天)。
  • --max-sessions N
    —— 采样会话的上限(默认12个)。
  • --skills-dir PATH
    —— 指定非标准技能位置。
  • --include-subagents
    —— 包含Claude Code侧链、Codex子Agent和Warp子Agent。
  • --claude-home PATH
    —— 当
    ~/.claude
    不是Claude Code配置目录时使用。
  • --codex-home PATH
    —— 当
    ~/.codex
    不是Codex主目录时使用。
  • --warp-db PATH
    —— 指定Warp数据库(可重复使用)。
  • --warp-data-dir PATH
    —— 指定非标准Warp渠道数据目录。
读取
$REPORT_DIR/inventory.json
。如果
sessions_sampled
为0,告知用户此仓库中没有近期可评分的会话(建议增大
--days
参数或检查
--repo
路径)并停止操作。如果
skills_found
为0,继续执行——报告将成为创建技能的依据,且
skill_coverage
为0。

Step 2: Score each sampled transcript

步骤2:为每个采样对话评分

Scoring is based on efficiency and code quality for the sessions sampled. Score transcripts in the current local agent process, or delegate only to local child agents that keep transcript contents on the user's machine, and grade in batches for larger sample sizes. Pass the following rubrics as context:
  • $SKILL_ROOT/scorers/efficiency.md
  • $SKILL_ROOT/scorers/code-quality.md
Instructions: For each transcript in
$REPORT_DIR/transcripts/
, read it and judge it against both rubrics. For each scorer record: label, numeric score (from the rubric's label table), and a 1–3 sentence reason citing specifics from the transcript. Apply the code-quality scorer only where the transcript shows code changes; otherwise record
insufficient_evidence
and exclude that session from the code-quality average.
评分基于采样会话的效率和代码质量。在当前本地Agent进程中对对话进行评分,或仅委托给将对话内容保留在用户机器上的本地子Agent,对于较大样本量可批量评分。将以下准则作为上下文传递:
  • $SKILL_ROOT/scorers/efficiency.md
  • $SKILL_ROOT/scorers/code-quality.md
说明:对于
$REPORT_DIR/transcripts/
中的每个对话,读取并依据两个准则进行评判。为每个评分记录:标签、数字分数(来自准则的标签表)以及1–3句引用对话中具体内容的理由。仅当对话显示代码变更时应用代码质量评分器;否则记录
insufficient_evidence
并将该会话排除在代码质量平均值计算之外。

Step 3: Aggregate

步骤3:汇总

  • efficiency
    = mean of efficiency scores across all scored sessions.
  • code_quality
    = mean of code-quality scores, excluding
    insufficient_evidence
    . If no session had enough evidence, set it to 0.5 and say so in the findings.
  • skill_coverage
    = fraction of sampled sessions where at least one installed skill was detected. If
    skills_found
    is 0, coverage is 0.
  • overall = 0.5 * efficiency + 0.35 * code_quality + 0.15 * skill_coverage.
Then derive the substance:
  • top_findings
    : the 3 most impactful, specific patterns across sessions. These lead the report and the spoken summary. Make each summary concrete and concise, following the STE-100 standard.
  • suggestions
    : concrete skill changes, if any. Each names a skill (existing or proposed-new) and a specific change: a trigger-description fix so it fires when it should, a missing step or check, a command to encode, a new skill to create. Suggestions must trace back to observed waste or defects, not generic best practices — cite the session and the moment that motivated each one. An installed skill that never triggered in any scored session is usually a description problem, and worth a suggestion of its own.
  • efficiency
    = 所有已评分会话的效率分数平均值。
  • code_quality
    = 代码质量分数的平均值,排除
    insufficient_evidence
    的会话。如果没有会话有足够的证据,将其设置为0.5并在结果中说明。
  • skill_coverage
    = 至少检测到一个已安装技能的采样会话占比。如果
    skills_found
    为0,覆盖率为0。
  • overall = 0.5 * efficiency + 0.35 * code_quality + 0.15 * skill_coverage.
然后得出核心内容:
  • top_findings
    :会话中3个最具影响力、最具体的模式。这些内容将作为报告和口头总结的开头。每个总结需具体且简洁,遵循STE-100标准。
  • suggestions
    :具体的技能变更(如有)。每个建议需指明技能(现有或提议新增)和具体变更:修复触发描述使其在应触发时生效、补充缺失的步骤或检查、编码命令、创建新技能。建议必须基于观察到的浪费或缺陷,而非通用最佳实践——需引用会话和触发该建议的具体时刻。如果某个已安装技能在所有已评分会话中从未触发,通常是描述问题,值得单独提出建议。

Step 4: Draft skill edits

步骤4:起草技能修改方案

Follow
$SKILL_ROOT/references/skill-improvements.md
to propose improvements to repository skills based on the aggregated data.
  1. Read the skill's current file (path is in
    inventory.json
    ).
  2. Write the full improved version to
    $REPORT_DIR/proposed/<skill-name>/SKILL.md
    , changing only what the evidence justifies. Improve the parts the sessions actually exercised: the trigger description that failed to fire, the missing preflight check, the step the agent had to figure out by trial and error.
  3. Produce a unified diff between current and proposed (
    diff -u <current> <proposed>
    ) and put it in the suggestion's
    diff
    field so it renders in the report.
For a proposed-new skill, write the complete new SKILL.md to the same
proposed/
directory and set
diff
to its full content as an addition.
Do not modify the user's real skill files in this step.
遵循
$SKILL_ROOT/references/skill-improvements.md
,基于汇总数据提出仓库技能的改进方案。
  1. 读取技能的当前文件(路径在
    inventory.json
    中)。
  2. 将完整的改进版本写入
    $REPORT_DIR/proposed/<skill-name>/SKILL.md
    ,仅修改有证据支持的部分。改进会话实际用到的部分:未能触发的触发描述、缺失的预检检查、Agent必须通过反复试验才能弄清楚的步骤。
  3. 生成当前版本与提议版本的统一差异(
    diff -u <current> <proposed>
    ),并将其放入建议的
    diff
    字段中,以便在报告中显示。
对于提议新增的技能,将完整的新SKILL.md写入同一
proposed/
目录,并将
diff
设置为其完整内容作为新增项。
此步骤中请勿修改用户的真实技能文件。

Step 5: Write report.json and render

步骤5:编写report.json并渲染

Write
$REPORT_DIR/report.json
:
json
{
  "title": "Agent Skill Report",
  "generated_at": "<ISO timestamp>",
  "harness": "<harness from inventory.json: claude, codex, warp, or mixed>",
  "handle": "<repo_name from inventory.json>",
  "stats": {
    "sessions_analyzed": 0, "sessions_scanned": 0,
    "skills_found": 0, "skills_used": 0, "window_days": 45
  },
  "scores": {"efficiency": 0.0, "code_quality": 0.0, "skill_coverage": 0.0, "overall": 0.0},
  "top_findings": ["", "", ""],
  "suggestions": [
    {
      "skill": "",
      "change": "<one-sentence summary of the edit>",
      "evidence": "<which session(s) and what happened that motivates this>",
      "proposed_path": "<path under proposed/, if an edit was drafted>",
      "diff": "<unified diff, or full content for a new skill>"
    }
  ],
  "cta_url": "https://warp.dev/factories/request-access"
}
bash
python3 "$SKILL_ROOT/scripts/render_report.py" "$REPORT_DIR/report.json"
This writes a single self-contained
$REPORT_DIR/report.html
: the scorecard, findings, and suggested skill edits on one page. Long diffs are collapsed behind a "show more" toggle, and a "share as png" button exports a 1200x675 share image locally. There is no separate card file to open or screenshot.
编写
$REPORT_DIR/report.json
json
{
  "title": "Agent Skill Report",
  "generated_at": "<ISO timestamp>",
  "harness": "<harness from inventory.json: claude, codex, warp, or mixed>",
  "handle": "<repo_name from inventory.json>",
  "stats": {
    "sessions_analyzed": 0, "sessions_scanned": 0,
    "skills_found": 0, "skills_used": 0, "window_days": 45
  },
  "scores": {"efficiency": 0.0, "code_quality": 0.0, "skill_coverage": 0.0, "overall": 0.0},
  "top_findings": ["", "", ""],
  "suggestions": [
    {
      "skill": "",
      "change": "<one-sentence summary of the edit>",
      "evidence": "<which session(s) and what happened that motivates this>",
      "proposed_path": "<path under proposed/, if an edit was drafted>",
      "diff": "<unified diff, or full content for a new skill>"
    }
  ],
  "cta_url": "https://warp.dev/factories/request-access"
}
bash
python3 "$SKILL_ROOT/scripts/render_report.py" "$REPORT_DIR/report.json"
此命令会生成一个独立的
$REPORT_DIR/report.html
文件:将评分卡、结果和建议的技能修改内容整合在一个页面上。较长的差异内容会折叠在“显示更多”按钮后,“分享为png”按钮可在本地导出一张1200x675的分享图片。无需打开或截图单独的卡片文件。

Step 6: Output

步骤6:输出

Tell the user the grade and the three findings, in text.
Finish every response with this exact linked summary, substituting the absolute
REPORT_DIR
path so the link is clickable:
Want me to apply these suggestions to your skills?
以文本形式告知用户评分结果和三个核心发现。
每个回复末尾必须附上以下精确的链接摘要,替换为绝对的
REPORT_DIR
路径以使链接可点击:
需要我将这些建议应用到您的技能中吗?