Official agent skill

Testing Patterns

by langchain-ai in langchain-ai/skills-benchmarks

Unit testing and integration testing best practices. An agent skill from langchain-ai/skills-benchmarks.

OfficialMITAuto-check passedTesting & QA

Install Testing Patterns

skills CLI
$ npx skills add langchain-ai/skills-benchmarks --skill testing-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install langchain-ai/skills-benchmarks testing-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/langchain-ai/skills-benchmarks.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/noise/testing_patterns .claude/skills/testing-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
testing-patterns
GitHub stars
118
Token cost
~447 tokens
SKILL.md length
37 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

Unit testing and integration testing best practices. An agent skill from langchain-ai/skills-benchmarks.

  • Tasks that involve Test strategy
  • SKILL.md covers Test Structure (AAA Pattern), Mocking External Services, Fixtures and Factories and Integration Tests, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve Integration testing

What it does

Testing Patterns is an agent skill from langchain-ai/skills-benchmarks, published by the product's own GitHub organization. Unit testing and integration testing best practices

Its SKILL.md is about 450 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Test strategy, Integration testing and Unit testing. The licence is MIT.

When your agent uses it

  • Tasks that involve Test strategy
  • Tasks that involve Integration testing
  • Tasks that involve Unit testing

Example prompts

  • “/testing-patterns”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 9195f8c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Testing Patterns loads about 447 tokens when it runs. Until then it costs about 17 tokens; SKILL.md has 37 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~17
When it runs · the whole SKILL.md, loaded when a task matches
~447

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from langchain-ai/skills-benchmarks at commit 9195f8c, republished under its MIT licence (© langchain-ai). 37 words, ~447 tokens.

