Token导航 LogoToken导航

Agent Skill · 研究检索

slack(Slack 团队协作)

用于处理 Slack 工作区里的频道、消息、线程、用户和通知信息。它适合让 Agent 查询团队沟通记录、整理上下文、回复线程或辅助协作提醒。使用时需要确认机器人或用户 token 是否具备目标频道访问权,私有频道和历史消息通常有额外权限限制;发送消息、@成员或批量读取对话时,应避免泄露内部讨论和敏感工作信息。

slack 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 52,782。

总安装 546周安装 23GitHub Stars 2下载 191核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:slack(Slack 团队协作)
来源仓库:https://github.com/azmym/agent-skills
仓库路径:skills/slack
安装命令:
npx skills add https://github.com/azmym/agent-skills --skill slack
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/azmym/agent-skills --skill slack

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于处理 Slack 工作区里的频道、消息、线程、用户和通知信息,适合查询团队沟通记录和辅助协作提醒。Slack Web API 技能,支持读取、写入、搜索、反应、固定和管理对话。通过 npx skills add 命令从指定 GitHub 仓库安装,需初始化配置模式(Token、Browser 或 Local)。

使用时需确认机器人 token 具备目标频道访问权,避免泄露内部讨论和敏感工作信息。slack 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/slack

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/azmym/agent-skills --skill slack;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

slack 怎么安装?

在终端执行 npx skills add https://github.com/azmym/agent-skills --skill slack。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

slack 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

slack 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

slack 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

slack 用的人多吗?

公开数据是累计安装 546 次,近一周安装 23 次,下载 191 次,GitHub 2 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

slack 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
slack

Slack 团队协作 · 本页

5462接触敏感数据未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Slack Web API Skill

Interact with Slack: read, write, search, react, pin, and manage conversations via the Web API.

IMPORTANT: First-Use Initialization

Before executing any Slack operation, check if the mode config file exists:

cat ~/.agents/config/slack/config.env

If the file does not exist (or does not contain SLACK_MODE), you must ask the user which mode they want to use. Present these three options:

  1. Token (macOS only): Extracts session tokens directly from Chrome. Fastest option. Requires Chrome with Slack open, AppleScript enabled, and uvx installed.
  2. Browser (cross-platform): Uses a local Playwright browser to make API calls. Works on macOS, Linux, and Windows. Requires Node.js 18+. Supports SSO and 2FA login.
  3. Auto-detect (recommended): Automatically uses browser mode if a Playwright session exists, otherwise falls back to token mode. Best of both worlds.

Once the user selects a mode, save it immediately:

mkdir -p ~/.agents/config/slack
echo 'SLACK_MODE=<selected_value>' > ~/.agents/config/slack/config.env

Where <selected_value> is token, browser, or auto.

After saving, never ask again. On all subsequent invocations, the config file will exist and the skill will use the saved mode automatically.

If the user selected browser mode, also run the browser session setup:

{SKILL_DIR}/scripts/slack-browser-session.sh login-manual

This opens a visible browser for the user to log in to Slack (supports SSO/2FA). The session is saved and reused for all future API calls.


Mode Selection

The skill supports three modes. Set via ~/.agents/config/slack/config.env or the SLACK_MODE environment variable:

ModeValueBehavior
TokentokenDirect curl calls using Chrome session tokens. Fast. macOS only.
BrowserbrowserAPI calls through a local Playwright browser session. Cross-platform.
Auto-detectautoUse browser if session exists; falls back to token on auth failure. (default)

Configure the mode

Option 1: Config file (persistent)

echo 'SLACK_MODE=token' > ~/.agents/config/slack/config.env
# or
echo 'SLACK_MODE=browser' > ~/.agents/config/slack/config.env
# or
echo 'SLACK_MODE=auto' > ~/.agents/config/slack/config.env

Option 2: Environment variable (per-call override)

SLACK_MODE=browser slack-api.sh conversations.history channel=C041RSY6DN2 limit=20

The environment variable takes priority over the config file.

Config and State Directory

All skill config and state lives under ~/.agents/config/slack/:

FilePurpose
config.envMode selection (`SLACK_MODE=auto\token\browser`)
tokens.envCached session tokens (xoxc, xoxd, user-agent)
browser-sessionActive browser session ID
sessions/<id>/storageState.jsonPlaywright session cookies and localStorage

This directory is created automatically on first use.

API Wrapper

All calls go through a single unified script:

{SKILL_DIR}/scripts/slack-api.sh <method> [key=value ...]

Where {SKILL_DIR} is the base directory provided when this skill is loaded (e.g., ~/.agents/skills/slack).

The script automatically routes to the correct mode based on your configuration. For the full method reference, see references/api-methods.md.

Token Mode (macOS)

Token mode extracts session tokens from your running Chrome browser and makes direct curl calls to the Slack Web API.

Prerequisites:

  • Chrome running with Slack open at app.slack.com
  • Chrome > View > Developer > Allow JavaScript from Apple Events
  • uvx installed (brew install uv)

No manual setup needed. On first API call, tokens are extracted automatically.

Browser Mode (Cross-Platform)

