App error boundary display

From ai-shifu/ai-shifu · View interactive version

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.

How to use this skill

Skill file

应用错误兜底展示

核心规则

工作流

  1. 先确认问题是 App Router 默认错误页,而不是业务组件内部已有错误态。
  2. 新增或修改共享错误兜底组件,统一格式化错误字段、浏览器字段和复制文本。
  3. 同步接入 src/app/error.tsx 与 src/app/global-error.tsx。
  4. 若错误页需要访问浏览器对象,必须放在 client component 中,并用事件或 effect 读取,避免服务端渲染阶段访问 window、document 或触发 store 初始化副作用。
  5. 修改后至少运行 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.