Agent skill
slack-context-fetcher
Fetches Slack thread content using a Slack bot for ticket context enrichment. Use when tickets reference Slack threads or discussions.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/slack-context-fetcher
SKILL.md
Slack Context Fetcher
Fetches Slack thread content when tickets reference Slack discussions. Assumes SLACK_BOT_TOKEN environment variable is set.
Prerequisites
SLACK_BOT_TOKENenv var set (xoxb-... token)- Bot added to relevant channels
Workflow
1. Detect Slack References
Parse ticket description for Slack links:
Pattern: https://{workspace}.slack.com/archives/{channel_id}/p{timestamp}
Example: https://comfy-org.slack.com/archives/C07ABCD1234/p1234567890123456
Extract:
channel_id: C07ABCD1234thread_ts: 1234567890.123456 (insert decimal before last 6 digits)
2. Fetch Thread Content
CHANNEL="C07ABCD1234"
THREAD_TS="1234567890.123456"
curl -s -H "Authorization: Bearer $SLACK_BOT_TOKEN" \
"https://slack.com/api/conversations.replies?channel=$CHANNEL&ts=$THREAD_TS" | \
jq '.messages[] | {user: .user, text: .text, ts: .ts}'
3. Resolve User Names
curl -s -H "Authorization: Bearer $SLACK_BOT_TOKEN" \
"https://slack.com/api/users.info?user=$USER_ID" | \
jq -r '.user.real_name'
4. Format for Context
## Slack Thread Context
**Thread:** [Link](https://comfy-org.slack.com/archives/C07.../p1234...)
**Participants:** Alice, Bob, Charlie
**Messages:** 12
### Full Thread
**Alice** (2024-01-15 10:30):
> Original message about the issue...
**Bob** (2024-01-15 10:45):
> Response with context...
5. Save to Run Directory
echo "$SLACK_CONTEXT" > "$RUN_DIR/slack-context.md"
jq '.slackThreads += [{"url": "...", "fetched": "...", "messages": N}]' \
"$RUN_DIR/ticket.json" > tmp && mv tmp "$RUN_DIR/ticket.json"
Integration with ticket-intake
During ticket-intake, if Slack URLs detected:
- Parse channel ID and thread timestamp
- Fetch thread content
- Save to slack-context.md
- Include in research context
Error Handling
| Error | Cause | Resolution |
|---|---|---|
channel_not_found |
Invalid channel ID | Verify URL |
not_in_channel |
Bot not added | Add bot to channel |
invalid_auth |
Bad token | Check SLACK_BOT_TOKEN |
Output Artifacts
| File | Location | Description |
|---|---|---|
| slack-context.md | runs/{ticket-id}/slack-context.md |
Thread content |
| ticket.json | runs/{ticket-id}/ticket.json |
Updated with slack refs |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?