testing

testing is a skill for Claude Code from avsm/ocaml-claude-marketplace. It costs 34 tokens per session (1,631 once invoked), scanned A, original, ISC.

Testing guidance for OCaml libraries, including test organization, Alcotest suites, Dune configuration, logging, and startup order. TDD, or test-driven development, means using tests to guide implementation, but this entry focuses on OCaml testing practices.

In plain words
What is it for?
Use it when setting up OCaml test directories, writing module-specific test files, configuring Dune, initializing test dependencies, or combining multiple Alcotest suites.
Why use it?
It provides a consistent structure for writing and running tests across modules instead of leaving each project to invent its own layout.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the ocaml-dev plugin — 21 skills, 5 commands shipped together

Good fit Use it when setting up OCaml test directories, writing module-specific test files, configuring Dune, initializing test dependencies, or combining multiple Alcotest suites.

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

Made for: Claude Code.

Or install ocaml-dev, the plugin that ships this one along with the rest of its 21 skills, 5 commands.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/avsm/ocaml-claude-marketplace/testing"><img src="https://agentmods.dev/badge/skills/avsm/ocaml-claude-marketplace/testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,631 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00034 $0.01631
Opus 5 $0.00017 $0.00816
Sonnet 5 $0.00007 $0.00326
Haiku 4.5 $0.00003 $0.00163

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

Security

Grade A, and why

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 10d 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.

plugins/ocaml-dev/skills/testing/SKILL.md · 232 lines

How it starts

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

OCaml Testing

Test Directory Structure

Use test/ directory with:

  • test.ml - Main runner controlling initialization order
  • test_x.ml - One file per module x.ml being tested, exports suite
lib/
├── foo.ml
└── bar.ml
test/
├── dune
├── test.ml          # Main runner
├── test_foo.ml      # suite : (string * unit Alcotest.test_case list) list
└── test_bar.ml

For single-module libraries, a single test_foo.ml as runner is acceptable.

Dune Configuration

(test
 (name test)
 (libraries mylib alcotest logs logs.fmt fmt.tty))

Main Runner Pattern (test.ml)

The main test.ml controls initialization order for side effects:

(* 1. Initialize RNG before any test module is loaded *)
let () = Crypto_rng_unix.use_default ()

(* 2. Set up logging *)
let () = Fmt_tty.setup_std_outputs ()
let () = Logs.set_reporter (Logs_fmt.reporter ())
let () = Logs.set_level (Some Logs.Debug)

(* 3. Run all test suites *)
let () = Alcotest.run "mylib" Test_foo.suite

For multiple modules:

let () = Crypto_rng_unix.use_default ()
let () = Alcotest.run "mylib" (Test_foo.suite @ Test_bar.suite)

Module Test File Pattern (test_x.ml)

Each module exports a suite value. Do not initialize RNG or run Alcotest here.

(** Tests for Foo module. *)

let test_basic () =
  let result = Foo.process "input" in
  Alcotest.(check string) "expected output" "output" result

let test_empty () =
  let result = Foo.process "" in
  Alcotest.(check string) "empty input" "" result

let suite =
  [
    ( "process",
      [
        Alcotest.test_case "basic" `Quick test_basic;
        Alcotest.test_case "empty" `Quick test_empty;
      ] );
  ]

Lazy State for Module-Level Values

If a test module needs RNG at load time, use lazy evaluation:

let key = lazy (Crypto_rng.generate 32)
let key () = Lazy.force key

let test_encrypt () =
  let ciphertext = Foo.encrypt ~key:(key ()) plaintext in
  ...

This defers RNG use until tests actually run, after test.ml initializes the RNG.

Read the full file on GitHub · 232 lines

Files

What ships with it

2 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. 10d ago First seen · 232 lines · 34 tokens per session scan A 0b57127ea34a

Subscribe to this mod's changes

testing is a skill published in the GitHub repository avsm/ocaml-claude-marketplace (35 stars, last pushed 7d ago), licensed ISC. It adds 34 tokens to every session and 1,631 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-30.