Browser mode uses a local Playwright Chromium instance to maintain a Slack session. API calls are made via fetch() inside the browser context, so no token extraction is needed. This works on macOS, Linux, and Windows.

Prerequisites:

  • Node.js 18+ installed
  • Playwright auto-installs on first use (downloads Chromium, ~150 MB)

For detailed documentation, see references/browser-mode.md.

Quick Start (Browser Mode)

# 1. Set mode to browser
echo 'SLACK_MODE=browser' > ~/.agents/config/slack/config.env

# 2. Start a browser session and log in manually (supports SSO/2FA)
{SKILL_DIR}/scripts/slack-browser-session.sh login-manual

# Or: automated email+password login
{SKILL_DIR}/scripts/slack-browser-session.sh start
{SKILL_DIR}/scripts/slack-browser-session.sh login user@example.com mypassword

# 3. Verify login succeeded
{SKILL_DIR}/scripts/slack-browser-session.sh status

# 4. Make API calls (same script, routes through browser automatically)
{SKILL_DIR}/scripts/slack-api.sh conversations.history channel=C041RSY6DN2 limit=20

# 5. Close when done
{SKILL_DIR}/scripts/slack-browser-session.sh stop

UI Automation (API Gaps)

Browser mode also enables direct interaction with Slack's web UI for features that lack API support:

# Get the session ID
SESSION_ID=$({SKILL_DIR}/scripts/slack-browser-session.sh get)

# Navigate to a specific channel
node {SKILL_DIR}/scripts/playwright-bridge.js --function interact --session $SESSION_ID \
  --input '{"action": "goto", "url": "https://app.slack.com/client/TEAM_ID/CHANNEL_ID"}'

# Take a snapshot to see interactive elements
node {SKILL_DIR}/scripts/playwright-bridge.js --function snapshot --session $SESSION_ID --input '{}'

# Interact with UI elements using @e refs from the snapshot
node {SKILL_DIR}/scripts/playwright-bridge.js --function interact --session $SESSION_ID \
  --input '{"action": "click", "ref": "@e5"}'

# Take a screenshot for visual verification
node {SKILL_DIR}/scripts/playwright-bridge.js --function screenshot --session $SESSION_ID --input '{}'

Use cases for UI automation:

  • Canvas creation and editing (no public API)
  • Huddle interactions (no API)
  • Workflow Builder configuration
  • Slack Connect invitations
  • Admin and settings pages
  • Visual message verification via screenshots

Parsing Slack URLs

Extract channel and timestamp from Slack URLs:

https://{WORKSPACE}.slack.com/archives/{CHANNEL_ID}/p{TIMESTAMP_WITHOUT_DOT}

Insert a dot before the last 6 digits of the timestamp:

  • URL: p1770725748342899 -> ts: 1770725748.342899

For threaded messages, the URL may include?thread_ts= parameter.

Read Operations

Read a thread

slack-api.sh conversations.replies channel=CHANNEL_ID ts=THREAD_TS limit=100

Read channel history

slack-api.sh conversations.history channel=CHANNEL_ID limit=20

Optional: oldest / latest (Unix timestamps) to bound the time range.

Search messages

slack-api.sh search.messages query="search terms" count=10

Modifiers: in:#channel, from:@user, before:YYYY-MM-DD, after:YYYY-MM-DD, has:link, has:reaction, has:pin.

Find a channel by name

slack-api.sh conversations.list types=public_channel limit=200 | python3 -c "import sys,json; channels=json.load(sys.stdin).get('channels',[]); matches=[c for c in channels if 'TARGET' in c['name']]; [print(f\"{c['id']} #{c['name']}\") for c in matches]"

Look up a user

slack-api.sh users.info user=USER_ID

Name: .user.real_name or .user.profile.display_name.

List pinned items

slack-api.sh pins.list channel=CHANNEL_ID

List channel members

slack-api.sh conversations.members channel=CHANNEL_ID limit=100

Write Operations

IMPORTANT: Confirmation required before any write operation.

Before sending, editing, deleting a message, adding/removing reactions, or pinning/unpinning, always show the user a preview and ask for confirmation. Format the preview as:

To: #channel-name (or @username for DMs) Message: The exact message text Action: Send / Edit / Delete / React / Pin (as applicable) Send this? (or: want to change anything?)

Do NOT execute the write API call until the user explicitly confirms. If the user wants changes, update the preview and ask again.

Send a message

For simple one-line messages:

slack-api.sh chat.postMessage channel=CHANNEL_ID text="Hello world"

Thread reply: add thread_ts=PARENT_TS. Broadcast to channel: add reply_broadcast=true.

Send a formatted multi-line message

For messages with newlines, bold, lists, or other mrkdwn formatting, use blocks instead of text. The text parameter with URLSearchParams double-escapes newlines in browser mode, so blocks are the reliable way to send formatted content.

Build the blocks JSON with python and pass it to the API:

