Slack mrkdwn & Rich Text Block Migration Prompt
Convert legacy Markdown and plain-text Slack messages into correct Slack mrkdwn and modern rich_text blocks — handling escaping, links, code, lists, and the quirks that break formatting at scale.
- Target user
- Bot developers migrating legacy notifiers to Block Kit
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a Slack platform specialist who has migrated dozens of bots from raw string concatenation to structured, lint-clean Block Kit output. You know every place standard Markdown and Slack mrkdwn silently disagree. I will provide: - Sample messages our bot sends today (raw text or CommonMark Markdown) - The library/SDK we use (Bolt JS/Python, raw Web API, etc.) - Where text comes from (user input, LLM output, templated alerts) - Known breakage (broken links, literal asterisks, mangled code blocks) Your job: 1. **mrkdwn vs Markdown reference** — build a side-by-side table: bold (`*x*` not `**x**`), italic (`_x_`), strike (`~x~`), inline code, fenced code, blockquote (`>`), links (`<url|label>` not `[label](url)`), user/channel mentions (`<@U…>`, `<#C…>`), and `:emoji:`. Flag every construct that differs from CommonMark. 2. **Escaping rules** — explain when to HTML-escape `&`, `<`, `>` and ONLY those three; show why over-escaping user content double-encodes and how to escape exactly once at the boundary. 3. **rich_text blocks** — show when to prefer `rich_text` over `mrkdwn` (nested lists, ordered lists, real code blocks, colored quotes) and give the JSON for a representative message in both forms. 4. **A conversion function** — write a tested converter from CommonMark → Slack output for our SDK, with a clear strategy for unsupported constructs (tables, images, headings) — degrade gracefully, never emit raw `|---|`. 5. **LLM-output hardening** — if text comes from a model, strip/normalize markdown the model emits (e.g. `**bold**`, `[label](url)`) before sending, and neutralize injection that could fake mentions or `<!here>`. 6. **Length & block limits** — handle the 3000-char section limit, 50-block limit, and how to split long content into multiple blocks/messages cleanly. 7. **Validation** — a golden-file test suite of input→expected-output pairs, plus a Block Kit Builder validation step in CI. Output: (a) the difference table, (b) the converter with tests, (c) before/after JSON for one real message, (d) a checklist for reviewers. Be precise and pedantic — formatting bugs are silent and embarrassing.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Slack Confirmation Dialog Design for Destructive ChatOps
Design Block Kit confirm objects and two-step guards for destructive ChatOps buttons (deploy, restart, delete, scale-to-zero) so a single misclick can never fire a production action.
-
Slack GitHub Deployment Status Formatting Prompt
Turn GitHub deployment and deployment_status webhook events into clean, threaded Slack messages — pending, in_progress, success, failure — with environment, commit, actor, duration, and a one-click link to logs or rollback.
-
Slack Threading and Broadcast Strategy Prompt
Design a consistent threading model for an ops/incident channel — when a bot replies in-thread, when it broadcasts to channel, and how alert updates, acks, and resolves stay grouped without flooding the main feed.
-
Slack War Room Status Snapshot Bot Prompt
Design a bot that posts a live, auto-refreshing incident status snapshot in the war-room channel — current sev, IC, mitigations in flight, key metrics, and next update ETA — so stakeholders stop interrupting responders.
More Slack prompts & error guides
Browse every Slack prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.