samurai

samurai is a skill for Claude Code, Codex from zerosixty/samurai. It costs 69 tokens per session (1,769 once invoked), scanned A, original, MIT.

A Go testing framework for tests with branching, state-changing steps. Go is a programming language, and tests check that software behaves as expected.

In plain words
What is it for?
Use it when testing Go code where different actions lead to several possible outcomes, especially with the framework's scoped test functions.
Why use it?
It keeps separate test paths isolated and provides rules for setup, cleanup, skipped tests, contexts, and parallel execution.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when testing Go code where different actions lead to several possible outcomes, especially with the framework's scoped test functions.

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

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 samurai

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/zerosixty/samurai/skill"><img src="https://agentmods.dev/badge/skills/zerosixty/samurai/skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,769 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.00069 $0.01769
Opus 5.5 $0.00028 $0.00708
Sonnet 5.5 $0.00014 $0.00354
Haiku 4.5 $0.00007 $0.00177

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

Security

Grade A, and why

samurai 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.

cmd/claude-setup/skill/SKILL.md · 84 lines

How it starts

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

Samurai Test Writing Rules

Good For: Go tests with a branching state-mutating tree (≥3 leaf paths, mutually exclusive siblings) using samurai.Run / samurai.RunWith. Bad For: read-only chains, sequential accumulation, same-action-different-input variants, flat independent tests (see "When to Use" below for full criteria).

Rules

  • One action + its assertions = one Test(). Don't split assertions into child Tests — assert the result in the same callback that produced it. Child Tests are for new actions (setup, mutations, queries), not for checking fields of a parent's result
  • DECLARE variables with var in the builder body, ASSIGN inside Test() callbacks
  • Each leaf path re-executes the builder from scratch — fresh variables, full isolation
  • w.Cleanup(fn): LIFO order, inner before outer, runs even on panic, thread-safe
  • s.Skip(): affects entire scope regardless of call order, no callbacks/cleanups execute
  • w.Context(): returns the scope's context.Context — use in factories for initialization needing a context
  • context.Context: first param in Test callbacks, live during test, canceled after path completes
  • Parallel by default; samurai.Sequential() forces order; go test -parallel N controls concurrency
  • Assertion-agnostic: use w.Testing() with any library (testify, is, stdlib)

Naming

Every s.Test("name", ...) — at every tree level — names a business action or outcome from the actor's POV. Not the function under test, the assertion, or the input shape.

Forbidden patterns:

  • Identifier leak — CamelCase tokens matching Go identifiers in the Test body. "UpdateQuote calls..." leaks UpdateQuote.
  • HTTP code leak — bare 3-digit codes (\b[1-5]\d{2}\b) or 4xx/5xx shorthand. "returns 409" → "rejects duplicate id".
  • Assertion phrasing — is / equals / returns / not nil / has length / contains. "err is not nil" → "rejects invalid signature".
  • Structure phrasing — empty / nil / with N / map / slice / struct. "with empty slice" → "borrower has no past loans".

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

Subscribe to this mod's changes

samurai is a skill published in the GitHub repository zerosixty/samurai (11 stars, last pushed 4mo ago), licensed MIT. It adds 69 tokens to every session and 1,769 once invoked, about $0.0003 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-08-30.

Related

Other skills, from other repositories

timeouts-and-async

Make Ginkgo specs interruptible and test asynchronous behavior — SpecContext/context.Context cancellable nodes, NodeTimeout/SpecTimeout/GracePeriod, the --timeout flag, Abort and SIGINT behavior, Gomega Eventually/Consistently (the func(g Gomega) form, .WithContext), and the defer GinkgoRecover() rule for goroutines.…

onsi/ginkgo · 106 tokens

setup

Wire Ginkgo into a Go package — install the ginkgo CLI and Ginkgo+Gomega, ginkgo bootstrap to generate the suitetest.go (TestXxx/RegisterFailHandler(Fail)/RunSpecs), the package xxxtest convention, dot-import alternatives (aliased import, dsl/ subpackages, --nodot), ginkgo generate, and testing.T interop via…

onsi/ginkgo · 118 tokens

overview

The Ginkgo mental model for writing Go tests — the one idea that explains everything (Ginkgo builds a spec tree at construction time, then runs it) and its consequences for how you write specs, plus spec independence and the node taxonomy. Use this first when you start working with Ginkgo in a project, or to decide…

onsi/ginkgo · 84 tokens

go-127

What changed in Go 1.27 (released August 2026) and how it changes the way Go is written in pi-go. Use this skill when writing or reviewing Go that could use a 1.27 feature, when bumping the go directive in go.mod, when a build or test behaves differently after a toolchain upgrade, or when code-guidelines-go points…

dimetron/pi-go · 177 tokens

bubbletea-testing

Use this skill whenever writing tests for Bubble Tea (charmbracelet/bubbletea) TUI applications in Go. Triggers include any mention of testing Bubble Tea models, teatest, golden file testing for TUIs, testing tea.Cmd or tea.Msg, snapshot testing terminal output, or writing tests for any Go CLI/TUI that uses the Elm…

dimetron/pi-go · 139 tokens

check-linters-before-commit

Before any commit, run linters, vet, tests, and build verification; do not commit until checks pass.

dimetron/pi-go · 30 tokens