[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77R9C6Y2PE363J3ZQRH2VFM":3,"skill-same:01M77R9C6Y2PE363J3ZQRH2VFM":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":36,"ownerDescription":6,"updatedAt":37,"install":38,"resources":51},"01M77R9C6Y2PE363J3ZQRH2VFM","slack",null,"Use when the user asks you to read, search, send, or react in Slack — including reading channel history, DMs, searching messages, or posting as the user. Covers \"check my Slack\", \"reply to Alice\", \"what's happening in","hao-ai-lab\u002Fhawky","hao-ai-lab","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F149045815?v=4","01M77R84J08EF4S0F8PR8CM7Y3","Hao AI Lab","01M77R84JS1XG4SDF3RMGFB1TG",33,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002Fsrc\u002Fskill-templates\u002Fslack\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: slack\ndescription: Use when the user asks you to read, search, send, or react in Slack — including reading channel history, DMs, searching messages, or posting as the user. Covers \"check my Slack\", \"reply to Alice\", \"what's happening in #eng\", \"send a message to Jane\", \"post in #standup as me\".\nmetadata: { \"hawky\": { \"emoji\": \"💬\", \"requires\": { \"config\": [\"channels.slack.user_token\"] } } }\n---\n\n# Slack Actions\n\n## Overview\n\nHawky's Slack integration has two sides:\n\n1. **Gateway adapter** (automatic, handled for you): the user DMs the Hawky\n   bot → messages flow into the bound session. Agent responses + heartbeat\n   findings are relayed back to Slack automatically. **You don't invoke\n   anything for this** — it's the always-on bridge.\n\n2. **This skill**: for user-initiated actions like \"check my Slack messages\"\n   or \"reply to that thread as me\". These use the **user token** (`xoxp-`)\n   and you call the Slack Web API via `bash` + `curl`.\n\n## When to use this skill\n\nUse it when the user says something like:\n- \"Check my Slack messages in #engineering from today\"\n- \"What's in my DMs?\"\n- \"Search Slack for 'deploy rollback'\"\n- \"Reply to the last message from Alice in #eng saying 'on it'\"\n- \"Send 'running 5 min late' to #standup as me\"\n- \"React with ✅ to that message\"\n\nDo **not** use this skill for:\n- Responding to a DM the user sent to the bot → the gateway relays that\n  automatically; just respond in the chat.\n- Posting a heartbeat or cron finding → that's `delivery: { mode: \"announce\" }`\n  in the job\u002Fheartbeat config.\n\n## Prerequisites\n\n- `channels.slack.user_token` is set in `~\u002F.hawky\u002Fconfig.json`.\n  If missing, tell the user: \"Slack skill needs a user token. Add\n  `channels.slack.user_token` to your config or re-run `\u002Fsetup`.\"\n\n### Required user token scopes\n\nThe `xoxp-` user token needs these OAuth scopes:\n\n| Scope | Used for |\n|-------|----------|\n| `channels:history` | Read public channel messages |\n| `channels:read` | List public channels |\n| `groups:history` | Read private channel messages |\n| `groups:read` | List private channels |\n| `im:history` | Read DM messages |\n| `im:read` | List DM conversations |\n| `mpim:history` | Read group DM messages |\n| `mpim:read` | List group DM conversations |\n| `chat:write` | Send\u002Fedit\u002Fdelete messages as the user |\n| `reactions:write` | Add\u002Fremove reactions |\n| `search:read` | Search messages |\n| `users:read` | Resolve user names to IDs |\n\nOptional (for opening new DMs):\n\n| Scope | Used for |\n|-------|----------|\n| `im:write` | Open a new DM with `conversations.open` |\n\n## Reading the user token\n\nRead the user token each time you need it (don't cache across sessions):\n\n```bash\nTOKEN=$(jq -r '.channels.slack.user_token \u002F\u002F empty' ~\u002F.hawky\u002Fconfig.json)\n[ -z \"$TOKEN\" ] && echo \"ERROR: user_token not configured\" && exit 1\n```\n\nAll subsequent `curl` calls use `Authorization: Bearer $TOKEN`.\n\n## API endpoint pattern\n\nAll Slack Web API calls follow the same shape:\n\n```bash\ncurl -s -X POST \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"...\":\"...\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002F\u003Cmethod>\n```\n\nResponses are JSON with `{ \"ok\": true, ... }` or `{ \"ok\": false, \"error\": \"...\" }`.\nAlways check `ok` before using the data.\n\n## Pagination\n\nMany Slack API methods paginate. The response includes\n`response_metadata.next_cursor` — if non-empty, there are more results.\n\n```bash\n# Generic pagination loop\nCURSOR=\"\"\nwhile true; do\n  URL=\"https:\u002F\u002Fslack.com\u002Fapi\u002F\u003Cmethod>?limit=200\"\n  [ -n \"$CURSOR\" ] && URL=\"${URL}&cursor=${CURSOR}\"\n  RESP=$(curl -s -H \"Authorization: Bearer $TOKEN\" \"$URL\")\n  # ... process RESP ...\n  CURSOR=$(echo \"$RESP\" | jq -r '.response_metadata.next_cursor \u002F\u002F empty')\n  [ -z \"$CURSOR\" ] && break\ndone\n```\n\nMethods that commonly paginate: `conversations.list`, `users.list`,\n`conversations.history`, `conversations.replies`.\n\nFor channel\u002Fuser resolution, always paginate — workspaces with 100+ channels\nwill not return all results in a single `limit=200` call.\n\n## Common actions\n\n### Resolve channel name → channel ID\n\n`#engineering` → `C01234ABCDE`. You need the ID for most other calls.\n\n**Important:** Workspaces with many channels require pagination. A single\n`limit=200` call may not return all channels.\n\n```bash\n# Paginated channel lookup\nCHANNEL_NAME=\"engineering\"\nCHANNEL_ID=\"\"\nCURSOR=\"\"\nwhile [ -z \"$CHANNEL_ID\" ]; do\n  URL=\"https:\u002F\u002Fslack.com\u002Fapi\u002Fconversations.list?types=public_channel,private_channel&limit=200\"\n  [ -n \"$CURSOR\" ] && URL=\"${URL}&cursor=${CURSOR}\"\n  RESP=$(curl -s -H \"Authorization: Bearer $TOKEN\" \"$URL\")\n  CHANNEL_ID=$(echo \"$RESP\" | jq -r --arg name \"$CHANNEL_NAME\" \\\n    '.channels[] | select(.name == $name) | .id \u002F\u002F empty')\n  CURSOR=$(echo \"$RESP\" | jq -r '.response_metadata.next_cursor \u002F\u002F empty')\n  [ -z \"$CURSOR\" ] && break\ndone\necho \"$CHANNEL_ID\"\n```\n\n### Open or find a DM by user ID\n\nTo find an existing DM, search your DM list:\n```bash\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Fslack.com\u002Fapi\u002Fconversations.list?types=im&limit=200\" \\\n  | jq -r --arg uid \"U0ALICEID\" '.channels[] | select(.user == $uid) | .id'\n```\n\nTo open a new DM (requires `im:write` scope):\n```bash\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"users\":\"U0ALICEID\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002Fconversations.open \\\n  | jq -r '.channel.id'\n```\n\nIf you get `missing_scope` on `conversations.open`, fall back to the\n`conversations.list` approach above. It works for any DM that already exists.\n\n### Resolve user\u002Fchannel name → ID (fuzzy)\n\nPREFER the `send_message` tool: it already fuzzy-resolves a name\u002Fhandle to a\nuser OR channel (substring, token, and **pinyin** matching, so \"邹欣凯\"\u002F\"欣凯\"\nmatch \"Jay (Xinkai) Zou\"; loose channel names like \"ambient\" match the channel),\nreturns candidates when ambiguous, and caches the directory. Use the raw bash\nbelow only when you need something the tool can't do.\n\nMatch loosely: case-insensitive substring across `name` (handle),\n`real_name`, and `profile.display_name`. A query like `xinkai` must match\n\"Jay (Xinkai) Zou\". For a query in Chinese, also try its pinyin (e.g. 欣凯 →\nxinkai). To resolve a channel, search `conversations.list` by `.name` the same\nloose way. NEVER require an exact equality match.\n\n```bash\n# Returns every candidate as: \u003Cid>\\t\u003Creal_name> (@handle) [display_name]\nQ=\"xinkai\"   # the name the user said, lowercased match\ncurl -s -H \"Authorization: Bearer $TOKEN\" https:\u002F\u002Fslack.com\u002Fapi\u002Fusers.list \\\n  | jq -r --arg q \"$(echo \"$Q\" | tr '[:upper:]' '[:lower:]')\" '\n      .members[]\n      | select(.deleted != true)\n      | { id, name, real: (.real_name \u002F\u002F \"\"), disp: (.profile.display_name \u002F\u002F \"\") }\n      | select(\n          (.name|ascii_downcase|contains($q)) or\n          (.real|ascii_downcase|contains($q)) or\n          (.disp|ascii_downcase|contains($q))\n        )\n      | \"\\(.id)\\t\\(.real) (@\\(.name)) [\\(.disp)]\"'\n```\n\nThen decide:\n- **Exactly one candidate** → use that user id (open a DM with\n  `conversations.open?users=\u003Cid>` or post to it).\n- **Multiple candidates** → DO NOT guess. List the matched names back to the\n  user (e.g. \"I found Jay (Xinkai) Zou and Xinkai Li — which one?\") and send\n  only after they pick.\n- **No candidates** → tell the user no Slack member matched that name.\n\nFor large workspaces (1000+ members), paginate `users.list` the same way as\nchannels. Most workspaces under ~500 members fit in a single call.\n\n### Read recent messages from a channel or DM\n\n```bash\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Fslack.com\u002Fapi\u002Fconversations.history?channel=C01234ABCDE&limit=20\" \\\n  | jq '.messages[] | {ts, user, text}'\n```\n\nTo filter by time (e.g., today's messages only):\n```bash\nTODAY_EPOCH=$(date -d \"$(date +%Y-%m-%d) 00:00:00\" +%s)\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Fslack.com\u002Fapi\u002Fconversations.history?channel=C01234ABCDE&oldest=$TODAY_EPOCH&limit=50\" \\\n  | jq '.messages[] | {ts, user, text}'\n```\n\nFor a threaded reply chain:\n```bash\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Fslack.com\u002Fapi\u002Fconversations.replies?channel=C01234ABCDE&ts=1712023032.1234\" \\\n  | jq '.messages[] | {ts, user, text}'\n```\n\n### Search across workspace\n\n```bash\nQUERY=$(jq -Rr @uri \u003C\u003C\u003C \"deploy rollback\")\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Fslack.com\u002Fapi\u002Fsearch.messages?query=${QUERY}&count=20\" \\\n  | jq '.messages.matches[] | {ts, channel: .channel.name, user: .username, text}'\n```\n\nUseful search modifiers:\n- `in:#channel-name` — restrict to a channel\n- `from:@username` — restrict to a user\n- `before:2024-01-15` \u002F `after:2024-01-01` — date range\n- `has:link` \u002F `has:reaction` — filter by content type\n\n### Send a message (as the user)\n\n```bash\ncurl -s -X POST \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"channel\":\"C01234ABCDE\",\"text\":\"running 5 min late\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002Fchat.postMessage\n```\n\nTo reply in a thread, include `thread_ts`:\n```bash\ncurl -s -X POST \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"channel\":\"C01234ABCDE\",\"thread_ts\":\"1712023032.1234\",\"text\":\"on it\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002Fchat.postMessage\n```\n\n### Edit \u002F delete a message\n\nYou can only edit\u002Fdelete messages the user posted.\n\n```bash\n# Edit\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"channel\":\"C...\",\"ts\":\"1712...\",\"text\":\"Updated text\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002Fchat.update\n\n# Delete\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"channel\":\"C...\",\"ts\":\"1712...\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002Fchat.delete\n```\n\n### React to a message\n\n```bash\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"channel\":\"C...\",\"timestamp\":\"1712...\",\"name\":\"white_check_mark\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002Freactions.add\n```\n\nUse the emoji name (no colons), e.g. `white_check_mark`, `eyes`, `+1`.\n\nTo remove a reaction:\n```bash\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"channel\":\"C...\",\"timestamp\":\"1712...\",\"name\":\"eyes\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002Freactions.remove\n```\n\n### List your DMs (who have I been talking to)\n\n```bash\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Fslack.com\u002Fapi\u002Fconversations.list?types=im&limit=50\" \\\n  | jq '.channels[] | {id, user, last_read}'\n```\n\n## Safety rules\n\n- **Always confirm before sending.** Draft the message text and show it to\n  the user before posting. Never send on the first ask without confirmation\n  — the message appears as **them**, not as a bot, so mistakes are costly.\n- **Confirm before editing\u002Fdeleting.** Same reasoning.\n- **Don't expose the token.** Don't echo `$TOKEN` or paste it into the\n  chat. Read it fresh each bash call.\n- **Respect rate limits.** Slack limits apps to ~1 req\u002Fsec on most tier 2\n  methods. If you get `rate_limited`, wait the `Retry-After` seconds.\n\n## Typical flows\n\n### \"Check my Slack messages in #engineering from today\"\n\n1. `conversations.list` (paginated) → resolve `#engineering` to channel ID\n2. `conversations.history` with `oldest=\u003Ctoday's epoch>` → last N messages\n3. Resolve user IDs to names via `users.list` (cache within the turn)\n4. Summarize: threads, mentions, pending replies\n\n### \"Reply to Alice's last message with 'thanks, will do'\"\n\n1. `users.list` → resolve \"Alice\" to `U0...`\n2. Check recent conversation history with Alice — DM or shared channel?\n3. Find her most recent message (by `ts`)\n4. **Draft** the reply and show it to the user: `\"Will send: 'thanks, will do' as a reply to Alice's 'can you review #123?' from 2:15 PM. Confirm?\"`\n5. On confirmation: `chat.postMessage` with `thread_ts` = Alice's message ts\n\n### \"What's happening in #standup today?\"\n\n1. Resolve `#standup` → channel ID (paginated)\n2. `conversations.history` with today's oldest\n3. Summarize: who posted, decisions, action items, open threads\n\n## Troubleshooting\n\n| Error | Cause | Fix |\n|-------|-------|-----|\n| `missing_scope` | Token lacks a required OAuth scope | Add the scope in the Slack app settings, reinstall to workspace |\n| `channel_not_found` | Wrong channel ID, or bot\u002Fuser not in the channel | Verify the ID; join the channel first |\n| `not_in_channel` | User token's owner hasn't joined the channel | Join via Slack UI or `conversations.join` |\n| `rate_limited` | Too many requests | Wait `Retry-After` header seconds, then retry |\n| `invalid_auth` | Token is expired or revoked | Regenerate the token in Slack app settings |\n| `account_inactive` | Token's user has been deactivated | Use a different user's token |\n\n## Ideas to try\n\n- React with ✅ to mark tasks you've handled.\n- Daily digest of mentions: search for `@\u003Cyour-user-id>` since yesterday.\n- Thread catch-up: fetch `conversations.replies` and summarize long threads.\n- Draft outgoing: agent writes the message, user reviews, agent sends.\n","# Slack Actions\n\n## Overview\n\nHawky's Slack integration has two sides:\n\n1. **Gateway adapter** (automatic, handled for you): the user DMs the Hawky\n   bot → messages flow into the bound session. Agent responses + heartbeat\n   findings are relayed back to Slack automatically. **You don't invoke\n   anything for this** — it's the always-on bridge.\n\n2. **This skill**: for user-initiated actions like \"check my Slack messages\"\n   or \"reply to that thread as me\". These use the **user token** (`xoxp-`)\n   and you call the Slack Web API via `bash` + `curl`.\n\n## When to use this skill\n\nUse it when the user says something like:\n- \"Check my Slack messages in #engineering from today\"\n- \"What's in my DMs?\"\n- \"Search Slack for 'deploy rollback'\"\n- \"Reply to the last message from Alice in #eng saying 'on it'\"\n- \"Send 'running 5 min late' to #standup as me\"\n- \"React with ✅ to that message\"\n\nDo **not** use this skill for:\n- Responding to a DM the user sent to the bot → the gateway relays that\n  automatically; just respond in the chat.\n- Posting a heartbeat or cron finding → that's `delivery: { mode: \"announce\" }`\n  in the job\u002Fheartbeat config.\n\n## Prerequisites\n\n- `channels.slack.user_token` is set in `~\u002F.hawky\u002Fconfig.json`.\n  If missing, tell the user: \"Slack skill needs a user token. Add\n  `channels.slack.user_token` to your config or re-run `\u002Fsetup`.\"\n\n### Required user token scopes\n\nThe `xoxp-` user token needs these OAuth scopes:\n\n| Scope | Used for |\n|-------|----------|\n| `channels:history` | Read public channel messages |\n| `channels:read` | List public channels |\n| `groups:history` | Read private channel messages |\n| `groups:read` | List private channels |\n| `im:history` | Read DM messages |\n| `im:read` | List DM conversations |\n| `mpim:history` | Read group DM messages |\n| `mpim:read` | List group DM conversations |\n| `chat:write` | Send\u002Fedit\u002Fdelete messages as the user |\n| `reactions:write` | Add\u002Fremove reactions |\n| `search:read` | Search messages |\n| `users:read` | Resolve user names to IDs |\n\nOptional (for opening new DMs):\n\n| Scope | Used for |\n|-------|----------|\n| `im:write` | Open a new DM with `conversations.open` |\n\n## Reading the user token\n\nRead the user token each time you need it (don't cache across sessions):\n\n```bash\nTOKEN=$(jq -r '.channels.slack.user_token \u002F\u002F empty' ~\u002F.hawky\u002Fconfig.json)\n[ -z \"$TOKEN\" ] && echo \"ERROR: user_token not configured\" && exit 1\n```\n\nAll subsequent `curl` calls use `Authorization: Bearer $TOKEN`.\n\n## API endpoint pattern\n\nAll Slack Web API calls follow the same shape:\n\n```bash\ncurl -s -X POST \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"...\":\"...\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002F\u003Cmethod>\n```\n\nResponses are JSON with `{ \"ok\": true, ... }` or `{ \"ok\": false, \"error\": \"...\" }`.\nAlways check `ok` before using the data.\n\n## Pagination\n\nMany Slack API methods paginate. The response includes\n`response_metadata.next_cursor` — if non-empty, there are more results.\n\n```bash\n# Generic pagination loop\nCURSOR=\"\"\nwhile true; do\n  URL=\"https:\u002F\u002Fslack.com\u002Fapi\u002F\u003Cmethod>?limit=200\"\n  [ -n \"$CURSOR\" ] && URL=\"${URL}&cursor=${CURSOR}\"\n  RESP=$(curl -s -H \"Authorization: Bearer $TOKEN\" \"$URL\")\n  # ... process RESP ...\n  CURSOR=$(echo \"$RESP\" | jq -r '.response_metadata.next_cursor \u002F\u002F empty')\n  [ -z \"$CURSOR\" ] && break\ndone\n```\n\nMethods that commonly paginate: `conversations.list`, `users.list`,\n`conversations.history`, `conversations.replies`.\n\nFor channel\u002Fuser resolution, always paginate — workspaces with 100+ channels\nwill not return all results in a single `limit=200` call.\n\n## Common actions\n\n### Resolve channel name → channel ID\n\n`#engineering` → `C01234ABCDE`. You need the ID for most other calls.\n\n**Important:** Workspaces with many channels require pagination. A single\n`limit=200` call may not return all channels.\n\n```bash\n# Paginated channel lookup\nCHANNEL_NAME=\"engineering\"\nCHANNEL_ID=\"\"\nCURSOR=\"\"\nwhile [ -z \"$CHANNEL_ID\" ]; do\n  URL=\"https:\u002F\u002Fslack.com\u002Fapi\u002Fconversations.list?types=public_channel,private_channel&limit=200\"\n  [ -n \"$CURSOR\" ] && URL=\"${URL}&cursor=${CURSOR}\"\n  RESP=$(curl -s -H \"Authorization: Bearer $TOKEN\" \"$URL\")\n  CHANNEL_ID=$(echo \"$RESP\" | jq -r --arg name \"$CHANNEL_NAME\" \\\n    '.channels[] | select(.name == $name) | .id \u002F\u002F empty')\n  CURSOR=$(echo \"$RESP\" | jq -r '.response_metadata.next_cursor \u002F\u002F empty')\n  [ -z \"$CURSOR\" ] && break\ndone\necho \"$CHANNEL_ID\"\n```\n\n### Open or find a DM by user ID\n\nTo find an existing DM, search your DM list:\n```bash\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Fslack.com\u002Fapi\u002Fconversations.list?types=im&limit=200\" \\\n  | jq -r --arg uid \"U0ALICEID\" '.channels[] | select(.user == $uid) | .id'\n```\n\nTo open a new DM (requires `im:write` scope):\n```bash\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"users\":\"U0ALICEID\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002Fconversations.open \\\n  | jq -r '.channel.id'\n```\n\nIf you get `missing_scope` on `conversations.open`, fall back to the\n`conversations.list` approach above. It works for any DM that already exists.\n\n### Resolve user\u002Fchannel name → ID (fuzzy)\n\nPREFER the `send_message` tool: it already fuzzy-resolves a name\u002Fhandle to a\nuser OR channel (substring, token, and **pinyin** matching, so \"邹欣凯\"\u002F\"欣凯\"\nmatch \"Jay (Xinkai) Zou\"; loose channel names like \"ambient\" match the channel),\nreturns candidates when ambiguous, and caches the directory. Use the raw bash\nbelow only when you need something the tool can't do.\n\nMatch loosely: case-insensitive substring across `name` (handle),\n`real_name`, and `profile.display_name`. A query like `xinkai` must match\n\"Jay (Xinkai) Zou\". For a query in Chinese, also try its pinyin (e.g. 欣凯 →\nxinkai). To resolve a channel, search `conversations.list` by `.name` the same\nloose way. NEVER require an exact equality match.\n\n```bash\n# Returns every candidate as: \u003Cid>\\t\u003Creal_name> (@handle) [display_name]\nQ=\"xinkai\"   # the name the user said, lowercased match\ncurl -s -H \"Authorization: Bearer $TOKEN\" https:\u002F\u002Fslack.com\u002Fapi\u002Fusers.list \\\n  | jq -r --arg q \"$(echo \"$Q\" | tr '[:upper:]' '[:lower:]')\" '\n      .members[]\n      | select(.deleted != true)\n      | { id, name, real: (.real_name \u002F\u002F \"\"), disp: (.profile.display_name \u002F\u002F \"\") }\n      | select(\n          (.name|ascii_downcase|contains($q)) or\n          (.real|ascii_downcase|contains($q)) or\n          (.disp|ascii_downcase|contains($q))\n        )\n      | \"\\(.id)\\t\\(.real) (@\\(.name)) [\\(.disp)]\"'\n```\n\nThen decide:\n- **Exactly one candidate** → use that user id (open a DM with\n  `conversations.open?users=\u003Cid>` or post to it).\n- **Multiple candidates** → DO NOT guess. List the matched names back to the\n  user (e.g. \"I found Jay (Xinkai) Zou and Xinkai Li — which one?\") and send\n  only after they pick.\n- **No candidates** → tell the user no Slack member matched that name.\n\nFor large workspaces (1000+ members), paginate `users.list` the same way as\nchannels. Most workspaces under ~500 members fit in a single call.\n\n### Read recent messages from a channel or DM\n\n```bash\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Fslack.com\u002Fapi\u002Fconversations.history?channel=C01234ABCDE&limit=20\" \\\n  | jq '.messages[] | {ts, user, text}'\n```\n\nTo filter by time (e.g., today's messages only):\n```bash\nTODAY_EPOCH=$(date -d \"$(date +%Y-%m-%d) 00:00:00\" +%s)\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Fslack.com\u002Fapi\u002Fconversations.history?channel=C01234ABCDE&oldest=$TODAY_EPOCH&limit=50\" \\\n  | jq '.messages[] | {ts, user, text}'\n```\n\nFor a threaded reply chain:\n```bash\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Fslack.com\u002Fapi\u002Fconversations.replies?channel=C01234ABCDE&ts=1712023032.1234\" \\\n  | jq '.messages[] | {ts, user, text}'\n```\n\n### Search across workspace\n\n```bash\nQUERY=$(jq -Rr @uri \u003C\u003C\u003C \"deploy rollback\")\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Fslack.com\u002Fapi\u002Fsearch.messages?query=${QUERY}&count=20\" \\\n  | jq '.messages.matches[] | {ts, channel: .channel.name, user: .username, text}'\n```\n\nUseful search modifiers:\n- `in:#channel-name` — restrict to a channel\n- `from:@username` — restrict to a user\n- `before:2024-01-15` \u002F `after:2024-01-01` — date range\n- `has:link` \u002F `has:reaction` — filter by content type\n\n### Send a message (as the user)\n\n```bash\ncurl -s -X POST \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"channel\":\"C01234ABCDE\",\"text\":\"running 5 min late\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002Fchat.postMessage\n```\n\nTo reply in a thread, include `thread_ts`:\n```bash\ncurl -s -X POST \\\n  -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"channel\":\"C01234ABCDE\",\"thread_ts\":\"1712023032.1234\",\"text\":\"on it\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002Fchat.postMessage\n```\n\n### Edit \u002F delete a message\n\nYou can only edit\u002Fdelete messages the user posted.\n\n```bash\n# Edit\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"channel\":\"C...\",\"ts\":\"1712...\",\"text\":\"Updated text\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002Fchat.update\n\n# Delete\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"channel\":\"C...\",\"ts\":\"1712...\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002Fchat.delete\n```\n\n### React to a message\n\n```bash\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"channel\":\"C...\",\"timestamp\":\"1712...\",\"name\":\"white_check_mark\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002Freactions.add\n```\n\nUse the emoji name (no colons), e.g. `white_check_mark`, `eyes`, `+1`.\n\nTo remove a reaction:\n```bash\ncurl -s -X POST -H \"Authorization: Bearer $TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson; charset=utf-8\" \\\n  -d '{\"channel\":\"C...\",\"timestamp\":\"1712...\",\"name\":\"eyes\"}' \\\n  https:\u002F\u002Fslack.com\u002Fapi\u002Freactions.remove\n```\n\n### List your DMs (who have I been talking to)\n\n```bash\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Fslack.com\u002Fapi\u002Fconversations.list?types=im&limit=50\" \\\n  | jq '.channels[] | {id, user, last_read}'\n```\n\n## Safety rules\n\n- **Always confirm before sending.** Draft the message text and show it to\n  the user before posting. Never send on the first ask without confirmation\n  — the message appears as **them**, not as a bot, so mistakes are costly.\n- **Confirm before editing\u002Fdeleting.** Same reasoning.\n- **Don't expose the token.** Don't echo `$TOKEN` or paste it into the\n  chat. Read it fresh each bash call.\n- **Respect rate limits.** Slack limits apps to ~1 req\u002Fsec on most tier 2\n  methods. If you get `rate_limited`, wait the `Retry-After` seconds.\n\n## Typical flows\n\n### \"Check my Slack messages in #engineering from today\"\n\n1. `conversations.list` (paginated) → resolve `#engineering` to channel ID\n2. `conversations.history` with `oldest=\u003Ctoday's epoch>` → last N messages\n3. Resolve user IDs to names via `users.list` (cache within the turn)\n4. Summarize: threads, mentions, pending replies\n\n### \"Reply to Alice's last message with 'thanks, will do'\"\n\n1. `users.list` → resolve \"Alice\" to `U0...`\n2. Check recent conversation history with Alice — DM or shared channel?\n3. Find her most recent message (by `ts`)\n4. **Draft** the reply and show it to the user: `\"Will send: 'thanks, will do' as a reply to Alice's 'can you review #123?' from 2:15 PM. Confirm?\"`\n5. On confirmation: `chat.postMessage` with `thread_ts` = Alice's message ts\n\n### \"What's happening in #standup today?\"\n\n1. Resolve `#standup` → channel ID (paginated)\n2. `conversations.history` with today's oldest\n3. Summarize: who posted, decisions, action items, open threads\n\n## Troubleshooting\n\n| Error | Cause | Fix |\n|-------|-------|-----|\n| `missing_scope` | Token lacks a required OAuth scope | Add the scope in the Slack app settings, reinstall to workspace |\n| `channel_not_found` | Wrong channel ID, or bot\u002Fuser not in the channel | Verify the ID; join the channel first |\n| `not_in_channel` | User token's owner hasn't joined the channel | Join via Slack UI or `conversations.join` |\n| `rate_limited` | Too many requests | Wait `Retry-After` header seconds, then retry |\n| `invalid_auth` | Token is expired or revoked | Regenerate the token in Slack app settings |\n| `account_inactive` | Token's user has been deactivated | Use a different user's token |\n\n## Ideas to try\n\n- React with ✅ to mark tasks you've handled.\n- Daily digest of mentions: search for `@\u003Cyour-user-id>` since yesterday.\n- Thread catch-up: fetch `conversations.replies` and summarize long threads.\n- Draft outgoing: agent writes the message, user reviews, agent sends.\n",{"name":5,"metadata":24,"description":7},{"hawky":25},{"emoji":26,"requires":27},"💬",{"config":28},[29],"channels.slack.user_token","main","67bb3667be325ce6adacf945aa1234824caeb03b","src\u002Fskill-templates\u002Fslack",3,"https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab","https:\u002F\u002Fhao-ai-lab.github.io","2026-10-01 15:34:56",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add hao-ai-lab\u002Fhawky --skill slack",{"tool":44,"command":45},"bunx","bunx skills add hao-ai-lab\u002Fhawky --skill slack",{"tool":47,"command":48},"pnpm","pnpm dlx skills add hao-ai-lab\u002Fhawky --skill slack","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002Fsrc\u002Fskill-templates\u002Fslack\u002FSKILL.md",true,[],[53,60,67,74,81,88],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M77R9GJMZGKNXG4GGD8KS8J6","summarize","Summarize or extract text\u002Ftranscripts from URLs, podcasts, and local files (great fallback for “transcribe this YouTube\u002Fvideo”).","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002Fsrc\u002Fskill-templates\u002Fsummarize\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M77R99M7P6MGP6PE2EAZDY5P","peekaboo","Capture and automate macOS UI with the Peekaboo CLI.","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002Fsrc\u002Fskill-templates\u002Fpeekaboo\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M77R96Q4YAZ19ZTHZC2251NQ","paper-search","Search academic papers on arXiv, Semantic Scholar, and DBLP","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002Fsrc\u002Fskill-templates\u002Fpaper-search\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M77R93715SNT4FE2N5WHRNJ3","import-history","Import chat history from ChatGPT, Claude.ai, iMessage, Slack, WeChat, Telegram, Discord, or WhatsApp into Hawky memory","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002Fsrc\u002Fskill-templates\u002Fimport-history\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M77R8ZJMA0QY235PVPQY07PE","himalaya","CLI to manage emails via IMAP\u002FSMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002Fsrc\u002Fskill-templates\u002Fhimalaya\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M77R8XENQ8F899EA2EP9V8WB","gog","Google Workspace CLI for Gmail, Calendar, Drive, Contacts, Sheets, and Docs.","https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002Fhawky\u002Fblob\u002Fmain\u002Fsrc\u002Fskill-templates\u002Fgog\u002FSKILL.md",[],[]]