/spec-autopilot:autopilot-test-health [score|mutate|all] — 默认 allfrom spec-autopilot
Use when the user wants to quantify test effectiveness — running lightweight shell-layer mutation testing and static health scoring to confirm the test suite would actually catch regressions. Typical triggers include weekly CI sweeps, on-demand audits asking 'how healthy are our tests', or '/autopilot-test-health score|mutate|all' invocations. Not part of any phase gate.
Ships in spec-autopilot. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
用途:在已有
autopilot-test-audit(静态扫描候选清单)之上,再加一层"用变异测试量化测试有效性"的能力。避免测试存在但无信号。
/autopilot-test-health all 输出 dashboard不建议挂 pre-commit:变异测试每次至少跑 N 个 mutant × test,开销太大。
| 模式 | 含义 | 输出 |
|---|---|---|
mutate | 仅跑变异测试 | .cache/spec-autopilot/mutation-report.json |
score | 仅跑静态健康度评分(含读入已有 mutation 结果) | .cache/spec-autopilot/test-health-report.json |
all(默认) | 先 mutate 再 score | 两份报告 |
MODE="${1:-all}"
case "$MODE" in
mutate|score|all) ;;
*) echo "用法: /autopilot-test-health [score|mutate|all]"; exit 1 ;;
esac
bash ${CLAUDE_PLUGIN_ROOT}/runtime/scripts/test-mutation-sample.sh \
--targets "plugins/spec-autopilot/runtime/scripts/*.sh" \
--sample-size 10 \
--timeout-per-mutant 30
输出:
.cache/spec-autopilot/mutation-report.json(含 targets / overall_kill_rate / survivors)MUTATION_KILL_RATE=0.XX SURVIVORS=Nbash ${CLAUDE_PLUGIN_ROOT}/runtime/scripts/test-health-score.sh \
--tests-dir plugins/spec-autopilot/tests \
--threshold 60
输出:
.cache/spec-autopilot/test-health-report.jsonHEALTH_SCORE=X 与可选 HEALTH_BELOW_THRESHOLD=1读取两份报告,汇总 dashboard:
Mutation kill_rate: 0.XX (survivors: N)
Health overall: XX/100
assertion_density: 0.XX
weak_ratio: 0.XX
duplicate_ratio: 0.XX
kill_rate: 0.XX (来自 mutation 报告)
HEALTH_BELOW_THRESHOLD=1 提示kill_rate < 0.5 → 该批 runtime 脚本测试质量整体不达标weak_ratio > 0.3 → 大量测试只断言 exit code,需补内容/格式断言duplicate_ratio > 0.2 → case 命名重复,可能是复制粘贴未改名top_weak 列表中的文件 → 优先改进对象.claude/autopilot.config.yaml 可加:
test_health:
thresholds:
overall: 60
assertion_density: 2.0
weak_ratio_max: 0.3
references/mutation-strategies.mdreferences/health-metrics.mdWhat SKILL.md sets; muted values are Claude Code's defaults
22 skills in this plugin
/autopilotUse when the user requests an end-to-end spec-driven delivery pipeline (requirements → OpenSpec → implementation → testing → archive); orchestrates Phase 0-7./autopilot-agentsUse when the user wants to discover, install, list, hot-swap, or get recommendations for phase-specific autopilot sub-agents sourced from community catalogs (OMC, Anthropic official, VoltAgent, etc.), or when the autopilot setup flow needs to resolve a missing agent for a given phase./autopilot-dispatchUse when the autopilot orchestrator main thread is about to dispatch a phase-specific sub-agent via the Task tool and needs the JSON envelope contract, explicit path injection, and parameterized prompt templates. Not for direct user invocation; skip when the current context is not the autopilot orchestrator.Other plugins' skills for the same job
npx claudepluginhub stoicatom/claude-autopilot --plugin spec-autopilot