PlugWiki

golang-stretchr-testify Skill for Claude Code: Write Go Tests with testify

Makes Claude write and review Go tests with stretchr/testify: assert vs require, mocks and suites.

Installs
40.2K
on skills.sh
Stars
3.7K
on GitHub
Files
2
besides SKILL.md
Updated
Nov 2026
last repo commit

golang-stretchr-testify teaches Claude the assert, require, mock and suite packages of testify. Its rules include using require for preconditions and assert for checks, passing arguments as (expected, actual), and always calling AssertExpectations on mocks.

It has Write mode and Review mode. It lists go and gotests as required programs, and bundles one reference file for mocks. It points to the testifylint linter for catching misuse.

Good for

  • Go developers writing unit tests with testify
  • Reviewers checking test code for testify misuse
  • Teams who want mocks and suites set up correctly

Install golang-stretchr-testify

Claude Code

  1. 1

    Copy this prompt.

    Install the golang-stretchr-testify skill in Claude Code. Run this command:
    
    /plugin marketplace add samber/cc
    /plugin install cc-skills-golang@samber
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Pick one route, not several. The README says the skills cross-reference each other and a subset gives a partial and potentially inconsistent view, so the plugin or the whole-set CLI command is the better choice. The plugin installs the repo's 46 skill folders; its manifest declares no hooks, commands or MCP servers. Claude Code names plugin skills /plugin-name:skill-name, so after the plugin install the full name is /cc-skills-golang:golang-stretchr-testify. The samber/cc marketplace lists seven plugins; the second command installs only cc-skills-golang.

From the project README. Source.

What's in the skill

When it loads

Comprehensive guide to stretchr/testify for Golang testing. Covers assert, require, mock, and suite packages in depth. Use when writing tests with testify, creating mocks, setting up test suites, or choosing between assert and require. Covers testify assertions, mock expectations, argument matchers, call verification, suite lifecycle, and advanced patterns like Eventually, JSONEq, and custom matchers. Apply when the codebase imports github.com/stretchr/testify.

Sections in SKILL.md

  1. assert vs require
  2. Core Assertions
  3. Advanced Assertions
  4. testify/mock
  5. testify/suite
  6. Lifecycle
  7. Example
  8. Common Mistakes
  9. Linters
  10. Cross-References

Key facts

Installs on skills.sh
40,196 as of 2026-11-02
Last repo commit
2026-11-01

What it includes

  • Add new tests or mocks to a codebase

    Uses testify as a complement to Go's testing package, with *testing.T as the entry point.

    Runs code · Write mode

  • Audit existing test code for testify misuse

    Checks the common mistakes list.

    Read · Review mode

  • assert records a failure and continues; require stops the test

    Rule: require for preconditions, assert for verifications, and never mix them at random.

    Read · assert vs require

  • Expected comes first, then actual

    Swapped order gives confusing diffs.

    Read · Core and advanced assertions

  • Embed mock.Mock, use m.Called(), verify with AssertExpectations(t)

    Matchers include mock.Anything and mock.MatchedBy. See references/mock.md.

    Write · testify/mock

  • Suites with shared setup and teardown

    Remember to call suite.Run(), or zero tests execute.

    Write · testify/suite

  • Six mistakes, such as is.Equal on wrapped errors

    Use ErrorIs for errors, and EqualExportedValues instead of comparing pointers.

    Read · Common mistakes

From the official docs

Permissions

Low risk

Claude can edit your Go files and run go and git commands while this skill is active. Work on a branch and read the diff before you commit.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • It edits files and runs commands in your project

    The frontmatter lists Edit, Write and these shell commands: go:*, golangci-lint:*, git:*, gotests:*, godig:*, gopls:*. Work on a branch and read the diff before you commit. github.com

  • Claude may fetch web pages

    The frontmatter lists WebFetch. Page text it reads goes into the conversation with your AI provider. github.com

  • The recommended plugin route installs the whole repo

    The plugin route and the --all skills CLI command add all 46 skill folders in the repo, not only this one. The plugin manifest (.claude-plugin/plugin.json, version 2.0.1) declares a name, description, author, license and keywords, and lists no hooks, commands or MCP servers. The skills CLI docs say --all installs every skill into every agent it supports without prompts. github.com

Technical details
Talks toWeb fetch/search through your assistant (WebFetch)
Sign-in and keysSKILL.md names no account or API key.
Scopes
  • Reads and edits files in your Go project

  • Runs the shell commands listed in the allowed-tools field: go:*, golangci-lint:*, git:*, gotests:*, godig:*, gopls:*

  • Frontmatter also allows MCP tools: mcp__context7__resolve-library-id, mcp__context7__query-docs, mcp__gopls__*

Questions

What does golang-stretchr-testify do?

It makes Claude write and review Go tests with testify: choose between assert and require, build mocks with testify/mock, group tests in suites and avoid common mistakes such as swapped argument order.

How do I install golang-stretchr-testify?

Install the whole golang set, not only this skill. The README calls the skills atomic, cross-referencing units and says a partial install gives a potentially inconsistent view. The install box lists the Claude Code plugin (/plugin marketplace add samber/cc, then /plugin install cc-skills-golang@samber), the skills CLI for the whole set or for this skill alone, and the README's Codex, Gemini CLI, Cursor and OpenCode routes. The README documents no Claude app route, so none is listed.

Do I need the other golang skills with golang-stretchr-testify?

Installing the set is the safer choice. SKILL.md hands neighboring topics to other skills: golang-testing, golang-lint, golang-pkg-go-dev, golang-gopls. This skill sits in the README's Tools list, and the README's advice to install together is written for its general-purpose skills, but the whole-set install gives you every skill this one points to.

What does golang-stretchr-testify need on my machine?

The frontmatter names these programs: go, gotests. SKILL.md names no API key or account.

Is golang-stretchr-testify safe?

It is instruction text and reference files, and the folder bundles no scripts. When you use it, Claude can edit files and run go, golangci-lint, git, gotests, godig and gopls commands in your project, as its frontmatter allows. The frontmatter also lists WebFetch, so pages Claude opens are read into your conversation. Work on a branch, read the diff and approve commands you do not recognize.

golang-stretchr-testify vs golang-testing?

This skill is only about the testify library. SKILL.md points to golang-testing for general test patterns, table-driven tests and CI, and to golang-lint for testifylint configuration.

Does golang-stretchr-testify work in Codex, Cursor or the Claude app?

The SKILL.md compatibility field says it is designed for Claude Code, Codex or a similar harness, and the README says the skills are built for Claude Code, Codex, Gemini, Copilot, Antigravity and Cursor. The install box covers Claude Code, Codex, Gemini CLI, Cursor, OpenCode and the skills CLI. The README documents no Claude app route.

Information

updated Nov 2, 2026

Folder
skills/golang-stretchr-testify

samber/cc-skills-golangskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 6
  1. cc-skills-golang README · github.com
  2. skills CLI commands · github.com
  3. cc-skills-golang plugin.json · github.com
  4. samber/cc marketplace.json · github.com
  5. Claude Code skills · code.claude.com
  6. golang-stretchr-testify SKILL.md · github.com

Updated Nov 2, 2026.