Add CLAUDE.md and generate-openapi-from-pr Claude skill#395
Merged
VedranZoricic merged 6 commits intointercom:mainfrom Mar 10, 2026
Merged
Add CLAUDE.md and generate-openapi-from-pr Claude skill#395VedranZoricic merged 6 commits intointercom:mainfrom
VedranZoricic merged 6 commits intointercom:mainfrom
Conversation
Add repo-level CLAUDE.md documenting the OpenAPI spec structure, CI/CD workflows, editing conventions, and SDK generation safety rules. Add a Claude skill that automates generating OpenAPI spec changes from intercom monolith PRs. The skill analyzes PR diffs (controllers, presenters, version changes, routes) and produces the corresponding YAML updates. Includes reference guides for Ruby-to-OpenAPI mapping, YAML patterns, and version propagation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
salmanbshah
reviewed
Mar 9, 2026
Add a UserPromptSubmit hook that detects intercom PR URLs and injects context telling Claude to use the generate-openapi-from-pr skill. Add user-invocable metadata and argument-hint to SKILL.md frontmatter. Update CLAUDE.md to explicitly direct Claude to use the skill. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- 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>
Tested against intercom/intercom#474982 (field addition) and #477688 (new endpoint). Both produced correct output matching human-written PRs. Improvements based on test observations: - Add fern check fallback (python YAML validation) for environments without fern installed - Add guidance to extract descriptions from version change define_description - Add guidance to match example verbosity level of sibling endpoints - Add guidance to reuse existing example value styles (IDs, workspace IDs) - Note common YAML validation pitfalls Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace <uuid> placeholder with actual UUID format in error template to prevent literal output - Make version-propagation note future-proof by removing hardcoded v2.15 reference and adding "check the actual file" guidance - Consolidate CLAUDE.md skill directive into single paragraph Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the intercom_version default column that mixed two different patterns without explanation, making v2.15 look like an anomaly. Instead, point readers to check the actual file. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
salmanbshah
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
Engineers making API changes in the intercom monolith have to manually translate their Ruby code into OpenAPI YAML spec updates in this repo. Adding Claude configuration files makes it easier for people to create doc changes using Claude Code.
How?
Add a
CLAUDE.mddescribing the repo structure and conventions, plus a Claude skill that takes an intercom monolith PR as input, analyzes the diff (controllers, presenters, version changes, routes), and generates the corresponding OpenAPI YAML updates.Implementation Plan
Plan: Create "Generate OpenAPI from PR" Claude Skill
Context
Engineers making API changes in the intercom monolith must manually translate their Ruby code (controllers, presenters, version changes) into OpenAPI YAML spec updates in this repo (Intercom-OpenAPI). This is the most tedious part of the "Ship to Public API" workflow documented in the Engineering Wiki.
This skill automates that translation: given an intercom monolith PR, it analyzes the diff, identifies API changes, and generates the corresponding OpenAPI spec updates in
descriptions/0/api.intercom.io.yaml(Unstable).Scope: This repo only (Intercom-OpenAPI). Developer-docs PR remains a separate step.
Files to Create
1.
.claude/skills/generate-openapi-from-pr/SKILL.mdMain skill entry point. Contains:
Task,Read,Glob,Grep,Write,Edit,Bash,AskUserQuestion)gh pr view <number> --repo intercom/intercomgh pr diff <number> --repo intercom/intercomfern checkto validate2.
.claude/skills/generate-openapi-from-pr/ruby-to-openapi-mapping.mdReference guide mapping Ruby patterns to OpenAPI YAML with concrete before/after YAML examples.
3.
.claude/skills/generate-openapi-from-pr/openapi-patterns.mdConcrete YAML templates for all common endpoint and schema patterns, extracted from real examples in the current spec.
4.
.claude/skills/generate-openapi-from-pr/version-propagation.mdGuide for when/how to propagate changes across API versions.
5.
CLAUDE.mdRepo-level configuration documenting structure, CI/CD, editing conventions, and SDK generation safety rules.
Generated with Claude Code