nextjs-unit-test-creator-skill

nextjs-unit-test-creator-skill is a skill for OpenCode from darellchua2/opencode-config-template. It costs 31 tokens per session (8,525 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 OpenCode

Written for OpenCode: installed under .opencode/. 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: OpenCode.

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.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.svg" alt="Measured on agentmods" 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 8,525 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.08525
Opus 5 $0.00015 $0.04262
Sonnet 5 $0.00006 $0.01705
Haiku 4.5 $0.00003 $0.00852

Measured 4d ago against content hash 697e69248004, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-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 4d 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
opencode_app/.opencode/skills/nextjs-unit-test-creator-skill/SKILL.md · 1,185 lines

How it starts

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

What I do

I implement a complete Next.js 16 test generation workflow by extending test-generator-framework:

  1. Analyze Next.js Codebase: Scan Next.js 16 application to identify components, hooks, and utilities using App Router patterns
  2. Detect Next.js Framework: Identify specific Next.js testing setup (Vitest recommended for Next.js 16, Jest, Playwright) from package.json
  3. Generate Next.js-16-Specific Scenarios: Create comprehensive test scenarios covering:
    • App Router Components: Server components (page.tsx, layout.tsx, loading.tsx, error.tsx)
    • Client Components: "use client" components with hooks and interactions
    • Server Actions: async server action functions and mutations
    • API Routes: App Router API handlers (app/api/*/route.ts)
    • Hooks: Custom hooks with React-specific patterns
    • Utility Functions: Next.js utilities (routing, data fetching, validation)
    • E2E Tests: Next.js routing, page navigation, API routes (if Playwright detected)
  4. Delegate to Framework: Use test-generator-framework for core test generation workflow
  5. Ensure Executability: Verify tests run with npm run test - ALL TESTS MUST PASS
  6. Validate Next.js 16 Patterns: Ensure tests handle Server Components, Suspense, and App Router correctly

Critical Requirement: All generated tests must pass (npm run test) before PR creation. This integrates with nextjs-pr-workflow to enforce test validation.

When to use me

Use this workflow when:

  • You need to create unit tests for new Next.js components
  • You want to ensure all edge cases and user interactions are covered
  • You need tests for utility functions in a Next.js application
  • You need E2E tests for Next.js applications (Playwright)
  • You prefer a systematic approach to test generation with user confirmation
  • You want to ensure tests run correctly with your project's test framework

Framework: This skill extends test-generator-framework for core test generation workflow, adding Next.js-specific functionality.

Read the full file on GitHub · 1,185 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. 4d 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 yesterday), licensed Apache-2.0. It adds 31 tokens to every session and 8,525 once invoked, about $0.0002 per session on Opus 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

Other skills, from other repositories

frontend-testing

Comprehensive frontend testing strategy covering unit, integration, E2E, visual regression, and accessibility testing.

cosmicstack-labs/mercury-agent-skills · 23 tokens

test-implement

Implements React/TypeScript unit, integration, and browser E2E tests with the repository's configured runner, mocks, setup, and browser harness. Use when creating or completing frontend tests and generated test skeletons.

shinpr/claude-code-workflows · 48 tokens

angular-testing

Write unit and integration tests for Angular v20+ applications using Vitest or Jasmine with TestBed and modern testing patterns. Use for testing components with signals, OnPush change detection, services with inject(), and HTTP interactions. Triggers on test creation, testing signal-based components, mocking…

Kilo-Org/kilo-marketplace · 94 tokens

angular-testing

Testing Angular 18-21: TestBed, component harnesses (@angular/cdk/testing), Karma+Jasmine (default historical) vs Jest (jest-preset-angular, modern), Angular Testing Library (RTL-style). HttpClient mocking via HttpTestingController. NgRx Effects testing. Cypress / Playwright e2e. Use this skill to: Detect runner…

AratKruglik/claude-sdlc · 185 tokens

vue-testing

Testing Vue 3 SPAs: Vitest + @vue/test-utils, RTL-style alternatives, Pinia testing via createTestingPinia, composable testing, msw for network mocks, Cypress component testing, Playwright e2e. Use this skill to: Set up Vitest for Vue 3 with jsdom + @vue/test-utils. Pick mount vs shallowMount. Test components by…

AratKruglik/claude-sdlc · 155 tokens

react-testing

Testing React SPAs: React Testing Library + Vitest/Jest for components and hooks, msw for network mocks, Playwright/Cypress for e2e. Query priority, user events, async assertions, mocking patterns. Use this skill to: Pick the right runner (Vitest vs Jest) and setup. Write component tests with RTL using accessible…

AratKruglik/claude-sdlc · 154 tokens