|
| 1 | +--- |
| 2 | +name: Notification |
| 3 | +description: Per-channel notification control. USE WHEN notification, notifications, voice on, voice off, mute, unmute, notification status. |
| 4 | +--- |
| 5 | + |
| 6 | +## Customization |
| 7 | + |
| 8 | +**Before executing, check for user customizations at:** |
| 9 | +`~/.claude/skills/PAI/USER/SKILLCUSTOMIZATIONS/Notification/` |
| 10 | + |
| 11 | +If this directory exists, load and apply any PREFERENCES.md, configurations, or resources found there. These override default behavior. If the directory does not exist, proceed with skill defaults. |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## Slash Command Interface |
| 16 | + |
| 17 | +This skill implements `/notification` with per-channel toggle control: |
| 18 | + |
| 19 | +``` |
| 20 | +/notification voice on # Enable voice (curl) notifications |
| 21 | +/notification voice off # Disable voice notifications — suppresses ALL curl calls |
| 22 | +/notification desktop on # Enable desktop notifications |
| 23 | +/notification desktop off # Disable desktop notifications |
| 24 | +/notification status # Show current notification channel states |
| 25 | +/notification all off # Disable all notification channels |
| 26 | +/notification all on # Enable all notification channels |
| 27 | +``` |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## Workflow Routing |
| 32 | + |
| 33 | +**When user requests toggling voice notifications:** |
| 34 | +Examples: "/notification voice on", "/notification voice off", "turn off voice", "mute voice", "unmute voice", "disable voice notifications", "enable voice", "silence the curls", "stop voice announcements" |
| 35 | +-> **Action:** Read `~/.claude/settings.json`, set `notifications.voice` to `true` or `false`, write back. Confirm the change. |
| 36 | +-> **Feedback:** "Voice notifications [enabled/disabled]. Phase announcement curls will [fire normally/be suppressed]." |
| 37 | + |
| 38 | +**When user requests toggling desktop notifications:** |
| 39 | +Examples: "/notification desktop on", "/notification desktop off", "turn off desktop", "mute desktop", "disable desktop notifications" |
| 40 | +-> **Action:** Read `~/.claude/settings.json`, set `notifications.desktop` to `true` or `false`, write back. Confirm the change. |
| 41 | +-> **Feedback:** "Desktop notifications [enabled/disabled]." |
| 42 | + |
| 43 | +**When user requests notification status:** |
| 44 | +Examples: "/notification status", "notification status", "what notifications are on", "show notification settings" |
| 45 | +-> **Action:** Read `~/.claude/settings.json` and display current state of all notification channels. |
| 46 | +-> **Output format:** |
| 47 | +``` |
| 48 | +Notification Channel Status: |
| 49 | + Voice: [ON/OFF] — Phase announcement curls |
| 50 | + Desktop: [ON/OFF] — Desktop alerts |
| 51 | + ntfy: [ON/OFF] — Push notifications (mobile) |
| 52 | + Discord: [ON/OFF] — Discord webhook |
| 53 | +``` |
| 54 | + |
| 55 | +**When user requests toggling all notifications:** |
| 56 | +Examples: "/notification all off", "/notification all on", "mute all", "unmute all", "silence everything", "turn on all notifications" |
| 57 | +-> **Action:** Read `~/.claude/settings.json`, set `notifications.voice` and `notifications.desktop` to the requested state, write back. Confirm the change. |
| 58 | +-> **Feedback:** "All notification channels [enabled/disabled]." |
| 59 | + |
| 60 | +--- |
| 61 | + |
| 62 | +## Settings Location |
| 63 | + |
| 64 | +Notification state is stored in `~/.claude/settings.json` under the `notifications` key: |
| 65 | + |
| 66 | +```json |
| 67 | +{ |
| 68 | + "notifications": { |
| 69 | + "voice": { "enabled": true }, |
| 70 | + "desktop": { "enabled": true }, |
| 71 | + "ntfy": { "enabled": true, ... }, |
| 72 | + "discord": { "enabled": true, ... }, |
| 73 | + ... |
| 74 | + } |
| 75 | +} |
| 76 | +``` |
| 77 | + |
| 78 | +- `voice.enabled` (boolean): Controls phase announcement curl commands. When `false`, VoiceGate.hook.ts blocks all curls to localhost:8888. |
| 79 | +- `desktop.enabled` (boolean): Controls desktop notification delivery. |
| 80 | + |
| 81 | +Both boolean format (`"voice": true`) and object format (`"voice": { "enabled": true }`) are supported for backwards compatibility. |
| 82 | + |
| 83 | +Settings persist across sessions automatically since they live in settings.json. |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +## Implementation Details |
| 88 | + |
| 89 | +### Voice Suppression Mechanism |
| 90 | + |
| 91 | +The voice toggle works through `VoiceGate.hook.ts` (PreToolUse hook on Bash): |
| 92 | + |
| 93 | +1. Algorithm emits a `curl -s -X POST http://localhost:8888/notify ...` command |
| 94 | +2. VoiceGate intercepts it before execution |
| 95 | +3. If `notifications.voice` is `false` in settings.json -> **BLOCK** (curl never executes) |
| 96 | +4. If `notifications.voice` is `true` (or missing) -> proceed to subagent check |
| 97 | +5. If main session -> **PASS** (curl executes) |
| 98 | +6. If subagent -> **BLOCK** (subagent curls always blocked) |
| 99 | + |
| 100 | +This means the Algorithm template's `[VERBATIM]` curl directives remain unchanged. The gating happens at infrastructure level, not prompt level. |
| 101 | + |
| 102 | +### Desktop Suppression |
| 103 | + |
| 104 | +Desktop notifications are sent via macOS `osascript` or notification hooks. When `notifications.desktop` is `false`, notification-sending code should check this setting before firing. |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +## When to Activate This Skill |
| 109 | + |
| 110 | +### Direct Notification Commands |
| 111 | +- "/notification voice on/off" |
| 112 | +- "/notification desktop on/off" |
| 113 | +- "/notification status" |
| 114 | +- "/notification all on/off" |
| 115 | + |
| 116 | +### Natural Language Triggers |
| 117 | +- "turn off voice notifications" |
| 118 | +- "mute the voice", "silence curls" |
| 119 | +- "stop announcing phases" |
| 120 | +- "enable voice", "unmute" |
| 121 | +- "what notification channels are on" |
| 122 | +- "show notification settings" |
| 123 | +- "disable all notifications" |
| 124 | + |
| 125 | +--- |
| 126 | + |
| 127 | +## Related Documentation |
| 128 | + |
| 129 | +- **Notification System:** `~/.claude/skills/PAI/THENOTIFICATIONSYSTEM.md` |
| 130 | +- **VoiceGate Hook:** `~/.claude/hooks/VoiceGate.hook.ts` |
| 131 | +- **Settings:** `~/.claude/settings.json` → `notifications` section |
0 commit comments