assertion-quality

Analyzes assertion diversity and depth across test suites in any language.

1|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/D1ssolve/craft-agents --skill assertion-quality-d1ssolve
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: assertion-quality
Source: https://github.com/D1ssolve/craft-agents/tree/main/skills/assertion-quality
Command: npx skills add https://github.com/D1ssolve/craft-agents --skill assertion-quality-d1ssolve

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Test suites often pass while verifying very little: tests with no assertions, only trivial null checks, or tautological round-trip comparisons give false confidence. This Skill audits test code to measure how varied and meaningful the assertions actually are, exposing shallow testing before bugs slip through. ## Core Features & Use Cases - Assertion Classification: Categorizes every assertion into 12 language-neutral categories (equality, exception, negative, state/side-effect, structural/deep, and more) across frameworks like MSTest, xUnit, pytest, Jest, JUnit, Go testing, RSpec, and GoogleTest. - Diversity Metrics: Computes suite-wide metrics including average assertions per test, assertion type spread, zero-assertion tests, trivial-only tests, and self-referential assertion detection. - Calibrated Reporting: Applies calibration rules so exception tests, guard null checks, and mock verifications are not misflagged, then produces a summary dashboard, gap analysis, and prioritized recommendations. - Use Case: Point the Skill at a pytest or Jest test directory and ask whether the tests verify anything meaningful; it returns a metrics dashboard listing assertion-free tests, missing negative assertions, and concrete suggestions per test method. ## Quick Start Analyze the assertion quality of the tests in my project's test directory and report which tests are shallow or missing meaningful assertions.

Frequently Asked Questions about assertion-quality

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check if my tests have meaningful assertions?

Run an assertion diversity analysis over your test files. The Skill classifies every assertion into 12 categories, computes metrics like average assertions per test and assertion type spread, and flags tests with zero or only trivial assertions.

What is a trivial assertion in unit tests?

A trivial assertion verifies nothing meaningful, such as a lone null check like Assert.IsNotNull(result) or an always-true check like expect(true).toBe(true). A null check used as a guard before a real value assertion is not flagged as trivial.

Does assertion quality analysis work with pytest, Jest, and Go?

Yes, the analysis is polyglot and covers .NET, Python, TypeScript/JavaScript, Java, Go, Ruby, Rust, Swift, Kotlin, PowerShell, and C++ frameworks. It loads a language-specific extension file first so framework-specific assertion APIs are classified correctly.

What are self-referential or tautological assertions?

They compare an input to a round-tripped version of itself, such as Assert.AreEqual(input, Parse(input.ToString())), verifying plumbing rather than behavior. The Skill flags these separately from normal equality assertions unless the test's purpose is explicitly round-trip verification.

When should I not use assertion quality analysis?

Do not use it to write new tests, detect general anti-patterns like flakiness or duplication, or measure line-based code coverage. It only audits the quality and diversity of existing assertions, not test creation or coverage percentages.