software-frontend by vasilyu1983/ai-agents-public
npx skills add https://github.com/vasilyu1983/ai-agents-public --skill software-frontend适用于现代 Web 应用程序的生产就绪模式。
技术栈 (2026年3月) : Next.js 16 + Turbopack, React 19.x + 服务器组件, TypeScript 5.9+ (严格模式), Tailwind CSS v4, TanStack Query, Zustand, Vitest (浏览器模式)。
重大变更 : Next.js 16 升级指南
共享发布关卡: ../software-clean-code-standard/assets/checklists/frontend-performance-a11y-checklist.md
如果使用 React 服务器组件 (RSC),请将安全公告视为阻塞性问题:参见 data/sources.json (React RSC 公告)。
| 任务 | 工具 | 命令 |
|---|---|---|
| Next.js 应用 | Next.js 16 + Turbopack | npx create-next-app@latest |
| Vue 应用 | Nuxt 4 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
npx nuxi@latest init |
| Angular 应用 | Angular 21 | ng new |
| Svelte 应用 | SvelteKit 2.49+ | npm create svelte@latest |
| React SPA | Vite + React | npm create vite@latest |
| UI 组件 | shadcn/ui | npx shadcn@latest init |
assets/ 中的匹配模板开始。references/ 中实现特定功能模式。Project needs:
|-- React ecosystem?
| |-- Full-stack + SEO -> Next.js 16
| |-- Progressive enhancement -> Remix
| `-- Client-side SPA -> Vite + React
|
|-- Vue ecosystem?
| |-- Full-stack -> Nuxt 4
| `-- SPA -> Vite + Vue 3.5+
|
|-- State management?
| |-- Server data -> TanStack Query
| |-- Global client -> Zustand
| `-- WARNING: DECLINING: Redux
|
`-- Styling?
|-- Utility-first -> Tailwind CSS v4
`-- WARNING: DECLINING: CSS-in-JS
npx @next/codemod@canary upgrade latest # 推荐
mv middleware.ts proxy.ts # 或手动重命名
"use cache")export default async function Page() {
"use cache";
const data = await fetchData();
return <ProductList data={data} />;
}
// next.config.ts
const nextConfig: NextConfig = {
experimental: { reactCompiler: true },
};
完整的迁移清单(异步 API、图像配置、并行路由、缓存 API),请参见 references/operational-playbook.md (Next.js 16 迁移清单部分)。
| 指标 | 目标 |
|---|---|
| LCP | <= 2.5s |
| INP | <= 200ms |
| CLS | <= 0.1 |
| TTFB | < 600ms |
在已知的本地代码检查/类型检查失败问题未解决前,避免重复进行完整构建。
react-hooks/set-state-in-effect, react-hooks/purity, react-hooks/rules-of-hooks, react/no-unescaped-entitiesnpx eslint --help / npx vitest --help<Link> hrefuseState(null) + useEffect — 参见 references/production-gotchas.mdulimit -n 10240 以避免大型项目中的 EMFILE 错误最终输出中需包含:确切更改的文件、运行的代码检查/类型检查/构建命令、失败是新的还是基线问题、针对任何重复出现的问题类别的一条预防说明。
npm run build — 无错误npm run lint — ESLint 错误为零vitest run — 所有测试通过仅阅读与用户框架或问题匹配的参考文件 — 而非全部。
| 用户主题 | 阅读此文件 |
|---|---|
| Next.js, RSC, Server Actions, 数据获取 | references/fullstack-patterns.md (见下方章节索引) |
| Next.js 迁移、升级、重大变更 | references/operational-playbook.md |
| 水合错误、存储访问、响应解析 | references/production-gotchas.md |
| Vue 3, Nuxt 4, Pinia, 组合式函数 | references/vue-nuxt-patterns.md |
| Angular, 信号, 独立组件 | references/angular-patterns.md |
| Svelte 5, SvelteKit, 符文 | references/svelte-sveltekit-patterns.md |
| Remix, 加载器, 动作, 渐进增强 | references/remix-react-patterns.md |
| Vite + React SPA (无 Next.js / 无 SSR) | references/vite-react-patterns.md |
| 状态管理 (Zustand, TanStack Query, Redux) | references/state-management-patterns.md |
| 测试 (Vitest, Testing Library, Playwright, MSW) | references/testing-frontend-patterns.md |
| Lighthouse, 包大小, 核心 Web 指标 | references/performance-optimization.md |
| 快速 HTML 原型 / 制品 | references/artifacts-builder.md |
此文件共 2044 行。仅阅读所需部分:
| 章节 | 行号 | 何时阅读 |
|---|---|---|
| 身份验证 (JWT, Zustand 身份验证存储) | 27–497 | 身份验证流程、受保护路由、登录表单 |
| 博客文章 CRUD (Prisma, API 路由, 表单) | 499–1264 | CRUD 功能、列表/详情页、创建表单 |
| 使用服务器组件的实时数据 | 1266–1355 | 在 RSC 中直接访问数据库、流式传输 |
| 用于变更的服务器操作 | 1357–1627 | 表单提交、"use server"、重新验证 |
| tRPC 端到端类型安全 | 1629–2020 | tRPC 设置、类型安全的 API 客户端 |
| 关键模式摘要 | 1992–2044 | 类型共享、验证的快速参考 |
| 技能 | 用途 |
|---|---|
| software-backend | 后端 API |
| dev-api-design | REST/GraphQL |
| software-code-review | 代码审查 |
| ops-devops-platform | CI/CD |
在最终回答前,使用网络搜索验证当前外部事实、版本和平台行为。优先使用主要来源;对于易变信息,需报告来源链接和日期。
每周安装量
84
仓库
GitHub 星标
49
首次出现
2026年1月23日
安全审计
安装于
opencode67
gemini-cli66
codex65
cursor65
github-copilot62
amp53
Production-ready patterns for modern web applications.
Stack (March 2026) : Next.js 16 + Turbopack, React 19.x + Server Components, TypeScript 5.9+ (strict), Tailwind CSS v4, TanStack Query, Zustand, Vitest (browser mode).
Breaking Changes : Next.js 16 Upgrade Guide
Shared release gates: ../software-clean-code-standard/assets/checklists/frontend-performance-a11y-checklist.md
If you use React Server Components (RSC), treat security advisories as blocking: see data/sources.json (React RSC advisories).
| Task | Tool | Command |
|---|---|---|
| Next.js App | Next.js 16 + Turbopack | npx create-next-app@latest |
| Vue App | Nuxt 4 | npx nuxi@latest init |
| Angular App | Angular 21 | ng new |
| Svelte App | SvelteKit 2.49+ | npm create svelte@latest |
| React SPA | Vite + React | npm create vite@latest |
| UI Components | shadcn/ui | npx shadcn@latest init |
assets/.references/.Project needs:
|-- React ecosystem?
| |-- Full-stack + SEO -> Next.js 16
| |-- Progressive enhancement -> Remix
| `-- Client-side SPA -> Vite + React
|
|-- Vue ecosystem?
| |-- Full-stack -> Nuxt 4
| `-- SPA -> Vite + Vue 3.5+
|
|-- State management?
| |-- Server data -> TanStack Query
| |-- Global client -> Zustand
| `-- WARNING: DECLINING: Redux
|
`-- Styling?
|-- Utility-first -> Tailwind CSS v4
`-- WARNING: DECLINING: CSS-in-JS
npx @next/codemod@canary upgrade latest # recommended
mv middleware.ts proxy.ts # or manual rename
"use cache")export default async function Page() {
"use cache";
const data = await fetchData();
return <ProductList data={data} />;
}
// next.config.ts
const nextConfig: NextConfig = {
experimental: { reactCompiler: true },
};
For the full migration checklist (async APIs, image config, parallel routes, caching APIs), see references/operational-playbook.md (Next.js 16 Migration Checklist section).
| Metric | Target |
|---|---|
| LCP | <= 2.5s |
| INP | <= 200ms |
| CLS | <= 0.1 |
| TTFB | < 600ms |
Avoid repeated full builds while known local lint/type failures remain.
react-hooks/set-state-in-effect, react-hooks/purity, react-hooks/rules-of-hooks, react/no-unescaped-entitiesnpx eslint --help / npx vitest --help before assuming flags from older setups<Link> hrefsuseState(null) + useEffect for browser-only values — see Include in final output: exact files changed, lint/type/build commands run, whether failures are new or baseline, one prevention note for any repeated class of issue.
npm run build — no errorsnpm run lint — zero ESLint errorsvitest run — all tests passingRead only the reference matching the user's framework or problem — not all of them.
| User's topic | Read this |
|---|---|
| Next.js, RSC, Server Actions, data fetching | references/fullstack-patterns.md (see section index below) |
| Next.js migration, upgrade, breaking changes | references/operational-playbook.md |
| Hydration bugs, storage access, response parsing | references/production-gotchas.md |
| Vue 3, Nuxt 4, Pinia, composables | references/vue-nuxt-patterns.md |
| Angular, signals, standalone components | references/angular-patterns.md |
| Svelte 5, SvelteKit, runes |
This file is 2044 lines. Read only the section you need:
| Section | Lines | When to read |
|---|---|---|
| Authentication (JWT, Zustand auth store) | 27–497 | Auth flow, protected routes, login forms |
| Blog Posts CRUD (Prisma, API routes, forms) | 499–1264 | CRUD features, list/detail pages, create forms |
| Real-time data with Server Components | 1266–1355 | Direct DB access in RSC, streaming |
| Server Actions for mutations | 1357–1627 | Form submissions, "use server", revalidation |
| tRPC end-to-end type safety | 1629–2020 | tRPC setup, type-safe API clients |
| Key patterns summary | 1992–2044 | Quick reference for type sharing, validation |
| Skill | Purpose |
|---|---|
| software-backend | Backend API |
| dev-api-design | REST/GraphQL |
| software-code-review | Code review |
| ops-devops-platform | CI/CD |
Use web search to verify current external facts, versions, and platform behavior before final answers. Prefer primary sources; report source links and dates for volatile information.
Weekly Installs
84
Repository
GitHub Stars
49
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode67
gemini-cli66
codex65
cursor65
github-copilot62
amp53
Genkit JS 开发指南:AI 应用构建、错误排查与最佳实践
7,700 周安装
references/production-gotchas.mdulimit -n 10240 to avoid EMFILE errors in large projectsreferences/svelte-sveltekit-patterns.md |
| Remix, loaders, actions, progressive enhancement | references/remix-react-patterns.md |
| Vite + React SPA (no Next.js / no SSR) | references/vite-react-patterns.md |
| State management (Zustand, TanStack Query, Redux) | references/state-management-patterns.md |
| Testing (Vitest, Testing Library, Playwright, MSW) | references/testing-frontend-patterns.md |
| Lighthouse, bundle size, Core Web Vitals | references/performance-optimization.md |
| Quick HTML prototype / artifact | references/artifacts-builder.md |