Store / Testing

Next.js Test Writer

Tests that catch real regressions in a Next.js app.

Your agent reads the project, plans tests from risk (money, access, irreversible data, the first five minutes), writes Vitest and Playwright tests in one consistent house style, and proves each test can fail before keeping it. Covers route handlers, server actions, middleware, auth, Stripe webhooks and time zones.

Price $15 one timeSafety scan ClearProof 3 runs each way

Instant download after payment. Updates included: your order link always serves the latest version.

The proof

With and without this skill.

Prompt: “Here is a small feature from our Next.js App Router app. Plan the tests and write them, and present the plan and every test file in a single HTML page. lib/coupon.ts: export type Coupon = { code: string; percentOff: number; expiresAt: string; maxRedemptions: number; redemptions: number; firstOrderOnly: boolean }; export function applyCoupon(c: Coupon, subtotalCents: number, now: Date, isFirstOrder: boolean) { if (new Date(c.expiresAt) < now) return { ok: false, reason: "expired" } as const; if (c.redemptions >= c.maxRedemptions) return { ok: false, reason: "used_up" } as const; if (c.firstOrderOnly && !isFirstOrder) return { ok: false, reason: "first_order_only" } as const; const discount = Math.round(subtotalCents * c.percentOff / 100); return { ok: true, totalCents: subtotalCents - discount, discountCents: discount } as const; } app/api/coupons/apply/route.ts: import { NextResponse } from "next/server"; import { getCoupon, isFirstOrder } from "@/lib/db"; import { applyCoupon } from "@/lib/coupon"; export async function POST(req: Request) { const { code, subtotalCents, userId } = await req.json(); if (!code || typeof subtotalCents !== "number") return NextResponse.json({ error: "code and subtotalCents are required" }, { status: 400 }); const coupon = await getCoupon(code.trim().toUpperCase()); if (!coupon) return NextResponse.json({ error: "not_found" }, { status: 404 }); const result = applyCoupon(coupon, subtotalCents, new Date(), await isFirstOrder(userId)); return NextResponse.json(result, { status: result.ok ? 200 : 422 }); } app/checkout/CouponForm.tsx is a client component with a text input labeled "Coupon code", an "Apply" button, and it shows the new total or an error message from the API.” Run on claude-opus-5-5. 3 independent runs per side; all are shown, none picked by hand.

Without the skillWith Next.js Test Writer
⇆
Without, runWith Next.js Test Writer, run3 independent runs per side, none selected by hand.

Download the with-skill page

Who it is for

Next.js teams with thin or flaky test suites, on the App Router or the Pages Router.

What you get
  • SKILL.md with the plan-from-risk method
  • Exact Vitest and Playwright setup and CI steps
  • House style with worked examples
  • Patterns for route handlers, server actions, middleware, auth, Stripe, dates and databases
License

Use it and change it for yourself and your team, in your own projects. Please do not resell or publish it. Each download carries a license ID tied to your order.

Install

Unzip into .claude/skills/ for Claude Code, .agents/skills/ for Codex, or .cursor/skills/ for Cursor. How to use a skill.