Enforce coverage thresholds AND test quality — coverage without behavioral assertions is meaningless.
From tdd-guardiannpx claudepluginhub xiaolai/claude-plugin-marketplace --plugin tdd-guardianThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
coverageMode:"absolute" (default): Current behavior — all metrics must meet configured thresholds.
"no-decrease": Blocks only if coverage decreased from a recorded baseline.
| Scenario | absolute | no-decrease |
|---|---|---|
| Coverage 72%, threshold 100% | BLOCK | PASS (if baseline ≤ 72%) |
| Coverage dropped 72% → 70% | BLOCK | BLOCK (decreased) |
| Coverage improved 72% → 75% | BLOCK | PASS (improved) |
Default threshold policy (absolute mode): 100 for all metrics.
Coverage alone is insufficient. A test that touches every line but only asserts expect(mock).toHaveBeenCalled() provides zero regression safety.
Follow the assertion hierarchy and mock rules defined in the policy-core skill.
For each test file in the coverage report:
Count assertion types per test using the assertion hierarchy from policy-core:
Flag violations:
it() block where ALL assertions are Level 6-7it() block where Level 6-7 assertions outnumber Level 1-5 assertions by 3:1 or moreReport format:
Test Quality Summary:
✓ 45/48 tests have behavioral assertions
✗ 3 tests are wiring-only:
- docker/container.test.ts: "applies security defaults" (line 52) — mock args only
- cli/lifecycle.test.ts: "stops container" (line 48) — mock-was-called only
- docker/network.test.ts: "creates network" (line 28) — mock args only
Gate result: FAIL if any wiring-only tests exist in changed files. WARN (non-blocking) for existing wiring-only tests in unchanged files.
Scan all source files (not test files) for V8 coverage ignore comments. Flag misuse:
/* v8 ignore next */ or /* v8 ignore next N */ — silently fails on ??, ternaries, catch bodies, and short-circuit operators (&&, ||). Replace with /* v8 ignore start */ / /* v8 ignore stop */./* v8 ignore start */ / /* v8 ignore stop */ range pairs.Coverage Ignore Audit:
✗ 2 files use unreliable /* v8 ignore next N */:
- src/config.ts:42 — covers ?? expression, will silently fail
- src/handler.ts:88 — covers ternary, will silently fail
Fix: replace with /* v8 ignore start */ / /* v8 ignore stop */ range comments
| Current assertion | Add this | Example |
|---|---|---|
expect(mockCreate).toHaveBeenCalledWith(opts) | Verify return value | expect(result.id).toMatch(/^mx-/) |
expect(mockStop).toHaveBeenCalled() | Verify formatted output | expect(formatter.success).toHaveBeenCalledWith("Mecha stopped.") |
expect(mockCreate).toHaveBeenCalledWith(securityOpts) | Add integration test | const info = await inspect(container); expect(info.HostConfig.ReadonlyRootfs).toBe(true) |