MCPInstall

block-kit

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.

Installs
514
Last 24h
+14
Trending rank
#7310
Security
Not audited

Install

Works with every agent the skills CLI supports.

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

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads block-kit automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

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).

  • Master index: the authoritative list of every block, block element, and composition object, each linking to its own page: https://docs.slack.dev/reference/block-kit.md. WebFetch it to confirm a type exists and to get the link to its page.
  • Per-component pages carry the full field schema (a fields table with required/optional flags and constraints, plus JSON examples):
    • Blocks: https://docs.slack.dev/reference/block-kit/blocks/<slug>-block.md
    • Block elements: https://docs.slack.dev/reference/block-kit/block-elements/<slug>-element.md
    • Composition objects: https://docs.slack.dev/reference/block-kit/composition-objects/<slug>.md
  • The slug is not always the type name. For example datepicker maps to date-picker-element.md, and every *_select menu (static_select, users_select, multi_channels_select, and so on) is documented on select-menu-element.md. When unsure of a slug, follow the link from the master index rather than building the URL by hand.
  • Surface payload structure lives in the surface guides: messages at https://docs.slack.dev/messaging/formatting-message-text.md, modals at https://docs.slack.dev/surfaces/modals.md, and Home tabs at https://docs.slack.dev/surfaces/app-home.md.

Never use a block type, element, or field you have not seen on a live page.


Fast Path (for clear, specific requests)

If the developer's request is specific enough to determine both the target surface and the desired layout, collapse Steps 1-4 into a single pass:

  1. Determine the surface from $0 or context
  2. Fetch only the doc pages for the blocks and elements mentioned
  3. Generate the JSON directly
  4. Proceed to Step 5 (validation)

Fast-path indicators (skip the full workflow):

  • Developer provides existing JSON to modify → use Modification Mode instead
  • Developer names specific block types: "add an actions block with two buttons"
  • Developer describes a well-known pattern: "approval message", "feedback form", "settings modal"
  • Developer provides a complete description in one message with enough detail to build

Full-workflow indicators (use Steps 1-7):

  • Vague requests: "make something cool", "build a dashboard"
  • Exploratory: "what can Block Kit do?", "show me my options"
  • Complex layouts: 10+ blocks, nested modals, conditional logic
  • Developer asks for help deciding what to build

Modification Mode

If the developer provides existing Block Kit JSON (pasted inline, in a file, or referenced from code), enter Modification Mode instead of the full creation workflow:

  1. Parse the existing structure:

    • List each block by index, type, and a short description of its content
    • Infer the surface: "type": "modal" = modal, "type": "home" = home tab, bare blocks array = message
  2. Ask what changes they want:

    • Add blocks (where in the sequence?)
    • Remove blocks (which ones?)
    • Modify blocks (which block, what change?)
    • Reorder blocks
  3. Apply changes while preserving:

    • All existing block_id values (these are referenced in app interaction handlers)
    • All existing action_id values (these map to event listeners)
    • Existing styles, text content, and structure for unchanged blocks
  4. Validate the modified JSON: proceed to Step 5 (validation)

Detection: If the developer's message contains a JSON array starting with [{"type": or a view object with "blocks":, enter Modification Mode automatically. If they say "edit", "update", "modify", or "change" in reference to existing blocks, ask them to provide the current JSON.


Step 1: Determine the Target Surface

If $0 is provided and matches one of message, modal, or home-tab, use it directly.

Otherwise, ask the developer using AskUserQuestion:

  • Message: Conversational content posted to a channel or DM. Max 50 blocks.
  • Modal: A dialog or form opened by a user action. Max 100 blocks.
  • Home tab: A persistent, per-user dashboard in the App Home. Max 100 blocks.

