assertion-patterns

assertion-patterns is a skill for Claude Code, Codex from QBall-Inc/the-bulwark. It costs 26 tokens per session (2,468 once invoked), scanned A, original, MIT.

A collection of testing patterns for checking what a program actually produces instead of checking only mock calls. Mocks are pretend replacements for real parts of a program used during tests.

In plain words
What is it for?
Use it when reviewing or rewriting tests that rely too heavily on mocks. It also checks that tests import and exercise real production code.
Why use it?
Tests built around mocks can pass without proving that the real program works. These patterns help replace such checks with tests of observable behavior.

Skill for Claude CodeCodex

Part of the the-bulwark plugin — 30 skills, 17 agents, 6 hooks shipped together

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.

agentmods
npx agentmods add skills/qball-inc/the-bulwark/assertion-patterns
Any agent
npx skills add QBall-Inc/the-bulwark --skill assertion-patterns
Clone the repo
git clone --depth 1 https://github.com/QBall-Inc/the-bulwark

Made for: Claude Code, Codex.

Or install the-bulwark, the plugin that ships this one along with the rest of its 30 skills, 17 agents, 6 hooks.

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/qball-inc/the-bulwark/assertion-patterns.svg)](https://agentmods.dev/skills/qball-inc/the-bulwark/assertion-patterns)
Your own site
<a href="https://agentmods.dev/skills/qball-inc/the-bulwark/assertion-patterns"><img src="https://agentmods.dev/badge/skills/qball-inc/the-bulwark/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,468 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. Scan, not verified.
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.00026 $0.02468
Opus 5 $0.00013 $0.01234
Sonnet 5 $0.00005 $0.00494
Haiku 4.5 $0.00003 $0.00247

Measured 5d ago against content hash b931ddd05baf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 5d 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

Copies of this mod

1 near-identical copy found in the catalogue:

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

How it starts

The opening of the file, as written. The whole thing — 302 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

Functions in test files should follow specific naming patterns.

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

Subscribe to this mod's changes

assertion-patterns is a skill published in the GitHub repository QBall-Inc/the-bulwark (8 stars, last pushed yesterday), licensed MIT. It adds 26 tokens to every session and 2,468 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). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

ros2-microros

Skill "ros2-microros" from Leehyunbin0131/claude-ros2-skills, covering micro-ros instructions (ubuntu 24.04 lts & ros 2 jazzy), 1. architecture, 2. documentation entry points, 3. key concepts & patterns and a. embedded client node setup (rclc in c).

Leehyunbin0131/claude-ros2-skills · 29 tokens

ros2-troubleshooting

Diagnose ROS 2 Jazzy faults that reading the code cannot settle: QoS mismatch, sensor-mount and frame errors (REP 103/105), and odometry calibrated against CAD instead of the floor. Ships four runnable pass/fail checks.

Leehyunbin0131/claude-ros2-skills · 57 tokens

create-site

Creates a new Power Pages code site (SPA) using React, Angular, Vue, or Astro. Guides through the full process from initial concept to deployed site: requirements discovery, scaffolding, component planning, design, implementation, validation, and deployment. Use when the user wants to create, build, or scaffold a new…

microsoft/power-platform-skills · 73 tokens

configure-env-variables

Configures environment variables for Power Pages site settings to support ALM across environments. Creates environment variable definitions in Dataverse, guides the user through linking site settings to those variables via the Power Pages Management app, adds the variables to the solution, and generates a…

microsoft/power-platform-skills · 119 tokens

deploy-site

Deploys an existing Power Pages code site to a Power Pages environment using PAC CLI. Handles tooling verification, authentication, environment confirmation, building, and uploading. Use when the user wants to deploy, upload, or publish their code site.

microsoft/power-platform-skills · 50 tokens

tidewave-integration

Tidewave MCP runtime tools — debugging, smoke testing, live state inspection, SQL queries, hex docs. Use when evaluating code in a running Phoenix app.

oliver-kriska/claude-elixir-phoenix · 38 tokens