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.
/plugin marketplace add linehaul-ai/linehaulai-claude-marketplace/plugin install slack-go-sdk@linehaulai-claude-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
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),
)
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:
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 authenticationCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.