gen-test

Generates Go unit tests with editable scaffolds from your own code.

5|5|Updated Nov 9, 2025
One-click install
npx skills add https://github.com/erraggy/oastools --skill gen-test-erraggy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gen-test
Source: https://github.com/erraggy/oastools/tree/main/.claude/skills/gen-test
Command: npx skills add https://github.com/erraggy/oastools --skill gen-test-erraggy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the creation of test scaffolds for Go files to enforce oastools testing conventions and reduce boilerplate.

Core Features & Use Cases

  • Generates a *_test.go scaffold for exported functions in a target file, ensuring consistent naming and structure.
  • Applies oastools testing conventions (table-driven tests, testify for assertions, and descriptive subtests).
  • Supports generating tests for single functions or full packages according to usage patterns.

Quick Start

Generate tests for a given Go file like /gen-test parser/resolver.go to create a ready-to-edit test skeleton.

Frequently Asked Questions about gen-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate table-driven tests for Go exported functions?

To generate table-driven tests for Go exported functions, you provide a target Go file and the tool creates a *_test.go scaffold using testify assertions and descriptive subtests following oastools conventions.

What is the best way to automate Go test scaffolding with testify?

Automating Go test scaffolding with testify involves generating a ready-to-edit test skeleton that enforces table-driven patterns and descriptive subtests, reducing boilerplate for exported functions and methods in your package.

Can I generate test files for a full Go package instead of a single file?

Yes, you can generate test files for a full Go package. The tool supports generating tests for single functions or entire packages according to your usage patterns within the repository.

Does this Go test generator apply to unexported functions and methods?

No, this Go test generator applies exclusively to exported functions and methods in your Go files, creating descriptive subtests and testify assertions only for the public API of the target package.

Do I need to install testify before generating Go test scaffolds?

You need testify available in your environment because the generated Go test scaffolds rely on it for assertions, creating *_test.go files that follow table-driven patterns and descriptive subtests natively.