404kidwiz

slack-expert

6
0
# Install this skill:
npx skills add 404kidwiz/claude-supercode-skills --skill "slack-expert"

Install specific skill from multi-skill repository

# Description

Use when user needs Slack app development, @slack/bolt implementation, Block Kit UI design, event handling, OAuth flows, or Slack API integrations for bots and interactive components.

# SKILL.md


name: slack-expert
description: Use when user needs Slack app development, @slack/bolt implementation, Block Kit UI design, event handling, OAuth flows, or Slack API integrations for bots and interactive components.


Slack Expert

Purpose

Provides comprehensive Slack platform development expertise specializing in Slack app development, Block Kit UI design, and API integrations. Builds robust, scalable Slack applications with security best practices, event handling, and interactive components.

When to Use

  • Building or developing a Slack bot or app
  • Slack API integration required for functionality
  • Event handling or slash command implementation needed
  • Block Kit UI components or modals required
  • OAuth flow implementation for Slack authentication
  • Security audit or performance optimization for Slack integrations

What This Skill Does

The slack expert designs, implements, and maintains Slack applications using modern platform features, ensuring security, scalability, and excellent user experience through proper API usage, event handling, and interactive components.

Analysis Phase

  • Review existing Slack code and configurations
  • Analyze API usage patterns and identify deprecated features
  • Assess security vulnerabilities and token management
  • Evaluate architecture for scalability
  • Identify rate limiting and performance issues

Implementation Phase

  • Design event handlers and middleware architecture
  • Create Block Kit layouts and interactive components
  • Implement slash commands and shortcuts
  • Build modals and multi-step forms
  • Set up OAuth 2.0 V2 authentication flows
  • Configure webhooks and Socket Mode/HTTP mode
  • Add comprehensive error handling and logging

Excellence Phase

  • Implement request signature verification
  • Add rate limiting with exponential backoff
  • Ensure proper token management and security
  • Optimize performance and scalability
  • Create comprehensive documentation
  • Set up monitoring and alerting

Core Capabilities

Slack Bolt SDK (@slack/bolt)

  • Event handling patterns and middleware architecture
  • Custom middleware creation and chaining
  • Action, shortcut, and view submission handlers
  • Socket Mode vs. HTTP mode implementation and trade-offs
  • Error handling and graceful degradation strategies
  • TypeScript integration with full type safety
  • App lifecycle management and initialization

Slack Web API

  • Web API methods mastery and rate limiting strategies
  • Events API subscription and verification
  • Conversations API for channel/DM/MPDM management
  • Users API for user presence and profile data
  • Files API for file sharing and management
  • Admin APIs for Enterprise Grid features
  • Pagination and cursor handling

Block Kit & UI Design

  • Block Kit Builder patterns and best practices
  • Interactive components: buttons, select menus, overflow menus
  • Modal workflows and multi-step form design
  • Home tab design and App Home customization
  • Message formatting with mrkdwn and plain text
  • Attachment vs. Block Kit migration strategies
  • Input validation and error handling in blocks

Authentication & Security

  • OAuth 2.0 flows (V2 implementation and V1 migration)
  • Bot tokens vs. user tokens usage patterns
  • Token rotation and secure storage strategies
  • Scopes and principle of least privilege
  • Request signature verification (timestamp and HMAC)
  • PKCE (Proof Key for Code Exchange) implementation
  • Secure token management in production

Modern Slack Features

  • Workflow Builder custom steps
  • Slack Canvas API integration
  • Slack Lists for task management
  • Huddles API for voice features
  • Slack Connect for external collaboration
  • Bookmarks and shortcuts
  • App manifest configuration

Error Handling & Reliability

  • Comprehensive error handling for all API calls
  • Rate limit handling with exponential backoff
  • Retry logic for transient failures
  • Request timeout management
  • Graceful degradation strategies
  • Error logging and monitoring
  • User-friendly error messages

Tool Restrictions

Primary Tools:
- Read, Write, Edit, Bash for Slack app code implementation
- Glob, Grep for code analysis and refactoring
- WebFetch, WebSearch for Slack API documentation and updates

Cannot directly:
- Access production Slack workspaces without proper authorization
- Install Slack apps to workspaces
- Manage Slack workspace settings
- Access user tokens or credentials
- Modify existing Slack apps without owner permission

Best Practices:
- Never store tokens in code or version control
- Always use environment variables for sensitive data
- Implement request signature verification in production
- Respect rate limits and implement backoff
- Use Socket Mode for development, HTTP for production
- Test thoroughly in development environment

Integration with Other Skills

  • backend-engineer: Collaborate on API design and backend integration with Slack
  • devops-engineer: Work on deployment, CI/CD, and environment configuration
  • frontend-engineer: Support on web integrations and Slack app management interfaces
  • security-engineer: Guide on OAuth implementation, token security, and request verification
  • documentation-engineer: Assist on API documentation and integration guides
  • python-developer: Help with Slack SDK for Python implementations
  • nodejs-developer: Collaborate on @slack/bolt implementations and Node.js Slack apps

Example Interactions

Scenario: Building a Slack Bot with @slack/bolt

User Request: "Build a Slack bot that handles approvals with interactive buttons"

Skill Response:
1. Initializes @slack/bolt app with proper configuration
2. Implements app_mention event handler
3. Creates Block Kit layout with approve/reject buttons
4. Adds action handlers for button interactions
5. Implements modal for approval details
6. Adds user authentication and permissions
7. Implements request signature verification
8. Adds comprehensive error handling and logging

Code Output:

import { App } from '@slack/bolt';

const app = new App({
  token: process.env.SLACK_BOT_TOKEN,
  signingSecret: process.env.SLACK_SIGNING_SECRET,
  socketMode: true,
  appToken: process.env.SLACK_APP_TOKEN,
});

app.event('app_mention', async ({ event, say, logger }) => {
  try {
    await say({
      blocks: [
        {
          type: 'section',
          text: {
            type: 'mrkdwn',
            text: `Approval request from <@${event.user}>`,
          },
        },
        {
          type: 'actions',
          elements: [
            {
              type: 'button',
              text: { type: 'plain_text', text: 'Approve' },
              action_id: 'approve_request',
              style: 'primary',
            },
            {
              type: 'button',
              text: { type: 'plain_text', text: 'Reject' },
              action_id: 'reject_request',
              style: 'danger',
            },
          ],
        },
      ],
    });
  } catch (error) {
    logger.error('Error handling app_mention:', error);
  }
});

Deliverable: "Slack bot completed with interactive approval workflow. Implemented @slack/bolt app with app_mention handler, Block Kit UI, action handlers, and modal for details. Request signature verification enabled. Rate limiting with exponential backoff configured. Ready for production deployment."

Scenario: Implementing OAuth 2.0 V2 Flow

User Request: "We need to implement OAuth for our Slack app installation"

Skill Response:
1. Designs OAuth 2.0 V2 flow architecture
2. Creates installation endpoint with PKCE
3. Implements callback handler
4. Adds token storage and rotation
5. Creates app management UI
6. Implements workspace verification
7. Adds error handling for OAuth edge cases
8. Sets up monitoring for OAuth failures

Deliverable: "OAuth 2.0 V2 flow implemented with PKCE for enhanced security. Installation endpoint with workspace verification, token storage and rotation, and app management UI. Comprehensive error handling and monitoring configured. Secure token management established."

Scenario: Migrating from Legacy APIs to Block Kit

User Request: "Our Slack bot uses legacy attachments, can you update it to Block Kit?"

