/slack-go-sdk:slack-client-fundamentalsfrom slack-go-sdk
Foundation skill for Slack Go SDK. Use when setting up a new Slack bot, initializing the API client, choosing between Web API vs Socket Mode vs Events API, implementing error handling patterns, or establishing testing strategies for Slack applications.
Ships in slack-go-sdk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Initialize the Slack API client with your bot token:
import "github.com/slack-go/slack"
api := slack.New("xoxb-your-bot-token")
Enable debug mode for development:
api := slack.New(
"xoxb-your-bot-token",
slack.OptionDebug(true),
)
Enable built-in retry handling for rate limits (prefer this over hand-rolled backoff):
api := slack.New(
"xoxb-your-bot-token",
slack.OptionRetry(3),
)
See client-configuration.md for full retry configuration, including retrying connection errors and 5xx responses.
Use for direct API calls where you initiate the action:
Use when your app runs behind a firewall and can't receive HTTP requests:
Use when you have a publicly accessible endpoint:
Always handle errors from API calls:
_, _, err := api.PostMessage(channelID, slack.MsgOptionText(text, false))
if err != nil {
// Handle specific error types
if rateLimitedError, ok := err.(*slack.RateLimitedError); ok {
// Wait and retry
time.Sleep(rateLimitedError.RetryAfter)
}
return fmt.Errorf("failed to post message: %w", err)
}
Use context for cancellation and timeouts:
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
// Pass context to API methods that support it
slack-bot/
├── cmd/
│ └── bot/
│ └── main.go # Entry point
├── internal/
│ ├── handlers/
│ │ ├── messages.go # Message handlers
│ │ ├── events.go # Event handlers
│ │ └── commands.go # Slash command handlers
│ ├── slack/
│ │ ├── client.go # Slack client wrapper
│ │ └── middleware.go # Authentication, rate limiting
│ └── config/
│ └── config.go # Configuration management
├── pkg/
│ └── models/ # Shared data models
├── go.mod
└── go.sum
See testing-patterns.md for comprehensive testing guidance including:
slacktest mock server (preferred for bot integration tests)For advanced configuration including custom HTTP clients, retry strategies, and rate limiting:
Based on your use case, explore these skills:
slack-web-api skill for messaging, channels, users, filesslack-realtime-events skill for Socket Mode or Events APIslack-auth-security skill for multi-workspace authenticationWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
5 skills in this plugin
/slack-admin-apiEnterprise Grid Admin API operations with the Slack Go SDK. Use when managing organization-wide conversations, assigning or listing admin roles, configuring team settings, restricting channel access, or building internal tooling for Slack workspace/org administrators./slack-auth-securityOAuth flows, token management, and security best practices for Slack apps. Use when implementing app distribution, multi-workspace installations, token storage and rotation, managing scopes and permissions, or securing production Slack applications./slack-realtime-eventsReal-time event handling with Socket Mode and Events API. Use when building interactive Slack bots, handling message events, app mentions, reactions, button clicks, modal submissions, slash commands, or any event-driven Slack application functionality./slack-web-apiComprehensive guidance for Slack Web API operations with the Go SDK. Use when sending messages, posting to channels, creating or managing channels, retrieving user information, uploading files, composing Block Kit messages, creating or editing Canvases, registering Calls, building an AI Assistant thread, or performing any synchronous Slack API operations.npx claudepluginhub freightcognition/linehaulai-claude-marketplace --plugin slack-go-sdk