Token导航 LogoToken导航

Agent Skill · 前端设计

testing-next-stack(测试 Next.js stack)

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

testing-next-stack 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证为 MIT,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 4,240。

总安装 948周安装 38GitHub Stars 3下载 307核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:testing-next-stack(测试 Next.js stack)
来源仓库:https://github.com/hopeoverture/worldbuilding-app-skills
仓库路径:skills/testing-next-stack
安装命令:
npx skills add https://github.com/hopeoverture/worldbuilding-app-skills --skill testing-next-stack
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/hopeoverture/worldbuilding-app-skills --skill testing-next-stack

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

专为 Next.js 技术栈设计的测试辅助工具集。支持服务端渲染、静态生成等特性的测试覆盖。可集成 Jest、React Testing Library 等框架。需区分客户端与服务器端组件的测试策略。testing-next-stack 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/testing-next-stack

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/hopeoverture/worldbuilding-app-skills --skill…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

testing-next-stack 怎么安装?

在终端执行 npx skills add https://github.com/hopeoverture/worldbuilding-app-skills --skill testing-ne…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

testing-next-stack 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

testing-next-stack 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

testing-next-stack 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

testing-next-stack 用的人多吗?

公开数据是累计安装 948 次,近一周安装 38 次,下载 307 次,GitHub 3 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

testing-next-stack 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
testing-next-stack

测试 Next.js stack · 本页

9483操作浏览器MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Testing Next Stack

Scaffold complete testing infrastructure for Next.js applications with modern testing tools.

Overview

To create a comprehensive testing setup for Next.js applications, use this skill to generate:

  • Vitest configuration for fast unit tests
  • React Testing Library setup for component testing
  • Playwright configuration for E2E testing
  • Accessibility testing with axe-core
  • Test utilities and helpers
  • Example test files demonstrating best practices

When to Use

Use this skill when:

  • Starting a new Next.js project requiring test infrastructure
  • Migrating from Jest to Vitest
  • Adding E2E testing with Playwright
  • Implementing accessibility testing requirements
  • Creating test utilities for worldbuilding app features (entities, relationships, timelines)
  • Standardizing testing patterns across projects

Setup Process

1. Analyze Project Structure

To understand the project layout, examine:

  • Package.json for existing dependencies
  • Next.js version and configuration
  • TypeScript or JavaScript setup
  • Existing testing infrastructure
  • Component architecture

2. Install Dependencies

Generate package.json additions using scripts/generate_test_deps.py:

python scripts/generate_test_deps.py --nextjs-version <version> --typescript

Install required packages:

  • vitest - Fast unit test runner
  • @testing-library/react - Component testing utilities
  • @testing-library/jest-dom - Custom matchers
  • @testing-library/user-event - User interaction simulation
  • @playwright/test - E2E testing framework
  • @axe-core/playwright - Accessibility testing
  • @vitejs/plugin-react - Vite React plugin
  • jsdom - DOM implementation for Vitest

3. Generate Configuration Files

Create configuration files using templates from assets/:

Vitest Configuration (vitest.config.ts):

  • Use template from assets/vitest.config.ts
  • Configure path aliases matching Next.js
  • Set up test environment (jsdom)
  • Configure coverage reporting

Playwright Configuration (playwright.config.ts):

  • Use template from assets/playwright.config.ts
  • Configure browsers (chromium, firefox, webkit)
  • Set baseURL for development server
  • Configure screenshot and video capture
  • Set up test artifacts directory

Test Setup (test/setup.ts):

  • Use template from assets/test-setup.ts
  • Import @testing-library/jest-dom
  • Configure global test utilities
  • Set up mock implementations

4. Create Test Utilities

Generate utility functions in test/utils/:

Render Utilities (test/utils/render.tsx):

  • Custom render function wrapping providers
  • Context providers (auth, theme, data)
  • Router mocking for Next.js
  • Query client setup for React Query

Mock Factories (test/utils/factories.ts):

  • Entity mock data generators
  • Relationship mock data
  • User mock data
  • API response mocks

Test Helpers (test/utils/helpers.ts):

  • Async test utilities
  • DOM query shortcuts
  • Accessibility test helpers
  • Custom matchers

5. Generate Example Tests

Create example test files demonstrating patterns:

Unit Test Example (test/unit/example.test.ts):

  • Use template from assets/examples/unit-test.ts
  • Demonstrate pure function testing
  • Show async function testing
  • Include edge case coverage

Component Test Example (test/component/example.test.tsx):

  • Use template from assets/examples/component-test.tsx
  • Demonstrate rendering and assertions
  • Show user interaction testing
  • Include accessibility checks with axe

E2E Test Example (test/e2e/example.spec.ts):

  • Use template from assets/examples/e2e-test.ts
  • Demonstrate user flow testing
  • Show authentication flows
  • Include accessibility scanning

6. Update Package Scripts

Add test scripts to package.json:

{
  "scripts": {
    "test": "vitest",
    "test:ui": "vitest --ui",
    "test:coverage": "vitest --coverage",
    "test:e2e": "playwright test",
    "test:e2e:ui": "playwright test --ui",
    "test:e2e:debug": "playwright test --debug"
  }
}

