From undercover
Test coverage feedback loop using undercover. Guides Claude to run undercover after tests to identify untested code changes, handle partial test runs with --include-files, and set up SimpleCov, CI pipelines, and coverage merging.
How this skill is triggered — by the user, by Claude, or both
Slash command
/undercover:coverage what you want to do — e.g. "run the loop", "set up coverage", "set up CI", "check this PR"what you want to do — e.g. "run the loop", "set up coverage", "set up CI", "check this PR"The summary Claude sees in its skill listing — used to decide when to auto-load this skill
The user may have stated an intent after the command (shown below as `$ARGUMENTS`).
The user may have stated an intent after the command (shown below as $ARGUMENTS).
Use it to decide what to do, then read the matching reference file before acting:
.undercover, permissions) → read references/setup.mdreferences/ci.mdreferences/pr-feedback.md:nocov:, add_filter, --exclude-files) → read references/skipping.mdStated intent: $ARGUMENTS
If no intent was given, default to the feedback loop.
After every test run, run undercover to check for coverage gaps.
Only use --include-files when you ran a partial test suite. Full suite → no flag.
Full test suite:
bundle exec undercover --format json
Partial test run (single file or subset — undercover must match scope):
bundle exec undercover --format json --include-files "app/models/foo.rb"
bundle exec undercover --format json --include-files "app/models/*.rb,app/services/foo*.rb"
--include-files accepts comma-separated glob patterns. When running a subset of
tests, SimpleCov only has coverage data for loaded files. Without --include-files,
undercover will falsely flag all other changed files as uncovered.
Workflow:
bundle exec undercover --format json (scoped with --include-files if partial):nocov: — only use :nocov: when the code genuinely cannot or should not be tested (see references/skipping.md). Only delete code if you are certain it is dead/unreachable — understand why it's uncovered before removing it{
"warnings": [
{
"node": "Foo#bar",
"type": "instance method",
"file": "lib/foo.rb",
"first_line": 10,
"last_line": 15,
"coverage": 0.5,
"uncovered_lines": [11],
"uncovered_branches": [
{"line": 13, "block": 0, "branch": 0},
{"line": 13, "block": 0, "branch": 1, "description": "else"}
]
}
],
"summary": {"total_warnings": 1, "files_affected": 1},
"validation": "stale_coverage"
}
uncovered_lines — lines with zero hitsuncovered_branches — branches with zero hits; description present for ternary/case branchesvalidation — only present on errors (e.g. stale_coverage); exit code is 0 in this casewarnings empty + no validation = all changed code coveredUndercover checks only the lines changed in your current diff (compared against a git ref). It does NOT measure total coverage.
Use undercover to ensure new and modified code is tested. Use SimpleCov's total percentage to track overall coverage trends separately.
Undercover only sees files that are staged or have unstaged changes to tracked files. Completely untracked files (never added to git) are invisible — undercover will not check them.
By default (no --compare), undercover checks uncommitted changes — staged
and unstaged vs HEAD. This only catches work in progress.
If you commit as you go (the normal workflow), the default diff is empty after each
commit and undercover always passes — a false green. --compare is required.
Use --compare in two situations:
On a feature branch — to check all commits since branching off main:
-c origin/main
No remote / local-only repo — compare against the initial commit SHA:
-c <initial-commit-sha>
Set it in .undercover so it applies consistently. If .undercover already exists
in the project, use the ref it specifies — do not overwrite it.
-c origin/main
Deeper guides, loaded on demand (see Routing above):
references/setup.md — SimpleCov + Gemfile + .undercover + Claude permissions + CLI referencereferences/ci.md — GitHub Actions, UndercoverCI, CircleCI, parallel test coverage mergingreferences/pr-feedback.md — reading UndercoverCI check annotations on a PR via gh apireferences/skipping.md — :nocov:, add_filter, --exclude-files and when to use eachnpx claudepluginhub grodowski/undercover-claude --plugin undercoverSearches MemPalace before answering questions about past work, people, projects, or prior decisions. Returns verbatim stored content instead of guessing from model memory.
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
Implements vector databases with Pinecone, Weaviate, Qdrant, Milvus, pgvector for semantic search, RAG, recommendations, and similarity systems. Optimizes embeddings, indexing, and hybrid search.