mcpField
C
custom-skills-notify

custom-skills-notify

github.com/valorvieエージェントワークフロー060 回インストール3 週間前に更新
リポジトリ

custom-skills-notify について

Claude Code のイベント通知を Telegram または Discord で設定、テスト、送信するスキルです。イベントの自動通知には別途プラグインのインストールが必要です。

主な機能

  1. 01Telegram と Discord の設定
  2. 02通知送信のテスト
  3. 03通知の手動送信
  4. 04マスク済み設定の表示
  5. 05イベント通知の切り替え

活用シーン

  1. 01Claude Code の通知先設定
  2. 02単発の状況メッセージ送信
  3. 03通知対象イベントの選択

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/valorvie/ai-dev-skills --skill custom-skills-notify

インストール後、Claude Code で/custom-skills-notifyを入力して読み込まれたか確認します。

同梱ファイルscripts/check-config.jsscripts/notify.js

詳細

プロジェクトの README より

custom-notify — Claude Code 通知系統

透過 Telegram 或 Discord 接收 Claude Code 的重要事件通知。

指令

/notify init — 初始化設定

引導使用者建立通知設定檔。詢問使用者要啟用哪些頻道(可多選)。

Telegram 設定步驟:

  1. 請使用者提供 Telegram Bot Token(從 @BotFather 取得)
  2. 請使用者提供 Chat ID(可用 @userinfobot 取得)

Discord 設定步驟:

  1. 請使用者提供 Discord Webhook URL(從 Discord 頻道設定 → 整合 → Webhook 取得)

設定檔範例 ~/.config/claude-notify/config.json:

{
  "channels": {
    "telegram": {
      "enabled": true,
      "bot_token": "<使用者提供的 token>",
      "chat_id": "<使用者提供的 chat_id>"
    },
    "discord": {
      "enabled": true,
      "webhook_url": "<使用者提供的 webhook URL>"
    }
  },
  "events": {
    "task_complete": true,
    "task_failed": true,
    "needs_input": true,
    "tool_rejected": true
  }
}

建立完成後,自動執行 /notify test 驗證連線。

注意:

  • 確保目錄存在:mkdir -p ~/.config/claude-notify
  • 如果使用者只要其中一個頻道,另一個設 "enabled": false 或不寫即可
  • 如果已有設定檔,詢問是否要新增頻道或覆蓋
/notify test — 測試連線

執行以下命令發送測試訊息:

node "<skill_path>/scripts/notify.js" --test
  • 成功:告知使用者「測試訊息已發送,請檢查通知頻道」
  • 失敗:顯示錯誤訊息並協助排查
/notify <訊息> — 手動發送通知

當使用者輸入 /notify 後面接任何文字時,發送該文字作為通知:

node "<skill_path>/scripts/notify.js" --manual --message "<使用者的訊息>"

範例:

  • /notify 部署完成,請來檢查
  • /notify 測試全部通過
/notify config — 查看目前設定

讀取並顯示 ~/.config/claude-notify/config.json 的內容(隱藏 bot_token 和 webhook_url 的中間部分)。

/notify toggle <event> — 開關事件通知

修改 ~/.config/claude-notify/config.json 中的 events 設定。

可用的 event 名稱:

  • task_complete — 任務完成通知
  • task_failed — 工具執行失敗通知
  • needs_input — 需要使用者決策通知
  • tool_rejected — 工具被拒絕通知

範例: /notify toggle task_complete — 切換任務完成通知的開關狀態

自動通知

npx skills 只安裝本 skill,不會安裝 Claude Code plugin。自動通知由 custom-skills-notify plugin 處理,監聽以下 Claude Code hook 事件:

事件觸發時機
Notification需要權限、閒置提示、需要回答問題
StopClaude 完成回應
PostToolUseFailure工具執行失敗

需要自動通知時,另外執行:

claude plugin marketplace add https://github.com/ValorVie/custom-skills.git
claude plugin install custom-skills-notify@custom-skills

這個 plugin 安裝是獨立操作,不屬於 npx skills add 的結果。

腳本路徑

通知腳本位於:<skill_path>/scripts/notify.js

使用 <skill_path> 代表此 skill 的根目錄路徑。在執行命令時,用實際的絕對路徑替換。

コメント