Test Patterns

Unit Testing with Vitest

To test utility functions and business logic:

import { describe, it, expect } from 'vitest'
import { validateEntityRelationship } from '@/lib/validation'

describe('validateEntityRelationship', () => {
  it('validates valid relationship', () => {
    const result = validateEntityRelationship({
      sourceId: '1',
      targetId: '2',
      type: 'BELONGS_TO'
    })
    expect(result.isValid).toBe(true)
  })

  it('rejects self-referential relationship', () => {
    const result = validateEntityRelationship({
      sourceId: '1',
      targetId: '1',
      type: 'BELONGS_TO'
    })
    expect(result.isValid).toBe(false)
  })
})

Component Testing with RTL

To test React components:

import { render, screen } from '@/test/utils/render'
import { userEvent } from '@testing-library/user-event'
import { axe } from '@axe-core/playwright'
import EntityCard from '@/components/EntityCard'

describe('EntityCard', () => {
  it('renders entity information', () => {
    render(<EntityCard entity={mockEntity} />)
    expect(screen.getByText(mockEntity.name)).toBeInTheDocument()
  })

  it('handles edit action', async () => {
    const onEdit = vi.fn()
    render(<EntityCard entity={mockEntity} onEdit={onEdit} />)

    await userEvent.click(screen.getByRole('button', { name: /edit/i }))
    expect(onEdit).toHaveBeenCalledWith(mockEntity.id)
  })

  it('has no accessibility violations', async () => {
    const { container } = render(<EntityCard entity={mockEntity} />)
    const results = await axe(container)
    expect(results.violations).toHaveLength(0)
  })
})

E2E Testing with Playwright

To test complete user flows:

import { test, expect } from '@playwright/test'
import { injectAxe, checkA11y } from '@axe-core/playwright'

test('user creates new entity', async ({ page }) => {
  await page.goto('/entities')

  // Inject axe for accessibility testing
  await injectAxe(page)

  // Navigate to create form
  await page.getByRole('button', { name: /create entity/i }).click()

  // Fill form
  await page.getByLabel(/name/i).fill('New Character')
  await page.getByLabel(/type/i).selectOption('character')
  await page.getByLabel(/description/i).fill('A mysterious traveler')

  // Submit
  await page.getByRole('button', { name: /save/i }).click()

  // Verify success
  await expect(page.getByText('New Character')).toBeVisible()

  // Check accessibility
  await checkA11y(page)
})

Accessibility Testing

Component-Level A11y

To add accessibility assertions in component tests:

import { render } from '@/test/utils/render'
import { axe, toHaveNoViolations } from 'jest-axe'

expect.extend(toHaveNoViolations)

it('meets accessibility standards', async () => {
  const { container } = render(<MyComponent />)
  const results = await axe(container)
  expect(results).toHaveNoViolations()
})

E2E A11y Scanning

To scan entire pages for accessibility issues:

import { test } from '@playwright/test'
import { injectAxe, checkA11y, getViolations } from '@axe-core/playwright'

test('homepage accessibility', async ({ page }) => {
  await page.goto('/')
  await injectAxe(page)

  // Check entire page
  await checkA11y(page)

  // Or check specific element
  await checkA11y(page, '#main-content')

  // Or get violations for custom reporting
  const violations = await getViolations(page)
  expect(violations).toHaveLength(0)
})

Coverage Configuration

To generate code coverage reports, configure Vitest coverage in vitest.config.ts:

export default defineConfig({
  test: {
    coverage: {
      provider: 'v8',
      reporter: ['text', 'json', 'html'],
      exclude: [
        'node_modules/',
        'test/',
        '**/*.config.{ts,js}',
        '**/*.d.ts'
      ],
      thresholds: {
        lines: 80,
        functions: 80,
        branches: 80,
        statements: 80
      }
    }
  }
})

Resources

Consult the following resources for detailed information:

  • references/vitest-setup.md - Vitest configuration details
  • references/rtl-patterns.md - React Testing Library best practices
  • references/playwright-setup.md - Playwright configuration guide
  • references/a11y-testing.md - Accessibility testing guidelines
  • assets/vitest.config.ts - Vitest configuration template
  • assets/playwright.config.ts - Playwright configuration template
  • assets/test-setup.ts - Test setup template
  • assets/examples/ - Example test files

Next Steps

After scaffolding the testing infrastructure:

  1. Run npm install to install dependencies
  2. Execute npm test to verify Vitest setup
  3. Execute npm run test:e2e to verify Playwright setup
  4. Review and customize configuration files
  5. Add tests for existing components and features
  6. Configure CI/CD pipeline with test execution
  7. Set up coverage reporting in CI
  8. Document testing guidelines for team

平台分布

kilo

29.08%
按下载量换算89

Cursor

20.31%
按下载量换算62

Claude Code

18.51%
按下载量换算57

github-copilot

12.19%
按下载量换算37

Codex

7.84%
按下载量换算24

mcpjam

3.58%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills