Communitygithub.com

React/Next.js 开发工作流

当请求涉及 React Next.js 开发时始终使用此技能:涵盖 React 和 Next.js 14+ 的应用开发,包括 App Router、服务器组件、TypeScript、Tailwind CSS 以及现代前端模式。

Next.js 开发工作流 是什么?

该技能提供了一套结构化的 React 和 Next.js 14+ 开发工作流,适用于使用 App Router、服务器组件、TypeScript 和 Tailwind CSS 构建现代前端应用。工作流分为八个阶段:项目搭建、组件架构、样式设计、数据获取、路由导航、表单验证、测试以及构建部署。每个阶段都列出了可调用的子技能(如 `app-builder`、`nextjs-app-router-patterns`、`frontend-developer` 等)以及具体的操作步骤和可复制粘贴的提示,帮助 AI 代理高效地执行任务。技能支持 React SPA 和 Next.js 应用,并推荐了相关的技术栈(如 Zustand、React Query、React Hook Form、Zod、Vitest 等)。使用者需要注意,该技能仅在任务明确匹配所描述范围时使用,且不能替代环境特定的验证、测试或专家审查。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Anhvu1107/all-agent-skill/tree/HEAD/.agent/skills/react-nextjs-development

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Next.js 开发工作流 是做什么的?

选择性阅读规则

从以下文件开始:

  • references/senior-master-standard.md
  • references/usage-routing.md
  • references/quality-checklist.md

然后仅加载与用户实际任务匹配的继承文档、脚本、资产或示例。

概述

专门用于构建 React 和 Next.js 14+ 应用的工作流,涵盖现代模式,包括 App Router、服务器组件、TypeScript 和 Tailwind CSS。

何时使用此工作流

在以下情况下使用此工作流:

  • 构建新的 React 应用
  • 使用 App Router 创建 Next.js 14+ 项目
  • 实现服务器组件
  • 设置 TypeScript 与 React
  • 使用 Tailwind CSS 进行样式设计
  • 构建全栈 Next.js 应用

工作流阶段

阶段 1:项目搭建

要调用的技能

  • app-builder - 应用脚手架
  • senior-fullstack - 全栈指导
  • nextjs-app-router-patterns - Next.js 14+ 模式
  • typescript-pro - TypeScript 设置

操作

  1. 选择项目类型(React SPA、Next.js 应用)
  2. 选择构建工具(Vite、Next.js、Create React App)
  3. 搭建项目结构
  4. 配置 TypeScript
  5. 设置 ESLint 和 Prettier

可复制粘贴的提示

使用 @app-builder 搭建一个新的 Next.js 14 项目,使用 App Router
使用 @nextjs-app-router-patterns 设置服务器组件

阶段 2:组件架构

要调用的技能

  • frontend-developer - 组件开发
  • react-patterns - React 模式
  • react-state-management - 状态管理
  • react-ui-patterns - UI 模式

操作

  1. 设计组件层次结构
  2. 创建基础组件
  3. 实现布局组件
  4. 设置状态管理
  5. 创建自定义 Hooks

可复制粘贴的提示

使用 @frontend-developer 创建可复用的 React 组件
使用 @react-patterns 实现正确的组件组合
使用 @react-state-management 设置 Zustand store

阶段 3:样式与设计

要调用的技能

  • frontend-design - UI 设计
  • tailwind-patterns - Tailwind CSS
  • tailwind-design-system - 设计系统
  • core-components - 组件库

操作

  1. 设置 Tailwind CSS
  2. 配置设计令牌
  3. 创建实用工具类
  4. 构建组件样式
  5. 实现响应式设计

可复制粘贴的提示

使用 @tailwind-patterns 使用 Tailwind CSS v4 为组件添加样式
使用 @frontend-design 创建现代仪表盘 UI

阶段 4:数据获取

要调用的技能

  • nextjs-app-router-patterns - 服务器组件
  • react-state-management - React Query
  • api-patterns - API 集成

操作

  1. 实现服务器组件
  2. 设置 React Query/SWR
  3. 创建 API 客户端
  4. 处理加载状态
  5. 实现错误边界

可复制粘贴的提示

使用 @nextjs-app-router-patterns 实现服务器组件的数据获取

阶段 5:路由与导航

要调用的技能

  • nextjs-app-router-patterns - App Router
  • nextjs-best-practices - Next.js 模式

操作

  1. 设置基于文件的路由
  2. 创建动态路由
  3. 实现嵌套路由
  4. 添加路由守卫
  5. 配置重定向

