Token导航 LogoToken导航

Agent Skill · 研究检索

mutation-testing(突变测试)

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

mutation-testing 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 53,170。

总安装 539周安装 22GitHub Stars 1下载 174核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/codyswanngt/lisa --skill mutation-testing

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

mutation-testing 实施变异测试流程,生成目标代码变异体并筛选有效样本。适用于强化测试套件,通过消灭存活变异体提升测试覆盖率。默认处理当前分支变更文件,也可指定目录或单个源文件。安装前请确认测试框架是否支持变异插件,如 Stryker 或 PIT。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

mutation-testing 怎么安装?

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

mutation-testing 支持哪些 AI 工具?

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

mutation-testing 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

mutation-testing 是免费的吗?

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

mutation-testing 用的人多吗?

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

mutation-testing 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

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

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
mutation-testing

突变测试 · 本页

5391调用外部服务未明确有提醒

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

SKILL.md 原文

AI-Powered Mutation Testing

Target: $ARGUMENTS

If no argument provided, default to files changed in the current branch (via git diff).

This skill implements the mutation testing workflow: generate targeted mutants, filter unproductive ones, run tests to find survivors, and harden the test suite by strengthening or creating tests that kill surviving mutants.

Step 1: Gather Context

1a. Identify Target Files

Determine what to mutate based on $ARGUMENTS:

  1. File path — Mutate the specified source file
  2. Directory — Mutate source files in the directory (exclude test files)
  3. No argument — Use git diff to find changed source files: git diff --name-only $(git merge-base HEAD main)...HEAD -- '*.ts' '*.tsx' ':!*.spec.*' ':!*.test.*'

If no target files found, notify the user and stop.

1b. Gather Supporting Context

For each target source file, collect:

  1. Source code — Read the full file contents
  2. Existing tests — Find corresponding test files (*.spec.ts, *.test.ts) via naming convention or import analysis
  3. Test coverage — Run tests with coverage for the target file to identify uncovered lines: bun run test -- --coverage --collectCoverageFrom='<target-file>' --silent 2>&1 | tail -20
  4. Recent git history — Check for recent defects or frequent changes: git log --oneline -10 -- <target-file>
  5. Risk factors — Assess which risk factors apply to each file:
Risk FactorIndicators
Data security / complianceHandles PII, auth, authorization, encryption, tokens
IntegrationsExternal API calls, HTTP clients, webhooks, message queues
Code vs data modelDatabase queries, ORM entities, schema validation
Historic defectsFrequent bug-fix commits, complex conditional logic
Change impactExported utility functions, shared modules, base classes
PerformanceLoops over large datasets, recursive calls, caching logic

1c. Determine Test Runner

Detect the project's test framework from package.json scripts and devDependencies:

  • Jest: bun run test
  • Vitest: bun run test
  • Other: adapt accordingly

Step 2: Generate Mutants

2a. Create Experimental Branch

git stash --include-untracked || true
git checkout -b mutation-testing/$(date +%Y-%m-%d-%H%M%S)
git stash pop || true

2b. Generate Risk-Factor-Guided Mutants

For each target source file, generate 3-5 mutants that target the identified risk factors. Apply these mutation operators:

Operator TypeExamples
Decision mutationsChange > to >=, && to `\\, === to !==`
Value mutationsChange constants, swap string literals, alter numeric values
Statement mutationsRemove guard clauses, delete error handling, skip validation
Integration mutationsRemove timeout handling, skip error code checks, bypass retry logic
Security mutationsRemove auth checks, bypass input validation, expose sensitive data in logs

For each mutant, produce:

  1. Mutant ID — Sequential identifier (M001, M002, etc.)
  2. File and line — Exact location of the change
  3. Mutation description — What was changed and why
  4. Risk factor — Which risk factor this targets
  5. The code change — A minimal, atomic edit to introduce the defect

Mutant quality criteria — Each mutant must be:

  • Non-trivial — Not just whitespace, comments, or formatting
  • Buildable — The project must still compile/typecheck
  • Realistic — Simulates a plausible programming error
  • Targeted — Addresses a specific risk factor
  • Atomic — Exactly one logical change per mutant

2c. Apply and Validate Each Mutant

For each generated mutant, one at a time:

  1. Apply the mutation — Edit the source file to introduce the defect
  2. Build check — Run bun run typecheck to verify the project still compiles

- If build fails: discard the mutant, revert the change, log failure reason, continue to next

  1. Commit the mutant — git commit -am "mutant: M00X - <description>"

Step 3: Filter Mutants

3a. Run Tests Against Each Mutant

Process mutants in reverse order (LIFO — latest commit first):

  1. Run relevant tests against the mutant: bun run test -- <test-file-path> --silent 2>&1
  2. Evaluate result:

- Test fails (mutant killed) → Revert the mutant commit. Log as killed. Proceed to next mutant. - Test passes (mutant survived) → The mutant reveals a test gap. Keep it for Step 4.

3b. Equivalence Detection for Surviving Mutants

For each surviving mutant, verify it is not semantically equivalent to the original:

  1. AST-level comparison — Compare the diff. If the change is purely syntactic (reordering independent statements, renaming to equivalent aliases), discard it.
  2. Behavioral analysis — Reason about whether any input could distinguish the mutant from the original:

- If no distinguishing input exists → Discard as equivalent - If a distinguishing input exists → Keep as a unique actionable mutant - If uncertain → Keep and flag for human review

