Agent skill

Snapbox Testing

by moonbitlang in moonbitlang/moon

Write and maintain Rust CLI/integration tests with snapbox 0.6+ using command assertions, inline snapshots, and minimal wildcard/redaction patterns.

Apache-2.0Auto-check passedTesting & QA

Install Snapbox Testing

skills CLI
$ npx skills add moonbitlang/moon --skill snapbox-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install moonbitlang/moon snapbox-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/moonbitlang/moon.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/snapbox-testing .claude/skills/snapbox-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
snapbox-testing
GitHub stars
423
Token cost
~595 tokens
SKILL.md length
232 words
Files
2
Skills in repo
2
Repo updated
First seen
Licence
Apache-2.0

At a glance

Write and maintain Rust CLI/integration tests with snapbox 0.6+ using command assertions, inline snapshots, and minimal wildcard/redaction patterns.

  • Works in 5 steps: Replace manual output plumbing with… → Start from empty inline snapshots… → Run tests with SNAPSHOTS=overwrite to… → …
  • Replacing manual getoutput parsing
  • SKILL.md covers Follow This Workflow, Prefer These Patterns, Minimize Redaction and Cross-Platform Guidance, plus 2 more sections
  • Calls cargo

What it does

Snapbox Testing is an agent skill from moonbitlang/moon. Write and maintain Rust CLI/integration tests with snapbox 0.6+ using command assertions, inline snapshots, and minimal wildcard/redaction patterns. Use when replacing manual getoutput parsing, stabilizing cross-platform snapshots, or refining existing snapbox assertions.

Its SKILL.md is about 600 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It sits in Testing & QA, covering Integration testing. It works with Rust. The repository describes itself as: The build system and package manager for MoonBit. The licence is Apache-2.0.

When your agent uses it

  • Replacing manual getoutput parsing
  • Stabilizing cross-platform snapshots
  • Refining existing snapbox assertions

Example prompts

  • “/snapbox-testing”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Replace manual output plumbing with direct snapbox assertions.
  2. Start from empty inline snapshots (snapbox::str![""]) for unstable/unknown output.
  3. Run tests with SNAPSHOTS=overwrite to capture real output.
  4. Tighten snapshots by keeping stable text exact and wildcarding only volatile parts.
  5. Re-run tests and clippy.

What it can do on your machine

Read from SKILL.md and the folder at commit 0a3f0d4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Snapbox Testing loads about 595 tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 232 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
When it runs · the whole SKILL.md, loaded when a task matches
~595

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from moonbitlang/moon at commit 0a3f0d4, republished under its Apache-2.0 licence (© moonbitlang). 232 words, ~595 tokens.

Download SKILL.mdSave it as .claude/skills/snapbox-testing/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
snapbox-testing
description
Write and maintain Rust CLI/integration tests with snapbox 0.6+ using command assertions, inline snapshots, and minimal wildcard/redaction patterns. Use when replacing manual `get_output` parsing, stabilizing cross-platform snapshots, or refining existing snapbox assertions.

Snapbox Testing

Use this skill to make Rust command-output tests simpler, more stable, and easier to review.

Follow This Workflow

  1. Replace manual output plumbing with direct snapbox assertions.
  2. Start from empty inline snapshots (snapbox::str![""]) for unstable/unknown output.
  3. Run tests with SNAPSHOTS=overwrite to capture real output.
  4. Tighten snapshots by keeping stable text exact and wildcarding only volatile parts.
  5. Re-run tests and clippy.

Use:

bash
SNAPSHOTS=overwrite cargo test -p <crate> --test <test-target>