BLOCKS=$(python3 -c "
import json
blocks = [
    {'type': 'section', 'text': {'type': 'mrkdwn', 'text': '*Bold heading*'}},
    {'type': 'section', 'text': {'type': 'mrkdwn', 'text': 'Line 1\nLine 2\nLine 3'}},
    {'type': 'section', 'text': {'type': 'mrkdwn', 'text': '1. First item\n2. Second item'}}
]
print(json.dumps(blocks))
")
slack-api.sh chat.postMessage channel=CHANNEL_ID blocks="$BLOCKS" text="Fallback text"

The text parameter serves as fallback for notifications and clients that cannot render blocks. Always include it with a plain-text summary.

Each block text field has a 3000-character limit. For longer messages, split across multiple section blocks.

Edit a message

slack-api.sh chat.update channel=CHANNEL_ID ts=MESSAGE_TS text="Updated text"

Delete a message

slack-api.sh chat.delete channel=CHANNEL_ID ts=MESSAGE_TS

Add a reaction

slack-api.sh reactions.add channel=CHANNEL_ID timestamp=MESSAGE_TS name=thumbsup

Emoji name without colons. Supports skin tones: thumbsup::skin-tone-3.

Remove a reaction

slack-api.sh reactions.remove channel=CHANNEL_ID timestamp=MESSAGE_TS name=thumbsup

Pin a message

slack-api.sh pins.add channel=CHANNEL_ID timestamp=MESSAGE_TS

Unpin a message

slack-api.sh pins.remove channel=CHANNEL_ID timestamp=MESSAGE_TS

Image and File Handling

Messages may contain files. In token mode:

source ~/.agents/config/slack/tokens.env
curl -s "FILE_URL_PRIVATE" \
  -H "Authorization: Bearer ${SLACK_XOXC}" \
  -H "Cookie: d=${SLACK_XOXD}" \
  -o /tmp/slack-image-N.png

In browser mode, navigate to the file URL and screenshot:

node {SKILL_DIR}/scripts/playwright-bridge.js --function interact --session $SESSION_ID \
  --input '{"action": "goto", "url": "FILE_URL_PRIVATE"}'
node {SKILL_DIR}/scripts/playwright-bridge.js --function screenshot --session $SESSION_ID --input '{}'

Then use the Read tool to view the downloaded image.

Output Formatting

  1. Parse JSON with python3 -c "import sys,json;..."
  2. Resolve user IDs (U...) to real names via users.info (cache lookups)
  3. Present messages with timestamps and names
  4. Replace <@U...> mentions with resolved real names
  5. Decode Slack markup (entities, link syntax, channel references) to plain text

Rate Limiting

  • Add sleep 1 between consecutive API calls
  • Never bulk-paginate large datasets (users.list), it kills the session
  • Prefer targeted queries over bulk fetches
  • Browser mode has additional latency per call; batch where possible

Token Refresh (Token Mode, Automatic)

Token refresh is fully automatic. The API wrapper:

  1. Auto-refreshes if ~/.agents/config/slack/tokens.env is missing
  2. Auto-refreshes on invalid_auth errors and retries the call

Tokens are extracted from the running Chrome browser:

  • xoxc: from Slack's localStorage via AppleScript
  • xoxd: from Chrome's cookie database via lsof + pycookiecheat

Setup

Token Mode (macOS)

  1. Open Chrome with Slack at app.slack.com
  2. Enable Chrome > View > Developer > Allow JavaScript from Apple Events
  3. Install uv: brew install uv
  4. Set mode (optional, auto-detect works by default): echo 'SLACK_MODE=token' > ~/.agents/config/slack/config.env

Browser Mode (Cross-Platform)

  1. Install Node.js 18+ from https://nodejs.org
  2. Set mode and start a session: echo 'SLACK_MODE=browser' > ~/.agents/config/slack/config.env {SKILL_DIR}/scripts/slack-browser-session.sh login-manual Playwright and Chromium install automatically on first use.

Auto-detect (Default)

No configuration needed. The skill checks for an active browser session first and makes the API call via Playwright. If the browser call returns an auth error (invalid_auth, not_authed, or no_teams_found), it automatically falls back to token mode. This provides seamless recovery when a browser session expires.

Full API Reference

For additional methods (bookmarks, user groups, reminders, emoji, files, user profiles, etc.), see references/api-methods.md.

Error Handling

  • not_in_channel: User does not have access to this channel
  • channel_not_found: Invalid channel ID
  • invalid_auth: Token expired, auto-refresh attempted (token mode)
  • ratelimited: Wait and retry with sleep 5
  • cant_update_message / cant_delete_message: Can only modify own messages
  • no_browser_session: No active browser session; run slack-browser-session.sh start
  • node_not_found: Node.js not installed; install from https://nodejs.org
  • no_teams_found: Slack has not loaded workspace data in browser; wait and retry
  • Automatic fallback: In auto mode, if the browser call returns invalid_auth, not_authed, or no_teams_found, the skill automatically retries via token mode. No manual intervention needed.

平台分布

Codex

34.55%
按下载量换算66

Claude

29.93%
按下载量换算57

Cursor

17.68%
按下载量换算34

Gemini CLI

8.13%
按下载量换算16

安全审计

Gen Agent Trust Hub

未通过

Socket

可疑

Snyk

未通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills