Mutation testing — single file

Run Stryker mutation testing on a single source file and return a structured, token-frugal report that's pipeable to a follow-up…

You say
Install this skill Read the source first Free Written by n8n-io · unverified publisher
Context cost
1.6k tokensestimated from the bundle, loaded when it triggers
Bundle
1 file · 6.3 kBtext throughout, nothing executable
Licence
Source-availablefree to use
Last change
no release on file
Servers it uses
Noneruns standalone

What it does

Run Stryker mutation testing on a single source file and return a structured, token-frugal report that's pipeable to a follow-up "strengthen tests" loop. Use when the user says /mutant-score, "mutation test this file", or has just edited tests and wants to verify they actually assert behaviour. Per-file only — full-package mutation runs are out of scope.

Installed, it changes the agent in these ways.

What this skill changes about the agent is not written down here yet. The listing was collected from its source, and the description is in its own SKILL.md.

Workflow

Runs a procedure end to end.

securitytesting

The skill itself

This is the whole product. A skill is instructions the model reads, so there is nothing behind the listing you cannot see first — the front matter loads with every session, and the body below it loads when the skill triggers.

SKILL.md6.3 kB · 117 lines
--- description: Run Stryker mutation testing on a single source file and return a structured, token-frugal report that's pipeable to a follow-up "strengthen tests" loop. Use when the user says /mutant-score, "mutation test this file", or has just edited tests and wants to verify they actually assert behaviour. Per-file only — full-package mutation runs are out of scope. ---
5# Mutation testing — single file
6
7Wraps pnpm mutate <file> and parses summary.json into a compact, structured shape suitable for downstream "strengthen the surviving mutants" iteration. Works for any vitest package — pnpm mutate infers the package from the path.
8
9## When to use
10
11- User explicitly invokes: /mutant-score <path>, "mutation test this file", "check my test effectiveness on X"
12- User has just edited a test file and wants to know if their assertions are load-bearing
13- Follow-up loop after a red verdict — feed the structured output back to a "fix" iteration
14
15**Don't** use this skill for:
16- Whole-package or whole-repo mutation runs — single file only
17- Coverage % questions (use the existing coverage workflow)
18- **jest** packages (nodes-base, cli, db) — Stryker's vitest-runner only covers vitest packages
19- @n8n/expression-runtime — it's the isolated-vm engine (blocked on DEVP-257)
20
21## Inputs
22
23One required argument: the source file to mutate. Prefer a **repo-relative path** — the package is inferred from it:
24
25- packages/workflow/src/cron.ts (package inferred)
26- packages/@n8n/crdt/src/utils.ts (package inferred)
27
28A bare package-relative path (src/cron.ts) is ambiguous — pass the repo-relative path, or add --package-dir <pkg>. Don't guess the package.
29
30## Steps
31
321. **Resolve the target.** Any vitest package works; pnpm mutate infers the package from a repo-relative path. If the file is in a jest package or @n8n/expression-runtime, say so and stop — don't fabricate output.
33
342. **Run Stryker with trimmed output:**
35 ```bash
36 pnpm mutate <repo-relative-file> 2>&1 | tail -40
37 ```
38 tail -40 discards the Stryker progress bar spam; the relevant numbers + survivor list always land in the last ~30 lines. Exit codes: 0 = pass, 1 = below threshold (still valid, summary.json exists), 2 = usage error, 3 = Stryker failure (no summary.json).
39
403. **If exit code 3**, surface the trimmed tail to the user, suggest checking that workspace deps are built (pnpm build), and stop. Don't fabricate a report.
41
424. **Read the package's reports/mutation/summary.json** (e.g. packages/workflow/reports/mutation/summary.json) — never raw.json. raw.json is 600KB+ and not needed for the strengthen loop. summary.json already contains every surviving mutant with its location, replacement, mutator name, and the names of tests that covered the line.
43
445. **Cap covering_tests at 3 per survivor.** If a mutant was covered by more than 3 tests, keep the first 3 and append +N more as a count. Names beyond 3 add tokens without adding actionable signal — the strengthen loop only needs to know *which test* to extend, not all of them.
45
466. **Compute minimum_kills_needed** to reach the threshold:
47 ```
48 killed_now = summary.overall.counts.killed + summary.overall.counts.timeout
49 valid_total = killed_now + summary.overall.counts.survived + summary.overall.counts.noCoverage
50 needed = ceil((threshold/100) * valid_total) - killed_now
51 ```
52 This tells the next loop the minimum number of survivors it has to kill to flip redgreen. Cap at the number of survivors.
53
547. **Output the structured shape** described below. Keep prose to one headline line; the rest is the JSON block.
55
56## Output shape
57
58One headline line, then a fenced JSON block. Nothing else — no preamble, no per-survivor commentary, no risk triage (that's the next loop's job).
59
60````
61[red|green] <score>% (threshold <T>%) — <N> survivors; need to kill ≥<K> to flip green.
62
63```json
64{
65 "verdict": "red",
66 "target": "packages/workflow/src/augment-object.ts",
67 "package": "n8n-workflow",
68 "score": 76.74,
69 "threshold": 80,
70 "delta_to_threshold": 3.26,
71 "minimum_kills_needed": 5,
72 "counts": {
73 "killed": 99,
74 "survived": 28,
75 "no_coverage": 2,
76 "timeout": 0
77 },
78 "survivors": [
79 {
80 "id": "77",
81 "mutator": "ConditionalExpression",
82 "location": "src/augment-object.ts:95:6",
83 "original": "value === null",
84 "replacement": "false",
85 "covering_tests": [
86 "augmentObject should handle null values",
87 "augmentObject should handle nested nulls"
88 ],
89 "covering_tests_overflow": 0
90 }
91 ]
92}
93```
94````
95
96Order the survivors array by location (ascending line number, then column) so the strengthen loop processes them top-to-bottom of the file.
97
98## Constraints
99
100- **No raw.json** — never read or surface it. summary.json is the only input.
101- **No HTML report** — don't open raw.html or paste links to it. If the user wants visual exploration they'll ask.
102- **No automatic triage** — don't categorise survivors by "real bug" vs "refactor insurance." That's a separate analysis step that should happen on demand, not by default. Keeps token cost predictable.
103- **No "I'll regenerate tests for you now"** — this skill reports the gap. Use n8n:mutant-fix if you want assertion edits.
104
105## Common follow-ups (don't do unless asked)
106
107- User says "fix these" → start a strengthen loop using the JSON output as input. Read covering_tests source, propose changes per mutant, run the skill again to verify.
108- User says "explain survivor #N" → fetch that mutant from summary.json, show its surrounding ~5 lines from the source file, no analysis beyond what summary.json contains.
109- User says "what's the threshold?" → 80% provisional; see scripts/mutation-health/README.md for the rationale.
110- User says "run it on the changed files" → use n8n:mutant-diff (mutates the diff vs origin/master).
111
112## Related
113
114- scripts/mutation-health/README.md — the broader BQ-backed observability story
115- scripts/mutation-health/stryker.default.mjs — the default Stryker config; a package may override with its own stryker.config.mjs (e.g. packages/workflow carves out the isolated-vm engine)
116- n8n:mutant-fix — the strengthen-the-survivors counterpart
117
In the file
SKILL.md884 words
Files1
LicenceSource-available
Why you can read it

