skills/dual-testing/SKILL.md
Language-agnostic strategy for testing code at the boundary with external infrastructure (databases, APIs, queues): integration tests with real infrastructure (e.g. Testcontainers) prove the full chain works for happy paths; unit/slice tests with mocks prove error-handling and mapping logic (domain error to status, input validation, infra failure). Works in any language/framework — Go, .NET/C#, Java, Python, TypeScript and more — with concrete references for Go, .NET (ASP.NET Core) and Java (Spring Boot) and an explicit path to adapt when no reference matches your language. Apply when designing a test strategy, creating a handler/feature/worker that needs tests, or deciding what type of test a scenario needs. Triggers: 'dual testing', 'integration vs unit', 'testcontainers vs mocks', 'what type of test', 'where should this test go', 'error path coverage'. Does NOT trigger on writing individual test assertions or test naming conventions (use test-namer for those).
npx skillsauth add mryll/skills dual-testingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A language-agnostic strategy for code at the boundary between your application and external infrastructure: integration tests prove the full chain works for happy paths; unit/slice tests prove the error-handling and mapping logic. It aligns with the Testing Honeycomb / Test Diamond philosophy — boundary code is dominated by interaction complexity, so lean on integration for wiring and on fast mock-based tests for the branchy error logic.
The strategy is the same in every language. Only the tooling changes. Concrete per-language references are listed at the bottom; if none matches your language, the Adapt When No Reference Exists algorithm tells you how to apply it anyway.
@ControllerAdvice, error middleware), so the right test is a framework slice (in-process pipeline with the service mocked), not a pure class unit test.Where a scenario belongs. The "outcome" is described generically — map it to your transport: HTTP status, gRPC status code, CLI exit code + stderr, or queue ack/nack/retry/dead-letter.
[] not null) — Integration: contract verified with real data.Do not bake specific status numbers into the strategy. HTTP 499 in particular is client-closed-request (nginx-specific), not a portable code — keep such codes in a transport-specific note, never in the portable list.
Make the boundary mockable without coupling tests to infrastructure:
ListItems, DeleteItem); never mock Query/Rows/Tx. Driver-level mocks test SQL strings, not behavior, and are fragile.errors.Is(err, ErrNotFound), Rust Result); languages that throw use typed exceptions (NotFoundException) caught at the mapping layer (@ControllerAdvice, exception filter, error middleware). The mapping decision is identical; only the mechanism differs — and because the mapping layer is often a separate class, the test that covers it is usually a slice test.The same split applies to consumers and workers:
Trade-offs, not hard rules:
[], not null — verify in integration. (The language-specific mechanics, if any, live in the per-language reference.)The dual strategy is specifically for code that sits at the boundary between your application and external infrastructure (databases, APIs, message queues).
If a reference matches your language or framework, read only that reference before writing tests. The core above tells you what belongs in each layer; the reference gives the idiomatic tooling, test shape, and language-specific gotchas — the core alone is not enough to get the idioms right.
WebApplicationFactory, Moq) — references/dotnet.md@ServiceConnection, MockMvc, Mockito) — references/java.mdNo reference for your language/framework? Do not skip the strategy — adapt it. Follow this algorithm:
This skill is self-contained. If you also use them, these compose cleanly:
/test-namer — how to name the test (this skill decides where it goes; test-namer decides what to call it)./vertical-slice-architecture — how to structure the feature directory./low-complexity — keeps test functions readable.None are required to apply dual testing.
For each new handler, feature, or worker:
tools
Explain anything — code, an error, a concept, or a non-technical topic — in the simplest, most plain-language way possible, ELI5-style, with a natural Río de la Plata (Argentine) voice that puts clarity first. Use ONLY when the user explicitly asks to have something dumbed down or simplified. Triggers (Spanish + English): 'explicámelo como si fuera de Boca' (or de River / de cualquier cuadro), 'explicámelo simple', 'explicalo fácil', 'más fácil', 'bajámelo un cambio', 'en criollo', 'como si tuviera 5 años', 'para tontos', 'ELI5', 'explain like I'm 5', 'dumb it down', 'in plain terms'. Optimized for technical material (code, architecture, tooling, errors) but the same method works for any topic. Do NOT use when the user wants full technical depth, a code review, or did not ask to simplify — this skill is for deliberate, on-request simplification, not for talking down to the user by default.
tools
Iterative non-code discussion between the local agent and Codex CLI on any open-ended topic: diet, fitness, writing, decisions, strategy, study plans, life choices, brainstorming. Orchestrates an automatic back-and-forth debate where both agents critique, propose alternatives, and iterate on the user's idea until reaching consensus. Codex CLI runs READ-ONLY, forms its own opinions, and normally does not navigate the filesystem unless the user provides file paths. Use when the user says discuss with codex, iterate with codex, consult codex, debate with codex, ask codex for a second opinion, get codex's take, or brainstorm with codex, including pasting or describing a plan, draft, idea, decision, or proposal and wanting a critical iterative review. Does NOT trigger on code review, plan-mode review of implementation plans, architecture discussions, or any technical software-engineering analysis; use codex-review for those.
tools
Iterative code review and planning discussion between the local agent and Codex CLI. Orchestrates an automatic back-and-forth debate where both agents discuss findings, architecture decisions, or implementation plans until reaching consensus. Codex CLI runs READ-ONLY and never modifies files; model and reasoning effort come from the user's local Codex config. Supports plan mode: when the local agent has a plan ready, Codex evaluates and iterates on it before implementation, producing an updated consensus plan. Use when the user asks to review with codex, analyze with codex, discuss code with codex, iterate with codex, consult codex, ask codex, review the plan with codex, validate plan with codex, or any Codex CLI request for code review, architecture review, plan review, or implementation strategy. Does NOT trigger on non-code topics like diet, fitness, writing, life decisions, or general strategy; use codex-discuss for those.
development
Explain a GitHub Pull Request (PR) or GitLab Merge Request (MR) to the user in plain, easy-to-understand language: WHAT was done, WHY/what for, and HOW — with the relevant code snippets embedded. Invoke this proactively and automatically right after creating or finishing a PR/MR (e.g. after running `gh pr create`, `glab mr create`, or pushing a branch and opening a PR/MR), even if the user did not explicitly ask for an explanation. Also use whenever the user asks to explain, summarize, walk through, recap, or 'tell me what you did' about a PR/MR or the changes in a branch. Works with any coding agent and relies on the local git diff, so it does NOT require gh/glab to function. Do NOT use for unrelated code reviews, bug hunting, or writing the PR/MR description itself — this skill only explains finished work back to the user.