Once the surface is determined, use the correct payload structure for it:

  • Message: a { "text": "Fallback text", "blocks": [...] } object posted via chat.postMessage (and friends). The text field is the notification/accessibility fallback. For message text formatting (mrkdwn, mentions, dates), see https://docs.slack.dev/messaging/formatting-message-text.md.
  • Modal: a view object ({ "type": "modal", "title": ..., "blocks": [...] }). For the full view object structure, lifecycle, and the rule that submit is required when the view contains any input block, see https://docs.slack.dev/surfaces/modals.md.
  • Home tab: a view object ({ "type": "home", "blocks": [...] }) published via views.publish. For structure and behavior, see https://docs.slack.dev/surfaces/app-home.md.

Step 2: Understand What to Build

Ask the developer to describe what they want their layout to look like or accomplish.

If they need inspiration, suggest examples — several map directly onto a ready-made template in references/common-patterns.md (named in parentheses), which you can start from in Step 3:

  • "A feedback form with a text input and a category selector" (Simple Form Modal)
  • "A deploy-failure notification with a description and next-step buttons" (Notification Alert), or "an approval request with Approve/Reject buttons" (Approval Message)
  • "A dashboard home tab with a welcome header, key metrics in fields, and quick-action buttons" (Dashboard Home Tab)
  • "A settings modal with dropdowns, checkboxes, and a time picker" (Settings Modal with Multiple Input Types)
  • "A table of sprint tasks with status and points" (Data Table)
  • "A deploy summary with bold text, a link, and a bullet list" (Rich Text Section)
  • "A row-level '⋯' menu for edit/duplicate/delete actions" (Row Actions with Overflow Menu)
  • "A product card with an image, price, and Add to Cart button" (Card Preview)

Get enough detail to plan the layout before generating any JSON.


Step 3: Plan the Block Layout

Based on the developer's description:

  1. Fetch only what you need from the live docs:

    • WebFetch the master index (https://docs.slack.dev/reference/block-kit.md) to confirm the block and element types you plan to use exist and to grab links to their pages.
    • Consult references/design-principles.md for design appropriateness — which block fits the shape of the content (table vs. stacked sections, card vs. loose blocks), emphasis, reading order, and accessibility. It is guidance on building layouts that read well, not on validity. Depending on the layout, also consult:
      • references/modal-design.md for modals and forms: titles and submit labels, input labels and hints, multi-step flows, validation errors, and loading or success states.
      • references/home-tab-design.md for Home tabs: what goes at the top, empty and first-run states, keeping the view current, different views per role, and review surfaces for agents.
      • references/data-display-design.md for numbers and records: choosing between section fields, table, data_table, and data_visualization charts, and presenting each clearly.
      • references/agent-progress-design.md for showing an agent's work with plan and task_card blocks or streamed task updates.
      • references/human-in-the-loop.md for approval gates, approving several proposed actions in one message, clarifying choices, and edit-before-send.
    • Check references/common-patterns.md if the request matches a common pattern; start from the template instead of building from scratch.
    • Defer reading individual component pages until Step 4, when you build each block's fields.
  2. Propose a numbered block outline. For example:

    1. header: "Weekly Report"
    2. section: Summary text with a datepicker accessory
    3. divider
    4. section: Status fields (Name, Role, Team)
    5. actions: "Approve Report" button (primary) and "Reject" button (unstyled)
    
  3. Present the outline to the developer and ask for approval or changes before generating JSON.

Surface constraints to check:

  • Block count limit: 50 for messages, 100 for modals/home tabs
  • Modal-specific: if using input blocks, the modal payload must include a submit field
  • Table: only one table block per message
  • Charts: at most two data_visualization blocks per message
  • Alert: the alert block is available only in modals. In messages, state severity in words in a header or section.
  • Surface compatibility (whether a block is valid on the chosen surface) and element compatibility (whether an element is allowed inside a given block) are not always spelled out on a component's doc page. Check references/design-principles.md's surface and limits table for these. blocks.validate in Step 5 does not enforce them — it checks block and element shape only, and will return ok: true for a block on the wrong surface or over a count limit. Don't treat a pass there as confirmation of surface or count compliance.

Step 4: Generate the Block Kit JSON

Once the layout is approved, build each block from its live doc page, fetching each page's fields table (required vs optional, constraints) and JSON example with WebFetch. The URL patterns are in Source of Truth above; the one slug to remember is that every *_select menu (static_select, users_select, multi_channels_select, …) lives on select-menu-element.md. Fetch pages as you need them and reuse what you have already fetched — don't re-fetch the same page for every block of the same type. Then build the payload block-by-block and wrap it in the surface structure from Step 1.

Guidelines:

  • Use descriptive action_id values (e.g., "approve_report_btn" not "action_1") — they identify the element in your interaction handlers
  • Include block_id values where the developer will need them for interaction handling
  • For modals, include title, submit, close, and callback_id; for home tabs, the type: "home" wrapper
  • Use mrkdwn text for rich formatting, plain_text where required (headers, labels, modal title)

mrkdwn vs. the markdown block: section and context blocks format text with Slack's mrkdwn (*bold*, not **bold**). The separate markdown block (messages only) renders standard markdown and is for AI/LLM-generated or long-form content that is already in standard markdown. references/design-principles.md, Text: rich_text, mrkdwn, and the markdown block, explains when to use each, including rich_text for formatted text you build in code.

Accessibility is easy to skip and hard to retrofit, so build it in now. Apply references/design-principles.md, Accessibility and fallback, as you write each block: it covers the text fallback, alt_text, color and emoji, button labels, and text equivalents for tables and charts.

Present the complete payload to the developer in the Step 1 surface structure.


Step 5: Validate

Always validate. blocks.validate is a public Web API method, so no auth token is required.

The authoritative reference for this method (its parameters, auth requirements, and response/error shape) is the live doc. WebFetch it before relying on any detail here: https://docs.slack.dev/reference/methods/blocks.validate.md. It documents the accepted parameters (blocks for a message's blocks array, view for a modal/home-tab view, message for a full message payload; send exactly one) and the response shape.

5a. Build the validation request

Prefer the Slack CLI when it's available, since it reuses the slack-cli skill's CLI detection and needs no token wrangling. If the CLI isn't installed, fall back to curl. Both call the same public method and return the same response, so Step 5b applies either way.

Path A: Slack CLI (preferred).

Use the slack:slack-cli skill, Step 1: Detect the Slack CLI, to check whether the public CLI is installed and resolve its command (SLACK_CMD).

If the CLI is available, use the slack:slack-cli skill, Step 4: Calling Web API Methods (slack api), to invoke it. That step covers the SLACK_CMD api <method> key=value … syntax. Run SLACK_CMD api --help first to confirm the syntax and the flag that skips authentication. blocks.validate needs no token, so call it without authentication. Don't hard-code that flag from memory; read it from the help output so this stays correct if it's ever renamed. Pass the payload as a positional key=value argument: blocks=<JSON array> for messages, or view=<JSON view object> for modals and home tabs.

Path B: curl (fallback, when the CLI isn't installed).

POST to the endpoint with the Bash tool. The API uses form-urlencoded encoding, so pass the JSON directly as the parameter value.

For messages, send the blocks array as a form-encoded parameter:

curl -s -X POST 'https://slack.com/api/blocks.validate' \
  -d 'blocks=[ ... the blocks array ... ]'

For modals and home tabs, send the complete view object in the view field:

curl -s -X POST 'https://slack.com/api/blocks.validate' \
  -d 'view={ "type": "modal", "title": ..., "blocks": [...] }'

5b. Handle the response

Success:

{ "ok": true }

Tell the developer their blocks are valid.

Failure:

{
  "ok": false,
  "error": "invalid_blocks",
  "errors": [
    {
      "code": "missing_field",
      "message": "missing required field: type",
      "field": "type",
      "pointer": "/0"
    }
  ]
}

When validation fails:

  1. Read each error. pointer is a JSON pointer to the offending node (e.g., /0 = first block, /2/elements/1 = second element of the third block, /0/text/type = the type field of the first block's text object). message describes the problem, and constraint (when present) names the rule that failed and its expected values.
  2. Fix the JSON. For the authoritative meaning of an error code and the field requirements behind it, consult the live method doc (https://docs.slack.dev/reference/methods/blocks.validate.md) and the relevant block/element/composition-object page you fetched in Steps 3-4.
  3. Re-validate. Repeat until "ok": true.

Step 6: Deliver the Final Output

Present the validated payload, then help the developer put it to use.

Send it

Building the payload is this skill's job; sending it (chat.postMessage, views.open, views.publish, and the token/scope handling around them) belongs to the Web API layer. To call the right method — via the Slack CLI, raw curl, or a Bolt SDK — use the slack:slack-api skill, Step 4: Call the Method (Manage), passing this payload as the method's blocks argument (messages) or view argument (modals and home tabs). That skill matches the argument names to the SDK or HTTP call so we don't duplicate them here.

Preview it

Help the developer view their layout with the Block Kit Builder. Prefer the Slack CLI if it is installed. The CLI automatically loads the blocks, saving the developer from copying and pasting. If the CLI is not available, provide the standard Builder link instead.

Path A: Slack CLI (preferred).

Use the slack:slack-cli skill, Step 1: Detect the Slack CLI, to check whether the public CLI is installed and resolve its command (SLACK_CMD).

If the CLI is available, run SLACK_CMD blocks preview --help to see how to pass the blocks and open the preview. The command loads the blocks into the Block Kit Builder in the developer's browser.

Because you run the CLI non-interactively, this command also needs a --team flag. Resolve the team ID with the slack:slack-cli skill, Step 2: Command Discovery via Help, whose "Resolving --app and --team values" guidance covers running SLACK_CMD auth list; Any authenticated workspace works for a preview, if several are available, pick one and mention which you used rather than blocking on the choice.

Path B: Block Kit Builder link (fallback, when the CLI isn't installed).

Offer the Block Kit Builder link so the developer can paste the JSON in and tweak visually: https://app.slack.com/block-kit-builder. Builder needs an object ({ "blocks": [...] } or a full view object), not a bare array.


Step 7: Iterate

Ask whether the developer wants to add, modify, remove, or reorder blocks, or build a layout for a different surface. If they want to change the layout you just produced, re-enter Modification Mode (it preserves their block_id/action_id values); for a fresh layout, loop back to Step 3.


Notes

  • Scope: this skill owns building and validating the Block Kit payload — choosing the surface, composing the JSON from the live docs, and confirming it with blocks.validate. Sending it lives in the Web API layer (slack:slack-api), and CLI detection/auth in slack:slack-cli.
  • blocks.validate needs no auth — it's a public method, so it works without a token whether you call it via the CLI or curl. Always validate before finalizing (Step 5).

FAQ

What does the block-kit skill do?

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.

How do I install block-kit?

Run npx skills add https://github.com/slackapi/slack-skills-plugin --skill block-kit in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/block-kit/ (personal) or .claude/skills/block-kit/ (project).

Which AI agents can use block-kit?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is block-kit safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains block-kit?

It is published by slackapi in slackapi/slack-skills-plugin. It has 514 recorded installs.

More from slackapi/slack-skills-plugin

View all →

slack-api

slackapi/slack-skills-plugin

Use when a developer asks which Slack Web API method does something, needs a method's OAuth scopes or token type, wants to call or test a family.method endpoint (chat.postMessage, conversations.history, users.info, views.open), is handling cursor pagination (nextcursor) or rate limits (tier/ratelimited/Retry-After), or is debugging errors like missingscope, invalidauth, or channelnotfound. Also trigger on a pasted slack.com/api/ URL or docs.slack.dev/reference/methods link.

Backend & APIs3K installs

slack-messaging

slackapi/slack-skills-plugin

Use when writing, drafting, scheduling, or improving a Slack message, announcement, or reply sent via the Slack MCP tools (slacksendmessage, slacksendmessagedraft, slackschedulemessage). Covers Slack markdown formatting, message structure, thread etiquette, reactions, and scheduling, and points to the right dialect for canvases and Block Kit.

slack-docs

slackapi/slack-skills-plugin

Use when answering a conceptual or how-to question about Slack platform features, or when asked to look up, fetch, or summarize a docs.slack.dev page, including a pasted docs.slack.dev link. Covers finding and reading official Slack docs as clean markdown.

Docs & Writing2.9K installs

slack-search

slackapi/slack-skills-plugin

Use when locating messages, files, channels, or people across Slack, or gathering context before answering, with the search MCP tools (slacksearchpublic, slacksearchpublicandprivate, slacksearchchannels, slacksearchusers). Covers search modifiers (in:, from:, before:), file-type filters, natural-language vs. keyword search, and reading results in context.

slack-cli

slackapi/slack-skills-plugin

Use when a developer works with the Slack CLI (slack command) to create, run, or manage a Slack app from the terminal: logging in or authenticating (slack login), adding a team or switching workspaces, running locally (slack run), deploying, editing the app manifest, calling Web API methods (slack api), or searching Slack docs (slack docs search).

create-slack-app

slackapi/slack-skills-plugin

Use when a developer wants to create, scaffold, or bootstrap a new Slack app or agent from scratch with the Slack CLI. Covers prerequisites, authentication, choosing a workspace to install into, and creating a project from a Bolt (JS or Python) template locally. Trigger on "create a Slack app", "new Bolt app", "start a Slack agent".

Popular productivity & automation skills

View category →

agent-browser

vercel-labs/agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.

OfficialProductivity & Automation1.3M installs

lark-doc

open.feishu.cn

飞书云文档(Docx / Wiki)内容操作:读取、创建、编辑文档,插入或下载图片附件,以及操作思维笔记。用户提供文档 URL/token(包括 doubao.com 的 /docx/、/wiki/)时使用;按 URL 路径/token 而非域名路由;/page/ 是妙搭应用,非飞书云文档。文档内嵌资源按读取参考中的统一规则分流。独立评论操作走 lark-drive;随正文读取评论使用 docs +fetch。表格或 Base 内部数据操作不在本 skill。

lark-base

open.feishu.cn

飞书多维表格(Base)操作:建表、字段、记录、视图、统计、公式/lookup、表单、仪表盘、应用模式(BaseApp/AppMode 页面与组件)、Workspace 目录、workflow、角色权限、模板中心(多维表格模板分类/列表/搜索);遇到 Base/多维表格/bitable、BaseApp/AppMode、/base/ 或 /app/ 链接时使用。BaseApp 不走 lark-apps;文件导入/导出转 lark-drive,认证/授权转 lark-shared。

lark-drive

open.feishu.cn

飞书云空间(云盘/云存储):管理 Drive 文件和文件夹,包含上传/下载、创建文件夹、复制/移动/删除、查看元数据、查询权限设置、评论/权限/订阅、标题、版本、飞书文档密级标签(secure labels)和本地文件导入。用户需要整理云盘目录、处理云空间资源 URL/token、判断链接类型/真实 token/标题,或导入 Word/Markdown/Excel/CSV/PPTX/.base 为 docx/sheet/bitable/slides 时使用;doubao.com 云空间 URL/token 也按资源路径和 token 路由,不回退 WebFetch。不负责:文档内容编辑(走 lark-doc)、表格/Base 表内数据操作(走 lark-sheets/lark-base)、知识空间节点/成员管理(走 lark-wiki)、原生 Markdown 文件读写/patch/diff(走 lark-markdown)。

lark-shared

open.feishu.cn

Use for lark-cli setup/auth tasks: auth login/status/logout, user vs bot identity, business-domain permissions (--domain, including all/docs/drive), missing scopes, revoking authorization, or handling notice JSON.

lark-im

open.feishu.cn

飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)、监听卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索群、创建群聊或话题群、管理标记数据、管理 Feed 置顶(添加/移除/查询置顶会话)、管理标签数据、处理卡片回调时使用。