可复制粘贴的提示

使用 @nextjs-app-router-patterns 设置并行路由和拦截路由

阶段 6:表单与验证

要调用的技能

  • frontend-developer - 表单开发
  • typescript-advanced-types - 类型验证
  • react-ui-patterns - 表单模式

操作

  1. 选择表单库(React Hook Form、Formik)
  2. 设置验证(Zod、Yup)
  3. 创建表单组件
  4. 处理提交
  5. 实现错误处理

可复制粘贴的提示

使用 @frontend-developer 创建使用 React Hook Form 和 Zod 的表单

阶段 7:测试

要调用的技能

  • javascript-testing-patterns - Jest/Vitest
  • playwright-skill - E2E 测试
  • e2e-testing-patterns - E2E 模式

操作

  1. 设置测试框架
  2. 编写单元测试
  3. 创建组件测试
  4. 实现 E2E 测试
  5. 配置 CI 集成

可复制粘贴的提示

使用 @javascript-testing-patterns 编写 Vitest 测试
使用 @playwright-skill 为关键流程创建 E2E 测试

阶段 8:构建与部署

要调用的技能

  • vercel-deployment - Vercel 部署
  • vercel-deploy-claimable - Vercel 部署
  • web-performance-optimization - 性能

操作

  1. 配置构建设置
  2. 优化包体积
  3. 设置环境变量
  4. 部署到 Vercel
  5. 配置预览部署

可复制粘贴的提示

使用 @vercel-deployment 将 Next.js 应用部署到生产环境

技术栈

类别技术
框架Next.js 14+, React 18+
语言TypeScript 5+
样式Tailwind CSS v4
状态管理Zustand, React Query
表单React Hook Form, Zod
测试Vitest, Playwright
部署Vercel

质量门禁

  • TypeScript 编译无错误
  • 所有测试通过
  • 代码检查无问题
  • 性能指标达标(LCP、CLS、FID)
  • 可访问性检查通过(WCAG 2.1)
  • 响应式设计已验证

相关工作流包

  • development - 通用开发
  • testing-qa - 测试工作流
  • documentation - 文档
  • typescript-development - TypeScript 模式

限制

  • 仅在任务明确匹配上述范围时使用此技能。
  • 不要将输出视为环境特定验证、测试或专家审查的替代品。
  • 如果缺少所需的输入、权限、安全边界或成功标准,请停止并请求澄清。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches 007: Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Agentfolio: Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Animejs Animation: Advanced JavaScript animation library skill for creating complex, high-performance web animations.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Astropy: Astropy is the core Python package for astronomy, providing essential functionality for astronomical research and data analysis.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Astro: Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Emotional ARC Designer: One sentence - what this skill does and when to invoke it

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Fixing Motion Performance: Audit and fix animation performance issues including layout thrashing, compositor properties, scroll-linked motion, and blur effects.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches I18n Localization: Internationalization and localization patterns.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Interactive Portfolio: Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches JQ: Expert jq usage for JSON querying, filtering, transformation, and pipeline integration.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Landing Page Generator: Generates high-converting Next.js/React landing pages with Tailwind CSS.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches LEX: Centralized ''Truth Engine'' for cross-jurisdictional legal context (US, EU, CA) and contract scaffolding.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Magic Animator: AI-powered animation tool for creating motion in logos, UI, icons, and social media assets.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Makepad Animation: CRITICAL: Use for Makepad animation system.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Nextjs APP Router Patterns: Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.

Anhvu1107/all-agent-skill

ALWAYS use this when the user mentions Nextjs Best Practices, asks to build, debug, review, document, automate, test, configure, migrate, or make decisions in this domain, or the task clearly depends on Nextjs Best Practices; scope: Next.js App Router principles. Apply the bundled workflow, references, scripts, Senior Master standard, and Codex strict review gate before final output.

Anhvu1107/all-agent-skill

description: ALWAYS use this when the work is specifically about modern Next.js or React architecture, data flow, rendering strategy, routing, or performance-sensitive frontend behavior.

Anhvu1107/all-agent-skill

ALWAYS use this when the request matches Nextjs Supabase Auth: Expert integration of Supabase Auth with Next.js App Router

Anhvu1107/all-agent-skill

ALWAYS use this when the task involves reading, extracting, splitting, merging, rotating, creating, validating, OCR-ing, form-filling, or otherwise producing or modifying PDF files.

Anhvu1107/all-agent-skill

ALWAYS use this when working with Remotion code, video compositions, rendering logic, timing, media assets, or React-based motion workflows.

相关技能