Token导航 LogoToken导航

Agent Skill · 开发

mutation-testing(突变测试)

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

mutation-testing 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 10,558。

总安装 2,179周安装 89GitHub Stars 2下载 705核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:mutation-testing(突变测试)
来源仓库:https://github.com/jwilger/agent-skills
仓库路径:skills/mutation-testing
安装命令:
npx skills add https://github.com/jwilger/agent-skills --skill mutation-testing
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jwilger/agent-skills --skill mutation-testing

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

mutation-testing 用于辅助测试设计、用例整理和回归验证。适合编写单元测试、端到端测试或根据失败日志定位问题。使用时需确认项目测试框架、运行命令和夹具数据。

安装命令:npx skills add https://github.com/jwilger/agent-skills --skill mutation-testing 涉及浏览器或外部服务时应区分本地模拟与生产环境。

来源仓库内路径:skills/mutation-testing

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/jwilger/agent-skills --skill mutation-testing;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

mutation-testing 怎么安装?

在终端执行 npx skills add https://github.com/jwilger/agent-skills --skill mutation-testing。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

mutation-testing 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

mutation-testing 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

mutation-testing 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

mutation-testing 用的人多吗?

公开数据是累计安装 2,179 次,近一周安装 89 次,下载 705 次,GitHub 2 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

mutation-testing 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
mutation-testing

突变测试 · 本页

2,1792只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Mutation Testing

Value: Feedback -- mutation testing closes the verification loop by proving that tests actually detect the bugs they claim to prevent. Without it, passing tests may provide false confidence.

Purpose

Teaches the agent to run mutation testing as a quality gate before PR creation. Mutation testing makes small changes (mutations) to production code and checks whether tests catch them. Surviving mutants reveal gaps where bugs could hide undetected. The required mutation kill rate is 100%.

Practices

Detect and Run the Right Tool

Detect the project type and run the appropriate mutation testing tool.

  1. Check for project markers:

- Cargo.toml -> Rust -> cargo mutants - package.json -> TypeScript/JavaScript -> npx stryker run - pyproject.toml or setup.py -> Python -> mutmut run - mix.exs -> Elixir -> mix muzak

  1. Verify the tool is installed. If not, provide installation instructions:

- Rust: cargo install cargo-mutants - TypeScript: npm install --save-dev @stryker-mutator/core - Python: pip install mutmut - Elixir: add {:muzak, "~> 1.0", only::test} to deps

  1. Run mutation testing against the relevant scope. Prefer scoping to changed files or packages rather than the entire codebase when possible: # Rust (scoped to package) cargo mutants --package <package> --jobs 4 # TypeScript npx stryker run # Python (scoped to source) mutmut run --paths-to-mutate=src/ mutmut results # Elixir mix muzak

Parse and Report Results

Extract from the mutation tool output:

  • Total mutants generated
  • Mutants killed (tests detected the change)
  • Mutants survived (tests did NOT detect the change)
  • Timed-out mutants
  • Mutation score percentage

Analyze Surviving Mutants

For each surviving mutant, report three things:

  1. Location: File and line number
  2. Mutation: What was changed (e.g., "replaced + with -")
  3. Meaning: What class of bug this lets through

Common mutation types and what survival indicates:

  • Arithmetic (+ -> -, * -> /): Calculations not verified
  • Comparison (> -> >=, == -> !=): Boundary conditions untested
  • Boolean (&& -> ||, ! removed): Logic branches not covered
  • Return value (true -> false, Ok -> Err): Return paths not checked
  • Statement removal (line deleted): Side effects not asserted

Scenario Coverage Check

Before recommending any test for a surviving mutant, check scenario coverage:

For each surviving mutant:

Step 1 — Scenario check: Does any acceptance scenario or domain scenario (from the slice's acceptance_scenarios or domain_scenarios arrays, or the plan's Confirmed Scenarios sections) require the behavior being mutated?

  • YES → A scenario exists but its test is missing. Proceed to Recommend Missing Tests below.
  • NO → Flag for human decision: Surviving mutant at [file]:[line] has no GWT scenario requiring this behavior. Options: (a) Delete the code — this behavior may not be needed. (b) Add a missing acceptance or domain scenario — the spec is incomplete. The 100% kill rate still applies; this clarifies how to resolve it. Do NOT proceed to test recommendations for uncovered mutants. Writing a test without a scenario games the metric without testing real behavior.

Recommend Missing Tests

