test-writing

test-writing is a skill for Claude Code from Kevin-Liu-01/Agent-Machines. It costs 58 tokens per session (1,021 once invoked), scanned A, original, MIT.

A guide for writing concise test output and test harnesses in Rust, Go, Python, and typed command-line tools. A test harness is the code that runs tests and reports whether they pass or fail.

In plain words
What is it for?
Use it when writing tests, assertions, test runners, CI test profiles, or reviewing how test results are displayed.
Why use it?
It keeps test results focused on what passed and what failed, making problems easier to spot in local output and CI.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it when writing tests, assertions, test runners, CI test profiles, or reviewing how test results are displayed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kevin-liu-01/agent-machines/test-writing
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 Kevin-Liu-01/Agent-Machines --skill test-writing
Clone the repo
git clone --depth 1 https://github.com/Kevin-Liu-01/Agent-Machines

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 test-writing

README.md
[![agentmods](https://agentmods.dev/badge/skills/kevin-liu-01/agent-machines/test-writing/github.svg)](https://agentmods.dev/skills/kevin-liu-01/agent-machines/test-writing)
Your own site
<a href="https://agentmods.dev/skills/kevin-liu-01/agent-machines/test-writing"><img src="https://agentmods.dev/badge/skills/kevin-liu-01/agent-machines/test-writing/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 test-writing

Your own site · 80×15
<a href="https://agentmods.dev/skills/kevin-liu-01/agent-machines/test-writing"><img src="https://agentmods.dev/badge/skills/kevin-liu-01/agent-machines/test-writing.svg" alt="Reviewed on agentmods" width="80" 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 1,021 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.00058 $0.01021
Opus 5 $0.00029 $0.00511
Sonnet 5 $0.00012 $0.00204
Haiku 4.5 $0.00006 $0.00102

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

Security

Grade A, and why

test-writing 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 8d 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.

knowledge/skills/test-writing/SKILL.md · 126 lines

How it starts

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

Test Writing

Output philosophy

Tests communicate two things: what passed and what failed. Everything else is noise. Model output on prove, go test, and Plan 9's /bin/test -- not JUnit XML rendered as prose.

The ok / FAIL convention

Every assertion or logical group prints exactly one line:

  ok  mkdir
  ok  rename
  ok  link (nlink=2)
FAIL  symlink (expected target 'foo', got 'bar')

Rules:

  • ok is lowercase, left-aligned to 6 chars ( ok ).
  • FAIL is uppercase, left-aligned to 6 chars (FAIL ).
  • skip for precondition-gated tests (skip fuse (no /dev/fuse)).
  • After the tag: a terse noun phrase, not a sentence.
  • Parenthetical detail only when the assertion carries a value (nlink=2, pid 4821).
  • Summary line at the end: 7/7 posix sanity ok or 6/7 posix sanity FAIL.

Rust #[test]

Rust test output is managed by cargo test (or nextest). The convention is in the test name, not in println!:

#[test]
fn invariant_rename_over_non_empty_dir_returns_enotempty() {
    // ...
    assert_eq!(err, Error::DirectoryNotEmpty);
}

Custom assertion helpers should panic with terse messages:

fn assert_nlink(store: &MetadataStore, ino: Ino, expected: u32) {
    let attr = store.get_inode(ino).unwrap().unwrap();
    assert_eq!(attr.nlink, expected, "ino {ino:?} nlink");
}

Go testing.T

func TestInvariant_ReconcilerSurvivesPerWorkspaceError(t *testing.T) {
    // ...
    if got != want {
        t.Fatalf("workspace B status: got %v, want %v", got, want)
    }
}

Use t.Fatalf (not t.Errorf + t.FailNow). One call, one line.

Python pytest

Let pytest handle reporting. Assertions use bare assert:

def test_invariant_chunk_key_is_deterministic():
    a = chunk_key("ws-1", b"hello")
    b = chunk_key("ws-1", b"hello")
    assert a == b

For parametrized output, use pytest.mark.parametrize -- it generates one ok line per case automatically.

CI integration

Read the full file on GitHub · 126 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. 8d ago First seen · 126 lines · 58 tokens per session scan A fe68e474b748

Subscribe to this mod's changes

test-writing is a skill published in the GitHub repository Kevin-Liu-01/Agent-Machines (29 stars, last pushed yesterday), licensed MIT. It adds 58 tokens to every session and 1,021 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.

Related

Other skills, from other repositories

api-testing

Testing patterns for MCP tool/resource handlers using createMockContext and Vitest. Covers mock context options, handler testing, McpError assertions, format testing, Vitest config setup, and test isolation conventions.

cyanheads/obsidian-mcp-server · 46 tokens

add-test

Scaffold a test file for an existing tool, resource, or service. Use when the user asks to add tests, improve coverage, or when a definition exists without a matching test file.

cyanheads/obsidian-mcp-server · 41 tokens

email-formatting

Markdown formatting conventions for email summary documents — heading depth, list style, line length, emoji policy, and a mandatory provenance footer. Read this when producing a markdown report that summarizes one or more email messages so the output matches the project's house style.

provos/ironcurtain · 53 tokens

dogfood

This skill guides you through systematic exploratory QA testing of web applications using the browser toolset. You will navigate the application, interact with elements, capture evidence of issues, and produce a structured bug report.

AtlasOmnia/donna-starter · 20 tokens

holix-cron

Schedule recurring agent tasks via Holix built-in gateway cron (not crontab or custom scripts).

javded-itres/Holix · 25 tokens

blazemeter-api-reference

Comprehensive reference for BlazeMeter REST APIs, including authentication, identifiers, and API endpoints. Use when working with BlazeMeter APIs for (1) Understanding BlazeMeter REST API structure, (2) Authenticating API requests, (3) Obtaining identifiers (Workspace ID, Project ID, Test ID, etc.), (4) Using Test…

Blazemeter/bzm-mcp · 109 tokens