react-nextjs-development
构建 React 和 Next.js 应用程序
此技能提供结构化的工作流,用于使用 App Router、服务器组件和 TypeScript 开发现代 React 和 Next.js 应用程序。它指导您完成项目设置、组件架构、样式设计、数据获取、路由、表单、测试和部署。
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“react-nextjs-development”。 使用 App Router 和 TypeScript 创建 Next.js 14 项目
预期结果:
- 使用 app/ 目录创建 App Router 的项目结构
- 使用严格模式和正确的 tsconfig 路径配置 TypeScript
- 安装 Tailwind CSS v4 并配置基础设置
- 设置 ESLint 和 Prettier 并配置 React 专用规则
- 生成基础布局和页面模板
正在使用“react-nextjs-development”。 构建带编辑功能的用户资料组件
预期结果:
- 用于从 API 获取用户数据的服务器组件
- 用于表单交互和状态管理的客户端组件
- 带自定义错误消息的 Zod 资料验证模式
- 带有正确类型推断的 React Hook Form 集成
- 带编辑模态框的 Tailwind 样式响应式资料卡片
安全审计
安全This skill is a documentation and workflow bundle containing only markdown content with usage prompts. Static analysis flagged 55 external_commands patterns and 11 cryptographic patterns, but all are FALSE POSITIVES - the backticks are markdown code formatting, not shell execution, and no cryptographic code exists. No security risks identified. Safe for publication.
质量评分
你能构建什么
前端开发者构建仪表板
使用 Next.js App Router、用于数据获取的服务器组件以及用于响应式设计的 Tailwind CSS 创建现代化管理仪表板,并采用正确的组件架构。
全栈开发者启动 SaaS 项目
快速搭建带有 TypeScript 的新 SaaS 应用程序,实现认证流程,使用 Zod 设置表单验证,并部署到带有预览环境的 Vercel。
技术负责人建立开发标准
为采用 Next.js 14+ 的开发团队定义一致的 React 模式、组件架构指南、测试策略和代码质量门禁。
试试这些提示
Help me scaffold a new Next.js 14 project with App Router, TypeScript, and Tailwind CSS. Set up the basic folder structure with proper conventions for components, lib, and app directories.
Create a Server Component that fetches data from an API endpoint and displays it in a list. Include proper error handling, loading states, and TypeScript types for the data structure.
Build a multi-step form using React Hook Form with Zod schema validation. Include field-level error messages, form state persistence, and proper TypeScript integration for type-safe form data.
Set up Next.js App Router parallel routes for a dashboard layout with intercepting routes for modal dialogs. Include proper slot configurations and conditional rendering based on navigation context.
最佳实践
- 默认使用服务器组件,仅在需要交互性时才切换到客户端组件
- 为所有组件、props 和 API 响应实现正确的 TypeScript 类型,以便在编译时捕获错误
- 遵循 colocated 原则,将组件、样式和测试一起保留在基于功能的目录中
避免
- 当服务器组件可以更高效地处理时,避免使用 useEffect 进行数据获取
- 不要将大型 JSON 对象作为客户端组件 props 传递 - 直接在组件中获取数据
- 切勿跳过错误边界 - 始终为异步操作实现正确的错误处理