testable-nextjs-skill-plugin

内容来源:README.md(说明文档) · 原始地址 · 查看安装指南

原始内容

Testable Next.js Skill Plugin for Claude Code

License: MIT Next.js

A Claude Code plugin that provides expert-level guidance for writing testable Next.js applications with minimal test deltas and stability-first design.


Features

  • Testable by design: Clear seams, deterministic behavior, dependency injection
  • Minimal test delta: Smallest meaningful automated test for each change
  • Stability tactics: Reduce flaky tests with proven patterns
  • Framework-aware: Covers App Router, RSC, Server Actions, Route Handlers, Proxy/middleware
  • Multi-stack support: Jest, Vitest, Playwright, Cypress, MSW

What's Included

skills/writing-testable-nextjs/
├── SKILL.md              # Main instructions (loaded by Claude Code)
├── README.md             # Skill overview
├── EVALS.md              # Evaluation prompts for testing the skill
├── CHANGELOG.md          # Version history
├── VERSION               # Current version
├── PLAYBOOK_README.md    # Playbook overview
├── reference/            # Deep documentation (loaded on demand)
├── templates/            # Test file templates
├── checklists/           # Pre-flight checklists
└── snippets/             # Copy-paste code snippets

Installation

Option A: As a Claude Code plugin (recommended)

git clone https://github.com/kndoshn/testable-nextjs-skill-plugin.git

Then register the plugin in Claude Code:

claude plugins:add /path/to/testable-nextjs-skill-plugin

Or add to your Claude Code settings manually.

Option B: Copy into your project

mkdir -p .claude/skills
cp -R skills/writing-testable-nextjs .claude/skills/

Option C: Personal installation

cp -R skills/writing-testable-nextjs ~/.claude/skills/

Usage

After installation, ask Claude Code for Next.js testing tasks. The Skill activates automatically when your request matches its scope.

Example Prompts

"Add tests for this Server Action."
"How should I test this RSC component?"
"Make this route handler testable."
"Review my test for flakiness."
"What's the minimal test delta for this change?"

Documentation

See the Skill's own documentation for details:


Compatibility

  • Next.js: 13+ (App Router), Pages Router also supported
  • Test frameworks: Jest, Vitest, Playwright, Cypress
  • Mocking: MSW, native mocks

License

MIT