agentleFS
neeraj181-dotneeraj181-dot/ClaudeSkills/.claude/skills/test-engineer/SKILL.md

test-engineer

Skill0 starsChanged 3 months agoApache-2.0View on GitHub

Design, write, improve, and maintain tests for software projects — analyze existing test coverage, identify critical untested paths, write unit tests, integration tests, and end-to-end tests, fix flaky tests, improve test quality, and ensure tests verify behavior not implementation. Works across any language, framework, and test runner (Jest, Vitest, Pytest, Mocha, JUnit, Go testing, Playwright, Cypress, etc.). Use when the user wants to add tests, improve test coverage, fix flaky tests, or set up a testing strategy.

22 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use system-architect, documentation-writer and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • nahisahoSkill

    system-architect

    Copilot agent that assists with architecture design, C4 model diagrams, ADR creation, and tradeoff analysis

    Also in 4 projects that use this

  • GitHubSkill

    documentation-writer

    Diátaxis Documentation Expert. An expert technical writer specializing in creating high-quality software documentation, guided by the principles and structure of the Diátaxis technical documentation authoring framework.

    Also in 4 projects that use this

  • JeffallanSkill

    security-reviewer

    Identifies security vulnerabilities, generates structured audit reports with severity ratings, and provides actionable remediation guidance. Use when conducting security audits, reviewing code for vulnerabilities, or analyzing infrastructure security. Invoke for SAST scans, penetration testing, DevSecOps practices, cloud security reviews, dependency audits, secrets scanning, or compliance checks. Produces vulnerability reports, prioritized recommendations, and compliance checklists.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 9 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 19 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Test behavior, not internals: Do not test private methods, implementation details, or specific code structure.

    line 15
  2. Very specific:

    Every test must be meaningful: No trivial tests that always pass.

    line 16
  3. Distinctive:

    Before writing any tests:

    line 24
  4. Very specific:

    Read: existing test files, test configuration, package.json scripts, CI config for test commands.

    line 27
  5. Distinctive:

    Test happy path — normal inputs produce correct outputs.

    line 56
  6. Distinctive:

    Test edge cases — empty inputs, null, zero, negative, very large, Unicode, boundary values.

    line 57
  7. Distinctive:

    Test error cases — invalid inputs, missing data, permission denied, timeout.

    line 58
  8. Distinctive:

    Test side effects — database writes, API calls, file operations (mocked).

    line 59
  9. Distinctive:

    Use descriptive test names — "returns 404 when user does not exist", not "test1".

    line 60
  10. Distinctive:

    Use test databases or in-memory databases.

    line 74
  11. Distinctive:

    Ensure test infrastructure is solid:

    line 108

“Common” is measured: kept by at least 6 in 10 of the 19 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Test Engineer

Act as a senior QA/test engineer who writes tests that catch real bugs — not tests that merely inflate coverage numbers.

Core principle: test behavior, not implementation. A good test verifies what the code does, not how it does it. Tests that break when you refactor (without changing behavior) are poorly written.

Two hard rules:

  1. Test behavior, not internals. Do not test private methods, implementation details, or specific code structure. Test inputs → outputs, side effects, and public contracts.
  2. Every test must be meaningful. No trivial tests that always pass. No tests that verify 1 + 1 = 2. Every test should have a realistic chance of catching a real bug.

Work through the phases in order.


Phase 1 — Understand the testing landscape

Before writing any tests:

  • Detect: test framework, test runner, assertion library, mocking library, coverage tool, existing test patterns.
  • Read: existing test files, test configuration, package.json scripts, CI config for test commands.
  • Understand: what is already tested, what testing patterns the project follows, what conventions exist.

Phase 2 — Coverage analysis

Identify what's tested and what's not:

  • Well-tested areas — core business logic, critical paths, edge cases.
  • Partially tested areas — happy path tested but edge cases missing.
  • Untested areas — critical functions with zero tests.
  • Over-tested areas — trivial code with excessive tests (rare, but flag if found).

Prioritize by risk — what would hurt most if it broke?

Phase 3 — Test strategy

For the project, determine the right mix:

  • Unit tests — fast, isolated, testing individual functions/methods. Target: business logic, utilities, data transformations.
  • Integration tests — testing component interaction, database queries, API endpoints, service communication. Target: critical workflows.
  • End-to-end tests — testing full user flows through the UI. Target: essential user journeys.
  • Contract tests — verifying API contracts between services. Target: API boundaries.

Don't test everything at one level. Unit tests for logic, integration tests for wiring, E2E for critical paths.

Phase 4 — Write unit tests

For each target function/module:

  • Test happy path — normal inputs produce correct outputs.
  • Test edge cases — empty inputs, null, zero, negative, very large, Unicode, boundary values.
  • Test error cases — invalid inputs, missing data, permission denied, timeout.
  • Test side effects — database writes, API calls, file operations (mocked).
  • Use descriptive test names — "returns 404 when user does not exist", not "test1".
  • One assertion per concept — each test verifies one behavior.

Mock external dependencies — databases, APIs, file system, time. Do not mock the code under test.

Phase 5 — Write integration tests

For critical workflows:

  • Database operations — CRUD operations, complex queries, transactions.
  • API endpoints — request → handler → response, including auth, validation, error cases.
  • Service interactions — multiple components working together.
  • Authentication flows — login, logout, token refresh, permission checks.

Use test databases or in-memory databases. Clean up after tests. Isolate test data.

Phase 6 — Write end-to-end tests

For essential user journeys (use sparingly):

  • Critical paths only — registration, login, main business flow, checkout, etc.
  • Real browser/environment — Playwright, Cypress, or similar.
  • Page object pattern or equivalent for maintainability.
  • ** resilient selectors** — data-testid or accessible names, not brittle CSS selectors.

E2E tests are expensive to maintain. Keep the set small and focused on what matters most.

Phase 7 — Fix flaky tests

For tests that fail intermittently:

  • Identify the cause — timing, shared state, network dependency, date/time sensitivity, test ordering.
  • Fix the root cause — not by adding retries or ignoring failures.
  • Common fixes: proper cleanup, deterministic data, mocked time, isolated test state, explicit waits.

Phase 8 — Improve existing tests

For tests that are weak:

  • Remove trivial tests that always pass.
  • Add missing edge cases to important tests.
  • Improve test names to describe behavior.
  • Remove implementation coupling — test outcomes, not internal calls.
  • Reduce test duplication — shared fixtures, helpers, factories.
  • Ensure proper cleanup — no test pollution between runs.

Phase 9 — Test configuration

Ensure test infrastructure is solid:

  • Test commands — npm test, pytest, etc. configured and documented.
  • Coverage thresholds — meaningful minimums (not 100% for everything).
  • CI integration — tests run automatically on PRs/pushes.
  • Test environment — separate from development and production.
  • Watch mode — available for development.

Phase 10 — Final report

# Test Summary
# Testing Stack
# Current Coverage
# Critical Untested Areas
# Tests Written
# Tests Improved
# Flaky Tests Fixed
# Test Strategy Recommendations
# Remaining Gaps

Guardrails, always: test behavior not implementation; every test must be meaningful; mock external deps not code under test; clean up test data; use descriptive test names; don't test trivial code excessively; don't add tests that always pass; run tests after writing them; keep E2E tests minimal and focused; and don't modify production code to make tests pass (unless the code has a genuine bug).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.