SuperAPI AI 工具集

tanstack-start-best-practices

前端与建站

查看项目

更新于 10-15 21:41

技能介绍

用途:为 TanStack Start 全栈 React 应用提供实现规范,覆盖服务端函数、中间件、SSR、认证与部署等主题,在创建服务端函数、配置中间件、设置 SSR 与 hydration、实现认证流程、处理客户端/服务端错误、组织全栈代码及部署时适用。

主要能力:规则按优先级分类。CRITICAL 含服务端函数 5 条(如 sf-create-server-fn 使用 createServerFn、sf-input-validation 校验输入、sf-method-selection 选择 HTTP 方法、sf-error-handling、sf-response-headers)与安全 4 条(sec-validate-inputs、sec-auth-middleware、sec-sensitive-data、sec-csrf-protection)。HIGH 含中间件 4 条(mw-request-middleware、mw-function-middleware、mw-context-flow、mw-composability)与认证 4 条(auth-session-management、auth-route-protection、auth-server-functions、auth-cookie-security)。MEDIUM 含 API 路由 1 条、SSR 6 条(ssr-data-loading、ssr-hydration-safety、ssr-streaming、ssr-selective、ssr-prerender)、错误处理 3 条、环境 1 条。LOW 含文件组织 3 条(file-separation、file-functions-file、file-shared-validation)与部署 2 条(deploy-env-config、deploy-adapters)。

使用方式:每条规则文件包含说明、反例、正例与适用上下文;按 rules/ 目录中的规则文件查阅详细指导与代码示例。

限制:资料未提供具体安装命令、收费信息、支持平台或效果数据,暂未提供。