testing-business-rules

testing-business-rules is a skill for Claude Code, Codex from luabagg/agent-skills. It costs 45 tokens per session (1,233 once invoked), scanned A, original, MIT.

A guide for writing tests around business rules and meaningful behavior. It treats a test as protection for a contract—such as validation, authorization, data integrity, ordering, retries, or a known regression—not merely a record of how code is currently written.

In plain words
What is it for?
Use it when adding, reviewing, or removing tests, deciding whether a function needs coverage, and choosing which branches or edge cases deserve assertions.
Why use it?
It reduces tests that only repeat implementation details or add many input variations without a distinct risk. This makes coverage more focused on failures that matter to users and systems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding, reviewing, or removing tests, deciding whether a function needs coverage, and choosing which branches or edge cases deserve assertions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/luabagg/agent-skills/testing-business-rules
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 luabagg/agent-skills --skill testing-business-rules
Clone the repo
git clone --depth 1 https://github.com/luabagg/agent-skills

Made for: Claude Code, Codex.

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 testing-business-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/luabagg/agent-skills/testing-business-rules/github.svg)](https://agentmods.dev/skills/luabagg/agent-skills/testing-business-rules)
Your own site
<a href="https://agentmods.dev/skills/luabagg/agent-skills/testing-business-rules"><img src="https://agentmods.dev/badge/skills/luabagg/agent-skills/testing-business-rules/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 testing-business-rules

Your own site · 80×15
<a href="https://agentmods.dev/skills/luabagg/agent-skills/testing-business-rules"><img src="https://agentmods.dev/badge/skills/luabagg/agent-skills/testing-business-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,233 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.00045 $0.01233
Opus 5.5 $0.00018 $0.00493
Sonnet 5.5 $0.00009 $0.00247
Haiku 4.5 $0.00005 $0.00123

Measured 2mo ago against content hash eeacaf3f3bfb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

testing-business-rules 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 2mo 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.

skills/testing-business-rules/SKILL.md · 90 lines

How it starts

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

Testing Business Rules

A test earns its place by protecting a meaningful behavior or contract, not by demonstrating today's implementation. A rule can be a product decision, a technical guarantee, or a consumer expectation.

Quick reference

Keep coverage for Reject or reshape
Domain behavior, API/provider contracts, numeric or ordering guarantees Assertions that merely restate the implementation
Validation, authorization, privacy, data integrity Input permutations with no distinct risk
Idempotency, retries, discard policies, persistence and queue integration Private helper calls or incidental call order
Observed regressions, including obvious mistakes Duplicate coverage with no additional failure detection
Boundaries with a named consequence Snapshots that freeze incidental output

Currency rounding can be a contract even when it uses simple arithmetic. Coverage metrics reveal gaps; they do not justify tests.

Procedure

1. Name the rule before writing the test

Record these in the test plan or review, not as boilerplate comments:

Rule: an empty tenant ID must never grant access to another tenant's records.
Established in: tenant-isolation security contract.
Failure: a caller reads another tenant's private records.

Find evidence in requirements, API documentation, callers, history, or incidents, not current output alone. Missing evidence requires investigation with owners and consumers, not coverage removal. Temporary characterization tests can support legacy refactoring; label unconfirmed assumptions instead of declaring permanent contracts.

2. Find the coverage gap

Identify the wrong behavior this test would catch. Compare failure modes, not lines executed: happy-path coverage does not cover an authorization bypass.

Keep regressions that protect valid rules and add detection, including obvious mistakes, manually detectable bugs, and bad decisions.

3. Choose the smallest honest boundary

Read the full file on GitHub · 90 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. 2mo ago Changed · +2 lines eeacaf3f3bfb
  2. 2mo ago First seen · 88 lines · 45 tokens per session scan A 57a1d46ba095

Subscribe to this mod's changes

testing-business-rules is a skill published in the GitHub repository luabagg/agent-skills (3 stars, last pushed 4d ago), licensed MIT. It adds 45 tokens to every session and 1,233 once invoked, about $0.0002 per session on Opus 5.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-09-23.

Related

testing-business-rules compared with skills from other repositories

testing-business-rules next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
testing-business-rulesluabagg/agent-skillsSkill34d agoMITA45Claude Code, Codex
migrate-xunit-to-xunit-v3managedcode/dotnet-skillsSkill52717d agoMITA149Claude Code, Codex
crap-scoremanagedcode/dotnet-skillsSkill52717d agoMITA99Claude Code, Codex
nunitmanagedcode/dotnet-skillsSkill52717d agoMITA146Claude Code, Codex
diagnostics-mcpmanagedcode/dotnet-skillsSkill52717d agoMITA82Claude Code, Codex
test-sqrlDataSQRL/sqrlSkill237todayApache-2.0A26Claude Code, Codex
testing-blocksadobe/skillsSkill342todayApache-2.0A114Claude Code