kagent: Skill for Claude Code

.agents/skills/given-when-assert-that/SKILL.md

given-when-assert-that is a skill for Claude Code, Codex from kagent-dev/kagent. It costs 36 tokens per session (818 once invoked), scanned A, original, Apache-2.0.

A guide to writing readable behavior tests in Go using ordinary Go test files. Each test describes the starting situation, one action, and the observable result without adding a separate behavior-testing framework.

In plain words
What is it for?
Use it when adding tests for a Go feature or bug fix, especially for HTTP or gRPC responses, saved data, caller identity, or emitted events.
Why use it?
It keeps tests focused on what users or callers can observe instead of internal implementation details. This makes missing wiring, bad inputs, and incorrect results easier to catch.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is kagent-dev/kagent's own configuration. It tells Claude Code and Codex how to work on kagent itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything kagent configures →

About the project

kagent is a Kubernetes-native framework for building, deploying, and managing AI agents as Kubernetes resources. It is intended for teams operating agents and tools alongside Kubernetes workloads, with catalogue entries supporting its agent-management workflows.

kagent-dev/kagent · 4,165 stars · on GitHub · kagent.dev

Reuse

Borrowing it

Nothing to install: this file belongs to kagent-dev/kagent. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/kagent-dev/kagent/main/.agents/skills/given-when-assert-that/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/kagent-dev/kagent

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 given-when-assert-that

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/kagent-dev/kagent/given-when-assert-that"><img src="https://agentmods.dev/badge/skills/kagent-dev/kagent/given-when-assert-that.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 818 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.00036 $0.00818
Opus 5.5 $0.00014 $0.00327
Sonnet 5.5 $0.00007 $0.00164
Haiku 4.5 $0.00004 $0.00082

Measured 3d ago against content hash 04bc3de3d3ce, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

given-when-assert-that 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 3d 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.

.agents/skills/given-when-assert-that/SKILL.md · 45 lines

How it starts

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

Given/When/AssertThat Go tests

Use this skill when writing Go behavior tests, including tests for new features and bug fixes. Keep the tests executable with go test. Do not add a BDD runner, .feature files, code generation, or a generic step registry.

Choose behavior before writing test code

  • Identify the user-visible contract and the boundary that proves it: an HTTP or gRPC response, handler reachability, caller identity, persisted state, or emitted event. Do not test only a helper when the behavior depends on listener wiring, serialization, or persistence.
  • Start with a working case and the few failure or boundary cases that could change the outcome. Include missing, empty, malformed, and fallback inputs only when the contract treats them differently. Set up any state that a negative assertion depends on, so the test cannot pass against an empty or unwired system.
  • For each case, write down Given <relevant state>, when <one action>, assert that <observable outcome>. Make the assertion specific enough to fail if the behavior is absent; avoid tests that just check constants, mocks, or implementation steps.

Write the scenario as an ordinary Go test

  • Give each test function a short behavior name. When subtests help distinguish cases, give each t.Run a sentence: Given <precondition>, when <one action with its input variant>, assert that <observable outcome>. Do not add a subtest or fixture just to satisfy the naming pattern.
  • Use an eventive When, not a stative one. "When a caller sends an RPC without a token" names the stimulus. "When an RPC has no credentials" describes state. Put stable state in Given.
  • Make the name match the actual input. "No valid token" includes missing, malformed, and expired tokens. Do not use it for a case that sends only a missing token.
  • Keep variants in a scenarios matrix when they share an action and assertion. Give distinct behaviors separate named subtests. Do not branch assertions on expected outcomes to force unlike cases into one table.

Read the full file on GitHub · 45 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. 3d ago First seen · 45 lines · 36 tokens per session scan A 04bc3de3d3ce

Subscribe to this mod's changes

given-when-assert-that is a skill published in the GitHub repository kagent-dev/kagent (4,165 stars, last pushed today), licensed Apache-2.0. It adds 36 tokens to every session and 818 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-11-03.

Related

given-when-assert-that compared with skills from other repositories

given-when-assert-that next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
given-when-assert-thatkagent-dev/kagentSkill4.2ktodayApache-2.0A36Claude Code, Codex
unit-testjohnqtcg/awesome-skillsSkill3028d agoMITA100Claude Code
fuzzing-testjohnqtcg/awesome-skillsSkill3028d agoMITA74Claude Code
golang-testing-patternscodeready-toolchain/tarsySkill10yesterdayApache-2.0A47Cursor
test-gosergeyklay/.agentsSkill62d agoApache-2.0A109Claude Code, Codex
go-testing-with-testifyn-n-code/n-n-code-skillsSkill45d agoMITA79Claude Code, Codex
golang-testingalexastrum/sklSkill104mo agoMITA115Claude Code