Slack Block Kit Patterns (SBK-001)
Use this skill when generating Slack interactive messages (buttons, modals) or structured notifications that must be consistent and easy for handlers/workflows to interpret.
When to Use
- •HITL approval requests and decision confirmations (buttons)
- •Status updates (replace/update the original message)
- •Notifications and error responses (ephemeral vs in-channel)
- •Modals for collecting structured input (reason, change request, etc.)
Instructions
- •
Use a consistent block structure
- •Prefer:
header→section(reason/details) →section.fields(metadata) →actions→context. - •Keep text short; put details in fields/context.
- •Prefer:
- •
Encode workflow context deterministically
- •Use button
valuefor the primary identifier (e.g.,workflowId). - •Use
block_idas a stable grouping key (e.g.,approval_<workflowId>). - •Keep
action_idstable and versionless (contracts used by handlers). - •Example reference:
packages/core/src/wcs/approval-signal.ts(APPROVAL_ACTION_IDS,createApprovalBlocks).
- •Use button
- •
Choose the right response mechanism
- •For interactive callbacks, respond within 3 seconds.
- •Prefer: acknowledge callback (
{ ok: true }) and let the workflow update the message asynchronously. - •If you must respond immediately, use an ephemeral response describing next steps.
- •
Use predictable status updates
- •Update the original message with a terminal result (approved/rejected/error).
- •Include a timestamp + source in a
contextblock for auditability.
- •
Keep templates JSON-serializable
- •Blocks are plain objects only; avoid runtime-only types/classes.
- •Use
mrkdwnfor formatted fields,plain_textfor headers/buttons.
References
- •
references/slack-block-kit-patterns.md - •
packages/core/src/wcs/approval-signal.ts - •
packages/apps/console/server/integrations/http/slack-interactive-handler.ts