mirror of
https://github.com/replicas-group/skill.git
synced 2026-09-14 16:13:52 +08:00
27125152ac
Restructure SKILL.md as an overview that references detailed capability files under references/. This teaches agents how to use Slack, Linear, GitHub, and previews via the replicas-agent skill, avoiding context bloat from always injecting full integration instructions. - SKILL.md → overview with "when to use" guidance for each capability - references/PREVIEWS.md → preview URL creation (extracted from old SKILL.md) - references/SLACK.md → Slack Web API usage with SLACK_BOT_TOKEN - references/LINEAR.md → Linear GraphQL API usage with LINEAR_ACCESS_TOKEN - references/GITHUB.md → gh CLI usage and advanced GitHub operations Co-authored-by: replicas-connector[bot] <replicas-connector[bot]@users.noreply.github.com> Co-authored-by: Connor Loi <loiconnor8@gmail.com>
2.2 KiB
2.2 KiB
Slack Integration
This guide covers how to interact with Slack from within your Replicas workspace.
Prerequisites
Check if the SLACK_BOT_TOKEN environment variable is set:
echo "${SLACK_BOT_TOKEN:+set}"
- If set: Your workspace has Slack access. You can use the Slack Web API as described below.
- If not set: Slack has not been configured for this workspace. The user needs to connect Slack in the Replicas dashboard under their organization's integration settings. Let the user know and do not attempt Slack operations.
Using the Slack API
All requests use the $SLACK_BOT_TOKEN for authentication via the Slack Web API.
Fetching a Thread from a Slack Link
If you encounter a Slack message link (e.g. https://team.slack.com/archives/C0123ABC/p1234567890123456), extract the channel ID and thread timestamp:
- Channel ID: The segment after
/archives/(e.g.C0123ABC) - Thread TS: The
pvalue with a dot inserted before the last 6 digits (e.g.p1234567890123456->1234567890.123456)
curl -s "https://slack.com/api/conversations.replies?channel=CHANNEL_ID&ts=THREAD_TS" \
-H "Authorization: Bearer $SLACK_BOT_TOKEN"
Sending a Message
curl -s -X POST "https://slack.com/api/chat.postMessage" \
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"channel": "CHANNEL_ID",
"text": "Your message here",
"thread_ts": "OPTIONAL_THREAD_TS"
}'
Omit thread_ts to post a new message to the channel. Include it to reply in a thread.
Searching Messages
curl -s "https://slack.com/api/search.messages?query=YOUR_SEARCH_QUERY" \
-H "Authorization: Bearer $SLACK_BOT_TOKEN"
Uploading Files
curl -s -X POST "https://slack.com/api/files.uploadV2" \
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
-F "channel_id=CHANNEL_ID" \
-F "file=@/path/to/file" \
-F "title=File title"
Other Operations
You can list channels, read channel history, add reactions, and perform any other operation supported by the Slack Web API using the same authentication pattern.
For full API documentation, see: https://docs.slack.dev/apis/web-api/