loom-testing

loom-testing is a skill for Claude Code from cosmix/loom. It costs 25 tokens per session (2,747 once invoked), scanned A, original, MIT.

A guide to writing tests for individual functions, connected components, full user journeys, infrastructure, data pipelines, and machine-learning systems. It explains test doubles, Arrange-Act-Assert, and writing a failing test first in TDD, or test-driven development.

In plain words
What is it for?
Use it to plan and implement unit, integration, end-to-end, security, infrastructure, data, or ML tests.
Why use it?
It helps choose a test level that matches the risk and makes failures easier to understand. It also reduces tests that pass without actually exercising the code.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to plan and implement unit, integration, end-to-end, security, infrastructure, data, or ML tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cosmix/loom/loom-testing
View source ↗ cosmix/loom
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 cosmix/loom --skill loom-testing
Clone the repo
git clone --depth 1 https://github.com/cosmix/loom

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/cosmix/loom/loom-testing"><img src="https://agentmods.dev/badge/skills/cosmix/loom/loom-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,747 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 96
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
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.00025 $0.02747
Opus 5.5 $0.00010 $0.01099
Sonnet 5.5 $0.00005 $0.00549
Haiku 4.5 $0.00003 $0.00275

Measured 1mo ago against content hash 84efd8785021, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

loom-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 1mo 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.

skills/loom-testing/SKILL.md · 236 lines

How it starts

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

Testing

Overview

Writing tests: unit/integration/e2e plus data-pipeline, ML, and infrastructure domains. This file owns test-double taxonomy, AAA, and framework patterns. For pyramid ratios, coverage targets, risk prioritization, and flaky-test diagnosis, see loom-test-strategy; for browser/Playwright/Cypress, see loom-e2e-testing.

Workflow

  1. Map the unit — public interface, dependencies/side effects, invariants, error paths, boundary values.
  2. Pick the altitude — unit for logic/branches; integration for real collaborators (DB, HTTP) at a boundary; e2e for user journeys. Push detail down the pyramid (loom-test-strategy).
  3. Write failing test first when practical (TDD red→green→refactor): a red test proves the test actually exercises the code; a test that never failed asserts nothing.
  4. Arrange-Act-Assert, one logical assertion per test, deterministic inputs.

AAA and naming

  • Arrange state/doubles → Act (one call to the unit) → Assert outcome. Blank-line separate the three; more than one Act means split the test.
  • Name test_<unit>_<scenario>_<expected> — e.g. test_cart_add_duplicate_increases_quantity. The name is the spec; a failing name should tell you what broke without reading the body.
  • One logical assert per test. Multiple physical asserts on one behavior are fine (status, then body); asserting two unrelated behaviors is "assertion roulette" — the first failure masks the rest. Prefer one composite assert (assert_eq!(got, expected_struct)) over many field asserts.

Test Doubles — taxonomy and misuse

Precision matters: "mock" is colloquially any double, but the kind you choose decides whether the test is brittle.

Double Does Verifies Reach for when
Dummy Fills a parameter, never used nothing Satisfy a signature
Stub Returns canned values for indirect inputs state (result) Drive a branch from a dependency's return
Spy Stub that records how it was called state + calls, after Assert an effect happened, loosely
Mock Pre-set call expectations, self-verifying interaction, strict The interaction is the contract (e.g. "charge called once with amount")
Fake Lightweight working impl (in-memory DB, fake clock) state Collaborator too slow/awkward for real, but behavior matters

Read the full file on GitHub · 236 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. 1mo ago First seen · 236 lines · 25 tokens per session scan A 84efd8785021

Subscribe to this mod's changes

loom-testing is a skill published in the GitHub repository cosmix/loom (62 stars, last pushed today), licensed MIT. It adds 25 tokens to every session and 2,747 once invoked, about $0.0001 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-03.