Skip to content

Commit 98bbc29

Browse files
committed
docs(maintainers): organize sections
1 parent 611685f commit 98bbc29

2 files changed

Lines changed: 27 additions & 15 deletions

File tree

AGENTS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,13 @@ Individual packages have their own `AGENTS.md` with package-specific guidance:
9393

9494
- `packages/web-api/AGENTS.md` — adding API methods, code generation, client architecture
9595

96+
## Development Philosophy
97+
98+
- **Follow existing patterns exactly** — when adding or modifying code, match the style of adjacent code.
99+
- **Reuse mixins and shared types** rather than duplicating field definitions across packages.
100+
- **PascalCase for types**, camelCase for methods.
101+
- **JSDoc on public APIs**: Always include `@description` and `@see` with a link to the API reference.
102+
96103
## Common Pitfalls
97104

98105
- **Build in dependency order** — see the dependency graph above.
99-
- **Follow existing patterns exactly** — match the style of adjacent code.

packages/web-api/AGENTS.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The core Slack Web API client. Wraps every Slack API method with typed request a
1515
- **p-retry** for automatic retries with backoff
1616
- **ChatStreamer** (`src/ChatStreamer.ts`) for streaming support via `chatStream()`
1717
- Built-in cursor pagination via `paginate()`
18+
- Rate limiting with emitted events
1819

1920
## Critical Rules
2021

@@ -24,12 +25,31 @@ The core Slack Web API client. Wraps every Slack API method with typed request a
2425
4. **Response type imports use individual files**, not the barrel — e.g., `import type { ChatPostMessageResponse } from './types/response/ChatPostMessageResponse'`.
2526
5. **Request type imports use the barrel**`import type { ChatPostMessageArguments } from './types/request'`.
2627

28+
## Naming Conventions
29+
30+
- **Types**: PascalCase
31+
- Request: `{Namespace}{Action}Arguments` (e.g., `ChatPostMessageArguments`)
32+
- Response: `{Namespace}{Action}Response` (e.g., `ChatPostMessageResponse`)
33+
- **Methods**: camelCase matching the API
34+
- e.g., `chat.postMessage` -> `postMessage`
35+
36+
## Development Philosophy
37+
38+
- **Follow existing patterns exactly** — when adding a new method, match the style of adjacent methods.
39+
- **Reuse mixins** from `common.ts` and namespace-specific files rather than duplicating field definitions.
40+
- **Every API method needs four things**: request type, response type, method binding, and type tests.
41+
- **JSDoc on method bindings**: Always include `@description` and `@see` with a link to the API reference.
42+
2743
## Adding a New Slack API Method
2844

45+
This is the most common contribution. Follow these steps in order.
46+
2947
### Step 1: Look Up the API Method Documentation
3048

3149
Reference: `https://docs.slack.dev/reference/methods/{method.name}`
3250

51+
For example, for `chat.appendStream`: https://docs.slack.dev/reference/methods/chat.appendStream
52+
3353
### Step 2: Generate Response Types
3454

3555
```bash
@@ -201,20 +221,6 @@ expectAssignable<Parameters<typeof web.chat.appendStream>>([
201221
3. Executes `scripts/code_generator.rb`
202222
4. Runs `npm run lint:fix` on generated output
203223

204-
## Naming Conventions
205-
206-
- Request types: `{Namespace}{Action}Arguments` (e.g., `ChatPostMessageArguments`)
207-
- Response types: `{Namespace}{Action}Response` (e.g., `ChatPostMessageResponse`)
208-
- Method names: camelCase matching the API (e.g., `chat.postMessage` -> `postMessage`)
209-
210-
## Development Philosophy
211-
212-
- **Follow existing patterns exactly** — when adding a new method, match the style of adjacent methods.
213-
- **Reuse mixins** from `common.ts` and namespace-specific files rather than duplicating field definitions.
214-
- **Every API method needs four things**: request type, response type, method binding, and type tests.
215-
- **Naming conventions**: PascalCase for types (`ChatPostMessageArguments`), camelCase for methods (`postMessage`).
216-
- **JSDoc on method bindings**: Always include `@description` and `@see` with a link to the API reference.
217-
218224
## Testing
219225

220226
```bash

0 commit comments

Comments
 (0)