.cursor/skills/stryker-mutation-diff/SKILL.md
Runs Stryker mutation tests only on git-changed production files under `src/` via `scripts/stryker-mutate-changed.mjs` and `bun run test:mutation:changed`. Uses `stryker.config.mutation-changed.mjs` so partial runs do not fail on global `thresholds.break`. Use when the user asks for mutation testing on changed files only, incremental mutation test, diff-based Stryker, or "差分だけミューテーション" / "mutation test for current changes". After a run, use `bun run mutation:report:summary` and attach `reports/mutation/mutation-summary.md` for AI explanation (not HTML).
npx skillsauth add otomatty/zedi stryker-mutation-diffInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Full-repo mutation (bun run test:mutation) mutates thousands of mutants and is slow. For local or branch-scoped runs, use the changed-file workflow below.
zedi (frontend Stryker config: stryker.config.mjs, Vitest).src/**/*.ts(x) excluding *.test.*, *.spec.*, __tests__. server/api is not mutated (different test setup; use cd server/api && bun run test:run for API tests).bun run test:mutation uses stryker.config.mjs (includes thresholds.break, e.g. 70%).bun run test:mutation:changed uses stryker.config.mutation-changed.mjs, which is the same settings except thresholds.break is null. Reason: partial --mutate runs often produce a low global score and many # no cov mutants that do not mean the same thing as a full-repo score; failing the process on CI-style thresholds is usually misleading for diff-only runs.Collects paths from git, joins them as a single --mutate argument (comma-separated), and invokes the local @stryker-mutator/core CLI.
# Working tree vs HEAD (staged + unstaged + untracked under src/)
bun run test:mutation:changed
# Recommended for slow machines / first failure: extend initial test run timeout (default is 5 minutes)
bun run test:mutation:changed -- --dryRunTimeoutMinutes 30
# Optional: ignore static mutants (often much faster)
bun run test:mutation:changed -- --ignoreStatic
# Dry-run only (initial test run + coverage; no mutants executed)
bun run test:mutation:changed -- --dryRunOnly
Uses git diff <base>...HEAD --name-only instead of working-tree diffs.
STRYKER_DIFF_BASE=develop bun run test:mutation:changed
On Windows PowerShell: $env:STRYKER_DIFF_BASE="develop"; bun run test:mutation:changed
bun run test:mutation:changed:list
# or: STRYKER_DIFF_BASE=develop bun run test:mutation:changed:list
STRYKER_HTML_REPORT=0 bun run test:mutation:changed
| Symptom | Likely cause | Action |
| -------------------------------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Initial test run timed out | Default dry-run limit is 5 minutes; Vitest + perTest coverage can exceed it. | Retry with --dryRunTimeoutMinutes 15 or 30. |
| There were failed tests in the initial test run | Unit tests fail under Stryker. | Fix tests: bun run test:run until green. |
| No changed files under src/ | Only tests / server/ / non-src changed, or nothing to diff. | Ensure production files under src/ exist; use STRYKER_DIFF_BASE for branch scope. |
| Low % Mutation score / many # no cov on changed runs | Expected for scoped --mutate: many mutants are not mapped to a test in this mode. | Use the report to review survivors; do not compare the number to full-repo test:mutation expectations. |
| Run is very slow | Many mutants + perTest coverage. | Try --ignoreStatic; reduce scope (fewer files); use --dryRunOnly to validate setup first. |
mutation.html in chat — it embeds megabytes of JS/data and wastes context.reports/mutation/mutation.json (from the json reporter in stryker.config.mjs).@:bun run mutation:report:summary
# → reports/mutation/mutation-summary.md
bun run mutation:report:summary -- --stdout-onlybun run test:mutation:changed:summaryOptional: STRYKER_SUMMARY_MAX_SURVIVED=120 (default 80), STRYKER_SUMMARY_OUT=path/to/out.md.
reports/mutation/mutation.html — use locally; not for AI context.# killed = tests caught the mutation; # survived = weakness to address; # no cov = no test matched in this run (often high on partial --mutate).src/ (not only tests or server/).STRYKER_DIFF_BASE or commit changes so git diff HEAD lists files.When the agent or user already knows the exact paths:
bunx stryker run --mutate "src/lib/foo.ts,src/hooks/bar.ts" --dryRunOnly stryker.config.mutation-changed.mjs
For full-repo thresholds, use stryker.config.mjs instead.
scripts/stryker-mutate-changed.mjsscripts/stryker-mutation-report-summarize.mjsstryker.config.mutation-changed.mjstest:mutation:changed, mutation:report:summary in root package.jsonbun run test:mutation:changed over editing stryker.config.mjs mutate globs for one-off runs.--dryRunTimeoutMinutes 30 before other changes.--: e.g. -- --ignoreStatic --timeoutMS 120000.server/api from this skill; point to Vitest under server/api instead.bun run test:run); Stryker aborts when the unmutated suite fails.test:mutation:changed as a CI gate failure; use bun run test:mutation for repo-wide thresholds.bun run mutation:report:summary and read reports/mutation/mutation-summary.md — never read mutation.html into context.stryker run --fileLogLevel trace --logLevel debug (see Stryker troubleshooting).documentation
Zenn 記事を A先輩と B後輩の対話形式で執筆する。 Q&A のように疑問点にピンポイントで答える構成で、 初心者がつまずきやすいポイントを自然に解消する。 "対話形式で記事を書いて", "会話形式の記事", "dialogue article", "対話記事", "先輩後輩の会話で記事" などで起動する。
documentation
Zenn 記事の執筆・推敲を、体験ベースで読みやすいトーンに仕上げる。 AIっぽい定型表現を排除し、実践報告として説得力のある文章を生成する。 "Zenn記事を書いて", "記事の下書き", "ブログ記事を書く", "記事を推敲して", "write a Zenn article", "draft a blog post" などで起動する。
development
手元の実装変更、または現在ブランチとターゲットブランチの差分を、 関連コード(テスト・依存先・呼び出し元)も含めて AI レビューし、結果をマークダウンファイルに出力する。 "レビューして", "実装をレビュー", "変更をチェック", "review my changes", "self review", "セルフレビュー", "develop との差分をレビュー", "ブランチの差分をチェック", "review branch diff" などで起動する。
development
PR レビューコメントを仕様に照らして分析し、対応方針を提案・実行する。 コメントをそのまま受け入れるのではなく、TSDoc/テスト/型定義に基づいて 妥当性を検証し、修正・代替案・対応不要を判断する。 "レビュー対応して", "PRコメントに対応", "review PR comments", "レビューコメントを確認", "PRのレビューを処理" などで起動する。 Cursor / Claude Code 共通で使用可能。