nextjs-unit-test-creator-skill

nextjs-unit-test-creator-skill is a skill for Claude Code, Codex from darellchua2/opencode-config-template. It costs 31 tokens per session (677 once invoked), scanned C, original, Apache-2.0.

A test-generation workflow for Next.js 16 applications, including pages, components, server actions, API routes, hooks, and utilities. It supports unit tests and, when configured, end-to-end tests that exercise the application as a user would.

In plain words
What is it for?
Use it to find testable parts of a Next.js project, create matching test scenarios, detect the existing test tools, and verify that the generated tests pass.
Why use it?
Writing tests for Next.js server and client code requires handling several different application patterns and testing setups.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions OpenCode.

Good fit Use it to find testable parts of a Next.js project, create matching test scenarios, detect the existing test tools, and verify that the generated tests pass.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/darellchua2/opencode-config-template/nextjs-unit-test-creator-skill
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 darellchua2/opencode-config-template --skill nextjs-unit-test-creator-skill
Clone the repo
git clone --depth 1 https://github.com/darellchua2/opencode-config-template

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 nextjs-unit-test-creator-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/nextjs-unit-test-creator-skill/github.svg)](https://agentmods.dev/skills/darellchua2/opencode-config-template/nextjs-unit-test-creator-skill)
Your own site
<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/nextjs-unit-test-creator-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/nextjs-unit-test-creator-skill/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 nextjs-unit-test-creator-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/nextjs-unit-test-creator-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/nextjs-unit-test-creator-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 677 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00031 $0.00677
Opus 5.5 $0.00012 $0.00271
Sonnet 5.5 $0.00006 $0.00135
Haiku 4.5 $0.00003 $0.00068

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

Security

Grade C, and why

nextjs-unit-test-creator-skill scanned grade C with 1 finding 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 2mo 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

When protocol is enabled, this skill defaults to `Iterations: 10` (sufficient for typical single-pass workflows). Override with `Iterations: N` for specific tasks. Safety blocks: `.env`, `node_modules/`, `rm -rf`, `git p
skills/nextjs-unit-test-creator-skill/SKILL.md · 47 lines

How it starts

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

What I do

Generate Next.js 16 tests by extending test-generator-framework (the core workflow lives there): App Router Server/Client Components, Server Actions, app/api/*/route.ts handlers, hooks, utilities, plus Playwright E2E when detected and requested.

When to use me

Unit tests for Next.js 16 components/actions/API routes; E2E for routing and navigation.

Hard requirement: all generated tests must pass npm run test before any PR — enforced downstream by pr-creation-workflow-skill (gate contract: verification-loop-skill).

Next.js 16 testing rules (the version-specific part)

  • Server Components are async: render(await ServerComponent()); no hooks in tests of them
  • Client Components: render(<ClientComponent/>) + interaction via user.click(screen.getByRole(...))
  • Server Actions: plain async functions — call directly with FormData: await serverAction(formData)
  • API routes: Request/Response handlers — const res = await POST(new Request('http://localhost', { method: 'POST', body })); assert status/json
  • Framework choice: Vitest recommended for Next 16 (ESM-native, faster); Jest works with more config; Playwright for E2E (detect from package.json; E2E only when explicitly requested)
  • E2E API mocking: page.route('**/api/x', route => route.fulfill({ status, contentType, body })) — cover 200, error status, and slow-response cases

Scenario coverage checklist: SSR render + props for Server Components; 'use client' interactivity + state updates; routing/navigation; image optimization; metadata generation.

Removed 2026-09: the 500-line step-by-step workflow (framework detection transcripts, per-artifact scenario walkthroughs, full Vitest/Jest config listings, generated-example dumps), Best Practices/Common Issues/Troubleshooting ceremony — framework-generic testing knowledge; kept the Next-16-specific render/action/route patterns and the pass-before-PR contract.

Iteration Protocol (opt-in)

DO NOT execute any of the following unless AUTORESEARCH_PROTOCOL=1 is set in your environment. When unset, this skill behaves exactly as documented in all sections above; the Iteration Protocol block is descriptive only.

Read the full file on GitHub · 47 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. 2mo ago Changed fa21cb626813
  2. 2mo ago Changed · -1,138 lines ec152486f7a6
  3. 3mo ago First seen · 1,185 lines · 31 tokens per session scan C 697e69248004

Subscribe to this mod's changes

nextjs-unit-test-creator-skill is a skill published in the GitHub repository darellchua2/opencode-config-template (6 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 31 tokens to every session and 677 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

nextjs-unit-test-creator-skill compared with skills from other repositories

nextjs-unit-test-creator-skill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
nextjs-unit-test-creator-skilldarellchua2/opencode-config-templateSkill62mo agoApache-2.0C31Claude Code, Codex
test-masterJeffallan/claude-skillsSkill13kyesterdayMITA104Claude Code
axiom-testingCharlesWiltgen/AxiomSkill1.3k3d agoMITA38Claude Code
test-generatorrshankras/claude-code-apple-skillsSkill92726d agoMITA33Claude Code
test-automation-expertcuriositech/some_claude_skillsSkill2858d agoMITA133Claude Code
testing-blocksadobe/skillsSkill343yesterdayApache-2.0A114Claude Code
mobile-app-testingsecondsky/claude-skillsSkill2575d agoMITA47Claude Code