notify
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNotify
通知
Send a Discord embed via . Never curl. Never hand-build JSON.
./scripts/notify.py send通过发送Discord嵌入消息。请勿使用curl,请勿手动构建JSON。
./scripts/notify.py sendFlags
参数
Skill flags map to CLI flags on :
send| Flag | CLI flag | Effect |
|---|---|---|
| | Task notification. Requires |
| | URL in embed. Required with |
| | URL file. Default: |
| | Embed color. Default |
| | Repeatable. Max 10. |
| | Message above embed. |
| | Print payload. No POST. |
| Positional arg | | Embed body if not passed as flag. |
--title--descriptionSkill参数对应命令的CLI参数:
send| 参数 | CLI参数 | 作用 |
|---|---|---|
| | 任务通知。需搭配 |
| | 嵌入消息中的URL。与 |
| | URL文件。默认值: |
| | 嵌入消息颜色。默认值为 |
| | 可重复使用。最多10次。 |
| | 嵌入消息上方的文本内容。 |
| | 打印请求负载,不执行POST请求。 |
| 位置参数 | | 若未通过参数传入,则作为嵌入消息主体内容。 |
--title--descriptionAnchor
锚点目录
Directory holding this . Script: .
SKILL.md<anchor>/scripts/notify.py存放此的目录。脚本路径:。
SKILL.md<anchor>/scripts/notify.pyStep 1: Classify branch
步骤1:分支分类
- Task work (implement, fix, review, PR, ticket, CI): use +
--task.--link - Generic ping: omit .
--taskoptional.--link
- 任务类工作(开发、修复、评审、PR、工单、CI):使用+
--task。--link - 通用提醒:省略。
--task为可选。--link
Step 2: Compose embed
步骤2:编写嵌入消息
- : short label ("Task complete", "Input needed").
--title - : positional arg or one-line session summary.
--description - : real URL when
--link. GitHub PR/commit, Linear issue, CI run, repo tree link.--task - : only when it adds signal (branch, ticket, status).
--field
Done when title + description set and has .
--task--link- :简短标签(例如“任务完成”、“需要输入”)。
--title - :位置参数或单行会话摘要。
--description - :使用
--link时需填写真实URL,例如GitHub PR/提交记录、Linear工单、CI运行记录、仓库目录链接。--task - :仅在能提供有效信息时使用(例如分支、工单、状态)。
--field
当标题和描述已设置,且搭配了时,此步骤完成。
--task--linkStep 3: Ensure webhook config
步骤3:确保Webhook配置
Skip this step when using .
--dry-run- Resolve path: or
--webhook <path>.<anchor>/webhook.url - Read the file if it exists. If missing or whitespace-only, ask the user for the
Discord webhook URL. Do not run yet. Wait for their reply.
send - On reply: write the URL as a single line to the resolved path. Create parent dirs
if needed. URL must start with . If invalid, ask again with the prefix requirement.
https://discord.com/api/webhooks/ - Step done when the file contains a valid webhook URL prefix.
First-time setup help: Discord channel → Integrations → Webhooks → New Webhook →
copy URL. See .
./REFERENCE.md使用时可跳过此步骤。
--dry-run- 解析路径:使用或默认的
--webhook <path>。<anchor>/webhook.url - 若文件存在则读取内容。若文件缺失或仅含空白字符,询问用户获取Discord webhook URL。此时不要运行命令,等待用户回复。
send - 收到回复后:将URL作为单行写入解析后的路径。若需要则创建父目录。URL必须以开头。若URL无效,再次询问并提示前缀要求。
https://discord.com/api/webhooks/ - 当文件中包含符合要求的有效webhook URL前缀时,此步骤完成。
首次设置指引:Discord频道 → 集成 → Webhooks → 新建Webhook → 复制URL。详见。
./REFERENCE.mdStep 4: Run CLI
步骤4:运行CLI命令
bash
python3 <anchor>/scripts/notify.py send --title "..." --description "..." [flags]Use when payload unclear. Read for Examples.
--dry-runsend --helpbash
python3 <anchor>/scripts/notify.py send --title "..." --description "..." [flags]当负载内容不明确时使用。查看获取示例。
--dry-runsend --helpStep 5: Check exit code
步骤5:检查退出码
0 only means sent (or dry-run ok). On 2/3: stderr verbatim to user. Stop. No silent retry.
On exit 1 after Step 3: URL in file failed validation at POST time. Ask user for a
fresh webhook URL, rewrite the file, rerun once.
send退出码为0仅表示消息已发送(或dry-run执行正常)。若退出码为2/3:将标准错误信息原封不动告知用户,停止操作,不进行静默重试。
若步骤3完成后退出码为1:文件中的URL在POST请求时验证失败。询问用户获取新的webhook URL,重写文件,重新运行一次命令。
sendStep 6: Report
步骤6:结果反馈
Parse stdout , , . Never echo webhook URL.
status:title:link:解析标准输出中的、、字段。切勿回显webhook URL。
status:title:link:Constraints
约束条件
- Always embeds. Script enforces.
- Never commit .
webhook.url - On exit 3, follow troubleshooting in .
./REFERENCE.md
- 始终使用嵌入消息,脚本会强制执行此要求。
- 切勿提交文件。
webhook.url - 若退出码为3,请按照中的故障排查步骤操作。
./REFERENCE.md