Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

dual-channel-watchexec双通道 watchexec

Agent Skill

dual-channel-watchexec 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,224

周安装

51

GitHub Stars

37

下载量

408
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dual-channel-watchexec(双通道 watchexec)
来源仓库:https://github.com/terrylica/cc-skills
仓库路径:skills/dual-channel-watchexec
安装命令:
npx skills add https://github.com/terrylica/cc-skills --skill dual-channel-watchexec
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/terrylica/cc-skills --skill dual-channel-watchexec

简介

dual-channel-watchexec 实现 watchexec 重启时的双通道通知(Telegram + Pushover)。

  • 适用于 macOS 文件监控与后台服务崩溃告警场景。
  • 自动转义 HTML 字符并剥离标签,确保消息正确送达。
  • 安装命令为 npx skills add https://github.com/terrylica/cc-skills --skill dual-channel-watchexec。
  • 需配置 BOT_TOKEN 与 CHAT_ID,凭证应通过环境变量加载而非硬编码。

SKILL.md

Dual-Channel Watchexec Notifications

Send reliable notifications to both Telegram and Pushover when watchexec detects file changes or process crashes.

Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

When to Use This Skill

Use this skill when:

  • Setting up file change monitoring with notifications
  • Implementing process crash alerting via Telegram and Pushover
  • Creating watchexec wrappers with dual-channel notification support
  • Formatting messages for both HTML (Telegram) and plain text (Pushover)
  • Troubleshooting notification delivery or formatting issues

Core Pattern

watchexec wrapper scriptdetect eventnotify-scriptTelegram + Pushover

# wrapper.sh - Monitors process and detects restart reasons
watchexec --restart -- python bot.py

# On event, call:
notify-script.sh <reason> <exit_code> <watchexec_info_file> <crash_context>

Critical Rule: Format Differences

Telegram: HTML mode ONLY

MESSAGE="<b>Alert</b>: <code>file.py</code>"
# Escape 3 chars: & → &, < → <, > → >

Pushover: Plain text ONLY

/usr/bin/env bash << 'SKILL_SCRIPT_EOF'
# Strip HTML tags before sending
MESSAGE_PLAIN=$(echo "$MESSAGE_HTML" | sed 's/<[^>]*>//g')
SKILL_SCRIPT_EOF

Why HTML for Telegram:

  • Markdown requires escaping 40+ chars (., -, _, etc.)
  • HTML only requires escaping 3 chars (&, <, >)
  • Industry best practice

Quick Reference

Send to Both Channels

/usr/bin/env bash << 'SKILL_SCRIPT_EOF_2'
# 1. Build HTML message for Telegram
MESSAGE_HTML="<b>File</b>: <code>handler_classes.py</code>"

# 2. Strip HTML for Pushover
MESSAGE_PLAIN=$(echo "$MESSAGE_HTML" | sed 's/<[^>]*>//g')

# 3. Send to Telegram with HTML
curl -s -d "chat_id=$CHAT_ID" \
  -d "text=$MESSAGE_HTML" \
  -d "parse_mode=HTML" \
  https://api.telegram.org/bot$BOT_TOKEN/sendMessage

# 4. Send to Pushover with plain text
curl -s --form-string "message=$MESSAGE_PLAIN" \
  https://api.pushover.net/1/messages.json
SKILL_SCRIPT_EOF_2

Execution Pattern

# Fire-and-forget background notifications (don't block restarts)
"$NOTIFY_SCRIPT" "crash" "$EXIT_CODE" "$INFO_FILE" "$CONTEXT_FILE" &

Validation Checklist

Before deploying:

  • Using HTML parse mode for Telegram (not Markdown)
  • HTML tags stripped for Pushover (plain text only)
  • HTML escaping applied to all dynamic content (&, <, >)
  • Credentials loaded from env vars/Doppler (not hardcoded)
  • Message archiving enabled for debugging
  • File detection uses stat (not find -newermt)
  • Heredocs use unquoted delimiters for variable expansion
  • Notifications run in background (fire-and-forget)
  • Tested with files containing special chars (_, ., -)
  • Both Telegram and Pushover successfully receiving

Summary

Key Lessons:

  1. Always use HTML mode for Telegram (simpler escaping)
  2. Always strip HTML tags for Pushover (plain text only)
  3. Escape only 3 chars in HTML: &&, <<, >>
  4. Archive messages before sending for debugging
  5. Use stat for file detection on macOS (not find -newermt)
  6. Load credentials from env vars/Doppler (never hardcode)
  7. Fire-and-forget background notifications (don't block restarts)

Reference Documentation

For detailed information, see:

Bundled Examples:

  • examples/notify-restart.sh - Complete dual-channel notification script
  • examples/bot-wrapper.sh - watchexec wrapper with restart detection
  • examples/setup-example.sh - Setup guide and installation steps

Troubleshooting

IssueCauseSolution
Telegram escaping errorsUsing Markdown instead of HTMLSwitch to HTML mode with parse_mode=HTML
Pushover shows HTML tagsHTML not strippedStrip tags with sed before sending to Pushover
Notifications not arrivingCredentials missingVerify BOT_TOKEN, CHAT_ID, Pushover keys
Special chars brokenMissing HTML escapingEscape &, <, > in dynamic content
find -newermt fails macOSmacOS incompatibilityUse stat for file detection instead
Notifications blockingNot running in backgroundAdd & to run notify script fire-and-forget
Duplicate notificationsRestart loopAdd debounce logic or cooldown period
Missing crash contextContext file not writtenVerify watchexec info file path exists

Post-Execution Reflection

After this skill completes, check before closing:

  1. Did the command succeed? — If not, fix the instruction or error table that caused the failure.
  2. Did parameters or output change? — If the underlying tool's interface drifted, update Usage examples and Parameters table to match.
  3. Was a workaround needed? — If you had to improvise (different flags, extra steps), update this SKILL.md so the next invocation doesn't need the same workaround.

Only update if the issue is real and reproducible — not speculative.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.78%
按下载量换算154

Claude

28.37%
按下载量换算116

Cursor

21.43%
按下载量换算87

Gemini CLI

9.43%
按下载量换算38

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills