Agent skill
libharness
libharness - Test harness and mock infrastructure. createMockStorage, createMockConfig, createMockLogger provide framework mocks. createMockMemoryClient, createMockLlmClient, createMockAgentClient provide service client mocks. createMockGrpcCall for gRPC testing. Use for unit testing services and packages with isolated dependencies.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/libharness
SKILL.md
libharness Skill
When to Use
- Writing unit tests for services and packages
- Mocking external dependencies (storage, config, logging)
- Creating isolated test environments
- Testing gRPC service implementations
Key Concepts
Framework mocks: createMockStorage, createMockConfig, createMockLogger provide test doubles for core infrastructure.
Client mocks: createMockMemoryClient, createMockLlmClient, etc. provide test doubles for gRPC service clients.
Fixtures: Pre-configured test data and assertion helpers.
Usage Patterns
Pattern 1: Mock infrastructure
import {
createMockConfig,
createMockStorage,
createMockLogger,
} from "@copilot-ld/libharness";
const config = createMockConfig("test-service");
const storage = createMockStorage();
const logger = createMockLogger();
Pattern 2: Mock service clients
import { createMockLlmClient } from "@copilot-ld/libharness";
const llmClient = createMockLlmClient({
completionResponse: { content: "Hello" },
});
Integration
Used across all test files. Requires libtype for generated type mocks.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?