Backend Test Patterns

Backend Test Patterns is a skill for Claude Code, Codex from niels-emmer/myace. It costs 33 tokens per session (786 once invoked), scanned A, original, MIT.

A backend testing guide for checking bad input, boundary values, concurrent writes, retries, and partial failures—not only the successful path.

In plain words
What is it for?
Use it when testing or reviewing endpoints, service methods, or database-related changes that accept input or modify shared state.
Why use it?
It helps reveal the failure conditions that can cause production incidents but are often missed by demo-focused tests.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for aider. Also seen: mentions Codex; built for aider; mentions OpenCode.

Good fit Use it when testing or reviewing endpoints, service methods, or database-related changes that accept input or modify shared state.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/niels-emmer/myace/backend-test-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 niels-emmer/myace --skill backend-test-patterns
Clone the repo
git clone --depth 1 https://github.com/niels-emmer/myace

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 Backend Test Patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/niels-emmer/myace/backend-test-patterns.svg)](https://agentmods.dev/skills/niels-emmer/myace/backend-test-patterns)
Your own site
<a href="https://agentmods.dev/skills/niels-emmer/myace/backend-test-patterns"><img src="https://agentmods.dev/badge/skills/niels-emmer/myace/backend-test-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 786 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.00033 $0.00786
Opus 5 $0.00016 $0.00393
Sonnet 5 $0.00007 $0.00157
Haiku 4.5 $0.00003 $0.00079

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

Security

Grade A, and why

Backend Test Patterns 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 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.

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.

collections/additional/backend/skills/backend-test-patterns/SKILL.md · 38 lines

How it starts

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

Purpose

A backend test suite that only exercises the happy path proves the feature can work, not that it's safe. This skill is guidance for rounding out test coverage on the paths that actually cause incidents: bad input, concurrent access, and partial failure — the situations a demo never hits but production eventually will.

When to use it

Whenever you finish implementing an endpoint, service method, or migration-adjacent code path and are writing or reviewing its tests. Especially relevant for anything that mutates state, touches more than one row/table, or could be called concurrently or retried.

Bad-input coverage

  • For every field an endpoint accepts, test at least one case of: missing when required, wrong type, out-of-range value, and a value that's syntactically valid but semantically nonsensical (e.g. an end date before a start date).
  • Test the boundary values, not just clearly-invalid ones — the empty string, zero, the maximum allowed length, a list with one item versus the max allowed items.
  • Confirm the response on bad input, not just that it fails: right status code, error shape matches the rest of the API, and no internal detail (stack trace, DB error text) leaked into the body.

Concurrency and race coverage

  • For anything backed by a uniqueness constraint (can't have two of the same thing), write a test that attempts two near-simultaneous creates and confirms exactly one succeeds with a sane error on the other — not a crash or a silent duplicate.
  • For read-modify-write logic (increment a counter, transition a status field), consider what happens if two requests interleave. If the code relies on an optimistic-locking version check or a database-level atomic operation, test that the loser of the race gets a clear conflict response rather than silently clobbering the winner's update.
  • These don't always need true multi-threaded tests — simulating the interleaving directly (e.g. issuing the two writes in the order a race would produce, or asserting the query includes the guard condition it needs) is often enough to catch the bug without a flaky concurrency test.

Read the full file on GitHub · 38 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 · 38 lines · 33 tokens per session scan A 31441227e890

Subscribe to this mod's changes

Backend Test Patterns is a skill published in the GitHub repository niels-emmer/myace (1 stars, last pushed yesterday), licensed MIT. It adds 33 tokens to every session and 786 once invoked, about $0.0002 per session on Opus 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-08-31.