nocobase-app-plugin-notification-in-app
它能做什么
这项技能在 NocoBase 3 应用中设置站内通知收件箱。每位用户只能看到自己的通知,收件箱会实时刷新。适合希望在应用内设置收件箱的开发者。
适用场景
- ✓当你希望用户在应用内的收件箱中看到通知时。
- ✓当通知保存后,你需要收件箱实时刷新时。
- ✓当收件箱项目缺失或显示给了错误的用户,需要诊断时。
技能链接
https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-notification-in-app/skills/nocobase-app-plugin-notification-in-app/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我为 NocoBase 应用添加站内通知收件箱,当任务分配给某位用户时实时刷新。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会注册客户端和服务器端的插件入口,把收件箱组件放在应用自己管理的页面上,并连接实时更新主题。已保存的通知仍是唯一的依据。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Goal
Integrate and maintain the authenticated, user-isolated in-app inbox while keeping durable HTTP state authoritative and realtime events limited to invalidation.
Ownership and Placement
This Skill is published with @nocobase/app-plugin-notification-in-app. The plugin owns its Server runtime, persistence, APIs, realtime contract, and Client inbox components. The target application owns whether both Client and Server entries are registered.
Scope
- Register the Client and Server plugin entries and the core notification dependency.
- Render the exported inbox components in an application-owned page.
- Consume the public realtime topic and event types from the
/realtimepackage entry. - Verify or diagnose inbox HTTP access, mutations, user isolation, and reconnect refresh.
Non-Goals
- Do not replace durable notifications with transient browser toasts.
- Do not edit inbox tables directly or publish forged realtime events as notification state.
- Do not expect the plugin to contribute an inbox page; the application owns the route.
Input Contract
| Input | Required | Default | Validation | Clarification Question |
|---|---|---|---|---|
action |
yes | verify for existing code; register for a new target |
register/verify/diagnose |
"Should I register, verify, or diagnose the inbox?" |
application |
yes | infer from one unambiguous workspace application | application root with Server and Client configuration | "Which application should register the inbox plugin?" |
apiConfig |
no | the target application's injected ApiClient and RealtimeClient |
authenticated client with the intended baseURL/realtimeURL |
"Should this application use its default or a custom API host?" |
Rules:
- Resolve package versions and enabled plugins from the target application before changing source.
- Register the package's public
/clientand/serverentries; do not import implementation files. - If the target application is ambiguous, stop mutation and ask.
Mandatory Clarification Gate
- Max clarification rounds:
2. - Max questions per round:
3. - Read-only inspection and diagnosis may proceed when the application is unambiguous.
- Missing required input blocks mutation; report the missing contract instead of guessing.
Workflow
- Read Inbox Integration Contract for package requirements, public surfaces, and runtime semantics.
- Inspect the target application's Server plugin list, Client composition, authentication setup,
api.baseURL,api.realtimeURL, and installed package versions. - Register
@nocobase/app-plugin-notificationbefore@nocobase/app-plugin-notification-in-app/serverwhen the application needs thein-appChannel contribution. - Register
@nocobase/app-plugin-notification-in-app/clientin the Client composition root. The plugin contributes no pages: renderNotificationInAppInboxinsideNotificationInAppProviderin a page the application declares among its own routes. - In React components and custom Hooks, use
useApiClient()from@nocobase/app-clientfor inbox reads and mutations, anduseService(realtimeClientToken)for subscriptions. Outside React, resolve the corresponding tokens from the application's services or receive the clients explicitly. Do not reconstruct/apifrom the browser location or Portal base. - Keep HTTP state authoritative. On a validated
inbox.changedevent, realtime connection open, or window focus, trigger a bounded HTTP refetch. - Use the public
@nocobase/app-plugin-notification-in-app/realtimeentry for shared topic or event types; do not import Server internals. - Test allowed and denied users, mutations without a CSRF token, cross-site cookie writes rejected with
INVALID_CSRF_ORIGIN, pagination, custom API hosts, realtime invalidation, and reconnect recovery. - Run lint, typecheck, tests, and build for the plugin and affected application.
Reference Loading Map
| Reference
常见问题
实时更新就是真实的通知吗?
不是。实时事件只是提示,已保存的收件箱才是权威记录。
插件会添加收件箱页面吗?
不会。路由由应用自己拥有,并由应用放置页面。
临时弹出的提示可以代替收件箱吗?
不可以。技能说明,持久通知不得被临时的浏览器提示取代。
详情
作者的原始描述
Use when agents need to register, verify, or diagnose the NocoBase durable in-app inbox, its development-only Client page, or realtime refresh behavior.
repo: nocobase/nocobase
热度
- GitHub 星标
- 25k
- 排名
- #10101
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
nocobase-app-development
25k帮你的智能体为完整的 NocoBase 3 业务应用构建页面、路由、数据、权限和测试。
shadcn
25k帮你的智能体在 Web 项目中查找、添加、修复和美化 shadcn/ui 组件,并使用其官方文档和注册表。
nocobase-app-plugin-development
25k帮你的智能体在现有应用中创建和维护 NocoBase 3 插件,包括服务端、客户端、数据库和注册部分。
nocobase-app-upgrade
25k帮你的智能体把 NocoBase 应用升级到较新的模板版本,引入模板的更改,同时保留你自己的工作。