Claude Agent Skill · by Vercel Labs

Slack

Automates Slack through browser sessions instead of requiring API setup or bot tokens. Connects to your already-open Slack workspace, checks unread channels acr

Install
Terminal · npx
$npx skills add https://github.com/vercel-labs/agent-browser --skill slack
Works with Paperclip

How Slack fits into a Paperclip company.

Slack drops into any Paperclip agent that handles this kind of work. Assign it to a specialist inside a pre-configured PaperclipOrg company and the skill becomes available on every heartbeat — no prompt engineering, no tool wiring.

S
SaaS FactoryPaired

Pre-configured AI company — 18 agents, 18 skills, one-time purchase.

$27$59
Explore pack
Source file
SKILL.md285 lines
Expand
---name: slackdescription: Interact 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 unreads", "send a message to", "search Slack for", "extract from Slack", "find who said", or any task requiring programmatic Slack interaction.allowed-tools: Bash(agent-browser:*), Bash(npx agent-browser:*)--- # Slack Automation Interact with Slack workspaces to check messages, extract data, and automate common tasks. ## Quick Start Connect to an existing Slack browser session or open Slack: ```bash# Connect to existing session on port 9222 (typical for already-open Slack)agent-browser connect 9222 # Or open Slack if not already runningagent-browser open https://app.slack.com``` Then take a snapshot to see what's available: ```bashagent-browser snapshot -i``` ## Core Workflow 1. **Connect/Navigate**: Open or connect to Slack2. **Snapshot**: Get interactive elements with refs (`@e1`, `@e2`, etc.)3. **Navigate**: Click tabs, expand sections, or navigate to specific channels4. **Extract/Interact**: Read data or perform actions5. **Screenshot**: Capture evidence of findings ```bash# Example: Check unread channelsagent-browser connect 9222agent-browser snapshot -i# Look for "More unreads" buttonagent-browser click @e21  # Ref for "More unreads" buttonagent-browser screenshot slack-unreads.png``` ## Common Tasks ### Checking Unread Messages ```bash# Connect to Slackagent-browser connect 9222 # Take snapshot to locate unreads buttonagent-browser snapshot -i # Look for:# - "More unreads" button (usually near top of sidebar)# - "Unreads" toggle in Activity tab (shows unread count)# - Channel names with badges/bold text indicating unreads # Navigate to Activity tab to see all unreads in one viewagent-browser click @e14  # Activity tab (ref may vary)agent-browser wait 1000agent-browser screenshot activity-unreads.png # Or check DMs tabagent-browser click @e13  # DMs tabagent-browser screenshot dms.png # Or expand "More unreads" in sidebaragent-browser click @e21  # More unreads buttonagent-browser wait 500agent-browser screenshot expanded-unreads.png``` ### Navigating to a Channel ```bash# Search for channel in sidebar or by nameagent-browser snapshot -i # Look for channel name in the list (e.g., "engineering", "product-design")# Click on the channel treeitem refagent-browser click @e94  # Example: engineering channel refagent-browser wait --load networkidleagent-browser screenshot channel.png``` ### Finding Messages/Threads ```bash# Use Slack searchagent-browser snapshot -iagent-browser click @e5  # Search button (typical ref)agent-browser fill @e_search "keyword"agent-browser press Enteragent-browser wait --load networkidleagent-browser screenshot search-results.png``` ### Extracting Channel Information ```bash# Get list of all visible channelsagent-browser snapshot --json > slack-snapshot.json # Parse for channel names and metadata# Look for treeitem elements with level=2 (sub-channels under sections)``` ### Checking Channel Details ```bash# Open a channelagent-browser click @e_channel_refagent-browser wait 1000 # Get channel info (members, description, etc.)agent-browser snapshot -iagent-browser screenshot channel-details.png # Scroll through messagesagent-browser scroll down 500agent-browser screenshot channel-messages.png``` ### Taking Notes/Capturing State When you need to document findings from Slack: ```bash# Take annotated screenshot (shows element numbers)agent-browser screenshot --annotate slack-state.png # Take full-page screenshotagent-browser screenshot --full slack-full.png # Get current URL for referenceagent-browser get url # Get page titleagent-browser get title``` ## Sidebar Structure Understanding Slack's sidebar helps you navigate efficiently: ```- Threads- Huddles- Drafts & sent- Directories- [Section Headers - External connections, Starred, Channels, etc.]  - [Channels listed as treeitems]- Direct Messages  - [DMs listed]- Apps  - [App shortcuts]- [More unreads] button (toggles unread channels list)``` Key refs to look for:- `@e12` - Home tab (usually)- `@e13` - DMs tab- `@e14` - Activity tab- `@e5` - Search button- `@e21` - More unreads button (varies by session) ## Tabs in Slack After clicking on a channel, you'll see tabs:- **Messages** - Channel conversation- **Files** - Shared files- **Pins** - Pinned messages- **Add canvas** - Collaborative canvas- Other tabs depending on workspace setup Click tab refs to switch views and get different information. ## Extracting Data from Slack ### Get Text Content ```bash# Get a message or element's textagent-browser get text @e_message_ref``` ### Parse Accessibility Tree ```bash# Full snapshot as JSON for programmatic parsingagent-browser snapshot --json > output.json # Look for:# - Channel names (name field in treeitem)# - Message content (in listitem/document elements)# - User names (button elements with user info)# - Timestamps (link elements with time info)``` ### Count Unreads ```bash# After expanding unreads section:agent-browser snapshot -i | grep -c "treeitem"# Each treeitem with a channel name in the unreads section is one unread``` ## Best Practices - **Connect to existing sessions**: Use `agent-browser connect 9222` if Slack is already open. This is faster than opening a new browser.- **Take snapshots before clicking**: Always `snapshot -i` to identify refs before clicking buttons.- **Re-snapshot after navigation**: After navigating to a new channel or section, take a fresh snapshot to find new refs.- **Use JSON snapshots for parsing**: When you need to extract structured data, use `snapshot --json` for machine-readable output.- **Pace interactions**: Add `sleep 1` between rapid interactions to let the UI update.- **Check accessibility tree**: The accessibility tree shows what screen readers (and your automation) can see. If an element isn't in the snapshot, it may be hidden or require scrolling.- **Scroll in sidebar**: Use `agent-browser scroll down 300 --selector ".p-sidebar"` to scroll within the Slack sidebar if channel list is long. ## Limitations - **Cannot access Slack API**: This uses browser automation, not the Slack API. No OAuth, webhooks, or bot tokens needed.- **Session-specific**: Screenshots and snapshots are tied to the current browser session.- **Rate limiting**: Slack may rate-limit rapid interactions. Add delays between commands if needed.- **Workspace-specific**: You interact with your own workspace -- no cross-workspace automation. ## Debugging ### Check console for errors ```bashagent-browser consoleagent-browser errors``` ### Get current page state ```bashagent-browser get urlagent-browser get titleagent-browser screenshot page-state.png``` ## Example: Full Unread Check ```bash#!/bin/bash # Connect to Slackagent-browser connect 9222 # Take initial snapshotecho "=== Checking Slack unreads ==="agent-browser snapshot -i > snapshot.txt # Check Activity tab for unreadsagent-browser click @e14  # Activity tabagent-browser wait 1000agent-browser screenshot activity.pngACTIVITY_RESULT=$(agent-browser get text @e_main_area)echo "Activity: $ACTIVITY_RESULT" # Check DMsagent-browser click @e13  # DMs tabagent-browser wait 1000agent-browser screenshot dms.png # Check unread channels in sidebaragent-browser click @e21  # More unreads buttonagent-browser wait 500agent-browser snapshot -i > unreads-expanded.txtagent-browser screenshot unreads.png # Summaryecho "=== Summary ==="echo "See activity.png, dms.png, and unreads.png for full details"``` ## References - **Slack docs**: https://slack.com/help- **Web experience**: https://app.slack.com- **Keyboard shortcuts**: Type `?` in Slack for shortcut list