From test-code-review
Use when test files are written or modified, or user asks to "review tests" or "check test changes". Catches weakened assertions, missing coverage, and tests rewritten to match buggy behavior.
How this skill is triggered — by the user, by Claude, or both
Slash command
/test-code-review:test-code-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are reviewing test code changes. Your job is to catch problems that green tests hide — weakened assertions, missing coverage, tests that pass for the wrong reason, and test changes that paper over bugs instead of catching them.
You are reviewing test code changes. Your job is to catch problems that green tests hide — weakened assertions, missing coverage, tests that pass for the wrong reason, and test changes that paper over bugs instead of catching them.
One of the most dangerous patterns in software development is when tests fail against new code and the developer rewrites the tests to match, rather than questioning the implementation. The tests were right — they were catching a bug. But the signal was interpreted as "tests need updating" instead of "the code is wrong." This happens more frequently in agentic coding loops where an AI agent confidently rewrites tests with plausible explanations.
Determine what test files were modified and what implementation files changed alongside them. Use git diff (staged + unstaged) or git diff HEAD~1 depending on context. Separate the changes into:
Understanding the implementation change is essential context for evaluating whether test changes are correct.
For each modified test, answer these questions:
Are the assertion changes justified by the implementation change?
expect(result).toBe(5) and now asserts expect(result).toBe(3), is that because the correct behavior genuinely changed, or because the implementation has a bug?Are assertions being weakened? Look for these red-flag patterns:
expected 2 rebases → expected 0 rebasesexpect(x).toBe(5) → expect(x).toBeTruthy()toEqual becoming toContain or toMatch (less precise matching)When you see weakened assertions, flag them explicitly. Explain what the test was checking before, what it checks now, and ask whether the old behavior was actually wrong.
Are test comments being rewritten to rationalize new behavior? If a comment changes from describing one behavior to describing a different (weaker) behavior, that's a signal the test was rewritten to match buggy code. The comment rewrite makes it look intentional when it might not be.
Is the test still testing what it claims to test? Sometimes a test's name says "test cascade propagation" but after modification it no longer tests cascading — it just checks that nothing happens. The name becomes misleading.
For new tests added alongside a bug fix:
Does the test actually reproduce the bug?
Does the test cover the right boundary?
For new tests added alongside a feature:
Are edge cases covered?
Are the assertions specific enough?
Look at the implementation diff and ask:
Structure your review as:
## Test Review: [brief summary]
### Weakened Assertions (if any)
For each weakened assertion:
- **File:line** — what changed, what it used to assert, why this is suspicious
- Recommendation: revert the assertion / keep with justification / rewrite differently
### Missing Coverage (if any)
- Code paths in the implementation diff that lack test coverage
- Specific test cases to add
### New Test Quality (if any)
- Whether new tests would catch the bug they claim to test
- Assertion specificity issues
### Verdict
One of:
- **Looks good** — tests are correct and comprehensive
- **Needs attention** — specific issues listed above should be addressed
- **Suspicious** — test changes may be papering over a bug; implementation should be re-examined
If you find issues, fix them rather than just reporting:
After applying fixes, run the tests. If they fail, that's valuable information — it means the tests are catching something the implementation gets wrong. Report this to the user rather than weakening the tests to make them pass.
func Test*(t *testing.T)*_test.got.Skip() added without justification, t.Fatal → t.Error (stops failing the test immediately), error returns not checked*.test.ts, *.spec.ts, *.test.js, *.spec.js.skip added to test cases, expect calls removed, .toEqual → .toMatchObject (allows extra fields)test_*.py, *_test.py@pytest.mark.skip added, assertEqual → assertIn (less precise), exception tests removedProvides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.
npx claudepluginhub pavelpascari/skills --plugin test-code-review