$npx -y skills add vercel-labs/agent-browser --skill slackInteract with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include "check my Slack", "what channels have unrea
| 1 | # Slack Automation |
| 2 | |
| 3 | Interact with Slack workspaces to check messages, extract data, and automate common tasks. |
| 4 | |
| 5 | ## Quick Start |
| 6 | |
| 7 | Connect to an existing Slack browser session or open Slack: |
| 8 | |
| 9 | ```bash |
| 10 | # Connect to existing session on port 9222 (typical for already-open Slack) |
| 11 | agent-browser connect 9222 |
| 12 | |
| 13 | # Or open Slack if not already running |
| 14 | agent-browser open https://app.slack.com |
| 15 | ``` |
| 16 | |
| 17 | Then take a snapshot to see what's available: |
| 18 | |
| 19 | ```bash |
| 20 | agent-browser snapshot -i |
| 21 | ``` |
| 22 | |
| 23 | ## Core Workflow |
| 24 | |
| 25 | 1. **Connect/Navigate**: Open or connect to Slack |
| 26 | 2. **Snapshot**: Get interactive elements with refs (`@e1`, `@e2`, etc.) |
| 27 | 3. **Navigate**: Click tabs, expand sections, or navigate to specific channels |
| 28 | 4. **Extract/Interact**: Read data or perform actions |
| 29 | 5. **Screenshot**: Capture evidence of findings |
| 30 | |
| 31 | ```bash |
| 32 | # Example: Check unread channels |
| 33 | agent-browser connect 9222 |
| 34 | agent-browser snapshot -i |
| 35 | # Look for "More unreads" button |
| 36 | agent-browser click @e21 # Ref for "More unreads" button |
| 37 | agent-browser screenshot slack-unreads.png |
| 38 | ``` |
| 39 | |
| 40 | ## Common Tasks |
| 41 | |
| 42 | ### Checking Unread Messages |
| 43 | |
| 44 | ```bash |
| 45 | # Connect to Slack |
| 46 | agent-browser connect 9222 |
| 47 | |
| 48 | # Take snapshot to locate unreads button |
| 49 | agent-browser snapshot -i |
| 50 | |
| 51 | # Look for: |
| 52 | # - "More unreads" button (usually near top of sidebar) |
| 53 | # - "Unreads" toggle in Activity tab (shows unread count) |
| 54 | # - Channel names with badges/bold text indicating unreads |
| 55 | |
| 56 | # Navigate to Activity tab to see all unreads in one view |
| 57 | agent-browser click @e14 # Activity tab (ref may vary) |
| 58 | agent-browser wait 1000 |
| 59 | agent-browser screenshot activity-unreads.png |
| 60 | |
| 61 | # Or check DMs tab |
| 62 | agent-browser click @e13 # DMs tab |
| 63 | agent-browser screenshot dms.png |
| 64 | |
| 65 | # Or expand "More unreads" in sidebar |
| 66 | agent-browser click @e21 # More unreads button |
| 67 | agent-browser wait 500 |
| 68 | agent-browser screenshot expanded-unreads.png |
| 69 | ``` |
| 70 | |
| 71 | ### Navigating to a Channel |
| 72 | |
| 73 | ```bash |
| 74 | # Search for channel in sidebar or by name |
| 75 | agent-browser snapshot -i |
| 76 | |
| 77 | # Look for channel name in the list (e.g., "engineering", "product-design") |
| 78 | # Click on the channel treeitem ref |
| 79 | agent-browser click @e94 # Example: engineering channel ref |
| 80 | agent-browser wait --load networkidle |
| 81 | agent-browser screenshot channel.png |
| 82 | ``` |
| 83 | |
| 84 | ### Finding Messages/Threads |
| 85 | |
| 86 | ```bash |
| 87 | # Use Slack search |
| 88 | agent-browser snapshot -i |
| 89 | agent-browser click @e5 # Search button (typical ref) |
| 90 | agent-browser fill @e_search "keyword" |
| 91 | agent-browser press Enter |
| 92 | agent-browser wait --load networkidle |
| 93 | agent-browser screenshot search-results.png |
| 94 | ``` |
| 95 | |
| 96 | ### Extracting Channel Information |
| 97 | |
| 98 | ```bash |
| 99 | # Get list of all visible channels |
| 100 | agent-browser snapshot --json > slack-snapshot.json |
| 101 | |
| 102 | # Parse for channel names and metadata |
| 103 | # Look for treeitem elements with level=2 (sub-channels under sections) |
| 104 | ``` |
| 105 | |
| 106 | ### Checking Channel Details |
| 107 | |
| 108 | ```bash |
| 109 | # Open a channel |
| 110 | agent-browser click @e_channel_ref |
| 111 | agent-browser wait 1000 |
| 112 | |
| 113 | # Get channel info (members, description, etc.) |
| 114 | agent-browser snapshot -i |
| 115 | agent-browser screenshot channel-details.png |
| 116 | |
| 117 | # Scroll through messages |
| 118 | agent-browser scroll down 500 |
| 119 | agent-browser screenshot channel-messages.png |
| 120 | ``` |
| 121 | |
| 122 | ### Taking Notes/Capturing State |
| 123 | |
| 124 | When you need to document findings from Slack: |
| 125 | |
| 126 | ```bash |
| 127 | # Take annotated screenshot (shows element numbers) |
| 128 | agent-browser screenshot --annotate slack-state.png |
| 129 | |
| 130 | # Take full-page screenshot |
| 131 | agent-browser screenshot --full slack-full.png |
| 132 | |
| 133 | # Get current URL for reference |
| 134 | agent-browser get url |
| 135 | |
| 136 | # Get page title |
| 137 | agent-browser get title |
| 138 | ``` |
| 139 | |
| 140 | ## Sidebar Structure |
| 141 | |
| 142 | Understanding Slack's sidebar helps you navigate efficiently: |
| 143 | |
| 144 | ``` |
| 145 | - Threads |
| 146 | - Huddles |
| 147 | - Drafts & sent |
| 148 | - Directories |
| 149 | - [Section Headers - External connections, Starred, Channels, etc.] |
| 150 | - [Channels listed as treeitems] |
| 151 | - Direct Messages |
| 152 | - [DMs listed] |
| 153 | - Apps |
| 154 | - [App shortcuts] |
| 155 | - [More unreads] button (toggles unread channels list) |
| 156 | ``` |
| 157 | |
| 158 | Key refs to look for: |
| 159 | - `@e12` - Home tab (usually) |
| 160 | - `@e13` - DMs tab |
| 161 | - `@e14` - Activity tab |
| 162 | - `@e5` - Search button |
| 163 | - `@e21` - More unreads button (varies by session) |
| 164 | |
| 165 | ## Tabs in Slack |
| 166 | |
| 167 | After clicking on a channel, you'll see tabs: |
| 168 | - **Messages** - Channel conversation |
| 169 | - **Files** - Shared files |
| 170 | - **Pins** - Pinned messages |
| 171 | - **Add canvas** - Collaborative canvas |
| 172 | - Other tabs depending on workspace setup |
| 173 | |
| 174 | Click tab refs to switch views and get different information. |
| 175 | |
| 176 | ## Extracting Data from Slack |
| 177 | |
| 178 | ### Get Text Content |
| 179 | |
| 180 | ```bash |
| 181 | # Get a message or element's text |
| 182 | agent-browser get text @e_message_ref |
| 183 | ``` |
| 184 | |
| 185 | ### Parse Accessibility Tree |
| 186 | |
| 187 | ```bash |
| 188 | # Full snapshot as JSON for programmat |