3c. Record Mutant Metadata

For each mutant, maintain a record:

{
  "mutant_id": "M001",
  "file": "<source-file>",
  "line": 42,
  "risk_factor": "Data security / compliance",
  "description": "Removed authentication check before data access",
  "status": "survived|killed|equivalent|discarded",
  "commit_hash": "<hash>",
  "tests_run": ["test-file.spec.ts"],
  "equivalence_result": "not_equivalent|equivalent|uncertain"
}

Print a summary table after filtering:

| Mutant | File | Risk Factor | Status |
|--------|------|-------------|--------|
| M001   | ... | ...          | survived |
| M002   | ... | ...          | killed   |

Step 4: Harden Test Suite

For each surviving, non-equivalent mutant:

4a. Determine Test Strategy

  1. Existing test covers the mutated region → Strengthen the existing test
  2. No test covers the mutated region → Generate a new test

4b. Strengthen Existing Test or Generate New Test

When strengthening an existing test, modify the test to:

  • Add assertions that detect the behavioral difference introduced by the mutant
  • Add or modify test inputs that expose the defect in the mutant code
  • Preserve the test method name, signature, and overall structure
  • Avoid adding trivial or unrelated checks

When generating a new test, create a test that:

  • Specifically exercises the behavioral difference between original and mutant code
  • Uses strong, precise assertions that detect the exact defect
  • Focuses on the identified risk factor
  • Includes realistic test data that exposes the mutant's flawed behavior
  • Follows existing test naming conventions and structure from the codebase

4c. Validate Each Test (3-attempt limit)

For each improved or new test, validate with up to 3 attempts:

  1. Revert the mutant — Switch to original code
  2. Build check — Ensure the test compiles
  3. Run on original code — Test must PASS on unmodified code
  4. Re-apply the mutant — Switch back to mutated code
  5. Run on mutant code — Test must FAIL on the mutant

If validation fails, refine the test (up to 3 total attempts). If still failing after 3 attempts, flag for manual review.

4d. Apply Decision Matrix

Classify each test result:

Original CodeMutant CodeSignalAction
Builds + PassesBuilds + FailsStrong detectionKeep — alert developer
Builds + PassesBuilds + PassesWeak assertionRefine — strengthen assertion
Builds + FailsBuilds + PassesBad testDiscard — generate new test
Doesn't buildAnyBroken testDiscard — generate new test
Builds + PassesDoesn't buildUntestable mutantDiscard — notify developer
Builds + FailsBuilds + FailsAmbiguous signalDiscard — generate new test

4e. Finalize Tests

For each validated test:

  1. Add an inline comment above the test referencing the mutant: // Test hardened to kill mutant M001 (Risk Factor: Data security / compliance)
  2. Commit the test improvement to the experimental branch

Step 5: Cleanup and Report

5a. Revert All Mutants

Remove all mutant commits from the experimental branch, keeping only test improvements:

# Revert mutant commits (identified by "mutant:" prefix in commit message)
git log --oneline | grep "^.* mutant:" | awk '{print $1}' | while read hash; do
  git revert --no-commit "$hash"
done
git commit -m "chore: revert all mutants after test hardening"

5b. Validate Clean State

  1. Run full test suite on the clean code with test improvements: bun run test 2>&1
  2. All tests must pass. If any fail, investigate and fix.

5c. Report Results

Print a comprehensive mutation testing report:

## Mutation Testing Report

**Target**: <files tested>
**Date**: <timestamp>
**Branch**: <experimental branch name>

### Summary
- Total mutants generated: X
- Killed by existing tests: X
- Survived (test gaps found): X
- Equivalent (discarded): X
- Build failures (discarded): X
- **Mutation Score**: X% (killed / (total - equivalent))

### Test Improvements
- Tests strengthened: X
- New tests generated: X
- Tests validated successfully: X
- Tests requiring manual review: X

### Surviving Mutants (Unresolved)
| Mutant | File | Line | Risk Factor | Description |
|--------|------|------|-------------|-------------|
| M00X   | ...  | ...  | ...         | ...         |

### Oracle Gap
- Code coverage: X%
- Mutation score: X%
- Oracle gap: X% (coverage - mutation score)

### Risk Factor Coverage
| Risk Factor | Mutants | Killed | Survived | Score |
|---|---|---|---|---|
| Data security | X | X | X | X% |
| Integrations  | X | X | X | X% |

5d. Present Options

Ask the user:

  1. Merge test improvements — Cherry-pick test commits to the original branch, delete experimental branch
  2. Keep experimental branch — For further review before merging
  3. Discard everything — Delete the experimental branch, no changes kept

If the user chooses to merge:

git checkout <original-branch>
git cherry-pick <test-improvement-commits>
git branch -D <experimental-branch>

Never

  • Modify test files to make them pass on mutants (defeats the purpose)
  • Generate mutants in test files (only mutate source code)
  • Skip the build check after generating a mutant
  • Commit mutants to protected branches (dev, staging, main)
  • Leave mutant code in the codebase after completion
  • Generate more than 5 mutants per file (diminishing returns)
  • Skip equivalence detection for surviving mutants
  • Mark a test as valid without running it on both original and mutant code
  • Use --no-verify with any git command

平台分布

Codex

34.12%
按下载量换算59

Claude

30.46%
按下载量换算53

Cursor

18.4%
按下载量换算32

Gemini CLI

9.65%
按下载量换算17

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

通过

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

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

继续浏览同类 Skills