Slack Pins Lifecycle Hygiene Bot Prompt
Build a bot that auto-pins the canonical incident summary and current status message in a channel, and unpins stale pinned messages once an incident resolves, keeping pinned context noise-free via pins.add and pins.remove
- Target user
- Incident automation engineers and SRE tooling teams
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior platform engineer who builds Slack apps and incident-tooling bots on Bolt and the Slack Web API. I will provide: - The events that should trigger a pin (e.g. incident opened, status update posted) and what should be unpinned on resolve - The message metadata or convention I use to identify "the canonical summary" vs ad-hoc chatter - My current scopes and whether the bot listens via Events API or Socket Mode Your job: 1. **Pin lifecycle model** — define the state machine: which message gets pinned on open, how a newer status message replaces the previous pin, and what unpins on resolve. 2. **API plumbing** — show `pins.add`, `pins.remove`, and `pins.list` usage, including how `pins.add` is keyed by channel + timestamp and is idempotent-safe to retry. 3. **Replace-not-duplicate logic** — pin the new status, then unpin the prior one so the channel never accumulates stale pins. 4. **Pin cap awareness** — handle the channel pin limit gracefully, surfacing a warning rather than failing when near the cap. 5. **Permissions and membership** — confirm `pins:read`/`pins:write` and bot membership; handle `not_in_channel` and `already_pinned` errors. 6. **Resolve cleanup** — on incident close, unpin everything the bot pinned (track its own pin timestamps; do not blindly clear human pins). 7. **Observability** — log every pin/unpin with incident ID for the timeline reconstruction. Output as: a Bolt event-handler module with the pin state machine, the API call wrappers, and a table mapping each lifecycle event to its pin/unpin action. Caution: pins.remove will happily remove a human's manually-pinned message if you don't track which timestamps the bot itself pinned — always scope cleanup to bot-owned pins.
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 Bookmarks API Channel Quick-Links Automation Prompt
Programmatically curate per-channel bookmark bars so every incident or service channel exposes the same runbook, dashboard, and on-call quick-links via bookmarks.add
-
Slack App Distributed Tracing Instrumentation Prompt
Instrument a Slack Bolt app with OpenTelemetry traces, metrics, and logs to debug latency across events, actions, and API calls
-
Slack App Rate-Limit Tier & Capacity Planning Prompt
Model a Slack app's request budget across method tiers, size fan-out and polling under per-workspace limits, and design a token-bucket schedule that never trips 429s.
-
Slack Block Kit Modal Input Validation & Error Display Prompt
Design server-side validation for Block Kit modals — response_action errors, per-input error keying, cross-field rules, and re-render UX that never loses user input.
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.