跳到主要内容
知仓学习社ZHICANG

skill-doctor

Use when the user wants their agent setup graded from real conversation history, asks which installed skills are actually working, or wants evidence…

执行命令读文件读环境变量(配置)严重 1 · 高危 3alirezarezvani/claude-skills

它会碰到什么

扫了多少12 个文本文件,93 KB
它会碰到什么执行命令读文件读环境变量(配置)
命中总数7 处
命中统计严重 1 · 高 3 · 中 2 · 低 0

关于「读环境变量(配置)」:这个技能会读 process.env 之类的环境变量,但读到的都是端口、目录、超时这类配置项,没有读取密钥类变量。扫描规则原本把「读环境变量」一律算作「读凭据」,本站按变量名做了细化区分,命中明细仍如实列在下面。

逐条看命中(4 条严重或高危)
  • 严重 scripts/collect_sessions.py:559cred-paths
    ("output", "export OPENAI_API_KEY=sk-abcdefghijklmnopqrstuv1234 loaded from .env"),
  • scripts/collect_sessions.py:99cred-envread
    p.add_argument("--claude-home", default=os.environ.get("CLAUDE_CONFIG_DIR", "~/.claude"),
  • scripts/collect_sessions.py:101cred-envread
    p.add_argument("--codex-home", default=os.environ.get("CODEX_HOME", "~/.codex"),
  • scripts/collect_sessions.py:126exec-spawn
    res = subprocess.run(["git", "rev-parse", "--show-toplevel"],

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

skill-doctor — grade the agent setup from real sessions

> Privacy is the contract. Everything runs locally. Transcripts are condensed,

> secret-redacted, chmod-0600, and never uploaded — the only shareable artifact is

> the report the user chooses to share.

Run from the repo being graded. Every artifact goes to one fresh scratch dir, never

into the repo:

RUN="$(mktemp -d "${TMPDIR:-/tmp}/skill-doctor-XXXXXXXX")"
python scripts/collect_sessions.py --out "$RUN"          # 1 — harvest + redact

1 — Collect. Scans Claude Code project-history JSONL and Codex rollouts,

discovers repo skills (.claude/skills, .agents/skills, .codex/skills, plugin

layouts), detects skill usage (Skill invocations, slash commands, SKILL.md paths), samples

newest-first, and writes redacted transcripts. Read $RUN/inventory.json: if

sessions_sampled is 0, tell the user there is nothing recent to score (suggest

--days 90 or --repo) and stop. skills_found 0 is fine — the report becomes a

case for creating skills.

2 — Score. `python scripts/score_aggregator.py --inventory "$RUN/inventory.json"

--emit-template > "$RUN/session_scores.json"`. Read each transcript in

$RUN/transcripts/ and judge it against both rubrics — scorers/efficiency.md

and scorers/code-quality.md. Fill the template with a **label from the rubric's

table** and a 1–3 sentence reason citing transcript specifics. Never invent numeric

scores — the aggregator derives them from labels. Use insufficient_evidence when

a transcript shows no judgeable diff. Also write 1–5 top_findings: the most

impactful cross-session patterns, concrete and specific.

3 — Draft edits. Follow references/skill_edit_governance.md (the filing bar:

would a competent agent with the current instructions still fail this way?). For

each suggestion that clears it, write the full improved SKILL.md to

$RUN/proposed/<skill>/SKILL.md, produce diff -u <current> <proposed>, and record

it in $RUN/suggestions.json citing the sampled session id(s) that motivated it.

Zero suggestions is a valid success — say why per finding. Never modify the user's

real skill files in this step.

4 — Aggregate (the gate). `python scripts/score_aggregator.py --inventory

"$RUN/inventory.json" --scores "$RUN/session_scores.json" --suggestions

"$RUN/suggestions.json"`. It validates labels against the rubric tables, refuses

scores for unsampled sessions, requires substantive reasons, rejects suggestions

that cite no scored session, computes `overall = 0.5·efficiency +

0.35·code_quality + 0.15·skill_coverage, and writes report.json`. **Exit 4 is a

stop**: fix what it names and re-run; never hand-edit report.json around it.

5 — Render + tell. python scripts/render_report.py --report "$RUN/report.json"

→ one self-contained report.html (no JS, no CDN, dark-mode + print-to-PDF). Then

tell the user the grade and the top findings in text, link

file://$RUN/report.html, and ask whether to apply the proposed diffs to their

real skills — apply only on an explicit yes, skill by skill.

Hard rules

  1. Never upload transcripts, session files, or any excerpt. Local only.
  2. Labels only, from the rubric tables. The aggregator owns all arithmetic.
  3. Every suggestion traces to a scored session — or it is dropped. Generic best practice is not evidence.
  4. Zero suggestions is a success, not a failure to report around.
  5. Exit 4 from the aggregator is a stop, not an error to swallow or bypass.
  6. Never touch the user's real skill files without an explicit per-skill yes; proposed edits live under $RUN/proposed/.
  7. A proposed skill edit follows write-a-skill discipline — trigger phrase in the description, smallest change that expresses the rule, replace over append.

Scripts

| Script | Role | Exit codes |

|---|---|---|

| scripts/collect_sessions.py | Harvest Claude Code + Codex sessions, redact secrets, sample, inventory | 0 · 3 bad input |

| scripts/score_aggregator.py | Validate labels/reasons/suggestions, compute grade, emit report.json | 0 · 2 warnings · 3 bad input · 4 validation failure |

| scripts/render_report.py | report.json → single self-contained report.html | 0 · 3 bad input |

All support --help, --output json, and --sample (no real history needed).

References and assets

  • [scorers/efficiency.md](scorers/efficiency.md) · [scorers/code-quality.md](scorers/code-quality.md) — the two rubrics, preserved verbatim from upstream
  • [references/transcript_scoring_canon.md](references/transcript_scoring_canon.md) — why rubric-anchored LLM judging works and where it fails (7 sources)
  • [references/session_mining_privacy.md](references/session_mining_privacy.md) — the local-only contract, redaction pattern canon (7 sources)
  • [references/skill_edit_governance.md](references/skill_edit_governance.md) — the filing bar for proposing skill edits (7 sources)
  • [assets/session_scores.example.json](assets/session_scores.example.json) · [assets/suggestions.example.json](assets/suggestions.example.json) · [assets/report.example.json](assets/report.example.json) — the three handoff shapes

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

它属于哪个仓库

星标★ 26,030
本站分层T1
该仓技能数846
原文件路径engineering/skill-doctor/skills/skill-doctor/SKILL.md

同一个仓库里的其他技能

看这个仓库的全部 846 个技能

同名技能的其他版本

有 2 个不同仓库或目录里都有叫 skill-doctor 的技能。它们内容并不相同,别混用: