mutation-testing
Automates mutation testing, test generation, and bug tracking for Clojure projects.
Install
mkdir -p .claude/skills/mutation-testing && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2604" && unzip -o skill.zip -d .claude/skills/mutation-testing && rm skill.zipInstalls to .claude/skills/mutation-testing
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Run mutation testing on a Clojure namespace, generate tests to kill surviving mutations, and open draft PRs with Linear issue tracking.Key capabilities
- →Executes Clojure-specific mutation testing
- →Identifies surviving mutations in source code
- →Automates test generation to cover missed mutations
- →Links test improvements to Linear issues
How it works
It runs local Clojure mutation engine scripts to identify code gaps and then invokes an LLM to generate tests that invalidate the surviving mutants.
Inputs & outputs
When to use mutation-testing
- →Identify weak test coverage
- →Automate mutation kill-rate improvements
- →Create draft PRs for test fixes
About this skill
Mutation Testing Skill
This skill runs mutation testing end-to-end: generates a coverage report, groups functions, shells out to claude -p to write tests, verifies mutations are killed, and creates draft PRs with Linear issues.
Prerequisites
- A running nREPL connected to the Metabase dev environment
LINEAR_API_KEYenvironment variable set with a valid Linear personal API keyghCLI authenticated with GitHubclaudeCLI available on PATH
Reference Files
dev/src/dev/coverage.clj— mutation testing engine (generates reports, runs mutations)dev/src/dev/mutation_testing.clj— orchestration, Linear API, PR helpers
Invocation
The argument is a Clojure namespace, optionally followed by a base branch:
/mutation-testing metabase.lib.order-by
/mutation-testing metabase.lib.order-by --base-branch release-x.52.x
/mutation-testing metabase.lib.order-by --project-id abc-123
/mutation-testing metabase.lib.order-by --base-branch release-x.52.x --project-id abc-123
--base-branch: defaults to the value in config (set viaset-config!), or"master"if not configured.--project-id: if provided, issues are added to this existing Linear project instead of creating a new one.
Steps
1. Parse arguments
Parse $ARGUMENTS to extract:
- namespace (required) — the first positional argument
--base-branch(optional) — if present, the next argument is the base branch name--project-id(optional) — if present, the next argument is an existing Linear project ID
2. Load and configure
(require '[dev.mutation-testing :as mut-test] :reload)
(require '[dev.coverage :as cov] :reload)
If this is the first invocation (or the REPL was restarted), set up the Linear team:
(mut-test/list-teams!)
(mut-test/set-config! {:team-id "<id>"})
3. Run
(mut-test/run! '<target-ns>)
;; Or with options:
(mut-test/run! '<target-ns> {:base-branch "release-x.52.x"})
(mut-test/run! '<target-ns> {:project-id "abc-123"})
(mut-test/run! '<target-ns> {:base-branch "release-x.52.x" :project-id "abc-123"})
Pass the opts map with :base-branch and/or :project-id if those flags were provided in the arguments.
This will:
- Generate a baseline mutation testing report
- Create a Linear project for the namespace
- Group functions by coverage relationships
- For each group: create branch → invoke Claude to write tests → verify → retry if needed → commit & push → create Linear issue → create draft PR
- Print a summary with PR links
4. Handle failures
If a group fails mid-processing, run! catches the error and continues to the next group. To retry a single group manually:
;; Get the parsed namespace info
(def parsed (mut-test/parse-namespace '<target-ns>))
;; Run coverage to get the data
(def coverage-results (cov/test-namespace (:target-ns parsed) [(:test-ns parsed)]))
;; Group and find the one you want
(def groups (mut-test/group-functions coverage-results))
;; Process just that group
(mut-test/process-group! parsed (nth groups <index>))
5. Verify the prompt (dry run)
To inspect what Claude will see without invoking it:
(def parsed (mut-test/parse-namespace '<target-ns>))
(def coverage-results (cov/test-namespace (:target-ns parsed) [(:test-ns parsed)]))
(def groups (mut-test/group-functions coverage-results))
(println (mut-test/build-test-prompt
(merge (select-keys parsed [:target-ns :test-ns :source-path :test-path])
(select-keys (first groups) [:fn-names :mutations]))))
Configuration
- Team ID: Set once per REPL session via
(mut-test/list-teams!)and(mut-test/set-config! {:team-id "..."}) - Project ID: Set automatically when
run!callscreate-project-for-namespace! - Base Branch: Defaults to
"master". Override via(mut-test/set-config! {:base-branch "release-x.52.x"})or pass{:base-branch "..."}as the second arg torun! - Project ID: If set (via
set-config!orrun!opts),run!reuses the existing Linear project instead of creating a new one
When not to use it
- →Projects using non-Clojure languages
- →Environments without nREPL access
Prerequisites
Limitations
- →Requires specific project structure defined in Metabase dev environment
- →Execution time scales linearly with test suite size
How it compares
It creates a tight feedback loop between mutation detection, code generation, and project management tools like Linear.
Compared to similar skills
mutation-testing side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| mutation-testing (this skill) | 5 | 5mo | Review | Advanced |
| verification-before-completion | 9 | 9mo | No flags | Beginner |
| workflow-patterns | 1 | 2mo | No flags | Intermediate |
| tdd-workflows-tdd-refactor | 1 | 4mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by metabase
View all by metabase →You might also like
verification-before-completion
obra
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
workflow-patterns
wshobson
Use this skill when implementing tasks according to Conductor's TDD workflow, handling phase checkpoints, managing git commits for tasks, or understanding the verification protocol.
tdd-workflows-tdd-refactor
sickn33
Use when working with tdd workflows tdd refactor
customaize-agent:create-hook
LAI-YEN-CHUN
Create and configure git hooks with intelligent project analysis, suggestions, and automated testing
qa
gmaiarviana
> **📌 Carregado por:** Claude Code Web após Dev marcar tasks como concluídas. > **📌 Documentação:** ver [README.md](README.md) para visão geral.
qc
macro-inc
Quality gate. 5 parallel agents review changes. All must pass.