assertion-patterns

assertion-patterns is a skill for Claude Code 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 Code

Written for Claude Code: allowed-tools in frontmatter.

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

Good fit Use it when reviewing or rewriting tests that rely too heavily on mocks. It also checks that tests import and exercise real production code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/qball-inc/the-bulwark/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 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.

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/github.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/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 assertion-patterns

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Server-Side Request Forgery · line 128
    Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.
    Fix: Avoid requests to loopback/link-local/private hosts from skill code. If internal access is intended, document it and validate the target against an allowlist.
How audits are shown
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.5 $0.00010 $0.00987
Sonnet 5.5 $0.00005 $0.00494
Haiku 4.5 $0.00003 $0.00247

Measured 1mo ago against content hash b931ddd05baf, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-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 1mo 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. 1mo 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.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-development

Implement or change ROS 2 Jazzy packages, nodes, interfaces, launch files and configuration in a colcon workspace. Use for building and validating a development change, including tests that report success without running. For a live QoS, TF, IMU or odometry fault, use ros2-troubleshooting.

Leehyunbin0131/claude-ros2-skills · 67 tokens

journey-simulation

Use when caller wants to observe how a stranger encounters a flow, artifact, or sandbox — triggers like "simulate a user journey", "test our onboarding / checkout / signup", "will my ICP convert", "how does a cold reader experience this README", "first-time user test", "cognitive walkthrough", or any request to…

RockyHong/super-bootstrap · 79 tokens

black-box-test

Use as an INDEPENDENT tester agent to test another agent's intesting ticket from the OUTSIDE — never your own, and never from the implementation diff. You test from the operational test contract + acceptance criteria only (never HOW it was built), writing one automated test per criterion that invokes the changed…

tmj-90/gaffer · 135 tokens

java-conventions

Use when a ticket adds or changes Java code and it must follow the repo's Java conventions — Effective Java, modern Java (records, sealed types, pattern matching, switch expressions), Optional discipline, immutability, try-with-resources, thread safety and virtual threads, Spring Boot constructor injection, and JUnit…

tmj-90/gaffer · 106 tokens

python-conventions

Use when a ticket adds or changes Python code and it must follow the repo's Python conventions — PEP 8, full type hints (PEP 484) checked by mypy/pyright, dataclasses, pythonic idioms, explicit error handling, asyncio and thread safety, ruff-clean, and pytest with coverage via the repo's env manager (uv/poetry).…

tmj-90/gaffer · 120 tokens

add-integration-test

Use when a ticket asks for integration or end-to-end coverage across components — an API route hitting a database, a service-to-service call, a multi-step flow, file or database persistence, concurrent writers, crash recovery — rather than a single unit. Invoke for "test the endpoint end to end", "cover the checkout…

tmj-90/gaffer · 91 tokens