Agent skill

Push Notification

by Rain-kl in Rain-kl/OpenFlare

Wavelet 项目专用:当需要开发或接入新的系统通知推送事件、修改消息推送底层设计、调用统一触发器投递消息、或开发带消息推送功能的业务功能时必须使用。本技能指导元数据声明、触发流程、解耦防线和动态同步机制。

Apache-2.0Auto-check passedMobile

Install Push Notification

skills CLI
$ npx skills add Rain-kl/OpenFlare --skill push-notification -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Rain-kl/OpenFlare push-notification --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Rain-kl/OpenFlare.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/push-notification .claude/skills/push-notification && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
push-notification
GitHub stars
288
Token cost
~1.6k tokens
SKILL.md length
324 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
Apache-2.0

At a glance

Wavelet 项目专用:当需要开发或接入新的系统通知推送事件、修改消息推送底层设计、调用统一触发器投递消息、或开发带消息推送功能的业务功能时必须使用。本技能指导元数据声明、触发流程、解耦防线和动态同步机制。

  • Works in 6 steps: 通用事件参数 (Common Variables) → 特定事件携带的业务变量 (Event Specific Variables) → 自定义消息通道的请求体变量说明 (Custom Channel JSON… → …
  • Mobile work in your project
  • SKILL.md covers 消息推送架构设计 (Architecture), 核心开发步骤 (Step-by-Step Flow), 模板渲染与支持的系统变量 (Template… and 严格遵循事项与防线 (Guardrails)
  • Calls go

What it does

Push Notification is an agent skill from Rain-kl/OpenFlare. Wavelet 项目专用:当需要开发或接入新的系统通知推送事件、修改消息推送底层设计、调用统一触发器投递消息、或开发带消息推送功能的业务功能时必须使用。本技能指导元数据声明、触发流程、解耦防线和动态同步机制。

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile. It works with Cloudflare. The repository describes itself as: OpenFlare is an open-source CDN orchestration and edge security platform. It supports reverse proxy, centralized configuration synchronization, in-network tunneling (Tunnels)… The licence is Apache-2.0.

When your agent uses it

  • Mobile work in your project

Example prompts

  • “/push-notification”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. 通用事件参数 (Common Variables)
  2. 特定事件携带的业务变量 (Event Specific Variables)
  3. 自定义消息通道的请求体变量说明 (Custom Channel JSON Variables)
  4. 禁止绕过统一触发器 (Always Use EventTrigger)
  5. 禁止业务模块直接依赖 push (Decouple via listener)
  6. 禁止 init() 与 router 副作用注册 (Explicit Bootstrap)

What it can do on your machine

Read from SKILL.md and the folder at commit 7c2304d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • go

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Push Notification loads about 1.6k tokens when it runs. Until then it costs about 31 tokens; SKILL.md has 324 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~31
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Rain-kl/OpenFlare at commit 7c2304d, republished under its Apache-2.0 licence (© Rain-kl). 324 words, ~1,610 tokens.

Download SKILL.mdSave it as .claude/skills/push-notification/SKILL.md (or your agent's skills folder).
name
push-notification
description
Wavelet 项目专用:当需要开发或接入新的系统通知推送事件、修改消息推送底层设计、调用统一触发器投递消息、或开发带消息推送功能的业务功能时必须使用。本技能指导元数据声明、触发流程、解耦防线和动态同步机制。

新增消息推送与通知事件开发规范

本技能涵盖 Wavelet 的系统通知推送开发规范。开始开发前先阅读仓库根目录 AGENTS.md,遵守项目级核心规则。


消息推送架构设计 (Architecture)

Wavelet 的消息推送机制采用了元数据驱动 + 统一触发器 + 异步任务派发的解耦设计,其分层及职责划分如下:

目录/包名职责定位包含内容与设计细节
pkg/push/推送基础设施层静态定义、不依赖系统数据库和任何框架。定义了统一接口 Pusher、单例 PusherPool 和多实现(Lark, Webhook, Email 等),提供配置验证及发送功能。
internal/apps/admin/push/通知服务与后台任务层包含以下核心文件:<br>1. events.go:定义通知事件的结构模型(NotificationMessage, EventMetadata)、内置事件的动态注册中心(BuiltInEvents 及 RegisterBuiltInEvent 函数)以及统一触发器类 EventTrigger(包括其底层的派发引擎逻辑)。<br>2. tasks.go:定义 Asynq 后台异步发送任务、处理器 PushHandler 及其校验逻辑,并记录推送历史审计。<br>3. routers.go:管理端接口,负责获取事件配置列表和更新配置。
internal/apps/admin/push/custom_events/自定义通知事件包事件元数据定义与 push 侧处理逻辑;一个 Go 文件代表一个事件。在 register.go 统一装配,禁止 init() 副作用。
internal/listener/域事件分发层核心域发射事件(如 EmitAdminLoggedIn),push 在 bootstrap 阶段通过 OnAdminLoggedIn 订阅,避免 auth/user 直接依赖 push。
internal/platform/bootstrap/应用装配根RegisterPushDomainEvents() 调用 custom_events.Register();Init 中执行 SyncEvents 将内置事件元数据同步到数据库。
数据库审计表状态与历史审计w_push_events 存放每个通知事件的启用状态、启用渠道、发送目标和自定义渲染模板。<br>w_push_histories 存放消息发送记录用于审计。

核心开发步骤 (Step-by-Step Flow)

如果某个新业务(如“新用户注册”或“订单创建”)需要带有消息推送功能,请严格按照以下步骤开发:

步骤 1:在 custom_events/ 中声明事件元数据与处理函数

在 internal/apps/admin/push/custom_events/ 下新建一个 Go 文件(如 user_registered.go),声明 EventMetadata 和 push 侧处理函数(组装 body 并调用 DefaultTrigger.Trigger)。

go
package custom_events

import (
	"context"
	"time"

	"github.com/Rain-kl/Wavelet/internal/apps/admin/push"
	"github.com/Rain-kl/Wavelet/internal/listener"
)

var NewUserRegistered = push.EventMetadata{
	Key:  "user_registered",
	Name: "新用户注册提醒",
	DefaultTemplate: push.NotificationMessage{
		Title:   "新用户注册通知",
		Content: "新用户 {{user.username}} (邮箱: {{user.email}}) 于 {{time}} 成功注册。",
		Level:   "INFO",
	},
	Description: "当系统有新用户注册成功时,向管理员或指定目标发送通知",
}

func handleUserRegistered(ctx context.Context, event listener.UserRegistered) {
	if event.User == nil {
		return
	}
	body := map[string]any{
		"user": event.User,
		"time": time.Now().Format("2006-01-02 15:04:05"),
	}
	push.DefaultTrigger.Trigger(ctx, NewUserRegistered, body)
}

EventTrigger.Trigger 已内置异步 Goroutine 与 context.WithoutCancel;处理函数内直接调用即可,无需外层 go func()。

步骤 2:在 listener/ 定义域事件并在 register.go 装配
  1. 在 internal/listener/ 新增域事件类型、Emit* 与 On* 注册函数(参考 admin_login.go)。
  2. 在 register.go 中注册元数据并订阅域事件:
go
func Register() {
	push.RegisterBuiltInEvent(NewUserRegistered)
	listener.OnUserRegistered(handleUserRegistered)
}

禁止在 custom_events 或 router 中使用 init() 注册;禁止在 router.go 空白导入 custom_events。

步骤 3:在业务代码中发射域事件(不 import push)

在业务逻辑完成处(如 internal/apps/user/routers.go)仅 import internal/listener 并发射事件:

go
import "github.com/Rain-kl/Wavelet/internal/listener"

func Register(c *gin.Context) {
	// ... 注册成功逻辑 ...
	listener.EmitUserRegistered(ctx, user)
}
步骤 4:在 bootstrap / cmd 入口显式装配

新增事件后,确保 custom_events.Register() 已被 bootstrap.RegisterPushDomainEvents() 调用,且 API/all 进程在 bootstrap.Init 之前完成注册:

进程cmd 入口调用
apibootstrap.RegisterAPI() → bootstrap.Init(ctx, Options{API: true})
allbootstrap.RegisterAll() → bootstrap.Init(ctx, Options{API: true})
worker / scheduler不注册 push 域事件;仅 bootstrap.Init + 各自 RegisterWorker/RegisterScheduler

Init 中的 SyncEvents 会将 user_registered 元数据同步到 w_push_events,管理员即可在前端配置推送渠道。

步骤 5:编写集成测试

在 custom_events/ 或 listener/ 包内添加测试,验证 Emit* → handler → DefaultTrigger.Trigger 全链路。测试 setup 须显式调用 custom_events.Register()(或 bootstrap.RegisterPushDomainEvents())和 push.SyncEvents,参考 admin_login_test.go。


模板渲染与支持的系统变量 (Template Rendering & Variables)

消息的 title、content 以及 ext 字段中的字符串值都支持变量占位符替换,采用双花括号形式 {{variable}}。

1. 通用事件参数 (Common Variables)

在 Wavelet 系统中,user 是一个通用的、必传的事件参数。如果在触发通知事件时未提供 user(或为 nil),底层 EventTrigger 会自动注入一个系统的虚拟用户(ID 为 999,昵称为“系统”)。因此,以下变量是所有通知事件均支持的通用渲染参数:

  • {{time}}:事件发生/触发的具体时间(格式:2006-01-02 15:04:05)
  • {{user.id}}:触发用户/系统用户的 ID
  • {{user.username}}:触发用户/系统用户的用户名
  • {{user.nickname}}:触发用户/系统用户的昵称
  • {{user.email}}:触发用户/系统用户的电子邮箱
  • {{user.phone}}:触发用户/系统用户的手机号
  • {{user.bio}}:触发用户/系统用户的个人简介
  • {{user.gender}}:触发用户/系统用户的性别
  • {{user.location}}:触发用户/系统用户的所在地
  • {{user.website}}:触发用户/系统用户的个人网站

(注:系统中的任何自定义事件,若传入了对应的复杂结构体,其结构体 JSON 字段均可通过扁平化点路径方式直接在模板中进行引用。)

2. 特定事件携带的业务变量 (Event Specific Variables)

除了通用的 user 和 time 外,特定事件在触发时还可以携带额外的上下文参数:

  • 管理员登录提醒 (admin_login)
    • {{ip}}:管理员登录来源的客户端 IP
    • {{time}}:管理员登录成功时间
3. 自定义消息通道的请求体变量说明 (Custom Channel JSON Variables)

在配置“自定义消息通道”时,其请求体 (JSON Schema) 支持以 $ 开头的变量替换。支持的替换变量如下:

json
{
  "title": "$title",
  "description": "$description",
  "content": "$content",
  "url": "$url",
  "to": "$to"
}
  • $title:通知的标题(如:“管理员登录提醒”)
  • $description:当前通知事件的描述
  • $content:通知的具体渲染后正文内容
  • $url:附加的操作或详情链接(若有)
  • $to:当前派发的推送目标(如邮箱、ID 或 Chat ID,即 resolved target)

严格遵循事项与防线 (Guardrails)

1. 禁止绕过统一触发器 (Always Use EventTrigger)
  • 所有推送请求必须经过 EventTrigger.Trigger,以确保进行“事件是否启用”、“目标渠道过滤”、“全局推送配置读取”及“发送日志审计”等流程。
2. 禁止业务模块直接依赖 push (Decouple via listener)
  • oauth、user 等核心域 不得 import internal/apps/admin/push 或 custom_events。
  • 跨模块通知必须通过 internal/listener 发射域事件;push 在 custom_events.Register() 中订阅。
3. 禁止 init() 与 router 副作用注册 (Explicit Bootstrap)
  • 不得在 init() 中调用 RegisterBuiltInEvent 或订阅 listener。
  • 不得在 router.go 空白导入 custom_events 触发注册。
  • 统一在 internal/platform/bootstrap + internal/cmd 入口显式装配。

© Rain-kl, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/push-notification of Rain-kl/OpenFlare.

Open the folder on GitHubat commit 7c2304d

Compare with similar skills

Push Notification next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Push Notification compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Push Notification this skillRain-kl/OpenFlare288—~1.6kAutomated safety check: PassApache-2.0
BrowserStack Live Testinghandsontable/handsontable22k—~950Automated safety check: PassCustom licence
Remote Installericodesign/remote-installer106—~4kAutomated safety check: PassMIT
Releasearul28/ADE114—~17kAutomated safety check: PassAGPL-3.0
Turnstile Spincloudflare/skills3k4 repos~7.2kAutomated safety check: NotesApache-2.0
Turnstile Spintry-works/role-model118—~3.8kAutomated safety check: PassCustom licence

Similar skills

  • BrowserStack Live Testing

    handsontable/handsontable

    Opens a live BrowserStack session on a real Android, iOS or desktop browser for a local or public URL, tunneling localhost through Cloudflare when needed.

    22k GitHub stars~950 tokensUpdated today
    Testing & QAAuto-check passed
  • Remote Installer

    icodesign/remote-installer

    Put an iOS or Android build on a real phone or tablet over the air with the remote-installer CLI — it validates the build, opens a temporary HTTPS tunnel, and prints one or more install URLs plus QR…

    106 GitHub stars~4k tokensUpdated 8 days ago
    MobileAuto-check passed
  • Release

    arul28/ADE

    ADE release conductor: detect whether desktop, iOS, and/or the Cloudflare web tier actually changed, bump desktop patch versions, keep iOS marketing versions fixed while bumping build numbers, ship…

    114 GitHub stars~17k tokensUpdated today
    MobileAuto-check passed
  • Turnstile Spin

    cloudflare/skills

    Official

    Set up, repair, or migrate to Cloudflare Turnstile bot verification in an existing frontend and backend, including server-side Siteverify.

    3k GitHub starsUsed in 4 repos~7.2k tokens
    Frontend & DesignAuto-check: notes
  • Turnstile Spin

    try-works/role-model

    Set up Cloudflare Turnstile end-to-end in a project — scan the codebase, create the widget via the Cloudflare API, deploy the managed siteverify Worker, write the frontend snippets, validate, and…

    118 GitHub stars~3.8k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Nuxt Content

    secondsky/claude-skills

    Nuxt Content v3 Git-based CMS for Markdown/MDC content sites.

    227 GitHub stars~4.3k tokensUpdated 10 days ago
    Frontend & DesignAuto-check passed

More from Rain-kl/OpenFlare

All 12 skills in this repo
  • Code Review Skill

    Rain-kl/OpenFlare

    Provides comprehensive code review guidance for React 19, Vue 3, Angular 17+, Svelte 5, Rust, TypeScript, Java, PHP, Python, Django, Go, C/.NET, Kotlin, Swift, NestJS, C/C++, and more.

    288 GitHub stars~2.3k tokensUpdated today
    Auto-check: notes
  • Go Logging

    Rain-kl/OpenFlare

    在选择日志方案、配置 slog、编写结构化日志语句或决定日志级别时使用。也适用于设置生产日志、为日志添加请求作用域上下文或从 log 迁移到 slog 的场景,即使用户未明确提及日志。不涵盖错误处理策略(参见 go-error-handling)。

    288 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • New API

    Rain-kl/OpenFlare

    Wavelet 项目专用:当新增或修改自定义业务 API、新增业务路由、新增 service 层核心逻辑时必须使用。本技能指导包职责划分、推荐文件结构、路由解耦、Swagger 文档生成与质量门禁验证。

    288 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Cache Framework

    Rain-kl/OpenFlare

    Wavelet 项目专用:当新增或修改业务缓存(RAM/Redis/DB 三层读路径)、缓存失效、多节点 pub/sub 同步、或评估高频读是否应接入缓存时必须使用。本技能说明系统标准缓存框架、参考实现、禁止写法与分布式一致性要求。

    288 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Clickhouse Batchwriter

    Rain-kl/OpenFlare

    Wavelet 项目专用:当新增或修改 ClickHouse 批量写入、接入 internal/infra/persistence/batchwriter、将业务域异步 flush 到分析表、迁移 riskcontrol/节点访问日志/可观测时序写入、或评估 asyncinsert 与背压策略时必须使用。本技能指导分层职责、各域独立 Writer 实例、repository 批量 API…

    288 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Database Migration

    Rain-kl/OpenFlare

    Wavelet 项目专用:当新增或修改数据库表结构、索引、初始化数据、系统配置 seed、模板 seed、默认管理员、goose SQL 迁移、internal/infra/persistence/migrator、ClickHouse 分析库 DDL 或数据库升级流程时必须使用。本技能指导在 internal/infra/persistence/migrator/goose 下编写…

    288 GitHub stars~1.3k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Push Notification

What does Push Notification do?

Wavelet 项目专用:当需要开发或接入新的系统通知推送事件、修改消息推送底层设计、调用统一触发器投递消息、或开发带消息推送功能的业务功能时必须使用。本技能指导元数据声明、触发流程、解耦防线和动态同步机制。. Push Notification is an agent skill from Rain-kl/OpenFlare.

When should I use Push Notification?

Push Notification fits situations like: mobile work in your project.

How do I install Push Notification in Claude Code?

Run `npx skills add Rain-kl/OpenFlare --skill push-notification -a claude-code`. Or copy the skill folder (.agents/skills/push-notification in Rain-kl/OpenFlare) into .claude/skills/push-notification in your project. Claude Code loads it when a task matches its description.

How do I install Push Notification in Codex?

Run `npx skills add Rain-kl/OpenFlare --skill push-notification -a codex`. Or copy the skill folder (.agents/skills/push-notification in Rain-kl/OpenFlare) into .agents/skills/push-notification in your project. Codex loads it when a task matches its description.

Can I use Push Notification in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Rain-kl/OpenFlare --skill push-notification -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/push-notification, .gemini/skills/push-notification, .github/skills/push-notification and .opencode/skills/push-notification in your project.

What does Push Notification need to run?

Going by SKILL.md and its folder, Push Notification needs the command-line tools its instructions call (go).

Does Push Notification access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Push Notification safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Push Notification use?

Push Notification is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Push Notification use?

About 1.6k tokens (SKILL.md is roughly 6.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Push Notification?

Skills that share tags, products or a category with Push Notification: BrowserStack Live Testing (handsontable/handsontable, 22k stars), Remote Installer (icodesign/remote-installer, 106 stars), Release (arul28/ADE, 114 stars) and Turnstile Spin (cloudflare/skills, 3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Push Notification?

Rain-kl (a GitHub user) maintains it in Rain-kl/OpenFlare, which has 288 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 8, 2026.

Source: Rain-kl/OpenFlare on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.