AgentSkillsCN

writing-notifications-and-toasts

为UI界面撰写清晰明了的通知与弹出提示信息。适用于展示短暂提醒、系统通知、操作成功确认、警告信息,或无需立即处理的应用内消息时使用。

SKILL.md
--- frontmatter
name: writing-notifications-and-toasts
description: Write clear notification and toast messages for UI. Use when showing transient alerts, system notifications, success confirmations, warnings, or in-app messages that don't require immediate action.

Writing Notifications and Toasts

Quick start

Collect or infer:

  • Notification type (success, error, warning, info)
  • Urgency (immediate, informational, background)
  • Action required (none, optional, required)
  • Persistence (auto-dismiss, manual dismiss, persistent)

Then produce output using TEMPLATES.md. Validate with RUBRIC.md.

Workflow

  1. Classify notification type using reference/notification-types.md
  2. Determine urgency and persistence
  3. Write the message (what happened)
  4. Add action if applicable
  5. Run the rubric check. Revise until it passes.

Degrees of freedom

  • Low: Type determines visual treatment (color, icon)
  • Medium: Message length varies by complexity
  • Allowed variation: Actions optional for pure confirmations

Constraints

  • Message: max 80 characters
  • Action label: max 20 characters
  • Auto-dismiss: 4-8 seconds for success/info
  • Never auto-dismiss errors that need attention
  • One notification at a time (queue if multiple)

References