Nothing in a skill executes. The client loads the text and the model follows it, so a skill can be audited the way a runbook is — by reading it.

What it costs in context

Skills are not billed by the call. They are paid for in context: every token the instructions occupy is a token your code, your diff and your conversation cannot use. Here is what this one takes and when it takes it.

≈90
always loaded
The name and description, so the model knows the skill exists and when to reach for it.
1,485
on trigger
The instruction body, read only when the skill fires.
0.79%
of a 200k window
Ten skills this size would take about 8% of the window before you open a file.
050k100k150k200k context window

1.6k tokens, estimated from the bundle at four bytes to the token, held for the rest of the session once it triggers. Middling. Fine to keep on in a project where you use it weekly, worth unloading in one where you never do.

Servers bill, skills cost

A server charges by the month. A skill charges once per session, in context, and then keeps charging it for as long as the session lives.

Before and after

The same question, put to the same model twice: once as it comes, and once with these instructions loaded.

No worked example has been published for this skill yet.

Adoption
Installsnone yet
Ratingno reviews yet

The procedure it runs

The procedure has not been published here. It is in the skill’s own SKILL.md, which its author has not sent to the marketplace yet.

Prose, not code

These steps are written for a model to follow, not executed by a runtime. It can still be told to skip one, and it will say so when it does.

Servers it uses

None. This skill calls no MCP servers at all.

Everything it needs is in the instructions, so it works in a project with nothing connected — the model reads the file and changes how it works with what it can already reach.

It writes no files and reaches no network. All it changes is how the model reasons and writes.

What it asks for
Writes filesno
Network accessno

Read from the allowed-tools line of this skill’s own SKILL.md. A skill grants no permissions of its own — it can only ask for tools your client already has.

What it will not do

Every skill is narrow, and the useful ones say where they stop. These are the jobs this one is the wrong tool for.

What this skill is not for has not been published here. Nothing is implied by that: it is a section the author has not filled in.

What is in the bundle

1 file, 6.3 kB on disk. A bundle is text throughout: the instructions the model reads, plus the templates it fills in.

  • SKILL.md6.3 kB
What is not in it

No dependencies and nothing executable: a skill is text the agent reads, so the bundle is 1 file you can review in full before installing. The Source-available licence covers the templates and examples as well as the instructions.

Install

Installing copies the bundle into your project. Nothing runs at install time — the files sit on disk until the model reads them.

# Mutation testing — single file · 1.6k tokens when loaded npx mcprush@latest skill add n8n-io/mutation-testing-single-file

Writes to .claude/skills/mutation-testing-single-file/ in the current project. Add --global to put it in your home directory instead, for every project.

Which clients pick it up on their own

A skill is a folder of text. A client with a skills folder reads it without being told; everywhere else the same text works, it is just handed to the model rather than found.

Claude Code.claude/skills/
Claude Desktop
ChatGPT
Cursor.cursor/skills/
VS Code.github/skills/
Codex CLI.agents/skills/
Gemini CLI.gemini/skills/
Grok.grok/skills/
Zed.agents/skills/
Windsurf.windsurf/skills/
Agent SDK.claude/skills/
HTTP / API
This release
Versionnot versioned
Publishedno release date on file
PriceFree
Referencen8n-io/mutation-testing-single-file

Versions

Its author publishes no version number, so there is nothing here to pin to: what you install is the folder as it stands today. Instructions change more often than APIs do — a skill can be rewritten entirely without anything it depends on moving.

v
  • No earlier releases have been published to the marketplace.
Pinning

Nothing to pin to: this skill carries no version number of its own. What you install is what the folder holds on the day you install it.

Reviews

no reviews yet · no installs yet

Nobody has reviewed this skill yet. The rating is the mean of the reviews written here, so there is none until somebody writes the first.

Who can post

Only accounts that have had the skill installed for fourteen days, so a review is written after living with it rather than after reading it. Publishers may reply once.

Publisher
Servers0
Claim this skill