Skip to content

Chore: Ask agents to take documentation comments from official sources - #467

Merged
nezhyborets merged 2 commits into
mainfrom
chore/doc-comments-from-official-sources
Oct 13, 2026
Merged

nezhyborets merged 2 commits into
mainfrom
chore/doc-comments-from-official-sources

Conversation

@nezhyborets

Copy link
Copy Markdown
Collaborator

What

Adds a section to CLAUDE.md that tells agents to copy documentation comments for public API that mirrors the OpenAI API word for word from official sources rather than writing their own. Sources, in order of preference:

  1. The description fields in the repository's openapi.yaml, which are the text of the API Reference in an easily searchable form
  2. The official SDKs generated from the same spec (openai-python, openai-java)
  3. The API Reference web page

Agents may change only names (expires_after → expiresAfter) and make relative links absolute. Text about this SDK rather than the API, such as which method to use instead or why a type is hand-written, goes in its own paragraph. If no official source describes something, it stays undocumented and the agent says so in its summary.

Why

Agent-written doc comments tend to paraphrase or invent descriptions, which can drift from the API's actual behaviour and from the wording users see in the API Reference. This came up while reviewing the Files API work in #401.

Affected Areas

  • CLAUDE.md only

More Info

The rule is already applied to the Files API doc comments in #401.

🤖 Generated with Claude Code

nezhyborets and others added 2 commits October 12, 2026 10:49
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy the wording and formatting of official descriptions by default, but
allow adapting or rephrasing where they don't fit a Swift documentation
comment, instead of requiring them word for word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The documentation-only change is clear, consistent, and fulfills the stated purpose.

0 open findings

What changed in this PR

Adds contributor guidance requiring public API documentation to use official OpenAI sources, reducing wording drift.

Changes:

  • Defines a prioritized list of official documentation sources.
  • Clarifies permitted adaptations and handling of Swift-specific documentation.
File Description
CLAUDE.md Adds documentation sourcing and adaptation guidance.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@nezhyborets
nezhyborets merged commit fdcc3ad into main Oct 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants