Skip to content
Development
Skill

/gate-tests

Audits test quality — assertion strength, boundary coverage, mock discipline, error path testing. Delegates to the tester agent for adversarial analysis. Internal gate — invoked by verify.

From plugin
specwright
1023 skills9 agents18 commands

Claude Code

$ npx -y skills add Obsidian-Owl/specwright --skill gate-tests --agent claude-code

SKILL.md

gate-tests.SKILL.md
name: gate-tests
description: >-
  Audits test quality — assertion strength, boundary coverage, mock
  discipline, error path testing. Delegates to the tester agent for
  adversarial analysis. Internal gate — invoked by verify.
allowed-tools:
  - Read
  - Bash
  - Glob
  - Grep
  - Write
  - Task

Gate: Test Quality

Goal

Ensure tests are actually worth having. Passing tests that don't catch bugs are worse than no tests — they create false confidence. This gate audits test quality, not just pass/fail.

Inputs

  • `{projectArtifactsRoot}/config.json` -- test commands, project language
  • `{projectArtifactsRoot}/TESTING.md` -- testing strategy with boundary classifications (optional)
  • `{repoStateRoot}/work/{selectedWork.id}/workflow.json` -- selected work unit
  • Test files in the codebase

Outputs

  • Evidence file at `{workDir}/evidence/test-quality.md`
  • Gate status in the selected work's `workflow.json`
  • Findings organized by category with specific file:line references

Constraints

**Scope (MEDIUM freedom):**

  • Focus on test files related to the current work unit.
  • Identify test files via convention (test/, __tests__/, *.test.*, *.spec.*).

**Analysis (HIGH freedom):**

  • Delegate to `specwright-tester` agent for adversarial test quality review.
  • The tester evaluates against these quality dimensions:
  • **Assertion strength**: Are assertions specific? (`toBe(42)` vs `toBeDefined()`)
  • **Boundary coverage**: Are edge cases tested? (empty, null, max, negative)
  • **Mock discipline**: Are mocks justified? Are integration boundaries real?
  • **Error paths**: Are failure scenarios tested? (network down, invalid input)
  • **Behavior focus**: Do tests verify behavior or implementation details?
  • **Mutation resistance**: Tiered analysis (T1/T2/T3) stays inside this gate; missing tools route to T2/T3, never a silent skip.
  • **T1**: configured tool-backed mutation run. Report concrete file:line evidence plus mutation score or restricted survivor details when available: operator, location, before/after, defect category, and action.
  • **T2**: LLM-generated mutation check when zero applicable mutants make T1 uninformative or when the configured LLM fallback is the active path. Report concrete file:line evidence plus the same restricted survivor details: operator, location, before/after, defect category, and action.
  • **T3**: qualitative floor when T1 errors, T2 errors, or fallback unavailable would otherwise leave the gate blind. Audit the three bypass classes: hardcoded returns, partial implementations, boundary skips.
  • Honor accepted-mutant lineage through the shared approval record and config contract instead of silently waiving survivors.
  • **Boundary test approach**: Validate mock-vs-integration decisions against TESTING.md boundary classifications per `protocols/testing-strategy.md`. WARN if internal boundary is mocked. INFO if TESTING.md absent.
  • **Tier distribution**: For each AC tagged with `[tier: integration]`, `[tier: contract]`, or `[tier: e2e]`, check whether corresponding tests exist at that tier. Use heuristics: integration tests touch multiple modules and use real infrastructure (Testcontainers, real DB, httptest with real handler); contract tests validate schema or shape at a boundary; E2E tests exercise a full flow. Verdicts: non-unit ACs with matching tier tests that pass → PASS. Non-unit ACs with tier-appropriate tests that fail → BLOCK (forces user decision at gate). Non-unit ACs with only unit-tier tests → BLOCK. Zero non-unit ACs in spec → PASS (nothing to check). When no tier-tagged ACs exist and TESTING.md is absent → INFO (no data to validate, no false positives).
  • Each weakness is a finding with severity and file:line reference.

**Verdict (LOW freedom):**

  • Follow `protocols/evidence.md#verdict-rendering`.
  • BLOCK findings: tests that verify nothing (e.g., `expect(result).toBeDefined()` only).
  • WARN findings: missing edge cases, over-mocking, weak assertions.
  • INFO findings: style suggestions, naming improvements.

Protocol References

  • `protocols/evidence.md#verdict-rendering` -- verdict rendering
  • `protocols/evidence.md` -- evidence storage
  • `protocols/state.md` -- gate status updates
  • `protocols/delegation.md` -- tester agent delegation
  • `protocols/testing-strategy.md` -- boundary classifications for mock-vs-integration validation

Failure Modes

| Condition | Action | |-----------|--------| | No test files found | Gate FAIL: "No tests found for this work unit" | | Tester agent unavailable | Fall back to inline analysis (less thorough) | | Project has no test framework | Gate SKIP with note |

Read more
@obsidian-owl
Ships withspecwright

Craft quality software with AI discipline. Spec-driven development plugin for Claude Code and Opencode — quality gates, adversarial testing, and evidence capture.

1023 skills9 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
10
Star history of Obsidian-Owl/specwright on GitHub, a chart by star-history.com

Other skills on specwright.

gate-build

gate-build

Runs configured build and test commands in tiered order. Captures output as evidence per tier. Returns PASS, FAIL, WARN, or SKIP…

gate-security

gate-security

Detects leaked secrets, injection patterns, and sensitive data exposure across changed files. Uses real tooling when configured,…

gate-semantic

gate-semantic

Tiered semantic analysis of changed code (rg → ast-grep → OpenGrep). Detects error-path bugs structural gates miss. Findings…

gate-spec

gate-spec

Maps every acceptance criterion from the spec to implementation evidence and test evidence. Criteria without evidence fail. The…

gate-wiring

gate-wiring

Detects unused exports, orphaned files, architecture layer violations, and circular dependencies across changed files. Delegates…

sw-adopt

sw-adopt

Explicitly adopt an existing work into the current worktree after validating live ownership, stale sessions, and branch…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about gate-tests.

Which coding agents can use gate-tests?
gate-tests installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.