gen-test

gen-test is a skill for Claude Code, Codex from erraggy/oastools. It costs 30 tokens per session (887 once invoked), scanned A, original, MIT.

A command that creates a starting set of Go tests for a selected file or function, following the project's testing conventions.

In plain words
What is it for?
Use it to generate test scaffolding for exported functions or named functions, then expand the generated cases with real assertions.
Why use it?
It reduces the initial effort of setting up tests while first checking the code and nearby examples for the right structure.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/erraggy/oastools/gen-test
Any agent
npx skills add erraggy/oastools --skill gen-test
Clone the repo
git clone --depth 1 https://github.com/erraggy/oastools

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/erraggy/oastools/gen-test.svg)](https://agentmods.dev/skills/erraggy/oastools/gen-test)
Your own site
<a href="https://agentmods.dev/skills/erraggy/oastools/gen-test"><img src="https://agentmods.dev/badge/skills/erraggy/oastools/gen-test.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 887 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00030 $0.00887
Opus 5 $0.00015 $0.00443
Sonnet 5 $0.00006 $0.00177
Haiku 4.5 $0.00003 $0.00089

Measured 3d ago against content hash 114995eb0a6b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gen-test 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.

.claude/skills/gen-test/SKILL.md · 145 lines

How it starts

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

gen-test

Generate test scaffolding for Go files following oastools testing conventions.

Usage:

  • /gen-test parser/resolver.go - Generate tests for all exported functions
  • /gen-test validator/validate.go ValidateSpec - Generate test for specific function

Step 1: Analyze Target File

Read the specified file and identify:

  1. Package name
  2. Exported functions/methods to test
  3. Existing test file (if any)
  4. Dependencies and types used

Note: In the commands below, $FILE refers to the path provided by the user when invoking the skill. For example, if the user runs /gen-test parser/resolver.go, then $FILE = parser/resolver.go.

# Check if test file already exists
# Example: parser/resolver.go -> parser/resolver_test.go
ls -la "${FILE%%.go}_test.go" 2>/dev/null

Step 2: Find Testing Patterns

Look for existing test patterns in the same package:

# Find existing tests in the package
# Example: parser/resolver.go -> parser/*_test.go
ls -la $(dirname "$FILE")/*_test.go 2>/dev/null | head -5

Read 1-2 existing test files to understand:

  • Table-driven test patterns used
  • Test helper usage (testutil, require, assert)
  • Fixture/testdata patterns
  • Subtests structure

Step 3: Generate Test Scaffolding

Create or append to the *_test.go file following these conventions:

oastools Testing Conventions

  1. Use testify: github.com/stretchr/testify/require and assert
  2. Table-driven tests: Use tests := []struct{...} pattern
  3. Subtests: Use t.Run(tt.name, func(t *testing.T) {...})
  4. Descriptive names: Test case names should describe the scenario
  5. testutil helpers: Use testutil.LoadSpec() for loading OAS fixtures

Template Structure

func TestFunctionName(t *testing.T) {
	tests := []struct {
		name    string
		input   InputType
		want    OutputType
		wantErr bool
	}{
		{
			name:  "valid input returns expected output",
			input: validInput,
			want:  expectedOutput,
		},
		{
			name:    "invalid input returns error",
			input:   invalidInput,
			wantErr: true,
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			got, err := FunctionName(tt.input)
			if tt.wantErr {
				require.Error(t, err)
				return
			}
			require.NoError(t, err)
			assert.Equal(t, tt.want, got)
		})
	}
}

Read the full file on GitHub · 145 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 · 145 lines · 30 tokens per session scan A 114995eb0a6b

Subscribe to this mod's changes

gen-test is a skill published in the GitHub repository erraggy/oastools (5 stars, last pushed 5d ago), licensed MIT. It adds 30 tokens to every session and 887 once invoked, about $0.0002 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-08-31.