qa-testing-enforcer

Enforce Vitest and Playwright test coverage for new or modified code artifacts.

Updated Nov 25, 2025
One-click install
npx skills add https://github.com/filimorniga-ux/farmacias-vallenar-suit --skill qa-testing-enforcer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: qa-testing-enforcer
Source: https://github.com/filimorniga-ux/farmacias-vallenar-suit/tree/main/.agent/skills/qa-testing-enforcer
Command: npx skills add https://github.com/filimorniga-ux/farmacias-vallenar-suit --skill qa-testing-enforcer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents the introduction of untested business logic and UI flows by enforcing a strict policy that every new or modified code artifact must be accompanied by automated tests, avoiding regressions in a mission-critical pharmacy ERP.

Core Features & Use Cases

  • Decision rules: Distinguishes when to create unit tests (Vitest) for pure business logic and when to create E2E tests (Playwright) for critical user flows.
  • Conventions & Structure: Requires mirrored test files for source files (for example src/actions -> tests/actions) and mandates the Arrange-Act-Assert pattern.
  • Safety & Quality: Requires DB mocks for unit tests, use of the existing Playwright login helper for E2E, explicit negative test cases, and forbids unsafe practices like using any in tests or commenting out failing tests.
  • Use Case: When adding a discount calculation function, generate src/domain/discounts.ts and tests/domain/discounts.test.ts with happy path and failure scenarios, using Vitest and TypeScript types.

Quick Start

Create a Vitest unit test for src/domain/discounts.ts and a corresponding tests/domain/discounts.test.ts that follows Arrange-Act-Assert, uses mocks for database interactions, includes both success and failure cases, and enforces TypeScript typing without any.

Frequently Asked Questions about qa-testing-enforcer

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

FAQPage Schema
When do I need unit tests versus E2E tests for an ERP module?

Unit tests using Vitest should cover pure business logic and action modules, while Playwright E2E tests should target critical user flows, ensuring both domain logic and UI pathways are validated.

How do I structure Vitest tests to follow the Arrange-Act-Assert pattern?

Structure Vitest tests by explicitly separating Arrange, Act, and Assert phases, using database mocks for unit tests, including explicit negative test cases, and enforcing strict TypeScript typing without using any.

Can I use Playwright login helpers for E2E testing in a pharmacy ERP?

Yes, Playwright E2E tests can utilize the existing login helper to authenticate critical user flows, ensuring that end-to-end testing safely validates actual application pathways without manual setup.

What are the limitations of using any in TypeScript test code?

Using any in TypeScript test code is forbidden because it bypasses type safety, allowing unsafe practices to hide regressions; tests must enforce strict typing to ensure reliable validation of business logic.