skills/tier-2-communication/slack-directory/SKILL.md
Look up Slack users by name with fuzzy matching. Caches discoveries for instant future lookups.
npx skillsauth add pbc-os/agent-skills-public slack-directoryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The Problem:
When someone says "DM Sarah about the budget" or "add Mike to the channel," you need a Slack user ID — not a name. Slack's API requires IDs for all user operations, but humans think in names.
The Solution:
This skill lets you search Slack users by partial name (first, last, display name, or username), handles multiple matches gracefully, and builds a local cache so you never look up the same person twice.
Real-world example:
"Hey, message the new hire about onboarding"
→ "What's their name?"
→ "Jamie something... started last week"
→ Run lookup for "Jamie" → Find Jamie Chen (U09ABC123)
→ Cache the mapping → Send the message
| Situation | Use This Skill | |-----------|---------------| | Need to DM someone by name | ✅ Yes | | Need to @mention someone | ✅ Yes | | Adding users to channels | ✅ Yes | | Building a people directory | ✅ Yes | | You already have the Slack ID | ❌ No (just use it) |
Before calling the API, check if you already have the mapping cached (in TOOLS.md, a JSON file, or wherever you store local state):
### People Directory
| Name | Slack ID | Notes |
|------|----------|-------|
| Sarah Chen | U09ABC123 | Engineering |
| Mike Brown | U07XYZ789 | Sales lead |
Why cache? Slack API calls cost time and rate limits. Most workspaces have the same 20-50 people you interact with regularly. Cache them once, use forever.
If not cached, run the lookup:
./lookup.sh "jamie"
The script searches across:
real_name (e.g., "Jamie Chen")display_name (e.g., "Jamie C")username (e.g., "jamie.chen")Case-insensitive, partial match.
Single match → Use it and cache it:
✅ Single match found:
| Jamie Chen | U09ABC123 | [email protected] |
Multiple matches → Clarify with the user:
⚠️ Multiple matches for 'jamie' (2 found):
1. Jamie Chen (U09ABC123) - [email protected]
2. Jamie Rodriguez (U08DEF456) - [email protected]
Which one did you mean?
No matches → Help troubleshoot:
❌ No matches found for 'jamie'
Suggestions:
- Check spelling
- Try first or last name only
- They may not be in this workspace
After finding someone new, add them to your local cache for next time.
users:read scopeIf your agent platform already manages Slack tokens for you, the token may already be available. Otherwise:
users:read, users:read.email (optional)xoxb-...)The included lookup.sh expects the token in an environment variable or secrets manager. Edit the TOKEN CONFIGURATION block near the top of the script for your setup:
# Option 1: Environment variable
TOKEN="${SLACK_BOT_TOKEN}"
# Option 2: GCP Secret Manager
TOKEN=$(gcloud secrets versions access latest --secret="slack-bot-token" --project=YOUR_PROJECT)
# Option 3: AWS Secrets Manager
TOKEN=$(aws secretsmanager get-secret-value --secret-id slack-bot-token --query SecretString --output text)
# Option 4: File (less secure, but simple)
TOKEN=$(cat ~/.slack-token)
Endpoint: https://slack.com/api/users.list
Auth: Authorization: Bearer xoxb-...
Rate limit: Tier 2 (~20 requests/minute) — safe for occasional lookups
| Field | Description | Example |
|-------|-------------|---------|
| id | Slack user ID (what you need) | U09ABC123 |
| name | Username/handle | jamie.chen |
| real_name | Full name | Jamie Chen |
| profile.display_name | Custom display name | Jamie |
| profile.email | Email (if visible) | [email protected] |
| deleted | Deactivated account? | false |
| is_bot | Bot account? | false |
TOKEN="xoxb-your-token"
# List all active users
curl -s -H "Authorization: Bearer $TOKEN" \
"https://slack.com/api/users.list" | \
jq '.members[] | select(.deleted == false and .is_bot == false) | {id, name, real_name}'
# Filter for a name
curl -s -H "Authorization: Bearer $TOKEN" \
"https://slack.com/api/users.list" | \
jq --arg q "jamie" '.members[] | select(.deleted == false) | select((.real_name // "" | ascii_downcase | contains($q)))'
Same flow, then use the ID with conversations.invite
Run lookup, display full profile info (name, email, title if available)
For new workspaces, you can bulk-cache everyone:
curl -s -H "Authorization: Bearer $TOKEN" \
"https://slack.com/api/users.list" | \
jq -r '.members[] | select(.deleted == false and .is_bot == false) | "| \(.real_name) | \(.id) | |"'
This outputs a markdown table you can paste into your cache file.
This skill is foundational to Slack communication:
If your agent uses Slack, it will eventually need to look up users. This skill solves that cleanly, with caching to make it fast and reliable over time.
slack-directory/
├── SKILL.md # This documentation
└── lookup.sh # Bash script for fuzzy user search
tools
Generate and iteratively refine USPTO-style patent figure drawings from provisional patent application markdown files, using nano-banana for v1 generation and targeted single-fix edits for v2+ iteration.
data-ai
Weekly revenue / sales forecasting for small businesses with multiple locations or product lines. Blends recent trend + seasonal baseline + YoY growth with per-entity holiday multipliers and week-of-month adjustments. Ships autoresearch-compatible eval and parameters so you can tune it on your own historical data.
data-ai
Analyze email, calendar, and file patterns to discover repeatable workflows that AI agents can automate.
testing
Automated daily digest for small business owners. Combines email triage, calendar agenda, open tasks, and business KPIs into a single morning briefing. Composable — works with whatever data sources are available. Urgent emails require body inspection and explicit escalation signals — never classified from sender/timing metadata alone.