kiro-rails: Command for Claude Code

.claude/commands/review-test-quality.md

review-test-quality is a command for Claude Code from sourjya/kiro-rails. It costs 28 tokens per session (2,052 once invoked), scanned A, original, MIT.

A review of whether a test suite actually catches broken behavior, rather than merely running successfully.

In plain words
What is it for?
Use it after features, before merging large changes, when tests become flaky or slow, or after an incident to check that regressions are covered.
Why use it?
It exposes missing coverage, weak checks, absent failure cases, excessive test doubles, and tests that could pass even when the code is wrong.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is sourjya/kiro-rails's own configuration. It tells Claude Code how to work on kiro-rails itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything kiro-rails configures →

Reuse

Borrowing it

Nothing to install: this file belongs to sourjya/kiro-rails. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/sourjya/kiro-rails/main/.claude/commands/review-test-quality.md
Clone the repo
git clone --depth 1 https://github.com/sourjya/kiro-rails

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for review-test-quality

README.md
[![agentmods](https://agentmods.dev/badge/commands/sourjya/kiro-rails/review-test-quality/github.svg)](https://agentmods.dev/commands/sourjya/kiro-rails/review-test-quality)
Your own site
<a href="https://agentmods.dev/commands/sourjya/kiro-rails/review-test-quality"><img src="https://agentmods.dev/badge/commands/sourjya/kiro-rails/review-test-quality/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for review-test-quality

Your own site · 80×15
<a href="https://agentmods.dev/commands/sourjya/kiro-rails/review-test-quality"><img src="https://agentmods.dev/badge/commands/sourjya/kiro-rails/review-test-quality.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,052 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.02052
Opus 5 $0.00014 $0.01026
Sonnet 5 $0.00006 $0.00410
Haiku 4.5 $0.00003 $0.00205

Measured 12d ago against content hash 33d7b2c953c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

review-test-quality scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/review-test-quality.md · 158 lines

How it starts

The opening of the file, as written. The whole thing — 158 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Before scanning, read docs/testing/ and docs/decisions/ if they exist. Use documented test strategy decisions to distinguish intentional coverage gaps from accidental omissions.

Act as a principal-level software engineer and test architect performing a comprehensive test quality audit.

Your mission is not to count tests. It is to determine whether the test suite would actually catch regressions, prevent defects, and remain maintainable as the codebase grows. A test that runs green but verifies nothing is worse than no test at all.


Activation Triggers

Run this review when:

  • A feature is complete and test coverage is claimed
  • At sprint end to assess overall test health
  • When flaky tests are reported or test suite runtime is growing
  • Before merging a large feature branch
  • After a production incident to verify regression coverage

Classification Lenses

Apply these four lenses when classifying findings. They are not scoring dimensions - they are frames for understanding why a gap matters.

  • Risk lens: Is this gap in a high-business-impact area (auth, payments, data mutation, job processing)? Effort should be proportional to quality risk, not line count.
  • Breadth lens: Does the suite cover both technology-facing tests (unit, integration) and business-facing tests (contract, E2E, acceptance)? Flag where an entire quadrant is missing.
  • Portfolio lens: Is the pyramid inverted? Too many E2E tests and no unit coverage is brittle and expensive. Too many unit tests with no integration coverage is blind to real system behavior.
  • Isolation lens: Classify gaps by test size - small (single process, no I/O), medium (cross-tier, controlled dependencies), large (full stack, real services). Flag where size and intent are mismatched.

Review Objectives

Identify:

  1. Assertion quality. Tests that make no meaningful assertions, assert trivially true conditions, or assert implementation details instead of behavior. Flag tests where removing the production code would still pass the test.
  2. Over-mocking. Tests that mock so many dependencies that the test no longer exercises any real logic. Flag when a mock is standing in for the thing actually being tested.
  3. Under-isolation. Tests that rely on external state, filesystem, network, or database without intent - causing flakiness, ordering sensitivity, or environment coupling.
  4. Test data hygiene. Hardcoded magic values, shared mutable fixtures, or test data that encodes business rules in the test rather than deriving them from the system under test.
  5. Coverage gaps on critical paths. Untested public interfaces, business-critical flows (auth, payments, data mutations, job processing), and service boundary contracts. Flag whether gaps are isolated or systemic per layer.
  6. Flakiness patterns. Inspect for the following root causes: order dependency between tests, async wait assumptions (sleep, arbitrary timeouts), shared mutable state, non-hermetic test data, time or randomness dependencies, and network or filesystem side effects. Reruns that mask flakes are mitigation, not a fix - flag them.
  7. Test structure and readability. Missing or misleading test names, tests that verify multiple unrelated behaviors in one case, and tests where the failure message gives no useful diagnostic information.
  8. Repeated setup and teardown. Copy-pasted fixture construction, repeated mock configuration, and missing test factories or builders that would eliminate duplication.
  9. Test type imbalance. Overreliance on a single layer. Flag where the portfolio is inverted or missing a tier entirely. Apply the portfolio lens: many fast low-level tests, fewer broad integration tests, minimal E2E only where behavior cannot be verified otherwise.
  10. Contract and boundary testing. Missing tests at service boundaries, API contracts, event schemas, and external integrations. Flag where a third-party interface change would go undetected.
  11. Test coupling to implementation. Tests that break when internal refactoring occurs without behavior change, indicating tests are coupled to structure rather than intent.
  12. Dead or disabled tests. Skipped, commented-out, or xtest / xit tests without explanation. Flag whether these represent known failures, deferred work, or forgotten cleanup.
  13. Missing negative and edge case coverage. Tests that only cover the happy path. For every critical input-handling path, check: invalid input, boundary values (min, max, off-by-one), empty/null/zero states, concurrent access, and error propagation. Apply boundary-value and equivalence-partitioning thinking: are representative values from each input class tested?
  14. Changed code without tests. For any recently added or modified module, service, Lambda handler, or public interface - flag whether corresponding tests exist or were updated. A gap here is a direct regression risk.
  15. CI orchestration gaps. Flag: coverage reports not published as CI artifacts, test results not exported in a parseable format (e.g. JUnit XML), no matrix coverage for OS or runtime versions where relevant, flaky-test reruns configured without underlying fixes, and missing fail-fast or concurrency cancellation settings that cause slow or misleading CI feedback.
  16. AI-generated test artifacts. Tests with verbose boilerplate that restates the test name, mock configurations that mirror the production code structure exactly, and test suites that were clearly generated in bulk without knowledge of actual system behavior.

Read the full file on GitHub · 158 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 158 lines · 28 tokens per session scan A 33d7b2c953c6

Subscribe to this mod's changes

review-test-quality is a command published in the GitHub repository sourjya/kiro-rails (9 stars, last pushed 1mo ago), licensed MIT. It adds 28 tokens to every session and 2,052 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.