test-guard

Review test code for quality and efficiency across multiple programming languages.

Updated Dec 5, 2025
One-click install
npx skills add https://github.com/ApothecaryMan/pharmaflow-ai --skill test-guard-apothecaryman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-guard
Source: https://github.com/ApothecaryMan/pharmaflow-ai/tree/main/.agents/skills/test-guard
Command: npx skills add https://github.com/ApothecaryMan/pharmaflow-ai --skill test-guard-apothecaryman

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pytest, PHPUnit, jest, Vitest, OpenAI, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Ensures test quality and efficiency by reviewing and guiding the development of test code to follow best practices, avoiding common pitfalls such as excessive testing, unnecessary mocks, and redundant test scenarios.

Core Features & Use Cases

  • Automated Code Review: Evaluates test code against a set of established rules to prevent common issues like mock-heavy unit tests and near-duplicate tests.
  • Language Support: Covers multiple programming languages including Python, PHP, JavaScript, and more, each with specific guidelines and rules.
  • Integration with Development Workflow: Works seamlessly with popular testing frameworks and is triggered during various stages like writing, editing, or reviewing test code.

Quick Start

Run the skill using the command use test-guard after writing or reviewing test code to check for potential improvements.

Frequently Asked Questions about test-guard

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

FAQPage Schema
How do I review test code to prevent test bloat and unnecessary mocks?

Review test code by applying best practices that emphasize behavior over implementation, justified mocking, and clear scenarios to prevent test bloat. This ensures test quality by eliminating redundant tests and excessive mocking across your testing frameworks.

What are the best practices for writing efficient unit tests in pytest and jest?

Best practices for writing efficient unit tests in pytest and jest include focusing on behavior over implementation, justifying mocks, and defining clear test scenarios. Following these guidelines prevents test bloat and ensures your test automation remains maintainable.

Does test code review work with both JavaScript and PHP testing frameworks?

Test code review works with JavaScript and PHP testing frameworks, covering specific guidelines for multiple programming languages. It integrates with popular testing frameworks like PHPUnit, jest, and Vitast to evaluate test code during development.

Why does my test suite have too many near-duplicate tests and how do I optimize it?

Near-duplicate tests and test bloat occur when test code lacks clear scenarios and behavior focus. Optimize test quality by reviewing test code against established rules to eliminate redundant scenarios and reduce unnecessary mocks in your test automation.

Can I automate test quality checks during code review for multiple programming languages?

You can automate test quality checks during code review by evaluating test code against established rules for multiple programming languages. This automated review prevents common issues like mock-heavy tests and redundant scenarios across different testing frameworks.

When should I avoid mocking in test automation and what limitations exist?

Avoid mocking in test automation when it is not justified by specific testing guidelines, as excessive mocking causes test bloat. Limitations arise when test code lacks behavior focus or clear scenarios, reducing overall test quality.