Instructions for AI coding agents working on this repository.
- Repository: https://github.com/slackapi/node-slack-sdk
- Documentation: https://docs.slack.dev/tools/node-slack-sdk/
- Monorepo managed with npm workspaces, TypeScript-first
- Publishes multiple
@slack/*packages to npm
| Package | Folder | Description |
|---|---|---|
@slack/web-api |
packages/web-api |
Core Web API client (most complex package) |
@slack/types |
packages/types |
Shared Slack platform TypeScript types (Block Kit, events, etc.) |
@slack/logger |
packages/logger |
Logging utility used by other packages |
@slack/webhook |
packages/webhook |
Incoming webhook client |
@slack/oauth |
packages/oauth |
OAuth flow handling and token management |
@slack/socket-mode |
packages/socket-mode |
WebSocket-based real-time event client |
@slack/cli-hooks |
packages/cli-hooks |
CLI integration hooks for Slack CLI |
Additional internal packages: cli-test (test utilities), rtm-api (legacy RTM client).
Independent (no internal deps): cli-hooks, cli-test
Base: logger, types
Depends on base: web-api, webhook
Depends on web-api: oauth, rtm-api, socket-modeBuild packages in this order — a package can only be built after its dependencies.
# Install all dependencies from the repo root
npm install
# Lint all packages (Biome)
npm run lint
npm run lint:fix
# Build a specific package
npm run build --workspace=packages/web-api
# Test a specific package
npm test --workspace=packages/web-api# 1. No internal dependencies
npm run build --workspace=@slack/cli-hooks
npm run build --workspace=@slack/cli-test
# 2. Base dependencies
npm run build --workspace=@slack/logger
npm run build --workspace=@slack/types
# 3. Packages requiring base dependencies
npm run build --workspace=@slack/web-api
npm run build --workspace=@slack/webhook
# 4. Packages depending on web-api
npm run build --workspace=@slack/oauth
npm run build --workspace=@slack/rtm-api
npm run build --workspace=@slack/socket-mode- Never manually edit
packages/web-api/src/types/response/*.ts— these files are auto-generated byscripts/generate-web-api-types.sh. They contain a "DO NOT EDIT" banner. - Request types ARE manually maintained —
packages/web-api/src/types/request/is hand-written code; edit these responsibly. - Build packages in dependency order — see the dependency graph above.
- Use Biome, not ESLint or Prettier — config is in
biome.jsonat repo root. - TypeScript 5.9.3, Node 18+ (tested on Node 18, 20, 22, 24).
- Formatting: configured in
biome.json - Test files:
*.test.{ts,js}usingnode:test+node:assert/strict; coverage via--experimental-test-coverage - Type tests:
*.test-d.tsusing tsd - CI matrix: Node 18.x, 20.x, 22.x, 24.x on Ubuntu + Windows
Individual packages have their own AGENTS.md with package-specific guidance:
packages/types/AGENTS.md— shared type definitions, Block Kit types, event typespackages/web-api/AGENTS.md— adding API methods, code generation, client architecture
- Follow existing patterns exactly — when adding or modifying code, match the style of adjacent code.
- Reuse mixins and shared types rather than duplicating field definitions across packages.
- PascalCase for types, camelCase for methods.
- JSDoc on public APIs: Always include
@descriptionand@seewith a link to the API reference.
- Build in dependency order — see the dependency graph above.