diff --git a/.cursor/rules/ntfy-notify.mdc b/.cursor/rules/ntfy-notify.mdc new file mode 100644 index 0000000..3cac042 --- /dev/null +++ b/.cursor/rules/ntfy-notify.mdc @@ -0,0 +1,34 @@ +--- +description: After finishing a user task, send ntfy to ntfy.dsx2020.com/codex +alwaysApply: true +--- + +# ntfy 收工通知(必须) + +每次完成用户交代的一轮有效工作(功能落地、刷机、提交、排错结论等)后,**自己发一条 ntfy**,不要等用户提醒。 + +## 目标 + +- URL:`https://ntfy.dsx2020.com/codex` +- Topic:`codex` + +## 怎么发(Windows) + +```powershell +curl.exe -sS ` + -H "Title: <简短标题>" ` + -H "Tags: white_check_mark" ` + -d "<一两句结果:做了什么 / 关键路径或 commit>" ` + "https://ntfy.dsx2020.com/codex" +``` + +## 内容要求 + +- 标题:任务关键词 + 结果(完成 / 失败) +- 正文:中文,一两句;含关键产物(如 env、COM 口、commit hash) +- 失败同样通知(Tags 可用 `x`),写清卡在哪 + +## 不要 + +- 不要为无意义的心跳/重复进度刷屏 +- 不要泄露密钥、密码、完整 `.env` diff --git a/scripts/ntfy.ps1 b/scripts/ntfy.ps1 new file mode 100644 index 0000000..cbfb8ff --- /dev/null +++ b/scripts/ntfy.ps1 @@ -0,0 +1,17 @@ +# Quick ntfy helper for this repo +# Usage: +# .\scripts\ntfy.ps1 "标题" "正文" +# .\scripts\ntfy.ps1 -Title "ok" -Message "done" -Tags "white_check_mark" + +param( + [Parameter(Position = 0)] + [string]$Title = "serverinfotest", + [Parameter(Position = 1)] + [string]$Message = "done", + [string]$Tags = "white_check_mark", + [string]$TopicUrl = "https://ntfy.dsx2020.com/codex" +) + +$ErrorActionPreference = "Stop" +curl.exe -sS -H "Title: $Title" -H "Tags: $Tags" -d $Message $TopicUrl +Write-Host ""