Prefer These Patterns

  • Assert command result directly:
    • .assert().success().stdout_eq(...)
    • .assert().failure().stderr_eq(...)
  • Prefer inline snapshots:
    • snapbox::str![[r#"...\n"#]] for multi-line outputs
    • string literals for short exact lines
  • Keep assertions local and readable:
    • inline expected value when used once
    • avoid temporary expected_* bindings unless reused

Minimize Redaction

  • Prefer built-in wildcard filters first:
    • [..] for variable substrings within a line
    • ... on its own line for variable trailing frames/lines
  • Keep stable semantics visible:
    • preserve meaningful suffixes like /_build/.../main.wasm
    • avoid over-redacting fixed tokens (for example, exact error kind/message)
  • Add custom Redactions only when wildcard patterns cannot express the instability clearly.

Cross-Platform Guidance

  • Rely on snapbox default path normalization before adding platform-specific cfg snapshots.
  • Use one snapshot when separator normalization is sufficient.
  • Add cfg(windows)/cfg(not(windows)) split only for truly semantic OS differences.

Avoid

  • Manual .get_output().stdout/stderr + UTF-8 parsing when direct assertions work.
  • Hand-written normalization helpers for paths/stack traces when snapbox patterns can express intent.
  • Broad wildcarding that hides behavior regressions.

Quick Checklist

  • cargo fmt --all
  • cargo test -p <crate> --test <target>
  • cargo clippy -p <crate> --tests -- -D warnings

© moonbitlang, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/snapbox-testing of moonbitlang/moon.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit 0a3f0d4

Compare with similar skills

Snapbox Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Snapbox Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Snapbox Testing this skillmoonbitlang/moon423—~595Automated safety check: PassApache-2.0
Remote Executor Integration Testsopeninterpreter/openinterpreter69k2 repos~842Automated safety check: PassApache-2.0
cargo-pgrx Commands and Testsyugabyte/yugabyte-db11k—~1.9kAutomated safety check: PassCustom licence
Warp Integration Test Videowarpdotdev/warp65k1 repos~2.6kAutomated safety check: PassAGPL-3.0
Rust Testingaxone-protocol/contracts123—~501Automated safety check: PassBSD-3-Clause
Testingstatic-web-server/static-web-server2.4k—~1.5kAutomated safety check: PassApache-2.0

Similar skills

  • Remote Executor Integration Tests

    openinterpreter/openinterpreter

    Explains how to run agent integration tests against remote executors, using Docker for Linux or Wine for Windows, and how to opt tests in or skip them.

    69k GitHub starsUsed in 2 repos~842 tokens
    Testing & QAAuto-check passed
  • cargo-pgrx Commands and Tests

    yugabyte/yugabyte-db

    Helps choose and run cargo-pgrx commands and decide whether a Rust test is a plain test or a pg_test, so code never crosses the Postgres boundary the wrong way.

    11k GitHub stars~1.9k tokensUpdated today
    Testing & QAAuto-check passed
  • Records screenshots and video from Warp's Rust integration-test harness, with the commands and environment variables to run a named test and review its artifacts.

    65k GitHub starsUsed in 1 repo~2.6k tokens
    Testing & QAAuto-check passed
  • Rust Testing

    axone-protocol/contracts

    Patterns for Rust testing in Axone CosmWasm contracts. An agent skill from axone-protocol/contracts.

    123 GitHub stars~501 tokensUpdated 12 days ago
    Testing & QAAuto-check passed
  • Testing

    static-web-server/static-web-server

    Write or review tests for the Static Web Server (SWS) project — unit tests, integration tests, test fixtures, and mocking strategies

    2.4k GitHub stars~1.5k tokensUpdated today
    Testing & QAAuto-check passed
  • Rust Testing

    kurealnum/dotfiles

    Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage.

    290 GitHub starsUsed in 6 repos~2.9k tokens
    Testing & QAAuto-check passed

More from moonbitlang/moon

  • Moon Development

    moonbitlang/moon

    Route implementation, design, review, diagnosis, and testing work on the Moon CLI and MoonBuild to canonical glossary, ADR, design, behavioral-reference, and testing documents.

    423 GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Snapbox Testing

What does Snapbox Testing do?

Write and maintain Rust CLI/integration tests with snapbox 0.6+ using command assertions, inline snapshots, and minimal wildcard/redaction patterns. Snapbox Testing is an agent skill from moonbitlang/moon.6+ using command assertions, inline snapshots, and minimal wildcard/redaction patterns.

When should I use Snapbox Testing?

Snapbox Testing fits situations like: replacing manual getoutput parsing; stabilizing cross-platform snapshots; refining existing snapbox assertions.

How do I install Snapbox Testing in Claude Code?

Run `npx skills add moonbitlang/moon --skill snapbox-testing -a claude-code`. Or copy the skill folder (.agents/skills/snapbox-testing in moonbitlang/moon) into .claude/skills/snapbox-testing in your project. Claude Code loads it when a task matches its description.

How do I install Snapbox Testing in Codex?

Run `npx skills add moonbitlang/moon --skill snapbox-testing -a codex`. Or copy the skill folder (.agents/skills/snapbox-testing in moonbitlang/moon) into .agents/skills/snapbox-testing in your project. Codex loads it when a task matches its description.

Can I use Snapbox Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add moonbitlang/moon --skill snapbox-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/snapbox-testing, .gemini/skills/snapbox-testing, .github/skills/snapbox-testing and .opencode/skills/snapbox-testing in your project.

What does Snapbox Testing need to run?

Going by SKILL.md and its folder, Snapbox Testing needs the command-line tools its instructions call (cargo).

Does Snapbox Testing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Snapbox Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Snapbox Testing use?

Snapbox Testing is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Snapbox Testing use?

About 595 tokens (SKILL.md is roughly 2.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Snapbox Testing?

Skills that share tags, products or a category with Snapbox Testing: Remote Executor Integration Tests (openinterpreter/openinterpreter, 69k stars), cargo-pgrx Commands and Tests (yugabyte/yugabyte-db, 11k stars), Warp Integration Test Video (warpdotdev/warp, 65k stars) and Rust Testing (axone-protocol/contracts, 123 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Snapbox Testing?

moonbitlang (a GitHub organization) maintains it in moonbitlang/moon, which has 423 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 8, 2026.

Source: moonbitlang/moon on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.