For each surviving mutant with a covering scenario, suggest a specific test:

Surviving: src/money.rs:45 -- replaced `+` with `-` in Money::add()
Recommend: Test that adding Money(50) + Money(30) equals Money(80),
           not Money(20). The current tests do not assert the sum value.

Surviving: src/account.rs:78 -- replaced `>` with `>=` in check_balance()
Recommend: Test the exact boundary -- check_balance with exactly zero
           balance. Current tests only check positive and negative.

Structured Output

After mutation testing completes, produce a MUTATION_RESULT evidence packet:

{
  "tool": "cargo-mutants",
  "scope": ["src/money.rs", "src/account.rs"],
  "total_mutants": 42,
  "killed": 40,
  "survived": 2,
  "score": 95.2,
  "survivors": [
    {"file": "src/money.rs", "line": 45, "mutation_type": "arithmetic", "description": "replaced + with -"}
  ],
  "verdict": "FAIL"
}
  • Verdict: PASS if score is 100% on changed files, FAIL otherwise
  • When running in pipeline mode, store to .factory/audit-trail/slices/<slice-id>/mutation.json
  • When running standalone, the output is informational only -- display it and proceed to the quality gate

Enforce the Quality Gate

The required mutation kill rate is 100%. All mutants must be killed.

  • If score is 100%: Report success, proceed to PR creation
  • If score is below 100%: List all survivors with recommendations. Block PR creation with a clear warning. The user may override, but the default is to fix first.

Do:

  • Scope mutation runs to changed code when possible
  • Report survivors with actionable fix recommendations
  • Re-run after fixes to confirm all mutants are now killed
  • Treat timeouts as killed (the mutation broke something)

Do not:

  • Skip mutation testing before PR creation
  • Accept surviving mutants without reporting them
  • Run mutations on the entire codebase when only a module changed
  • Recommend tests for data validation that belongs in domain types

Pipeline Mode

When invoked by the pipeline orchestrator:

  • A FAIL verdict routes automatically back to the tdd skill with the survivor list attached. The pipeline handles this rework routing -- mutation-testing just reports results.
  • Survivor details in the MUTATION_RESULT packet must be specific enough (file, line, mutation type, description) for the TDD pair to write targeted tests without re-running the mutation tool to understand what failed.
  • The pipeline may invoke mutation-testing multiple times per slice; each run overwrites the previous mutation.json for that slice.

Enforcement Note

  • Pipeline mode: Gating. 100% kill rate is a gate -- failing blocks merge.
  • Standalone mode: Advisory. The agent reports but cannot prevent override.

Hard constraints:

  • 100% kill rate: [H] in pipeline mode, [RP] in standalone (block PR, user can override with documented reason)

See CONSTRAINT-RESOLUTION.md in the template directory for override documentation requirements.

Constraints

  • 100% kill rate: 100% means 100%. Not "close enough." Not "98% with justification." The only path below 100% is an explicit user override, which MUST include a documented reason explaining why each surviving mutant is acceptable. "I want to ship" is not a reason. "This mutant tests logging output which is not a business rule" is a reason.
  • "No test without scenario": Writing a test solely to kill a mutant without a corresponding scenario games the metric. The test proves you can kill the mutant, not that the behavior matters. If no scenario covers the behavior, the correct response is to flag the gap for the team -- the missing scenario might reveal a missing requirement.

Verification

After completing mutation testing, verify:

  • Mutation testing tool was run against the relevant scope
  • All surviving mutants are listed with file, line, and mutation type
  • Each survivor checked for scenario coverage before test recommendations
  • Each survivor with a covering scenario has a specific test recommendation
  • Each survivor without a covering scenario is flagged for human decision
  • Mutation score is 100% (or user explicitly chose to override)
  • If fixes were made, mutation testing was re-run to confirm

If any criterion is not met, revisit the relevant practice before proceeding.

Dependencies

This skill works standalone but is most valuable as a pre-PR quality gate. It integrates with:

  • tdd: TDD produces the tests that mutation testing validates; surviving mutants indicate the TDD cycle missed a case
  • code-review: Mutation results inform code review -- reviewers can check that new code has no surviving mutants

Missing a dependency? Install with:

npx skills add jwilger/agent-skills --skill tdd

平台分布

Codex

34.35%
按下载量换算242

Claude

31.39%
按下载量换算221

Cursor

17.1%
按下载量换算121

Gemini CLI

8.72%
按下载量换算61

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills