Agent skill · Testing & QA

test-guard

Review generated or changed test code against universal testing rules before it ships. Best used reactively after an agent writes, edits, generates, or refactors tests, before presenting, committing, or merging them. Use for pytest (test_*.py, *_test.py), PHPUnit/Pest (*Test.php), Jest/Vitest (*.test.ts, *.spec.js), Go (*_test.go), files under tests/, __tests__/, or spec/, and review requests like 'write tests for X', 'add tests', 'test this', 'review these tests', or PR diffs containing tests. Can also guide test writing when explicitly invoked before the work. This skill is the quality gate

amElnagdygithub.com/amElnagdyGitHub ↗
claude-codecodexMIT
Install
npx skills add amElnagdy/guard-skills --skill test-guard --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 6
SKILL.md size: 8 KB
Bundled scripts: none
Path: skills/test-guard/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 1,138

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Test Guard You are reviewing generated or changed test code before it ships. Enforce the rules below after the first test-writing pass and before the tests are presented, committed, or merged. Be a sharp reviewer, not a pedantic one: flag what wastes maintenance effort or hides real bugs, ignore cosmetic preferences. These rules exist because coding agents over-generate tests. The common failure modes: mock-heavy unit tests that assert implementation details, near-duplicate test bodies that differ by one value, and tests that re-verify the framework instead of the project's logic. Each looks productive in a diff and costs maintenance forever. ## When this skill activates - A coding agent has just written new test functions or test files, in any language - You are editing existing tests - You are reviewing a diff that contains test changes - The user asks you to write, add, or review tests ## Adapt to the project first These rules are universal, but their application is not. Before reviewing: 1. Check the project's own agent instructions (CLAUDE.md, AGENTS.md) and testing docs. Project-specific testing rules win over this skill when they conflict. 2. Identify the test stack, then

What's inside
Steps it walks through
  1. When this skill activates
  2. Adapt to the project first
  3. What to do
  4. The Nine Rules
  5. Rule 1: Test behavior, not implementation
  6. Rule 2: Every mock must be justified
  7. Rule 3: One scenario per test, data-driven for variants
  8. Rule 4: Every test must justify its existence
  9. Rule 5: Name tests for the scenario
  10. Rule 6: Production regression tests are sacred
  11. Rule 7: No tests for framework guarantees
  12. Rule 8: State and value objects are real, never mocked
  13. Rule 9: Infrastructure under test gets real infrastructure
  14. Reporting format
Ships with 5 files
  • agents/openai.yaml
  • references/jest.md
  • references/llm-app-testing.md
  • references/phpunit.md
  • references/pytest.md
More from guard-skills
All skills →
About this skill
What does the test-guard skill do?

Review generated or changed test code against universal testing rules before it ships. Best used reactively after an agent writes, edits, generates, or refactors tests, before presenting, committing, or merging them. Use for pytest (test_*.py, *_test.py), PHPUnit/Pest (*Test.php), Jest/Vitest (*.test.ts, *.spec.js), Go (*_test.go), files under tests/, __tests__/, or spec/, and review requests like 'write tests for X', 'add tests', 'test this', 'review these tests', or PR diffs containing tests. Can also guide test writing when explicitly invoked before the work. This skill is the quality gate

How do I install it?

Run `npx skills add amElnagdy/guard-skills --skill test-guard --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From amElnagdy/guard-skills, a repository with 1,138 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going