arnesto: Skill for Claude Code

.agents/skills/test-doubles-first/SKILL.md

test-doubles-first is a skill for Claude Code, Codex from saski/arnesto. It costs 58 tokens per session (768 once invoked), scanned A, original, Unlicense.

A testing guide for choosing between fakes, stubs, spies, and mocks, which are substitutes for real dependencies in tests.

In plain words
What is it for?
Use it when writing or refactoring tests, especially when deciding whether to simulate data, control responses, observe effects, or verify interactions.
Why use it?
It keeps tests focused on observable behavior instead of fragile details about how the code is built internally.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is saski/arnesto's own configuration. It tells Claude Code and Codex how to work on arnesto 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 arnesto configures →

Reuse

Borrowing it

Nothing to install: this file belongs to saski/arnesto. 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/saski/arnesto/main/.agents/skills/test-doubles-first/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/saski/arnesto

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 test-doubles-first

README.md
[![agentmods](https://agentmods.dev/badge/skills/saski/arnesto/test-doubles-first.svg)](https://agentmods.dev/skills/saski/arnesto/test-doubles-first)
Your own site
<a href="https://agentmods.dev/skills/saski/arnesto/test-doubles-first"><img src="https://agentmods.dev/badge/skills/saski/arnesto/test-doubles-first.svg" alt="Measured on agentmods" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 768 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.00058 $0.00768
Opus 5 $0.00029 $0.00384
Sonnet 5 $0.00012 $0.00154
Haiku 4.5 $0.00006 $0.00077

Measured 3d ago against content hash febddf29ef87, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

test-doubles-first 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 3d 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/test-doubles-first/SKILL.md · 81 lines

How it starts

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

Test Doubles First

Quick Navigation

Goal

Write tests that describe behavior and state, not implementation details. Avoid mock-by-default.

Default Rule

  1. Prefer state/output assertions first.
  2. Choose the lightest double that makes the test clear.
  3. Use mocks only when interaction contract is the behavior under test.

Decision Tree

  1. Can the test assert state (persisted data, returned value, emitted event)?
    • Yes -> use a Fake (in-memory or lightweight real implementation).
    • No -> continue.
  2. Do you need to force a branch (success/failure/timeout) with controlled responses?
    • Yes -> use a Stub.
    • No -> continue.
  3. Do you need to observe an outbound effect (email, message, metrics) without prescribing internal construction?
    • Yes -> use a Spy.
    • No -> continue.
  4. Do you need to verify interaction contract (never called, called once, call order/protocol)?
    • Yes -> use a Mock, with minimal expectations.

If one test needs many interaction expectations, treat it as a design smell and raise the abstraction of the port.

Naming and Placement

  • Names
    • FakeXxxRepo, InMemoryXxxRepo
    • StubXxxGateway, FailingXxxStub, FixedClockStub
    • SpyXxxPublisher, SpyEmailService
    • MockXxxClient only for contract-driven tests
  • Paths (cross-platform style)
    • Python: tests/doubles/
    • TypeScript: test/doubles/ or __tests__/doubles/

Always use forward slashes in paths.

Style Constraints

  • Prefer state/output assertions over called_with assertions.
  • For spies, assert only relevant facts (for example count, recipient, subject).
  • Keep stubs configurable per scenario; do not build mini-systems.
  • Keep fakes honest to domain invariants; add contract tests for real adapters when needed.

Read the full file on GitHub · 81 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 81 lines · 58 tokens per session scan A febddf29ef87

Subscribe to this mod's changes

test-doubles-first is a skill published in the GitHub repository saski/arnesto (5 stars, last pushed today), licensed Unlicense. It adds 58 tokens to every session and 768 once invoked, about $0.0003 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-09-03.