App error boundary display is an AI agent skill from the GitHub repository ai-shifu/ai-shifu. Use when changing Next.js App Router global or route error fallbacks in Cook Web. Show the error name, message, digest, cause, URL, and available stack directly instead of only referring users to the console.
错误兜底组件不要静态 import @/store barrel,避免错误页加载时触发 unrelated store 的模块副作用。
兜底页样式优先使用 Tailwind class 和现有主题变量,不要引入硬编码色值;高度使用 dvh,不要使用 vh 或 env(safe-area-inset-bottom)。
Minimal static fallback labels follow the narrow exception in src/components/error/AGENTS.md; normal business UI still uses shared i18n. Keep useful diagnostics visible in the fallback.
若错误页需要访问浏览器对象,必须放在 client component 中,并用事件或 effect 读取,避免服务端渲染阶段访问 window、document 或触发 store 初始化副作用。
修改后至少运行 npm run type-check,确认 App Router 特殊文件签名和 client component 类型通过。
Use this skill with your AI agent:Open on Skill Issue to copy, download, or add to your library.
Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.