agentleFS
chnlichchnlich/charlie-bot/skills/slack/SKILL.md

slack

Skill9 starsChanged 4 days agoMITView on GitHub

This skill should be used when the user asks to read Slack messages, search Slack conversations, look up Slack users, check DMs, or interact with the Slack workspace in any way.

We split this skill into the rules it gives an agent

11 rules. 0 are common, 2 are distinctive, and 9 are very specific to this project.

  • 0

    Common

    Most of the 60 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read messages, search conversations, and look up users in the configured Slack workspace using the Slack Web API.

    line 9
  2. Very specific:

    Use slack.user_token for one-off reads and treat it as read-only.

    line 19
  3. Very specific:

    Use slack.bot_token for posting.

    line 20
  4. Distinctive:

    Follow the standing approval rules for outbound messages.

    line 22
  5. Very specific:

    Use oldest and latest (Unix timestamps) to filter by date range.

    line 79
  6. Very specific:

    Do NOT use conversations.open — it requires im:write scope which is not available.

    line 97
  7. Very specific:

    Do NOT use conversations.join or any write endpoints — only read scopes are available.

    line 98
  8. Very specific:

    If looking up a user, call users.list first to resolve the user ID

    line 106
  9. Very specific:

    If reading DMs, call conversations.list?types=im to find the DM channel ID by matching the user ID

    line 107
  10. Very specific:

    Call conversations.history to fetch messages

    line 108
  11. Very specific:

    Use jq to parse JSON responses for readability — format output with timestamps, sender names, and message text

    line 109

“Common” is measured: kept by at least 6 in 10 of the 60 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Slack

Read messages, search conversations, and look up users in the configured Slack workspace using the Slack Web API.

Configuration

  • Token location: $CHARLIEBOT_HOME/credentials.yaml under slack.user_token and slack.bot_token
  • Token type: User OAuth Token (xoxp-)
  • Available scopes: channels:history, channels:read, groups:history, groups:read, im:history, im:read, mpim:history, search:read, users:read
  • Requests: send every Slack Web API call through charliebot slack request. The command reads the token from credentials.yaml inside its own process, so no token appears in a command, an output or a run record.
  • CharlieBot runtime calls use app credentials.
  • Use slack.user_token for one-off reads and treat it as read-only.
  • Use slack.bot_token for posting.
  • Grant missing runtime scopes to the app.
  • Follow the standing approval rules for outbound messages.

API Reference

Send every request through charliebot slack request <METHOD> <URL>:

charliebot slack request GET 'https://slack.com/api/auth.test'
charliebot slack request GET 'https://slack.com/api/conversations.list?types=im&limit=200'

The command adds the bearer header itself and prints the 2xx response body. It uses slack.user_token by default; pass --token bot to use slack.bot_token for a post. Pass a request body from a file with --data-file <path>, and add any other header with --header 'NAME:VALUE'.

Exit codeMeaning
0A 2xx response whose ok is not false.
1Another status, "ok": false, or a network failure.
2Invalid arguments.
3credentials.yaml is unreadable or the chosen slack key is missing.

Pipe the response body to jq when you need one field.

Authentication

GET https://slack.com/api/auth.test

Users

GET https://slack.com/api/users.list?limit=200

To find a user, match against real_name, name, and profile.display_name fields (case-insensitive).

Channels

GET https://slack.com/api/conversations.list?types=public_channel,private_channel&limit=200

Direct Messages

List all DM conversations:

GET https://slack.com/api/conversations.list?types=im&limit=200

Each DM channel has a user field — match it against the target user's ID to find the right channel.

Read Messages

GET https://slack.com/api/conversations.history?channel=CHANNEL_ID&limit=50

Use oldest and latest (Unix timestamps) to filter by date range. Use cursor for pagination.

Read Threads

GET https://slack.com/api/conversations.replies?channel=CHANNEL_ID&ts=THREAD_TS

Search Messages

GET https://slack.com/api/search.messages?query=QUERY

Supports Slack search modifiers: from:username, in:#channel, before:2026-01-01, after:2026-01-01, has:link, etc.

Important Workarounds

  • Do NOT use conversations.open — it requires im:write scope which is not available. Instead, list DM conversations with conversations.list?types=im and find the channel by user ID.
  • Do NOT use conversations.join or any write endpoints — only read scopes are available.
  • Resolve a private channel by ID because channel listings can omit it while its history remains readable.
  • The bot-token listing shows exactly which private channels allow posting; public channels accept posts without bot membership.

Workflow

  1. Send each read through charliebot slack request (it uses slack.user_token by default)
  2. If looking up a user, call users.list first to resolve the user ID
  3. If reading DMs, call conversations.list?types=im to find the DM channel ID by matching the user ID
  4. Call conversations.history to fetch messages
  5. Use jq to parse JSON responses for readability — format output with timestamps, sender names, and message text

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.