Download SKILL.mdSave it as .claude/skills/testing-patterns/SKILL.md (or your agent's skills folder).
name
testing-patterns
description
Unit testing and integration testing best practices

Testing Patterns

Write effective, maintainable tests using modern patterns.

Test Structure (AAA Pattern)

python
def test_user_registration():
    # Arrange
    user_data = {"email": "test@example.com", "password": "secure123"}

    # Act
    result = register_user(user_data)

    # Assert
    assert result.success is True
    assert result.user.email == "test@example.com"

Mocking External Services

python
from unittest.mock import Mock, patch

@patch('services.email.send_email')
def test_sends_welcome_email(mock_send):
    mock_send.return_value = True

    register_user({"email": "test@example.com"})

    mock_send.assert_called_once_with(
        to="test@example.com",
        template="welcome"
    )

Fixtures and Factories

python
import pytest
from factories import UserFactory

@pytest.fixture
def user():
    return UserFactory.create(role="admin")

@pytest.fixture
def authenticated_client(user):
    client = TestClient(app)
    client.login(user)
    return client

def test_admin_dashboard(authenticated_client):
    response = authenticated_client.get("/admin")
    assert response.status_code == 200

Integration Tests

python
@pytest.mark.integration
def test_full_checkout_flow(db_session, stripe_mock):
    # Create test data
    user = create_user()
    product = create_product(price=100)

    # Execute flow
    cart = add_to_cart(user, product)
    order = checkout(cart, payment_method="card")

    # Verify
    assert order.status == "completed"
    assert stripe_mock.charges.create.called

Test Coverage Goals

  • Unit tests: 80%+ coverage
  • Integration tests: Critical paths
  • E2E tests: Happy paths only

© langchain-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/noise/testing_patterns of langchain-ai/skills-benchmarks.

Open the folder on GitHubat commit 9195f8c

Compare with similar skills

Testing Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Testing Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Testing Patterns this skilllangchain-ai/skills-benchmarks118—~447Automated safety check: PassMIT
Abp Testingabpframework/abp14k—~1.7kAutomated safety check: PassLGPL-3.0
Testing Patternsaiskillstore/marketplace4301 repos~1kAutomated safety check: NotesNone
Assessing Test Coveragebitwarden/ai-plugins154—~1.1kAutomated safety check: PassCustom licence
Testing QAaiskillstore/marketplace4303 repos~1.2kAutomated safety check: PassNone
Test Experteinverne/dotfiles121—~2.3kAutomated safety check: PassGPL-3.0

Similar skills

  • Abp Testing

    abpframework/abp

    ABP testing patterns - integration tests over unit tests, GetRequiredService, IDataSeedContributor, Shouldly assertions, AddAlwaysAllowAuthorization, NSubstitute mocking, WithUnitOfWorkAsync.

    14k GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Testing Patterns

    aiskillstore/marketplace

    Cross-language testing strategies and patterns. An agent skill from aiskillstore/marketplace.

    430 GitHub starsUsed in 1 repo~1k tokens
    Testing & QAAuto-check: notes
  • Assessing Test Coverage

    bitwarden/ai-plugins

    Official

    A skill your agent uses when determining what test coverage ALREADY exists for a specific change (a PR, Jira key, Tech Breakdown doc, Testmo CSV, changed paths, or named component).

    154 GitHub stars~1.1k tokensUpdated today
    Testing & QAAuto-check passed
  • Testing QA

    aiskillstore/marketplace

    Comprehensive testing and QA workflow covering unit testing, integration testing, E2E testing, browser automation, and quality assurance.

    430 GitHub starsUsed in 3 repos~1.2k tokens
    Testing & QAAuto-check passed
  • Test Expert

    einverne/dotfiles

    Testing methodologies, test-driven development (TDD), unit and integration testing, and testing best practices across multiple frameworks.

    121 GitHub stars~2.3k tokensUpdated 29 days ago
    Testing & QAAuto-check passed
  • Recommending Test Layers

    bitwarden/ai-plugins

    Official

    A skill your agent uses when deciding WHICH new tests a change needs and at WHICH layer each belongs, working from a Jira key, a Testmo CSV, an assessing-test-coverage report, a PR, or a feature…

    154 GitHub stars~2.4k tokensUpdated today
    Testing & QAAuto-check passed

More from langchain-ai/skills-benchmarks

All 8 skills in this repo
  • Framework Selection

    langchain-ai/skills-benchmarks

    Official

    INVOKE THIS SKILL at the START of any LangChain/LangGraph/Deep Agents project, before writing any agent code.

    118 GitHub stars~1.8k tokensUpdated 16 days ago
    Auto-check passed
  • Langchain Agents

    langchain-ai/skills-benchmarks

    Official

    Build LangChain agents with modern patterns. An agent skill from langchain-ai/skills-benchmarks.

    118 GitHub stars~2.5k tokensUpdated 16 days ago
    Auto-check passed
  • Langchain Oss Primer

    langchain-ai/skills-benchmarks

    Official

    ALWAYS START HERE for any LangChain, Deep Agents, or LangGraph agent building project.

    118 GitHub stars~4.1k tokensUpdated 16 days ago
    Auto-check passed
  • React Components

    langchain-ai/skills-benchmarks

    Official

    Modern React component patterns with hooks and TypeScript. An agent skill from langchain-ai/skills-benchmarks.

    118 GitHub stars~437 tokensUpdated 16 days ago
    Auto-check passed
  • API Docs

    langchain-ai/skills-benchmarks

    Official

    OpenAPI documentation and REST API design patterns. An agent skill from langchain-ai/skills-benchmarks.

    118 GitHub stars~358 tokensUpdated 16 days ago
    Auto-check passed
  • Database Migrations

    langchain-ai/skills-benchmarks

    Official

    Database migration patterns and schema versioning. An agent skill from langchain-ai/skills-benchmarks.

    118 GitHub stars~350 tokensUpdated 16 days ago
    Auto-check passed

Categories

Questions about Testing Patterns

What does Testing Patterns do?

Unit testing and integration testing best practices. An agent skill from langchain-ai/skills-benchmarks. Testing Patterns is an agent skill from langchain-ai/skills-benchmarks, published by the product's own GitHub organization.

When should I use Testing Patterns?

Testing Patterns fits situations like: tasks that involve Test strategy; tasks that involve Integration testing; tasks that involve Unit testing.

How do I install Testing Patterns in Claude Code?

Run `npx skills add langchain-ai/skills-benchmarks --skill testing-patterns -a claude-code`. Or copy the skill folder (skills/noise/testing_patterns in langchain-ai/skills-benchmarks) into .claude/skills/testing-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Testing Patterns in Codex?

Run `npx skills add langchain-ai/skills-benchmarks --skill testing-patterns -a codex`. Or copy the skill folder (skills/noise/testing_patterns in langchain-ai/skills-benchmarks) into .agents/skills/testing-patterns in your project. Codex loads it when a task matches its description.

Can I use Testing Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add langchain-ai/skills-benchmarks --skill testing-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/testing-patterns, .gemini/skills/testing-patterns, .github/skills/testing-patterns and .opencode/skills/testing-patterns in your project.

What does Testing Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Testing Patterns is instructions for the agent only. Our summary lists: Python 3.

Does Testing Patterns access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Testing Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Testing Patterns use?

Testing Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Testing Patterns use?

About 447 tokens (SKILL.md is roughly 1.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Testing Patterns?

Skills that share tags, products or a category with Testing Patterns: Abp Testing (abpframework/abp, 14k stars), Testing Patterns (aiskillstore/marketplace, 430 stars), Assessing Test Coverage (bitwarden/ai-plugins, 154 stars) and Testing QA (aiskillstore/marketplace, 430 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Testing Patterns?

langchain-ai (a GitHub organization, an official publisher) maintains it in langchain-ai/skills-benchmarks, which has 118 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on September 21, 2026.

Source: langchain-ai/skills-benchmarks on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.