notification-system
БесплатноБез исполняемых скриптовНе проверенDesigns and implements multi-channel notification systems with email, push, and in-app delivery. Use when you need to build a notification service, set up…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Notification System
Overview
This skill enables AI agents to architect, implement, and configure multi-channel notification systems. It covers channel routing, user preference management, template rendering across formats, delivery tracking, retry logic, and compliance requirements like CAN-SPAM unsubscribe.
Instructions
1. Notification Architecture
Every notification system needs these components:
Event Source → Notification Router → Channel Adapters → Delivery
↓ ↓
Preference Store Retry Queue
↓
Dead Letter Queue
Notification Router: Receives a typed event, resolves the user's channel preferences, and dispatches to the appropriate channel adapters.
Channel Adapters: Pluggable handlers for each delivery channel. Must implement a common interface:
interface ChannelAdapter {
channel: 'email' | 'push' | 'in-app';
send(notification: FormattedNotification): Promise<DeliveryResult>;
validateRecipient(userId: string): Promise<boolean>;
}
Preference Store: Database-backed user preferences with per-notification-type, per-channel toggles. Some notifications (transactional/security) must be non-disableable.
2. Notification Type Classification
Always classify notifications into categories that determine default behavior:
| Category | Examples | Can Disable? | Default Channels |
|---|---|---|---|
| Security | Password reset, 2FA | No | |
| Transactional | Order confirm, receipt | No | Email + In-app |
| Activity | Comments, mentions | Yes | Push + In-app |
| Social | New follower, like | Yes | In-app |
| Marketing | Digest, announcements | Yes |
3. Channel-Specific Constraints
Email:
- Commercial and marketing email needs an unsubscribe link and must honor opt-outs (CAN-SPAM, 15 U.S.C. 7704). CAN-SPAM does not treat transactional or relationship messages (receipts, password resets) as commercial email, but keep promotional content out of them
- Gmail requires one-click unsubscribe for subscribed and marketing mail. Send both
List-Unsubscribe: <https://terminalskills.io/unsubscribe/7f3c9a2e>andList-Unsubscribe-Post: List-Unsubscribe=One-Click(RFC 8058). DKIM must sign both headers, and the POST handler must complete the unsubscribe itself, without a login or confirmation page - Senders of 5,000 or more messages a day to Gmail must meet Google's bulk-sender rules (SPF or DKIM, PTR records, TLS, DMARC alignment)
- HTML + plain text versions
- Sender reputation — batch marketing emails separately from transactional
Push Notifications:
- Keep titles near 65 characters and bodies near 178: lock screens cut longer text, and the cut-off varies by OS and device. These are display guidance, not API limits; check your provider's payload size limit
- Include
datapayload for deep linking - Handle token expiration and refresh
- Respect OS-level notification settings
In-App:
- Store in database with read/unread status
- Deliver in real-time via WebSocket if user is online
- Group related notifications (e.g., "3 people commented on your post")
- Paginate the notification feed
4. Retry and Failure Handling
Implement exponential backoff per channel:
- Email: 3 retries at 1min, 5min, 30min (provider outages are temporary)
- Push: 2 retries at 30s, 2min (invalid tokens should fail fast)
- In-app: 0 retries (direct DB write, either succeeds or doesn't)
After max retries, move to dead letter queue with full context for debugging.
5. Template Strategy
Use a single data context per notification type that renders differently per channel:
interface NotificationContext {
type: 'new-comment';
actor: { name: string; avatarUrl: string };
target: { title: string; url: string };
content: { preview: string; full: string };
}
// → Email: Full HTML with actor avatar, comment preview, and action button
// → Push: "Alex commented: 'Great analysis of the…'"
// → In-app: "Alex commented on Your Post Title" with link
6. Delivery Tracking
Track these states for every notification:
queued → sent → delivered → read → failed
Store in a notification_deliveries table with: notification_id, user_id, channel, status, attempted_at, delivered_at, read_at, error_message.
Examples
Example 1: Express + BullMQ notification router
Prompt: "Build a notification service for my Express app that sends order confirmations via email and in-app."
Output: The agent creates a BullMQ-backed router that accepts { type: 'order-confirmed', userId, data: { orderId, total, items } }, checks user preferences, and dispatches to the email adapter (SendGrid) and in-app adapter (PostgreSQL insert + Socket.io emit).
Example 2: Preference management API
Prompt: "Create an API for users to manage their notification
Установить notification-system в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл notification-system?
Designs and implements multi-channel notification systems with email, push, and in-app delivery. Use when you need to build a notification service, set up user notification preferences, create delivery pipelines, implement retry logic for failed notifications, or route messages across channels. Trigger words: notification system, push notifications, email notifications, in-app notifications, notification preferences, delivery tracking, unsubscribe, notification routing.
Как установить скилл notification-system?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл notification-system запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic