askill
slack-blockkit-ui

slack-blockkit-uiSafety 90Repository

Render rich Block Kit messages in Slack from AI agent tool results. Use when building agents that display formatted responses with sections, images, and buttons.

0 stars
1.2k downloads
Updated 1/13/2026

Package Files

Loading files...
SKILL.md

Slack Block Kit UI Responses

Render rich, interactive Block Kit messages in Slack from AI agent tool results.

Problem Statement

Plain text responses limit how agents can present information. Block Kit enables rich formatting - headers, sections, images, buttons - making agent responses more useful and actionable.

When to Use

  • Displaying structured data (weather, reports, dashboards) in Slack
  • Adding interactive buttons to agent responses
  • Rendering multi-section content with formatting
  • Keywords: block kit, slack blocks, rich messages, interactive messages, slack ui

Quick Start

# MCP tool returns Block Kit as resource
WidgetTemplateService.hydrate_for_tool_result(
  template: :weatherCurrent,
  slack_blocks_template: :slackBlockKitWeatherCurrent,
  data: { location: "Toronto", temperature: "-5°C" },
  text: "Current weather in Toronto"
)

Architecture

Tool Call → MCP Server → Tool Result with slack://blocks/ resource
    ↓
SlackResourceExtractor detects blocks
    ↓
SlackTaskResponseService sends chat_postMessage with blocks

Resource Format

{
  type: "resource",
  resource: {
    uri: "slack://blocks/weather/uuid",
    mimeType: "application/vnd.slack.blocks+json",
    text: '{ "blocks": [...] }'
  }
}

Key Constants

# app/mcp_servers/base_mcp_server.rb
SLACK_BLOCKS_MIME_TYPE = "application/vnd.slack.blocks+json"
SLACK_BLOCKS_URI_PREFIX = "slack://blocks/"

Testing Strategy

RSpec.describe SlackResourceExtractor do
  let(:message) { create(:message, metadata: block_kit_metadata) }

  it "detects block kit resources" do
    expect(described_class.has_blocks?(message)).to be true
  end

  it "extracts blocks array" do
    result = described_class.extract_blocks(message)
    expect(result[:blocks]).to be_an(Array)
  end
end

Block Kit Limits

  • Maximum 50 blocks per message
  • Maximum 3000 characters per text field
  • Maximum 10 elements per actions block

Common Pitfalls

  • Text fallback required: Always provide text: for notifications
  • Text type matters: Use mrkdwn for formatting, plain_text for buttons
  • Image URLs: Must be HTTPS and publicly accessible
  • Action IDs: Must be unique within the message

Reference Files

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

55/100Analyzed 2/24/2026

A reasonably well-structured skill for rendering Slack Block Kit messages with clear sections and architecture. However, it scores lower on reusability and actionability because it heavily depends on undefined internal Ruby services and provides code examples that cannot run without significant additional context. The core Block Kit limits and pitfalls sections are valuable, but the skill reads more like internal documentation than a general-purpose reusable skill. The reference files are dead links and no actual Block Kit JSON examples are provided."

90
70
45
60
50

Metadata

Licenseunknown
Version-
Updated1/13/2026
Publisherrbarazi

Tags

No tags yet.