x-mockery

Official

Generate testify mocks with mockery v3.

Authorpure-golang
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill solves the problem of writing and maintaining reliable Go unit-test mocks when a consumer needs to stub interface dependencies in a consistent, type-safe way.

Core Features & Use Cases

  • Consumer-side interface mock flow: defines a minimal interface in the package that consumes it, then generates mocks from the root configuration.
  • Mockery v3 + testify integration: produces testify-based mocks with EXPECT() and the New<Type>(t) constructor for mockery v3.
  • Guardrails and validation: ensures you use the project’s centralized .mockery.yml and validates generated output via a post-check script.
  • Run-time return logic: uses RunAndReturn for typed results derived from call arguments.

Quick Start

Run x-mockery to generate a testify mock for a consumer-side interface using the root .mockery.yml, then verify the result with scripts/check-mockery-targets.sh.

Dependency Matrix

Required Modules

None required

Components

scripts

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: x-mockery
Download link: https://github.com/pure-golang/level85/archive/main.zip#x-mockery

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.