前端开发

block-kit

slackapi/slack-…s-plugin

Use when a developer wants to build or validate Block Kit layouts for Slack messages, modals, or Home tabs: message layouts, modals/forms/dialogs, Home tab interfaces, interactive buttons or menus, or modifying existing Block Kit JSON. Also trigger on any Slack UI component (sections, actions, inputs, headers, alerts, tables, carousels), the words "blocks" or "Block Kit Builder", a request to preview rendered blocks, or pasted JSON like "type": "section". Validates via the blocks.validate API method.

  • 548 次安装
  • 161 星标
  • 收录于

安装命令

npx skills add https://github.com/slackapi/slack-skills-plugin --skill block-kit

SKILL.md

Block Kit

Help the developer build a rich Block Kit layout. If $0 is exactly message, modal, or home-tab, treat it as the target surface. Otherwise (including if it's empty or any other value), ignore it and determine the surface in Step 1.

This skill walks through surface selection, layout planning, JSON generation, and validation. Block types, elements, and fields come from the live docs (see Source of Truth below) — discover them and read each component's schema there, never from memory.

Common Block Kit mistakes (and why): A few errors recur often enough to flag up front. Most others are caught by blocks.validate in Step 5, so lean on validation rather than memorizing rules.

  • "type": "text" is not a thing. Text is a composition object: { "type": "plain_text", "text": "..." } or { "type": "mrkdwn", "text": "..." }.
  • markdown is a block type, not a text type. A markdown block holds standard markdown; text objects inside other blocks use mrkdwn (see mrkdwn vs. the markdown block in Step 4). Slack's mrkdwn is *bold* / _italic_ / ~strike~, not **bold**.
  • Messages need a top-level text fallback. blocks.validate won't flag a missing one, but notifications and screen readers display it instead of the blocks — so summarize what the layout conveys rather than leaving it empty.

Source of Truth: the Live Docs

Every block, element, and composition object is documented on docs.slack.dev. Append .md to any reference URL to fetch it as markdown with WebFetch (no auth required).