跳到正文
Skillpedia
邮件与消息41k · #6814

formatting-slack-messages

它能做什么

本技能帮助 AI 编写并检查 Slack 消息布局,例如卡片、按钮、菜单和表格。适合开发 Slack 机器人或应用、希望结果整洁易读的人。

适用场景

  • ✓当你希望 Slack 机器人发布带有按钮或表格的清晰更新时。
  • ✓当你需要修改已有的 Slack 消息,同时保留其按钮和链接的时候。
  • ✓当你在制作 Slack 弹窗或 App Home 界面,并希望它能正确显示的时候。

技能链接

https://github.com/PostHog/posthog/blob/master/.agents/skills/formatting-slack-messages/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/PostHog/posthog/blob/master/.agents/skills/formatting-slack-messages/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我设置一条 Slack 消息的格式,展示我们每日的销售摘要,并附带一个批准按钮。”

每周 5 个新技能,1 分钟读完。

工作原理

它遵循 Slack 官方的布局规则,选择合适的构建模块,编写消息数据,并在使用前检查是否存在错误。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Formatting Slack messages

Build a layout that makes the result, its context, and the next action clear. This workflow adapts Slack's official Block Kit skill. It is self-contained; another installed skill is not required. See sources for upstream attribution.

1. Identify the surface and the change

Infer the surface from the request or existing payload:

  • A message has blocks or attachments and goes to a channel or direct message.
  • A modal has type: modal and a view lifecycle.
  • An App Home view has type: home and is published for a user.

Inspect the existing payload before changing its layout. For modifications, preserve unchanged content, source links, block_id, action_id, values, and menu choices. Ask only when missing information changes the implementation. Do not repeat questions the user already answered. For a clear small edit, read the relevant schema, make the edit, and validate it. For a broad redesign, establish the content order before building the payload.

2. Read live schemas

Use the Block Kit index to find the current component pages. Fetch each selected block, element, and composition object's schema and example. Append .md to Slack documentation URLs when a Markdown response is easier to read. Follow index links rather than guessing slugs; select menus share one reference page. Reuse pages already read during the task.

Check required fields, allowed nesting, text types, limits, and supported surfaces separately. Do not treat this skill's comparison tables as permanent schemas.

Common errors:

  • markdown is a block type. It is not a text-object type.
  • Text objects use plain_text or mrkdwn. A text element is valid inside the appropriate rich_text structure, not as a standalone block.
  • Valid JSON does not establish valid Block Kit.
  • A schema-validation success does not establish surface compatibility or block-count compliance.

3. Match the structure to the content

Content Starting point
One change or important number A short sentence with its comparison and units
Independent facts about one item section.fields with short labels and values
Several comparable rows table
Rows that need sorting, pagination, filtering, or row actions data_table
A compact entity with a short body and a few buttons card
Optional peer items for browsing A carousel of cards
A related group of blocks container
A real task or investigation step with progress updates task_card or plan
A view-wide notice in a modal alert
Existing generated Markdown markdown, if supported and safe for the intended message
Formatted text assembled in code rich_text

Use block selection for limits, table comparisons, and template patterns. Keep required findings visible outside carousels, pagination, and collapsed groups. Do not add dividers between every block or put a one-line notice in a card without a reason. Use a consistent size and hierarchy across comparable messages. Keep at most one visually primary action per message or view. Leave equal navigation choices unstyled.

For modals, check the view wrapper, title, callback, close, and submit requirements. An input-containing modal needs a submit action. Do not compete with Submit using another primary button. For App Home, handle first use, empty results, and view refresh for the current user. Use task cards for work with progress updates. Their sta

常见问题

这项技能会帮我设置 Slack 工作区吗?

不会。它不用于工作区或应用的设置,只专注于消息本身的布局。

它能检查消息在 Slack 中的显示效果吗?

可以。它会验证布局,并检查 Slack 的显示方式。

它能修改已经存在的消息吗?

可以。在更新布局的同时,它会保持原有的内容、链接、按钮和数值不变。

详情

作者的原始描述

Builds and validates Slack Block Kit messages, modals, and App Home layouts. Use for Slack formatting, block selection, Markdown, cards, tables, charts, metadata, buttons, and menus. Covers live schemas, payload validation, accessibility, and actual Slack rendering. Not for workspace setup.

repo: PostHog/posthog

热度

GitHub 星标
41k
排名
#6814
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能