implement-test-guide

Implement test suites with result-focused assertions across Vitest, Storybook, and Jest frameworks.

1|1|Updated Dec 18, 2025
One-click install
npx skills add https://github.com/nexuslabs-ai/nexus --skill implement-test-guide-nexuslabs-ai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: implement-test-guide
Source: https://github.com/nexuslabs-ai/nexus/tree/main/.agents/skills/implement-test-guide
Command: npx skills add https://github.com/nexuslabs-ai/nexus --skill implement-test-guide-nexuslabs-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing tests that actually catch bugs is hard: teams often chase coverage numbers with shallow assertions, flaky mocks, and inconsistent patterns. This Skill guides the implementation of deterministic, result-validating tests for any codebase, from unit tests to Storybook interaction tests. ## Core Features & Use Cases - Multi-source context intake: Accepts testing plans, GitHub issues (via gh issue view), source files, or conversational requirements as input. - Package-aware patterns: Applies the right testing approach per package type — Vitest unit tests for core token scripts, Storybook play functions for React components, and integration tests for pipelines. - Structured four-phase workflow: Understand the target, design the strategy (fixtures, mocks, test types), implement systematically, then verify determinism and error coverage. - Use Case: Given a GitHub issue requesting coverage for a new React component, the Skill fetches the issue, detects the packages/react/ context, and implements story-first tests with play functions plus error and edge cases. ## Quick Start Ask the agent to implement tests for a specific source file or GitHub issue, for example by saying: implement tests for the Button component following the testing guide.

Frequently Asked Questions about implement-test-guide

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write unit tests with Vitest for TypeScript code?▼

Import describe, it, and expect from vitest, then structure tests with nested describe blocks per function. Follow the arrange-act-assert pattern, use toMatchObject for partial matching on complex results, and keep one assertion focus per test.

How to test React components with Storybook play functions?▼

Write stories in *.stories.tsx files and add play functions using expect, fn, userEvent, and within from storybook/test. This story-first approach covers both visual states and interaction behavior against the real component.

Should I mock internal functions or external APIs in tests?▼

Mock only external boundaries such as APIs, databases, and LLM services; never mock internal functions. Mocks must implement the real interfaces so tests stay honest about integration behavior.

Why are my tests flaky and how do I make them deterministic?▼

Flakiness usually comes from timing dependencies, shared state, or unordered assertions. Run tests multiple times to verify determinism, use order-independent matchers like arrayContaining, and isolate each test's fixtures.

What is partial matching in test assertions?▼

Partial matching asserts only on the fields that matter using toMatchObject or objectContaining, instead of exact equality on entire objects. This keeps tests resilient to irrelevant changes while still validating the contract.