oastools: Skill for Claude Code

.claude/skills/gen-test/SKILL.md

gen-test is a skill for Claude Code 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 Code

Written for Claude Code: installed under .claude/.

This is erraggy/oastools's own configuration. It tells Claude Code how to work on oastools 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 oastools configures →

Reuse

Borrowing it

Nothing to install: this file belongs to erraggy/oastools. 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/erraggy/oastools/main/.claude/skills/gen-test/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/erraggy/oastools

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/erraggy/oastools/gen-test/github.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/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 gen-test

Your own site · 80×15
<a href="https://agentmods.dev/skills/erraggy/oastools/gen-test"><img src="https://agentmods.dev/badge/skills/erraggy/oastools/gen-test.svg" alt="Reviewed on agentmods" width="80" 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. 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.00030 $0.00887
Opus 5.5 $0.00012 $0.00355
Sonnet 5.5 $0.00006 $0.00177
Haiku 4.5 $0.00003 $0.00089

Measured 1mo ago against content hash 114995eb0a6b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

.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. 1mo 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 (6 stars, last pushed 9d ago), licensed MIT. It adds 30 tokens to every session and 887 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-08-31.

Related

Other skills, from other repositories

API Test Suite Generator

Automatically generate comprehensive API test suites from OpenAPI specifications covering CRUD operations, error handling, authentication, pagination, and edge cases.

PramodDutta/qaskills · 29 tokens

API Contract Validator

Validate API responses against OpenAPI/Swagger specifications, JSON Schema definitions, and consumer-driven contracts to prevent breaking changes.

PramodDutta/qaskills · 26 tokens

go-testing

Use when writing, reviewing, or improving Go test code — including table-driven tests, subtests, parallel tests, test helpers, test doubles, and assertions with cmp.Diff. Also use when a user asks to write a test for a Go function, even if they don't mention specific patterns like table-driven tests or subtests. Does…

cxuu/golang-skills · 80 tokens

go-test-implementation

Use for test-only changes or non-routine fixtures and harnesses, selecting cases and assertions from accepted behavior during implementation.

Dankosik/go-service-template-rest · 29 tokens

Go Testing Patterns

Go testing with testing package, table-driven tests, subtests, benchmarks, test fixtures, httptest, and testify assertions.

PramodDutta/qaskills · 29 tokens

golang-testing

Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI…

alexastrum/skl · 115 tokens