agentleFS
chatquillchatquill/claude-code-websites/.claude/skills/test-setup/SKILL.md

test-setup

Skill1 starsChanged 23 days agoMITView on GitHub

Sets up the project's test infrastructure for its stack: unit/component runner, integration tests against a real test database (Docker Compose), Playwright e2e with axe, coverage, fixtures and CI-ready scripts. Use after /setup-stack, when tests are missing, or when the test setup is broken.

  • Installs packages

14 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write each file after approval.

    line 51

“Common” is measured: kept by at least 6 in 10 of the 13 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 Setup

Gives the project the three test layers the TDD workflow needs, with commands that run identically on a laptop and in CI.

Inputs

  • project.yaml → stack.*, stack.test_unit, stack.test_e2e
  • .claude/docs/stack-matrix.md: the runner, commands and conventions per stack
  • Existing config (vitest.config.*, jest.config.*, pytest.ini/pyproject.toml, playwright.config.*, phpunit.xml, .rspec)
  • bash .claude/scripts/detect-stack.sh to confirm what is installed

Phases

Phase 1: Inventory

Report what exists and what is missing per layer. If stack.test_unit is null, recommend the matrix default (Vitest for Vite/TS stacks, Jest only if already present, pytest, go test, Pest/PHPUnit, RSpec/Minitest) and set it after approval.

Phase 2: Plan

Spawn test-engineer to propose:

  • Unit/component: runner config, Testing Library for UI, path aliases matching the app, tests/unit/ and colocated component tests
  • Integration: docker-compose.test.yml with Postgres (and Redis if used) on non-default ports; per-run database (or per-worker schema) with migrations applied; factories/fixtures; MSW/respx/httptest for third-party HTTP
  • E2E: playwright.config.ts with webServer starting the app, baseURL from BASE_URL, traces on first retry, projects for chromium (+ mobile viewport); @axe-core/playwright helper; auth storage-state setup
  • Scripts: test, test:unit, test:integration, test:e2e, test:coverage (or Makefile/composer/rake equivalents) so bash .claude/scripts/test-run.sh finds them
  • Coverage thresholds by rigor (minimal none, standard 70% lines on src/ logic, full 80% + changed-lines coverage in CI)

Show the file list and ask.

Phase 3: Write and verify

Write each file after approval. Install commands (e.g. pnpm add -D vitest @testing-library/react @playwright/test @axe-core/playwright) are printed for the user to run or approved individually. Add one smoke test per layer and run bash .claude/scripts/test-run.sh all; show the result.

Next step

/ci-setup to run these in CI, or /dev-story.

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.