testing-kit

testing-kit is a skill for Claude Code from fermonterom/claude-testing-kit. It costs 78 tokens per session (3,867 once invoked), scanned A, original, MIT.

A testing and quality-check workflow for Next.js applications using the App Router. TDD, or test-driven development, means writing a failing test before writing the code that makes it pass; the workflow also covers unit tests, browser tests, builds, environment variables, and security checks.

In plain words
What is it for?
Use it when creating or changing Next.js routes, pages, or tests, including writing Vitest unit tests, Playwright end-to-end tests, and checking the production build.
Why use it?
It makes each route and page prove its expected behavior and catches failures before changes reach users.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions Claude Code.

Good fit Use it when creating or changing Next.js routes, pages, or tests, including writing Vitest unit tests, Playwright end-to-end tests, and checking the production build.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fermonterom/claude-testing-kit/testing-kit
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add fermonterom/claude-testing-kit --skill testing-kit
Clone the repo
git clone --depth 1 https://github.com/fermonterom/claude-testing-kit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for testing-kit

README.md
[![agentmods](https://agentmods.dev/badge/skills/fermonterom/claude-testing-kit/testing-kit/github.svg)](https://agentmods.dev/skills/fermonterom/claude-testing-kit/testing-kit)
Your own site
<a href="https://agentmods.dev/skills/fermonterom/claude-testing-kit/testing-kit"><img src="https://agentmods.dev/badge/skills/fermonterom/claude-testing-kit/testing-kit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for testing-kit

Your own site · 80×15
<a href="https://agentmods.dev/skills/fermonterom/claude-testing-kit/testing-kit"><img src="https://agentmods.dev/badge/skills/fermonterom/claude-testing-kit/testing-kit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,867 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00078 $0.03867
Opus 5.5 $0.00031 $0.01547
Sonnet 5.5 $0.00016 $0.00773
Haiku 4.5 $0.00008 $0.00387

Measured 1mo ago against content hash 05fbd464c80f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

testing-kit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/testing-kit/SKILL.md · 485 lines

How it starts

The opening of the file, as written. The whole thing — 485 lines — stays where its author put it; the contents beside it link to each section on GitHub.

testing-kit — TDD + Unit + E2E + Quality Gate para Next.js

Parte 1: TDD — Test First, Code Second

3 Reglas de Hierro

1. TEST FIRST, CODE SECOND — sin excepciones
2. NUNCA codigo de produccion sin un test que falle primero
3. CADA route.ts tiene route.test.ts, CADA page.tsx tiene .spec.ts

Ciclo RED → GREEN → REFACTOR

RED: Escribir UN test que describe UN comportamiento → ejecutar → DEBE FALLAR GREEN: Escribir el codigo MINIMO para que pase → ejecutar → DEBE PASAR REFACTOR: Limpiar sin romper tests → ejecutar → SIGUE PASANDO

Repetir. Un test a la vez. SIEMPRE vertical (test → codigo → green), NUNCA horizontal (todos los tests → luego todo el codigo).

Test List (antes de escribir codigo)

Listar todos los comportamientos a testear. Ejemplo para POST /api/users:

1. 201 — crea usuario con datos validos
2. 401 — rechaza sin autenticacion
3. 400 — rechaza campos requeridos vacios
4. 400 — rechaza email invalido
5. 404 — recurso padre no existe
6. 500 — maneja error de base de datos

Cada item = un ciclo RED → GREEN.


Parte 2: Unit Tests con Vitest

Template de 6 Casos (minimo obligatorio)

import { describe, it, expect, vi, beforeEach } from 'vitest'

// Mocks ANTES de los imports del codigo
const mockGetUser = vi.fn()
const mockFrom = vi.fn()

vi.mock('@/lib/supabase/server', () => ({
  createClient: vi.fn(() => Promise.resolve({
    auth: { getUser: mockGetUser },
    from: mockFrom,
  })),
}))

// Import del codigo a testear
import { POST } from './route'

const MOCK_USER = { id: 'user-123', email: '[email protected]' }

function createRequest(body?: unknown): Request {
  return new Request('http://localhost/api/resource', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    ...(body ? { body: JSON.stringify(body) } : {}),
  })
}

beforeEach(() => { vi.clearAllMocks() })

describe('POST /api/resource', () => {
  // CASO 1: Happy path (200/201)
  it('returns 201 with created resource', async () => {
    mockGetUser.mockResolvedValue({ data: { user: MOCK_USER } })
    mockFrom.mockReturnValue({
      insert: vi.fn().mockReturnThis(),
      select: vi.fn().mockReturnThis(),
      single: vi.fn().mockResolvedValue({ data: { id: '1', name: 'Test' }, error: null }),
    })

    const res = await POST(createRequest({ name: 'Test' }))
    expect(res.status).toBe(201)
  })

  // CASO 2: Sin autenticacion (401)
  it('returns 401 when not authenticated', async () => {
    mockGetUser.mockResolvedValue({ data: { user: null } })
    const res = await POST(createRequest({ name: 'Test' }))
    expect(res.status).toBe(401)
  })

  // CASO 3: Input invalido (400)
  it('returns 400 on invalid input', async () => {
    mockGetUser.mockResolvedValue({ data: { user: MOCK_USER } })
    const res = await POST(createRequest({})) // body vacio
    expect(res.status).toBe(400)
  })

  // CASO 4: No encontrado (404)
  it('returns 404 when resource not found', async () => {
    mockGetUser.mockResolvedValue({ data: { user: MOCK_USER } })
    mockFrom.mockReturnValue({
      select: vi.fn().mockReturnThis(),
      eq: vi.fn().mockReturnThis(),
      single: vi.fn().mockResolvedValue({ data: null, error: null }),
    })

    const res = await POST(createRequest({ parentId: 'not-found' }))
    expect(res.status).toBe(404)
  })

  // CASO 5: Error de BD (500)
  it('returns 500 on database error', async () => {
    mockGetUser.mockResolvedValue({ data: { user: MOCK_USER } })
    mockFrom.mockReturnValue({
      insert: vi.fn().mockReturnThis(),
      select: vi.fn().mockReturnThis(),
      single: vi.fn().mockResolvedValue({ data: null, error: { message: 'DB error' } }),
    })

    const res = await POST(createRequest({ name: 'Test' }))
    expect(res.status).toBe(500)
    // Verificar que NO expone el error interno
    const body = await res.json()
    expect(body.error).not.toContain('DB error')
  })

  // CASO 6: Extra (especifico del endpoint — SIEMPRE implementar, nunca dejar vacio)
  it('returns 409 when duplicate name exists', async () => {
    mockGetUser.mockResolvedValue({ data: { user: MOCK_USER } })
    mockFrom.mockReturnValue({
      insert: vi.fn().mockReturnThis(),
      select: vi.fn().mockReturnThis(),
      single: vi.fn().mockResolvedValue({
        data: null,
        error: { message: 'unique_violation', code: '23505' },
      }),
    })

    const res = await POST(createRequest({ name: 'Duplicado' }))
    expect(res.status).toBe(409)
  })
})

Read the full file on GitHub · 485 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 485 lines · 78 tokens per session scan A 05fbd464c80f

Subscribe to this mod's changes

testing-kit is a skill published in the GitHub repository fermonterom/claude-testing-kit (10 stars, last pushed 6mo ago), licensed MIT. It adds 78 tokens to every session and 3,867 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

test-master

Generates test files, creates mocking strategies, analyzes code coverage, designs test architectures, and produces test plans and defect reports across functional, performance, and security testing disciplines. Use when writing unit tests, integration tests, or E2E tests; creating test strategies or automation…

Jeffallan/claude-skills · 104 tokens

axiom-testing

Use when writing ANY test, debugging flaky tests, making tests faster, or choosing Swift Testing vs XCTest. Covers unit tests, UI tests, async testing, test architecture.

CharlesWiltgen/Axiom · 38 tokens

designing-tests

Designs and implements testing strategies for any codebase. Use when adding tests, improving coverage, setting up testing infrastructure, debugging test failures, or when asked about unit tests, integration tests, or E2E testing.

CloudAI-X/claude-workflow-v2 · 48 tokens

testing-blocks

Use this when you have made AEM Edge Delivery Services code changes to blocks, scripts, or styles and need to validate them before opening a pull request. Covers unit testing for utilities and logic, browser testing with Playwright, linting, and guidance on what to test and how.

adobe/skills · 61 tokens

JMeter Load Testing

Load and performance testing skill using Apache JMeter, covering test plans, thread groups, assertions, listeners, timers, and distributed testing.

PramodDutta/qaskills · 32 tokens

testing-patterns

Testing strategy: pyramid, AAA, mocks/fakes/stubs, flaky tests, coverage. Triggers: test, fixture, mock, stub, e2e, TDD, Playwright, Cypress, flaky, coverage, property-based.

softspark/ai-toolkit · 52 tokens