assertion-patterns

assertion-patterns is a skill for Claude Code from ashaykubal/essential-agents-skills. It costs 26 tokens per session (2,467 once invoked), scanned A, a copy of assertion-patterns, MIT.

A guide for replacing mock-based test checks with tests that verify real, observable results from production code.

In plain words
What is it for?
Use it when reviewing or rewriting tests, especially tests flagged by test-audit or used in verification scripts.
Why use it?
Mocks can make a test pass without proving that the actual application behavior works, so these patterns help expose that weakness.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Good fit Use it when reviewing or rewriting tests, especially tests flagged by test-audit or used in verification scripts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ashaykubal/essential-agents-skills/assertion-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ashaykubal/essential-agents-skills --skill assertion-patterns
Clone the repo
git clone --depth 1 https://github.com/ashaykubal/essential-agents-skills

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 assertion-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/ashaykubal/essential-agents-skills/assertion-patterns.svg)](https://agentmods.dev/skills/ashaykubal/essential-agents-skills/assertion-patterns)
Your own site
<a href="https://agentmods.dev/skills/ashaykubal/essential-agents-skills/assertion-patterns"><img src="https://agentmods.dev/badge/skills/ashaykubal/essential-agents-skills/assertion-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,467 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 98% copy Near-identical to another mod 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.00026 $0.02467
Opus 5 $0.00013 $0.01234
Sonnet 5 $0.00005 $0.00493
Haiku 4.5 $0.00003 $0.00247

Measured 7d ago against content hash 117b0341d00e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

assertion-patterns scanned grade A with 2 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 7d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

| `expect(fetch).toHaveBeenCalledWith(url)` | `const resp = await fetch(url); expect(resp.status).toBe(200)` |

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

| `expect(spawn).toHaveBeenCalledWith(cmd, args)` | `const output = execSync(cmd); expect(output).toContain(expected)` |
Origin

This is a copy

98% identical to assertion-patterns — 597 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/assertion-patterns/SKILL.md · 297 lines

How it starts

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

Assertion Patterns

Purpose

Transform T1-T4 violating assertions into real behavior verification. This skill provides pattern libraries for converting mock-based tests to tests that verify observable output.

When to Use

Load this skill when:

  • Rewriting tests flagged by test-audit
  • Generating verification scripts via bulwark-verify skill
  • Implementing test-audit Step 7 rewrites

Prerequisite Checks (T0) - CRITICAL

Before checking T1-T4 violations, verify these prerequisites. Tests failing these checks are "testing nothing real" - they pass but provide zero confidence.

T0.1: Production Module Imports

Test files MUST import functions from actual production modules.

Valid Invalid
import { calculate } from '../src/calculator' Function defined within test file
from calculator import add def add(a, b): return a + b in test

Detection:

  • Scan test file for function definitions
  • Check if tested functions are imported vs defined inline
  • Flag if test calls functions not imported from production code

Violation Response:

"Test defines production logic inline. Move {function_name} to production module and import it. Tests should verify production code, not self-defined code."

T0.2: Separation of Concerns

Test files MUST NOT contain functions representing production logic.

Allowed in test files:

  • Test functions (test_*, it(), describe())
  • Test helpers/fixtures (make_*, create_*, setup_*)
  • Mock factories (mock_*, fake_*, stub_*)
  • Pytest fixtures (@pytest.fixture)

Not allowed:

  • Business logic functions
  • Utility functions that should be in production
  • Any function that would make sense in src/

Detection:

  • Identify all function definitions in test file
  • Check naming patterns against allowed prefixes
  • Flag functions that don't match test/helper patterns

T0.3: Function Naming Conventions

Read the full file on GitHub · 297 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. 7d ago First seen · 297 lines · 26 tokens per session scan A 117b0341d00e

Subscribe to this mod's changes

assertion-patterns is a skill published in the GitHub repository ashaykubal/essential-agents-skills (2 stars, last pushed 1mo ago), licensed MIT. It adds 26 tokens to every session and 2,467 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). It is 98% identical to assertion-patterns, differing in 597 lines, and is treated as a copy.

Related

Other skills, from other repositories

research-engineer

An uncompromising Academic Research Engineer. Operates with absolute scientific rigor, objective criticism, and zero flair. Focuses on theoretical correctness, formal verification, and optimal implementation across any required technology.

davila7/claude-code-templates · 43 tokens

tika-eval-compare

Compare extracts from two Tika builds over a corpus to detect regressions in content, encoding, exceptions, and embedded-document handling. Use for "compare before/after extracts", "eval this change against the corpus".

apache/tika · 50 tokens

neuron-evaluation-engineer

Create and run AI evaluations with datasets, assertions, and output drivers in Neuron AI. Use this skill whenever the user mentions evaluation, testing AI systems, creating evaluators, dataset-driven testing, assertion-based validation, or wants to measure AI system performance. Also trigger for tasks involving…

neuron-core/neuron-ai · 77 tokens

jetson-validate-image

Use after jetson-flash-image to run static BSP checks, on-target smoke/regression tests on a flashed DUT, or both. Not for build or flash steps. Triggers: validate bsp, on-target validation.

NVIDIA/skills · 50 tokens

atmos-validation

Validate Atmos projects, components, arbitrary JSON Schema inputs, EditorConfig, and GitHub Actions; use affected-file selection and native CI annotations.

cloudposse/atmos · 31 tokens

skill-benchmark

Benchmark AI skill effectiveness by measuring implementation quality against legacy constraints.

HoangNguyen0403/agent-skills-standard · 16 tokens