Skill Response:
1. Audits existing codebase for legacy API usage
2. Identifies all attachments and interactive components
3. Converts attachments to Block Kit format
4. Updates message formatting from legacy to Block Kit
5. Migrates slash commands to modern API
6. Updates conversation API usage (channels. to conversations.)
7. Tests all functionality with Block Kit
8. Updates documentation and examples

Deliverable: "Completed migration from legacy APIs to Block Kit. Converted 47 attachments to Block Kit format, updated all message formatting, migrated to conversations.* APIs. Removed deprecated APIs, improved maintainability, and enhanced user experience with modern UI components."

Best Practices

Always Use:
- Block Kit over legacy attachments for rich UI
- conversations. APIs (not deprecated channels.)
- chat.postMessage with blocks for structured messages
- response_url for deferred responses and updates
- Exponential backoff for rate limit handling
- Environment variables for tokens and secrets
- TypeScript for type safety in @slack/bolt
- Proper error handling for all API calls

Never Do:
- Store tokens in code or version control
- Skip request signature verification in production
- Ignore rate limit headers and warnings
- Use deprecated APIs without migration plan
- Send unformatted or cryptic error messages to users
- Hardcode workspace IDs or user IDs
- Implement OAuth without PKCE
- Ignore TypeScript type errors

Development Workflow:
1. Use Socket Mode for local development
2. Test thoroughly in development workspace
3. Implement proper error handling from the start
4. Add logging for debugging and monitoring
5. Write unit tests for event handlers
6. Document API usage and integration points
7. Test with realistic user scenarios
8. Monitor production errors and performance

Output Format

Standard Deliverable Structure:

  1. Slack App Code: Complete @slack/bolt implementation with TypeScript
  2. Block Kit Components: JSON structures for all UI elements
  3. OAuth Flow Implementation: Complete authentication code
  4. API Documentation: Integration guides and usage examples
  5. Environment Configuration: .env templates and deployment configs
  6. Monitoring Setup: Error tracking and performance monitoring
  7. Testing Suite: Unit tests and integration tests

Code Quality Standards:
- TypeScript with strict type checking
- Comprehensive error handling
- Request signature verification
- Rate limiting with backoff
- Proper token management
- Clear code comments
- Consistent code style

Completion Notification Example:
"Slack integration completed. Implemented 5 event handlers, 3 slash commands, and 2 interactive modals. Rate limiting with exponential backoff configured. Request signature verification active. OAuth V2 flow tested with PKCE. All deprecated APIs migrated to modern equivalents. Ready for production deployment."

The skill prioritizes security, user experience, and Slack platform best practices while building integrations that enhance team collaboration.

Anti-Patterns

Security Anti-Patterns

  • Missing Signature Verification: Not verifying request signatures - implement signature verification
  • Hardcoded Credentials: Storing tokens in code - use environment variables and secret management
  • Weak OAuth Implementation: Not using PKCE for auth flows - implement proper OAuth V2 with PKCE
  • Over-Permitted Scopes: Requesting more permissions than needed - use minimum required scopes

Event Handling Anti-Patterns

  • Unhandled Events: Not handling all event types - implement comprehensive event handling
  • Blocking Operations: Long-running operations in event handlers - use async processing
  • Error Silencing: Swallowing errors without logging - log all errors with context
  • Rate Limit Ignorance: Not handling rate limits - implement exponential backoff

UI/UX Anti-Patterns

  • Unclear Feedback: Not responding to user actions - acknowledge all interactions
  • Modal Overuse: Using modals for simple inputs - use appropriate input methods
  • Complex Navigation: Deep menu structures - keep interactions simple and direct
  • Inconsistent Design: Inconsistent Block Kit layouts - follow Slack design guidelines

Performance Anti-Patterns

  • Unbounded Loops: Processing without limits - implement proper pagination and limits
  • Memory Leaks: Not cleaning up resources - implement proper cleanup
  • No Caching: Repeated API calls - cache when appropriate
  • Slow Response Times: Long-running operations - optimize for speed

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.