notifications
持久化事件通知层 + topic-based pub-sub。所有 cron / sub-agent / mail / 价格异动等事件写入 SQLite 并按 channel 订阅 fan-out。channel 通过 channel_subscribe 声明关心哪些 topic;同时所有事件无条件 union…
Skill by maxesisn
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/maxesisn-notifications
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Node.js package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/notifications
What's inside
- Skill name
notifications- Description
- 持久化事件通知层 + topic-based pub-sub。所有 cron / sub-agent / mail / 价格异动等事件写入 SQLite 并按 channel 订阅 fan-out。channel 通过 channel_subscribe 声明关心哪些 topic;同时所有事件无条件 union 一份推 telegram:private(全量通知出口)。
- License
- MIT
- Instructions
- 169 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Agent Skills spec issues
- files: referenced but missing: scripts/mailcheck/mail_check.py
Files (2)
- SKILL.md
- tools.ts
SKILL.md (first lines)
# Notifications Skill
## 设计哲学
**Channel 是 transport,notification 是 fact,topic 是 consumer-defined 的事件分类**。三层分离:
1. **持久化独立于 push 出口**:SQLite 表永久保留
2. **跨 chat 可见**:任何 web chat 用 `notification_recent` 都能查所有历史
3. **Topic 由 consumer 定义**:producer 不能自创 topic,只能从订阅过的 topic 里选。channel 通过 `channel_subscribe` 创建/加入 topic
4. **Topic 是全局 first-class entity**:同一字符串 = 同一 topic。无 namespace 前缀(用 `ccxt` 不用 `mail:ccxt`),任何 channel 引用即指同一个
**纯时序日志,不维护 read/unread 状态**。曾经尝试过 read_at + mark_read 工具,但实际用户行为不会触发"明确 ack"。删掉这层状态机后,"我错过了什么"靠 LLM 看 created_at 时间戳自行判断。
## Push 路由模型(关键不变量)
`notification_create` 不传 `push_channels` 时(推荐路径):
```
有 topic:
1. 查 channel_subscriptions WHERE topic_name = <topic> → 拿订阅 channels
2. 始终 union 一份 'telegram:private' → 全量通知出口(unconditional)
3. fan-out push 到 union 后的列表
无 topic(producer 不知道事件主题归属):
→ 直接只推 'telegram:private',跳过订阅查询
```
**topic 是可选的**。Producer 知道事件主题时填写(如 `ccxt` / `etf-premium`),订阅了该 topic 的 channel 被 fan-out;不知道分类时省略——事件作为"无主题路由"事件只进流水账。⚠️ **不要为"杂项/未知"造 magic topic**(如 `misc` / `mail-uncategorized`)——topic 是主题路由 key,不是来源标签。来源信息放 `source` 字段。
**push 出口支持 `web:*` / `telegram:*`**。其中 `web:<session>` 会通过 WebChannel.send 写入对应 web session 的 `web_messages` 并广播到在线 WS 连接;离线时下次打开也能看到。`telegram:*` 走 Telegram notification backend,仅用于通知,不进入 agent 对话。找不到或未初始化的 channel 会 warn 后跳过,不污染 failed 语义。
推送显示前缀由 `source` 决定:`source` 以 `cron:` 开头显示 `[CRON]`,其他来源显示 `[NOTIFICATION]`。前缀只影响 push 文本,不改变 DB 中的 title/body。
## 工具
### notification_create
写入一条通知到 SQLite + 按订阅 fan-out push。
参数:
- `topic` — **可选** consumer-defined 事件分类,如 `ccxt` / `etf-premium` / `credit-card`。不知道主题归属时省略——事件只进流水账。⚠️ 建议先 `topic_list` 看是否已有相似命名
- `severity` — `info` / `alert` / `critical`
- `title` — 一行摘要(≤120 字符,推送时显示这条)
- `body` — 完整 markdown 内容(推送时取前 800 字符 preview)
- `source` — 来源标识,如 `cron:402de9ee` / `mail-daemon` / `manual` / `sub-agent:portfolio-backtest-v2`
- `metadata` — 可选额外 JSON 数据
- `push_channels` — **应急 override**:显式指定推送 channels(绕过订阅 fan-out + 流水账)。正常 pub-sub 路径**不传**
返回 `{ ok, id, pushed: string[], failed: string[] }`。
### notification_recent
查询历史通知,按 `created_at` DESC 排序。参数:`topic` / `severity` / `limit`(默认 10,最大 100)。
### channel_subscribe
当前 channel 订阅某 topic。Topic 不存在时由本工具创建(强烈推荐填 `description`——给 mail daemon LLM 分类作 context)。
参数:
- `topic` — topic 名,建议 lowercase 短串
- `description` — topic 已存在时忽略
- `channel_key` — **必填**。订阅者 channel key,agent 必须显式从 session 起点的 channel 标识中取值
返回 `{ ok, createdTopic: boolean, warning?: string }`。
**Fuzzy match warning**:服务器端做大小写归一化检查。命中类似 topic 时返回 warning(不阻塞),agent 自行决定是否撤回 + 改订已有 topic。
### channel_unsubscribe
退订某 topic。当该 channel 是最后订阅者时 topic 被 application-layer GC,返回 `deleted_orphan_topic=true`。
### channel_subscriptions_list
列出订阅关系。可按 `channel_key` 或 `topic` 过滤;都不传则全列。
### topic_list
列出所有 topic(名称、描述、订阅者数量)。⚠️ `channel_subscribe` 创建新 topic 前应先 call 一下避免重复命名。`filter` 是 substring case-insensitive 模糊匹配。
### topic_get
查看单个 topic 详情:description、订阅者列表、最近 30 天 notification 数量。
## v1 限制
- 无 update / delete notification 工具——通知是不可变事实
- Topic 命名无 hard normalize(存原值);fuzzy 检查只在 subscribe 时给 warning
- `push_channels` 是应急 override:显式传入时会绕过 topic 订阅 fan-out;如果仍需要全量通知出口,调用方必须把 `telegram:private` 一并放入列表。
## 内部 Ingest API(外部 source 接入点)
MaxClaw 主进程暴露 HTTP endpoint 给外部 producer(launchd daemon / webhook / 其他独立脚本)。**源代码:`src/server/internal-api.ts`**。
**鉴权**:bearer token,复用 `CLAW_WEBHOOK_SECRET`(与 webhook / internal API 同一个 token)。daemon 端从 `secrets/keys.env` 加载,不要发明新 token。
### POST `/api/mail/ingest` — mail daemon 专用
Daemon 投递原始邮件元数据,handler 内部完成:拉 topics → LLM 分类(`palette:light` via taskType `intent`)→ 对每个 matched topic 调一次 `notification_create`;0 match 时调一次无 topic 的 `notification_create` 走流水账。
请求体:
```json
{
"from": "string (required)",
"subject": "string",
"preview": "string (前 1500 字 plain text)",
"uid": "string (required, IMAP UID)",
"message_id": "string (optional, Message-ID header)",
"date": "string (optional, Date header)"
}
```
响应:`{ ok, matched: [topic_names], reasoning, notification_ids: [ids] }`。
### POST `/api/notifications/create` — 通用兜底
无 LLM、无分类,参数与 `notification_create` 工具签名一致。给 daemon 在主链路出错时落 alert 用,避免"邮件分类挂了 → 连 alert 都发不出"的死锁。
### 如何接入新 sourceFrom maxesisn/maxclaw-oss, MIT.
More from maxesisn/maxclaw-oss
- 0.526score
knowledge-base
maxesisn
通用知识库构建 & 查询工具。给定一个包含 PDF/Sphinx-HTML 的原始文档文件夹,批量转成可 grep 的 Markdown、抽符号倒排、生成 LLM 摘要 sidecar 和 manifest 聚合索引。Agent 进入陌生领域时先 `ls ~/.maxclaw/kb/` 看有无相关知识库,再按"L3…
SkillBFreshness: BClaude Code +9 - 0.521score
code-intelligence
maxesisn
代码仓库智能问答工具(repo_symbol_answer v1)。Tree-sitter AST 召回 function/class/method/interface/variable 定义 + ripgrep 词法搜索 + reranker 精排 + palette:mid LLM 综合,输出含…
SkillBFreshness: BClaude Code +9 - 0.521score
web-search
maxesisn
搜索互联网获取实时信息,通过自建 search-proxy 聚合 Tavily/Brave/Jina 三家付费 provider(带配额管理 + 失败 fallback 到 SearXNG)。适用于:查询新闻、实时价格、技术文档、不在训练数据中的信息。
SkillBFreshness: BClaude Code +9 - 0.521score
seek-advice
maxesisn
跨家 LLM 顾问 panel——给一个最小化 scenario,并行 dispatch 给 3-5 个不同 vendor 的模型,每个模型同时跑联网+离线两份,对抗单家族 prior 高度相关导致的 anchoring 偏差。用于复杂诊断、重要技术决策、自己推理 ≥2 小时未收敛兜底。
SkillBFreshness: BClaude Code +9 - 0.521score
pinned-notes
maxesisn
显式标记当前对话中需要永久保留的关键事实(必要开支、风险偏好、核心约束等),让它在 session compact/rollover 后仍存活。Agent 主动判断"哪些信息长期重要"调用,跨 session 通过 6 字符短 pin_id 引用。单 session 上限 25 条。
SkillBFreshness: BClaude Code +9 - 0.520score
reflection
maxesisn
自主反思与行动——静默处理能处理的,把该 Max 决策的记上面板
SkillBFreshness: BClaude Code +9 - 0.519score
channel-notes
maxesisn
Channel-scoped working notes — a short Markdown document per channel for decisions, deferred items, open questions, and next steps.
SkillBFreshness: BClaude Code +9 - 0.518score
async-runtime
maxesisn
需要未来唤醒、后台等待、跨 channel 通知或长期订阅时的调度选择;覆盖 cron、后台 subagent、notification、channel_subscribe、wake_channel。
SkillBFreshness: BClaude Code +9 - 0.518score
workdir
maxesisn
声明当前 channel 正在使用的工作目录(可多个),显示在右侧 Workspace 卡并在压缩后可查回。多文件任务时用 set_workdirs 钉下工作目录,避免文件散落 /tmp 或每次重说。仅记录+展示,不改进程 cwd。
SkillBFreshness: BClaude Code +9 - 0.518score
wake-channel
maxesisn
跨 channel agent 通信原语——通过 wake_channel "按门铃"通知另一个 channel 的 agent 有新状态变化
SkillBFreshness: BClaude Code +9 - 0.515score
memory
maxesisn
主动搜索、核查和更新记忆系统——查询 Facts、Episodes、Chunks 三层记忆,替换过时事实
SkillBFreshness: BClaude Code +9 - 0.515score
subagent
maxesisn
派独立 subagent 执行任务——同步返回结果或后台运行完成时唤醒,同回合多次调用即并行 fan-out
SkillBFreshness: BClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Aug 9, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/maxesisn/maxclaw-oss
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from maxesisn
- 0.526score
knowledge-base
maxesisn
通用知识库构建 & 查询工具。给定一个包含 PDF/Sphinx-HTML 的原始文档文件夹,批量转成可 grep 的 Markdown、抽符号倒排、生成 LLM 摘要 sidecar 和 manifest 聚合索引。Agent 进入陌生领域时先 `ls ~/.maxclaw/kb/` 看有无相关知识库,再按"L3…
SkillBFreshness: BClaude Code +9 - 0.521score
seek-advice
maxesisn
跨家 LLM 顾问 panel——给一个最小化 scenario,并行 dispatch 给 3-5 个不同 vendor 的模型,每个模型同时跑联网+离线两份,对抗单家族 prior 高度相关导致的 anchoring 偏差。用于复杂诊断、重要技术决策、自己推理 ≥2 小时未收敛兜底。
SkillBFreshness: BClaude Code +9 - 0.521score
pinned-notes
maxesisn
显式标记当前对话中需要永久保留的关键事实(必要开支、风险偏好、核心约束等),让它在 session compact/rollover 后仍存活。Agent 主动判断"哪些信息长期重要"调用,跨 session 通过 6 字符短 pin_id 引用。单 session 上限 25 条。
SkillBFreshness: BClaude Code +9 - 0.521score
code-intelligence
maxesisn
代码仓库智能问答工具(repo_symbol_answer v1)。Tree-sitter AST 召回 function/class/method/interface/variable 定义 + ripgrep 词法搜索 + reranker 精排 + palette:mid LLM 综合,输出含…
SkillBFreshness: BClaude Code +9 - 0.521score
web-search
maxesisn
搜索互联网获取实时信息,通过自建 search-proxy 聚合 Tavily/Brave/Jina 三家付费 provider(带配额管理 + 失败 fallback 到 SearXNG)。适用于:查询新闻、实时价格、技术文档、不在训练数据中的信息。
SkillBFreshness: BClaude Code +9 - 0.520score
reflection
maxesisn
自主反思与行动——静默处理能处理的,把该 Max 决策的记上面板
SkillBFreshness: BClaude Code +9
Cite this page
notifications skill. Agent Mart. https://agentmart.dev/skills/maxesisn-notifications (last updated 2026-10-24)