slack
Slack skill for proactive outbound Slack communication: posting a message to a channel or thread, editing an existing bot message, or adding an emoji reaction. Use when the bot needs to: (1) post a message somewhere OTHER than the current reply (e.g. a different channel, or a side note in the same thread), (2) edit a previously-sent bot message (e.g. a progress placeholder), or (3) acknowledge a message with a non-verbal emoji reaction. NOTE: normal replies to the current message are posted AUTOMATICALLY by the runtime — just answer as text. Reach for this skill only for proactive / out-of-band sends and message edits.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-11
- Stars
- ★ 19
- Forks
- 23
01 前言 Front Matter
- name
- slack
- metadata
- { "channel": "slack" }
- description
- Slack skill for proactive outbound Slack communication: posting a message to a channel or thread, editing an existing bot message, or adding an emoji reaction. Use when the bot needs to: (1) post a message somewhere OTHER than the current reply (e.g. a different channel, or a side note in the same thread), (2) edit a previously-sent bot message (e.g. a progress placeholder), or (3) acknowledge a message with a non-verbal emoji reaction. NOTE: normal replies to the current message are posted AUTOMATICALLY by the runtime — just answer as text. Reach for this skill only for proactive / out-of-band sends and message edits.
02 资源文件 5
- 脚本__init__.py348 B
- 参考文档resources/implementation-playbook.md35.4 KB
- 脚本scripts/slack_edit.py3.4 KB
- 脚本scripts/slack_react.py2.9 KB
- 脚本scripts/slack_send.py3.7 KB
03 SKILL.md 正文
Slack Skill
Agent-facing execution guide for proactive Slack outbound communication.
Your ordinary reply to the user is delivered automatically — you do not call this skill to answer. Use it only for: proactive sends (another channel/thread), editing a bot message you already posted, or reacting with an emoji.
The runtime also auto-acks every inbound message for you: it reacts ⏳ (
:hourglass:) on receipt and flips to ✅ (:white_check_mark:) once you reply. Do not add those reactions yourself for the current turn — this skill is only for proactive / out-of-band reactions.
Env vars
BUB_SLACK_BOT_TOKEN— the bot OAuth token (xoxb-...). The runtime sets it in the process environment at startup. The scripts read it from the environment; you do not need to pass it or expose its value anywhere.
The runtime resolves $PYTHON (the venv interpreter) and $SKILL_DIR (this
skill's directory) for you in every example below — run the commands verbatim.
The scripts are stdlib-only (no requests), so they work under the venv python
with no extra dependencies.
Where you are
Your runtime context surfaces Slack identity you can reuse for proactive sends:
chat_id— the current channel ID (e.g.C0XXXXXX)thread_ts— the current thread's parent ts (present inside a thread; blank at channel root)ts— the inbound message's own ts
To post a proactive message in the same thread, pass --thread-ts <thread_ts>.
To post at channel root, omit --thread-ts.
Send a message
$PYTHON $SKILL_DIR/scripts/slack_send.py \
--channel-id <CHANNEL_ID> \
--thread-ts <THREAD_TS> # optional; omit for channel root
--text - # "-" reads the body from stdin
printf '*Heads up*\nHere is a proactive note.' | \
$PYTHON $SKILL_DIR/scripts/slack_send.py --channel-id C0XXXXXX --text -
The script prints the new message's ts (e.g. Sent to ... (ts=1234.0005)) —
capture it to edit the message later.
Block Kit (optional, richer formatting)
For structured output (sections, fields, buttons), pass a blocks JSON file:
$PYTHON $SKILL_DIR/scripts/slack_send.py --channel-id C0XXXXXX --blocks-file blocks.json --text "fallback text"
Always include a plain --text fallback (shown in notifications) alongside blocks.
Full Block Kit reference: https://api.slack.com/block-kit
Edit a message
$PYTHON $SKILL_DIR/scripts/slack_edit.py \
--channel-id <CHANNEL_ID> \
--ts <TS_OF_BOT_MESSAGE> \
--text -
Only messages authored by the bot can be edited.
React to a message
$PYTHON $SKILL_DIR/scripts/slack_react.py \
--channel-id <CHANNEL_ID> \
--ts <MESSAGE_TS> \
--reaction white_check_mark # emoji name, no colons
Common reactions: eyes (looking at it), hourglass (working), white_check_mark
(done), rocket (shipped).
Progress-update pattern (long tasks)
For long-running work, borrow the send-then-edit model:
- Post a short acknowledgement in the thread and capture its
ts:TS=$(printf 'Working on it…' | $PYTHON $SKILL_DIR/scripts/slack_send.py \ --channel-id <CHANNEL_ID> --thread-ts <THREAD_TS> --text - \ | sed -n 's/.*ts=\([0-9.]*\).*/\1/p') - Add an
:hourglass:reaction or edit the placeholder with progress. - Do the work.
- Edit the placeholder with the final result:
printf '*Done.*\n<result>' | $PYTHON $SKILL_DIR/scripts/slack_edit.py \ --channel-id <CHANNEL_ID> --ts "$TS" --text -
Prefer editing the placeholder over posting many incremental messages.
Formatting
- Text uses Slack
mrkdwnby default (*bold*,_italic_,`code`,block). - Keep proactive messages short and skimmable.
- For tables or complex layouts, use Block Kit instead of ascii art.
04 同仓库更多 Skills
tape-dataset-share-review
Export, filter, scan, and review shareable tape datasets produced by `tape-dataset-opendal`. Use when Codex needs to prepare Bub-generated tape data for public sharing, Hugging Face upload, external research handoff, or any review-sensitive export that must run CEL filtering, TruffleHog secret scanning on the staged artifact, and a final conservative LLM audit.
wecom
WeCom channel skill. Return normal replies directly. For proactive sends such as scheduled jobs, use the packaged wecom_send.py script.
QQ C2C and group channel skill. Use when Bub is handling a QQ conversation. In the default tool reply mode, reply by calling qq.send (text or media) and stay silent by not calling it. In direct reply mode, return the reply text; output exactly <no_reply/> to stay silent.
feishu
Use this skill to respond to messages from feishu channel.
discord
Discord Bot integration for sending messages, managing channels, and responding to events. Use when Bub needs to: (1) Send messages to Discord channels, (2) Create Discord bot with discord.py, (3) Handle Discord events (on_message, on_member_join, etc.), (4) Work with Discord webhooks, or (5) Any Discord-related functionality.
dingtalk
DingTalk channel skill. When $dingtalk appears in message context, return your response as text and the framework will deliver it. For programmatic sends (e.g. progress updates), use dingtalk_send.