test-ts

test-ts is a skill for Claude Code, Codex from sergeyklay/.agents. It costs 139 tokens per session (3,730 once invoked), scanned A, original, Apache-2.0.

A testing guide for TypeScript and React code in a Next.js 16 application, using Vitest as the test runner. Tests are checks that code behaves as expected; React Testing Library renders components for those checks.

In plain words
What is it for?
Writing, reviewing, running, and configuring Vitest tests for Next.js App Router code.
Why use it?
It provides a consistent way to test utilities, components, hooks, server actions, and integrations without introducing a different test framework.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument; installed under .agents/ (shared by several agents).

Good fit Writing, reviewing, running, and configuring Vitest tests for Next.js App Router code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sergeyklay/.agents/test-ts
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 sergeyklay/.agents --skill test-ts
Clone the repo
git clone --depth 1 https://github.com/sergeyklay/.agents

Made for: Claude Code, Codex.

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 test-ts

README.md
[![agentmods](https://agentmods.dev/badge/skills/sergeyklay/.agents/test-ts/github.svg)](https://agentmods.dev/skills/sergeyklay/.agents/test-ts)
Your own site
<a href="https://agentmods.dev/skills/sergeyklay/.agents/test-ts"><img src="https://agentmods.dev/badge/skills/sergeyklay/.agents/test-ts/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 test-ts

Your own site · 80×15
<a href="https://agentmods.dev/skills/sergeyklay/.agents/test-ts"><img src="https://agentmods.dev/badge/skills/sergeyklay/.agents/test-ts.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 139 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,730 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 3 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 22
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 23
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 24
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
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.00139 $0.03730
Opus 5 $0.00069 $0.01865
Sonnet 5 $0.00028 $0.00746
Haiku 4.5 $0.00014 $0.00373

Measured 9d ago against content hash f5daaf55e4d5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

test-ts 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 9d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (assets/vitest.config.ts, assets/vitest.setup.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.agents/skills/test-ts/SKILL.md · 369 lines

How it starts

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

TypeScript/React testing

This project uses Vitest as the test runner. The Next.js 16 official documentation recommends Vitest over Jest for App Router projects: native ESM and TypeScript support require no additional transformation configuration, and Vitest runs 3–5x faster than Jest on equivalent suites. Do not introduce Jest.

Test runner commands

npm test                                   # run all tests once
npm run test:watch                         # watch mode
npm run test:coverage                      # with coverage report

# Targeted runs
npx vitest run src/components/invoice/     # run tests in a directory
npx vitest run -t "renders the client"     # filter by test name pattern
npx vitest run path/to/component.test.tsx  # run a single file

Decision framework

Before writing any test, classify it:

Category What it covers Vitest environment
Unit Pure functions, utilities, Zod schemas, computed logic node
Component Client Components rendered with RTL jsdom
Hook Custom hooks via renderHook jsdom
Server Action 'use server' functions with mocked Prisma node
Integration Real database or external service node + env gate

jsdom is the default environment configured in vitest.config.ts. For Server Actions and utilities, add a file-level directive to switch to node:

// @vitest-environment node
import { describe, it, expect, vi, beforeEach } from 'vitest';

Pick the lightest category that validates the behavior. Async Server Components (RSCs) cannot be rendered by RTL; see "RSC testing strategy" below and references/rsc-patterns.md for full mocking recipes.

File organization

  • One test file per source file: invoice-card.tsx maps to invoice-card.test.tsx.
  • Co-locate test files next to the source file, not in a separate __tests__/ directory.
  • Fixture factories live in src/__fixtures__/<domain>.fixtures.ts.
  • All new features require tests; every bug fix requires a regression test.

Read the full file on GitHub · 369 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 369 lines · 139 tokens per session scan A f5daaf55e4d5

Subscribe to this mod's changes

test-ts is a skill published in the GitHub repository sergeyklay/.agents (5 stars, last pushed today), licensed Apache-2.0. It adds 139 tokens to every session and 3,730 once invoked, about $0.0007 per session on Opus 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

112-java-maven-plugins

Use when you need to add or configure Maven plugins in your pom.xml — including quality tools (enforcer, surefire, failsafe, jacoco, pitest, spotbugs, pmd), security scanning (OWASP), code formatting (Spotless), version management, container image build (Jib), build information tracking, and benchmarking (JMH) …

jabrena/plinth · 149 tokens

lab:autoresearch

Self-improving loop for plugin skills. Reads program.md, proposes one mutation per iteration, evaluates against deterministic scorer, keeps improvements via git, reverts failures. Targets weakest skill+dimension. Use with /loop for overnight runs.

oliver-kriska/claude-elixir-phoenix · 52 tokens

mix-compression

Reduce mix output noise (5-15% token savings) by installing rtk filters that compress mix test/credo/dialyzer/compile output before it reaches Claude. Use when long mix output floods context.

oliver-kriska/claude-elixir-phoenix · 48 tokens

verify

Verify Elixir/Phoenix changes — compile, format, and test in one loop. Use after implementation, before PRs, or after fixing bugs.

oliver-kriska/claude-elixir-phoenix · 33 tokens

codex-ab

Run an A/B codex review experiment — holistic codex review vs 3 focused dimension passes (security, ecto, liveview) on the branch diff, classify findings, report a panel-value verdict. Use when the branch is fresh, before any codex review runs.

oliver-kriska/claude-elixir-phoenix · 60 tokens

testing

Write or repair Elixir tests with ExUnit, sandbox isolation, async reliability, Mox, ExMachina, and LiveViewTest. Use for test files, test setup, or failing/flaky tests. NOT for investigating an application bug outside the test suite.

oliver-kriska/claude-elixir-phoenix · 55 tokens