slack-integration

Slack messaging — send messages, manage channels, upload files, add reactions, and automate team notifications via CLI and API.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "slack-integration" with this command: npx skills add charlie-morrison/cm-slack-integration

Slack Integration

Send messages, manage channels, upload files, and automate notifications in Slack workspaces using the Web API. Works with bot tokens or user tokens.

Setup

# 1. Create a Slack App: https://api.slack.com/apps → Create New App
# 2. Add scopes under OAuth & Permissions:
#    Bot Token Scopes: chat:write, channels:read, channels:history,
#                      files:write, reactions:write, users:read
# 3. Install to workspace → copy Bot User OAuth Token

export SLACK_TOKEN="xoxb-..."   # Bot token (starts with xoxb-)

For user-level actions (DMs to yourself, custom status), use a User OAuth Token (xoxp-...) instead.

Sending Messages

# Simple text message
curl -s -X POST https://slack.com/api/chat.postMessage \
  -H "Authorization: Bearer $SLACK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"channel": "C0123ABCDEF", "text": "Deploy complete ✓"}'

# With rich formatting (Block Kit)
curl -s -X POST https://slack.com/api/chat.postMessage \
  -H "Authorization: Bearer $SLACK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "channel": "C0123ABCDEF",
    "blocks": [
      {"type": "header", "text": {"type": "plain_text", "text": "Deploy Report"}},
      {"type": "section", "text": {"type": "mrkdwn", "text": "*Status:* ✅ Success\n*Version:* v2.1.0\n*Duration:* 45s"}}
    ]
  }'

# Reply in thread
curl -s -X POST https://slack.com/api/chat.postMessage \
  -H "Authorization: Bearer $SLACK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"channel": "C0123ABCDEF", "thread_ts": "1234567890.123456", "text": "Fix deployed"}'

# Schedule a message (Unix timestamp)
curl -s -X POST https://slack.com/api/chat.scheduleMessage \
  -H "Authorization: Bearer $SLACK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"channel": "C0123ABCDEF", "text": "Standup time!", "post_at": 1700000000}'

# Update a message
curl -s -X POST https://slack.com/api/chat.update \
  -H "Authorization: Bearer $SLACK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"channel": "C0123ABCDEF", "ts": "1234567890.123456", "text": "Updated text"}'

Channels

# List channels (paginated — follow next_cursor)
curl -s "https://slack.com/api/conversations.list?types=public_channel,private_channel&limit=200" \
  -H "Authorization: Bearer $SLACK_TOKEN" | jq '.channels[] | {id, name, num_members}'

# Get channel info
curl -s "https://slack.com/api/conversations.info?channel=C0123ABCDEF" \
  -H "Authorization: Bearer $SLACK_TOKEN"

# Channel history (recent messages)
curl -s "https://slack.com/api/conversations.history?channel=C0123ABCDEF&limit=10" \
  -H "Authorization: Bearer $SLACK_TOKEN" | jq '.messages[] | {ts, text, user}'

# Find channel by name
curl -s "https://slack.com/api/conversations.list?types=public_channel&limit=999" \
  -H "Authorization: Bearer $SLACK_TOKEN" | jq '.channels[] | select(.name=="general") | .id'

# Create a channel
curl -s -X POST https://slack.com/api/conversations.create \
  -H "Authorization: Bearer $SLACK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "incident-2026-04", "is_private": false}'

# Set channel topic
curl -s -X POST https://slack.com/api/conversations.setTopic \
  -H "Authorization: Bearer $SLACK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"channel": "C0123ABCDEF", "topic": "Production incident — DB latency spike"}'

Files

# Upload a file (v2 API)
curl -s -X POST https://slack.com/api/files.getUploadURLExternal \
  -H "Authorization: Bearer $SLACK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"filename": "report.csv", "length": 1024}' \
  | jq '{upload_url, file_id}'
# Then POST the file content to upload_url, then call files.completeUploadExternal

# Share a remote file link
curl -s -X POST https://slack.com/api/files.remote.add \
  -H "Authorization: Bearer $SLACK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"external_id": "report-1", "external_url": "https://example.com/report.pdf", "title": "Monthly Report"}'

Reactions & Users

# Add reaction to a message
curl -s -X POST https://slack.com/api/reactions.add \
  -H "Authorization: Bearer $SLACK_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"channel": "C0123ABCDEF", "timestamp": "1234567890.123456", "name": "white_check_mark"}'

# List users
curl -s "https://slack.com/api/users.list?limit=200" \
  -H "Authorization: Bearer $SLACK_TOKEN" | jq '.members[] | {id, name, real_name}'

# User info by ID
curl -s "https://slack.com/api/users.info?user=U0123ABCDEF" \
  -H "Authorization: Bearer $SLACK_TOKEN" | jq '.user | {name, real_name, tz}'

# Look up user by email
curl -s "https://slack.com/api/users.lookupByEmail?email=dev@company.com" \
  -H "Authorization: Bearer $SLACK_TOKEN" | jq '.user.id'

Common Workflows

CI/CD notification: After a deploy, post a formatted message to #deployments with version, commit, and status. On failure, create a thread with the error log.

Incident channel: Create a private channel named incident-YYYY-MM-DD-<slug>, set the topic, invite responders, post the initial report with severity and affected services.

Standup reminder: Schedule a daily message at 9:30 AM to #team with a prompt template. Collect threaded replies.

Error alert: When Sentry fires a webhook, post the error title, count, and link to the relevant channel. Add a 🔴 reaction for critical, 🟡 for warning.

Notes

  • Bot tokens (xoxb-) can only post to channels the bot has been invited to
  • Rate limits: ~1 msg/sec per channel (Tier 2); respect Retry-After headers
  • Channel IDs (not names) are required for most API calls — look them up first
  • For rich messages, use Block Kit Builder to design layouts
  • mrkdwn (Slack's markdown) uses *bold*, _italic_, ~strike~, `code`, >quote
  • DMs: use conversations.open with user IDs to get the DM channel ID, then post normally

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Integrated Manufacturing Consulting

制造咨询全栈技能——以附件为素材,按5Part标准结构生成面向客户企业高层汇报的 正式咨询项目总结报告(非简单摘要)。整合四大模块:(1)7大部门调研方法论+ODP-I²诊断框架+改善项目定义(原manufacturing-consulting-toolkit); (2)原PPT图片提取复用+python-ppt...

Registry SourceRecently Updated
Coding

database_skill

Python-based database connectivity skill supporting MySQL, PostgreSQL, Oracle, SQL Server, and SQLite. Provides connection management, parameterized query ex...

Registry SourceRecently Updated
Coding

Miaoji Asin Clinic

基于ASIN和品类,快速诊断亚马逊Listing五维健康指数并智能排序修复优先级,提供详细分析与个性化修复方案。

Registry SourceRecently Updated
Coding

Web Publisher Skill

输入文章 URL **或本地文档(PDF/DOCX/PPTX/XLSX/EPUB/图片/音频/...)**,自动提取正文、可选 AI 改写、并发布到微信公众号;也可只把任意文档转成 Markdown 文本(不发布)。抓取 / 转换 / 改写 / 发布都在服务端 (tools.siping.me) 完成,CLI 不...

Registry SourceRecently Updated