test-gate
Skill1 starsChanged 7 months agoMITView on GitHub
Verifies test coverage before PR creation. Triggers ONLY when: about to create a PR and need to verify tests exist, or after self-review passes. Do NOT trigger when: discussing testing strategy or during early development.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- stigmer/stigmertheir own version, first seen Nov 8, 2026
- Alex5350/arsenaltheir own version, first seen Nov 1, 2026
- Jaxsbr/sabstheir own version, first seen Oct 20, 2026
- Giamme/kent-testtheir own version, first seen Oct 15, 2026
- BrentRector/claude-skillstheir own version, first seen Oct 3, 2026
- Kohulan/orthonym-skillstheir own version, first seen Sep 29, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- stigmer/stigmer★ 9same name
- BrentRector/claude-skills★ 6same name
- gabrieldabbah/genesis★ 4same name
- Kohulan/orthonym-skills★ 2same name
- Giamme/kent-test★ 1same name
- Alex5350/arsenal★ 0same name
- Jaxsbr/sabs★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- claude.mdCLAUDE.md
- biz-thinkSkill
- biz-validateSkill
- brand-buildSkill
- community-engageSkill
- content-createSkill
- content-distributeSkill
- copy-craftSkill
- data-decideSkill
- finance-opsSkill
- growth-trackSkill
- infra-opsSkill
- issue-createSkill
- legal-guardSkill
- post-mergeSkill
- pre-codeSkill
- pre-commitSkill
- pre-prSkill
- product-evalSkill
- project-initSkill
- retroSkill
- roadmap-steerSkill
- sales-closeSkill
- search-evalSkill
- self-reviewSkill
- sopSkill
- staging-verifySkill
- support-opsSkill
- ux-auditSkill
- work-breakdownSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 10 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Before proceeding (PR creation, merge, or marking a feature as done), verify ALL three testing layers are satisfied.
- Distinctive: line 16
If the pyramid is inverted (more E2E than unit), refactor tests downward.
- Distinctive: line 93
Tests in same PR as feature: NEVER create a standalone "testing issue" to defer writing tests.
- Distinctive: line 94
Unit tests passing ≠ feature works: Must verify by running the actual app (dev server + browser or Playwright).
- Distinctive: line 96
Before fixing: reproduce the bug — prove it exists
- Distinctive: line 97
Write a failing test that captures the bug
- Distinctive: line 99
After fixing: reproduce again with the SAME steps — prove it's gone
- Distinctive: line 100
If you can't complete all steps, the bug is NOT fixed
- Distinctive: line 107
Before creating a PR, answer each question.
- Distinctive: line 127
All pass → "Run pre-commit"
“Common” is measured: kept by at least 6 in 10 of the 7 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.
Files
Test Gate — Testing Completeness Check
Before proceeding (PR creation, merge, or marking a feature as done), verify ALL three testing layers are satisfied.
Testing Pyramid (Martin Fowler)
- Base: Many fast unit tests — the foundation of confidence
- Middle: Fewer integration tests — verify real system interactions
- Top: Very few E2E tests — validate complete user flows
If the pyramid is inverted (more E2E than unit), refactor tests downward.
Three Layers — ALL Required
Layer 1: Unit Tests (mocked, isolated)
- Every function with logic gets a test — no exceptions
- Colocated with source files (
foo.test.tsnext tofoo.ts) - Must NOT depend on external systems (DB, network, filesystem) — use mocks/stubs to isolate
- Cover happy path AND edge cases, error conditions, boundary values
- Trigger: every feature, every PR
Layer 2: Integration Tests (real services)
- Hit real databases, real APIs, real auth — mocks hide real bugs
- Stored in
tests/integration/directory - Cover: DB queries, external API calls, webhooks, service interactions
- Trigger: the moment code connects to ANY external service (DB, third-party API, storage, auth)
- If API keys or env setup is needed — STOP and ask the user immediately. Do not silently skip.
Layer 3: E2E Tests (browser)
- Full user flow in a real browser (Playwright)
- Stored in
tests/e2e/directory - If the user can't click through it successfully, the feature is broken
- Trigger: the moment a user-facing flow can be completed end-to-end
Do NOT defer any layer to "a testing phase." Each layer is written at its trigger point.
Test Quality Rules (AAA + Isolation)
Structure: Arrange-Act-Assert
- Arrange — set up test data and preconditions
- Act — execute the single behavior under test
- Assert — verify the expected outcome
- Every test follows this three-phase structure explicitly
Isolation Principles
- Each test is fully isolated — no shared mutable state between tests
- No order dependency — tests pass in any sequence
- Each test tests ONE behavior — if the test name contains "and", split it
- Tests must be deterministic — no randomness, no time-dependency, no flaky tests
- Clean up after yourself — reset state, close connections, remove temp files
Naming & Readability
- Test names describe scenario and expected outcome:
shouldReturnEmpty_whenNoItems - Tests are production code — maintained, readable, no unnecessary complexity
- Avoid test helpers that obscure what is being tested
Verification (Google Engineering Practices)
- Tests must actually fail when code is broken — verify no false positives
- Mutation check: temporarily break the code and confirm the test catches it
- Never write a test that passes regardless of implementation correctness
What to Test
- Business logic and data transformations
- API endpoints: success cases, auth failures, validation errors, edge cases
- Integration points: DB queries, external APIs, webhooks
- User interactions: form submissions, navigation, error states
- ALL variants, not just the happy path — missing one variant = not tested
- Bug fixes: write a failing test FIRST that reproduces the bug, then fix, then verify the test passes
What NOT to Test
- Framework internals (Next.js routing, React rendering mechanics)
- Pure configuration files
- Third-party library behavior
Rules — Non-Negotiable
- No test = no feature. Code without tests is unfinished code. Do not proceed.
- Tests in same PR as feature. NEVER create a standalone "testing issue" to defer writing tests.
- Unit tests passing ≠ feature works. Must verify by running the actual app (dev server + browser or Playwright).
- Bug fix verification protocol:
- Before fixing: reproduce the bug — prove it exists
- Write a failing test that captures the bug
- Write the fix
- After fixing: reproduce again with the SAME steps — prove it's gone
- If you can't complete all steps, the bug is NOT fixed
- Test fixtures (sample input files, seed data) must be created alongside the feature, not deferred.
Pre-PR Checklist
Before creating a PR, answer each question. If any answer is "no", go back and fix it.
- Do unit tests exist for every new/changed function with logic?
- Do integration tests exist for every external service interaction?
- Do E2E tests exist for every completable user-facing flow?
- Are all test variants covered (not just happy path)?
- Does every test follow Arrange-Act-Assert structure?
- Is every test isolated (no shared state, no order dependency)?
- Do all tests pass locally?
- Have you verified tests actually fail when code is broken (no false positives)?
- Have you verified the feature works by actually running the app?
- Are test fixtures included (not deferred)?
- If integration tests need API keys, have you asked the user for them?
If any check fails, the feature is not ready for PR. Go back and complete it.
Next Steps
Report to user: "Tests: [N passed / N failed / N skipped]. Coverage: [summary]. Layers: [unit ✅/❌, integration ✅/❌, E2E ✅/❌]"
Suggested next steps (user decides):
- All pass → "Run pre-commit"
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

