doughnut: Skill for Claude Code

.agents/skills/backend-testing/SKILL.md

backend-testing is a skill for Claude Code from nerds-odd-e/doughnut. It costs 41 tokens per session (1,318 once invoked), scanned A, original, MIT.

Guidance for testing the Java backend with JUnit, a Java testing framework, including controller-level tests, database-backed setup, and test builders.

In plain words
What is it for?
Use it when writing or changing backend tests for HTTP behaviour, services, repositories, transactions, or parameterised cases.
Why use it?
It encourages tests at stable user-visible boundaries and avoids brittle tests that depend too heavily on internal implementation details.

Skill for Claude Code

Written for Claude Code: paths in frontmatter. Also seen: installed under .agents/ (shared by several agents).

This is nerds-odd-e/doughnut's own configuration. It tells Claude Code how to work on doughnut itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything doughnut configures →

Reuse

Borrowing it

Nothing to install: this file belongs to nerds-odd-e/doughnut. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/nerds-odd-e/doughnut/main/.agents/skills/backend-testing/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/nerds-odd-e/doughnut

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 backend-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/nerds-odd-e/doughnut/backend-testing/github.svg)](https://agentmods.dev/skills/nerds-odd-e/doughnut/backend-testing)
Your own site
<a href="https://agentmods.dev/skills/nerds-odd-e/doughnut/backend-testing"><img src="https://agentmods.dev/badge/skills/nerds-odd-e/doughnut/backend-testing/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 backend-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/nerds-odd-e/doughnut/backend-testing"><img src="https://agentmods.dev/badge/skills/nerds-odd-e/doughnut/backend-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,318 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.00041 $0.01318
Opus 5.5 $0.00016 $0.00527
Sonnet 5.5 $0.00008 $0.00264
Haiku 4.5 $0.00004 $0.00132

Measured 26d ago against content hash 219693d517f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

backend-testing 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 26d 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.

.agents/skills/backend-testing/SKILL.md · 118 lines

How it starts

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

Backend Testing Rules

Style ("small test" practice — stable boundary, data over mocks, focused assertions, concise makeMe): the unit-testing skill — follow that first.

Commands

Run backend verification from the repo root:

CURSOR_DEV=true nix develop -c pnpm backend:verify

When no database migration is involved, this is faster:

CURSOR_DEV=true nix develop -c pnpm backend:test_only

Always run all backend unit tests instead of a selected file or test case.

For dough-test-optimization, use backend:test_only as both the ordinary feedback measurement and profiling run. Per-test timings are the time attributes in backend/build/test-results/test/TEST-*.xml; keep any derived raw profile outside committed files. To count Spring context boots, temporarily add logging.level.org.springframework.test.context.cache=DEBUG to backend/src/test/resources/application.properties (a logback-test.xml logger is overridden by the test profile's logging.level.root=OFF); each rise in the logged missCount is one boot. Revert it afterwards.

Core Principles

Backend application of the "small test" style (unit-testing skill):

  1. Prefer controller (or other HTTP-stable-boundary) tests for behavior users see through HTTP. These tests often do not reference the internal class you edited; cover services/repos via realistic makeMe preconditions and the real DB.
  2. Test services and algorithms directly only when they are an independent, intentional domain-stable contract (pure logic or algorithms).
  3. Keep tests small and focused: one behavior per test and descriptive names that explain the behavior.

Controller-style example:

@Test
void shouldBeAbleToSaveNoteWhenValid() throws UnexpectedNoAccessRightException {
  Note note = makeMe.aNote().creatorAndOwner(userModel).please();
  final NoteRealm noteRealm = controller.show(note);
  assertThat(noteRealm.getId(), equalTo(note.getId()));
}

Prefer injecting the controller on ControllerTestBase (as above). Every Spring test of the test profile extends SpringTestBase (testability package), directly or through ControllerTestBase, so the suite shares one application context. Do not add @AutoConfigureMockMvc or extra @MockitoBean / @TestBean on a subclass unless that exact annotation mix already exists — each unique mix caches another ApplicationContext and Hikari pool; CI MySQL then fails with Too many connections while a local run still passes. To observe a package-private persistence table, query through EntityManager rather than opening a new MockMvc context.

Read the full file on GitHub · 118 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. 26d ago Changed · +2 lines 219693d517f9
  2. 1mo ago Changed · +1 lines 6d7b5ea41116
  3. 1mo ago Changed · +8 lines a85c0db80cec
  4. 1mo ago Changed · +1 lines 035c08bb3f4a
  5. 1mo ago First seen · 106 lines · 41 tokens per session scan A bdb321a2ede9

Subscribe to this mod's changes

backend-testing is a skill published in the GitHub repository nerds-odd-e/doughnut (50 stars, last pushed today), licensed MIT. It adds 41 tokens to every session and 1,318 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-17.

Related

Other skills, from other repositories

sync-new-data-type

Adds scaffolding for a new Sync data type in Chromium across protocol buffers, DataType definitions, feature flags, controller builders, unit tests, and metrics.

chromium/chromium · 36 tokens

generate-testability-wrappers

DO NOT USE when the target already consumes an injected interface or built-in abstraction such as IFileSystem or TimeProvider, even if the request says "generate a wrapper"; no new wrapper is needed. Use only when C# source calls an ambient/static dependency and no injectable seam exists: first-time TimeProvider…

dotnet/skills · 147 tokens

convex-test

Generate convex-test tests for the app's Convex functions.

openclaw/clawhub · 16 tokens

testing

Testing and code quality context for Jest, React Testing Library, ESLint, and test patterns. Use when writing tests or fixing linting issues.

Team-Commonly/commonly · 31 tokens

platform-apex-test-generate

Use to generate and validate Apex test classes with TestDataFactory patterns, bulk testing (251+ records), mocking, assertions, and disciplined test-fix loops. Use when creating Apex test classes (for triggers, services, controllers, batch jobs, queueables, and callouts), improving coverage, debugging or fixing…

forcedotcom/sf-skills · 116 tokens

platform-apex-test-run

Apex test execution, coverage analysis, and test-fix loops with 120-point scoring. Use when the user runs Apex tests, checks code coverage, fixes failing tests, or touches Test.cls / Test.cls files. DO NOT TRIGGER when writing Apex production code (use platform-apex-generate), Agentforce agent testing (use…

forcedotcom/sf-skills · 92 tokens