You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Make description pushier for better trigger accuracy (catches PR URLs,
"update the spec", "document API change", etc.)
- Remove redundant "When to Activate" section (triggering is from description)
- Slim SKILL.md from 313 to 205 lines by moving inline YAML templates to
reference files and using conditional pointers instead
- Add clear "read X when doing Y" guidance for reference files
- Condense endpoint/schema checklists into scannable summaries
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
description: Generate OpenAPI spec changes from an intercom monolith PR. Use when a user provides an intercom/intercom PR URL or number and wants to create the corresponding OpenAPI documentation changes in this repo.
3
+
description: >
4
+
Generate OpenAPI spec changes from an intercom monolith PR. Use this skill whenever a user
5
+
provides an intercom/intercom PR URL or number, asks to generate or update OpenAPI docs,
6
+
update the spec, document an API change, or mentions shipping API documentation from a PR.
7
+
Also trigger when the user pastes a github.com/intercom/intercom/pull/ URL even without
8
+
explicit instructions — they almost certainly want spec changes generated. This is the
This skill takes an intercom monolith PR (from `intercom/intercom`) and generates the corresponding OpenAPI spec changes in this repo (`Intercom-OpenAPI`).
17
23
18
-
## When to Activate
19
-
20
-
- User provides an `intercom/intercom` PR URL or number
21
-
- User asks to "generate docs from PR", "create OpenAPI from PR", "document this API change"
22
-
23
24
## Workflow
24
25
25
26
### Step 1: Parse Input
@@ -129,136 +130,28 @@ Read the target spec file(s) to understand:
#### Adding a new field to an existing schema (most common change)
138
-
139
-
This is the most frequent PR type. You must update TWO places in the spec:
140
-
141
-
1.**Schema property** — add the new field to `components/schemas/<schema_name>/properties`
142
-
2.**Inline response examples** — search for ALL endpoints that return this schema and update their inline example `value` objects to include the new field
143
-
144
-
Example from a real PR (adding `previous_ticket_state_id` to ticket):
145
-
```yaml
146
-
# 1. In components/schemas/ticket/properties — add the field:
147
-
previous_ticket_state_id:
148
-
type: string
149
-
nullable: true
150
-
description: The ID of the previous ticket state.
151
-
example: '7493'
152
-
153
-
# 2. In EVERY endpoint response example that returns a ticket — add the value:
154
-
examples:
155
-
Successful response:
156
-
value:
157
-
type: ticket
158
-
id: '494'
159
-
# ... existing fields ...
160
-
previous_ticket_state_id: '7490'# ADD THIS
161
-
```
133
+
Read the appropriate reference file based on what the PR changes:
162
134
163
-
**To find all examples that need updating**, search the spec file for the schema name:
135
+
-**Adding/modifying fields or schemas?** → Read [./ruby-to-openapi-mapping.md](./ruby-to-openapi-mapping.md) for how Ruby presenter attributes map to OpenAPI types
136
+
-**Adding new endpoints?** → Read [./openapi-patterns.md](./openapi-patterns.md) for concrete YAML templates (GET, POST, PUT, DELETE, search)
137
+
-**Updating multiple versions?** → Read [./version-propagation.md](./version-propagation.md) for the decision tree on which files to update
138
+
139
+
#### The two most important rules
140
+
141
+
**Rule 1: Field additions require updates in TWO places.** When adding a field to a schema, you must update both the schema definition in `components/schemas` AND every inline response example that returns that schema. Find all affected examples with:
If adding a completely new API resource (not just new endpoints on an existing resource), you MUST add a tag entry to the **top-level `tags` array** at the bottom of the spec file (after `security`):
- The `tags` array on each endpoint (e.g., `tags: [Your Resource]`)
247
-
- The `x-tags` on related schemas (e.g., `x-tags: [Your Resource]`)
146
+
**Rule 2: New resources need a top-level tag.** If adding an entirely new API resource, add an entry to the `tags` array at the bottom of the spec (alphabetical order). The tag name must match the `tags` on endpoints and `x-tags` on schemas. See existing tags in [./openapi-patterns.md](./openapi-patterns.md) under "Top-Level Tags".
248
147
249
-
Existing top-level tags include: Admins, AI Content, Articles, Away Status Reasons, Brands, Calls, Companies, Contacts, Conversations, Custom Channel Events, Custom Object Instances, Data Attributes, Data Events, Data Export, Emails, Help Center, Internal Articles, Jobs, Macros, Messages, News, Notes, Segments, Subscription Types, Switch, Tags, Teams, Ticket States, Ticket Type Attributes, Ticket Types, Tickets, Visitors, Workflows.
148
+
#### Quick checklist for new endpoints
250
149
251
-
#### Reusable `components/responses` (optional)
150
+
Every endpoint needs: `summary`, `description`, `operationId` (unique, camelCase), `tags`, `Intercom-Version` header parameter (`"$ref": "#/components/schemas/intercom_version"`), response with inline examples + schema `$ref`, and at minimum a `401 Unauthorized` error response. POST/PUT endpoints also need a `requestBody` with schema and examples. See [./openapi-patterns.md](./openapi-patterns.md) for complete templates.
252
151
253
-
The spec defines reusable error responses in `components/responses`:
254
-
- `Unauthorized`— 401 with access token invalid
255
-
- `TypeNotFound`— 404 for custom object types
256
-
- `ObjectNotFound`— 404 for objects/custom objects/integrations
You can reference these with `"$ref": "#/components/responses/Unauthorized"` instead of inlining the error response, but most existing endpoints inline their errors. **Match the style of nearby endpoints** in the same resource group.
154
+
Every schema needs: `title` (Title Case), `type: object`, `x-tags`, `description`, and `properties` where each property has `type`, `description`, and `example`. Mark nullable fields explicitly with `nullable: true`. Timestamps use `type: integer` + `format: date-time`.
0 commit comments