Senior qa

From borghei/Claude-Skills · View interactive version

Senior qa is an AI agent skill from the GitHub repository borghei/Claude-Skills. Testing for React/Next.js with Jest, React Testing Library, and Playwright. Use when generating tests, writing unit tests, analyzing coverage, scaffolding E2E tests, configuring Jest, or improving test quality.

How to use this skill

Skill file

Senior QA Engineer

Test automation, coverage analysis, and quality assurance patterns for React and Next.js applications. Generates Jest + React Testing Library unit test stubs, analyzes Istanbul/LCOV coverage for gaps, and scaffolds Playwright E2E suites for App Router and Pages Router projects.

Core Capabilities

When to Use

Clarify First

Before generating tests, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.

Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.

Tools Overview

| Tool | Purpose | Example (runs as written) |

|------|---------|---------|

| test_suite_generator.py | Jest + RTL stubs from React components; reads the XProps interface to build typed mockProps for required props (--output, --include-a11y, --scan-only, --json) | python scripts/test_suite_generator.py assets/sample_components --output /tmp/qa/tests |

| coverage_analyzer.py | Istanbul JSON / LCOV gap analysis with critical-path weighting (--threshold, --strict, --critical-paths, --format text/html/json, --json) | python scripts/coverage_analyzer.py assets/sample_lcov.info --threshold 80 --strict |

| e2e_test_scaffolder.py | Playwright specs, page objects, fixtures and playwright.config.ts from Next.js routes, all written under --output | python scripts/e2e_test_scaffolder.py assets/sample_app/app --output /tmp/qa/e2e |

Exit codes: 0 ok; 1 coverage below --threshold when --strict is set (without

--strict the analyzer always reports and exits 0, so use --strict in CI); 2 bad input

(path not found, unparseable report). With --json the report goes to stderr and stdout is

pure JSON.

Generated stubs are a starting point: they render with valid required props and leave

TODO assertions, so they compile but assert nothing until you write the checks. The

sample LCOV has a payment file at 37.5% line coverage, so --strict --threshold 80 exits 1.

Workflow

  1. Generate stubs or scaffold E2E specs into the project's test folder (always pass --output).
  2. Replace every TODO with an assertion on behaviour the user can see (role, text, called handler); delete stubs that test nothing useful.
  3. Run the project's tests with coverage, then coverage_analyzer.py <report> --threshold <n> --strict.
  4. Done when the suite passes, the analyzer exits 0, and no generated test is still assertion-free.

References

Load the reference that matches the task — keep this file lean and pull detail on demand:

Scope & Limitations

This skill covers:

This skill does NOT cover:

Anti-Patterns

Shipping Generated Stubs as Tests

Mistake: Committing the generated files with their TODO assertions still in place.

Why it happens: They run green and raise the coverage number.

Instead: A render with no assertion only proves the component does not throw. Write the assertion or delete the case.

Querying by Test ID First

Mistake: Reaching for getByTestId for every element.

Why it happens: It is the most stable selector to write.

Instead: Prefer getByRole and getByLabelText: they test what users and assistive tech see, and fail when accessibility regresses. Keep test IDs for elements with no accessible name.

Gating on Overall Coverage Only

Mistake: Passing CI because the project average clears 80%.

Why it happens: One number is easy to configure.

Instead: Use --critical-paths and read the per-file gaps: a 37% payment module hidden behind a 90% average is the bug that ships.

Files

| File | Purpose |

|------|---------|

| scripts/test_suite_generator.py | Jest + RTL stub generator |

| scripts/coverage_analyzer.py | Coverage gap analyzer and CI gate |

| scripts/e2e_test_scaffolder.py | Playwright scaffolder for Next.js routes |

| assets/sample_components/Button.tsx | Component with a typed props interface for the generator |

| assets/sample_app/app/ | Two-route Next.js App Router tree for the scaffolder |

| assets/sample_lcov.info | LCOV report with an under-tested payment file (strict gate exits 1 at 80) |

| references/*.md | Workflows, CLI reference, strategies, automation patterns, best practices |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.