x-unit-test-partial-interface
OfficialKeep unit tests isolated with minimal contracts.
System Documentation
What problem does it solve?
Skill helps you write unit tests with external dependencies without turning them into integration tests by capturing only the minimal consumer-side contract (or using callback aliases) needed for verification.
Core Features & Use Cases
- Consumer-side minimal interface: define a small local interface next to the code under test using only methods you actually call.
- Callback alias when interfaces are unnecessary: if the API already accepts a function, prefer a local callback alias instead of creating an interface just for mocking.
- Mocking strategy via x-mockery: generate mocks for the chosen local interface and avoid mocking callback types through mockery.
- Test shape guidance: choose between simple, table-driven, call-test, or suite.Suite based on setup/verify complexity.
Use case: a service depends on a storage adapter where only GetItem is needed for the unit scenario; extract a tiny interface (or callback) so you can test error mapping and returned entities with clean Arrange/Act/Assert.
Quick Start
Ask the AI to apply x-unit-test-partial-interface to my service method, and to propose the smallest consumer-side interface (or callback alias), plus a unit test structure (including Arrange/Act/Assert) that stays isolated from the real external adapter.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 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-unit-test-partial-interface Download link: https://github.com/pure-golang/level85/archive/main.zip#x-unit-test-partial-interface Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.