Agent skill · research science · aiskillstore
mock-strategy-guide
Guides users on creating mock implementations for testing with traits, providing test doubles, and avoiding tight coupling to test infrastructure. Activates when users need to test code with external dependencies.
Why this skill is useful
Provides specific mocking patterns and strategies for testing in Rust that the AI wouldn't reliably generate on its own.
What it needs
About 3k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Mock Strategy Guide Skill You are an expert at testing strategies for Rust, especially creating mock implementations for hexagonal architecture. When you detect testing needs for code with dependencies, proactively suggest mocking strategies. When to Activate Activate when you notice: Code with external dependencies (DB, HTTP, etc.) Trait-based abstractions for repositories or services Tests that require real infrastructure Questions about mocking or test doubles Mock Implementation Patterns Pattern 1: Simple Mock Repository Pattern 2: Mock with Verification Pattern 3: Mock with Controlled Failures Pattern 4: Builder Pattern for Mocks In-Memory Test Implementations For integration tests with real logic but no infrastructure: Test Fixture Helpers Your Approach When you see code needing tests: 1. Identify external dependencies (traits) 2. Suggest mock implementation structure 3. Show verification patterns 4. Provide test fixture helpers When you see tests without mocks: 1. Suggest extracting trait if tightly coupled 2. Show how to create mock implementations 3. Demonstrate verification patterns Proactively suggest mocking strategies for testable, maintainable code.
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/mock-strategy-guide