test-guard

Review test code for brittle assertions, unjustified mocks, and duplicate scenarios.

Updated Jun 14, 2026
One-click install
npx skills add https://github.com/basmawebinfo-hub/lover-diet-center --skill test-guard-basmawebinfo-hub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-guard
Source: https://github.com/basmawebinfo-hub/lover-diet-center/tree/main/.opencode/skills/test-guard
Command: npx skills add https://github.com/basmawebinfo-hub/lover-diet-center --skill test-guard-basmawebinfo-hub

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents low-value, brittle, and over-generated tests from reaching commits or pull requests. It helps teams review AI-written or edited tests with practical guardrails so test suites stay useful, maintainable, and focused on real bugs.

Core Features & Use Cases

  • Behavior-first test review: Flags tests that assert implementation details instead of observable behavior.
  • Mocking and duplication control: Identifies unjustified mocks, repeated test scenarios, framework-guarantee tests, and cases where real state objects or infrastructure should be used.
  • Language-aware guidance: Adapts its review for pytest, PHPUnit/Pest, and Jest/Vitest, with extra rules for LLM applications and agent workflows.
  • Use case: After generating a batch of frontend or backend tests with an AI assistant, use this Skill to review the diff and surface which tests should be merged, rewritten, or removed before merge.

Quick Start

Review the tests I just added in this diff with test-guard and list any rule violations with concise fixes.

Frequently Asked Questions about test-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I review AI-generated test code for brittle assertions and low-value scenarios?

Review AI-generated test code by enforcing behavior-first testing, boundary-only mocking, and scenario-based naming to catch brittle assertions, unjustified mocks, and duplicate scenarios before shipping to pull requests.

What is test bloat and how do I prevent over-generated tests from reaching commits?

Test bloat consists of low-value, duplicate, or framework-guarantee tests that clutter test suites. Prevent over-generated tests by reviewing diffs to surface which tests should be merged, rewritten, or removed before merge.

How do I identify unjustified mocking and implementation detail assertions in pytest or Jest?

Identify unjustified mocking and implementation detail assertions in pytest or Jest by flagging tests that do not assert observable behavior, enforcing real state objects and real infrastructure for persistence testing.

Does this behavior-first test review approach work with PHPUnit, Pest, Vitest, and Go?

Yes, behavior-first test review applies to pytest, PHPUnit, Pest, Jest, Vitest, and Go. It adapts language-aware guidance to identify repeated scenarios and enforce boundary-only mocking across these frameworks.

How do I review LLM application and agent workflow tests for quality gates?

Review LLM application and agent workflow tests by applying specialized guardrails during diff review that catch low-value test bloat and enforce behavior-first testing for AI workflows before pull request merge.

When should I use real infrastructure instead of mocks for persistence testing?

Use real infrastructure for persistence testing when validating observable behavior, as boundary-only mocking guidelines flag tests with unjustified mocks that should instead utilize real state objects to prevent brittle test scenarios.