From e6441aaa5ff9c46a7f8676ac32a7b79e2bbcc42a Mon Sep 17 00:00:00 2001 From: Minsu Lee Date: Tue, 7 Jul 2026 12:21:00 +0900 Subject: [PATCH 1/4] feat(openai-docs): add OpenAI Docs plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new local plugin bundling OpenAI's openai-docs skill (from the openai/codex repo sample, Apache-2.0) with the openaiDeveloperDocs remote HTTP MCP server (https://developers.openai.com/mcp). The skill was adapted for Claude Code: Codex-agent-specific content (Codex manual helper, self-knowledge/surface-map sections, `codex mcp add` steps, fetch-codex-manual.mjs, agents/+assets/) was removed, while OpenAI docs MCP guidance, model selection, migration, and prompting guidance were retained. A NOTICE file records the source, Apache-2.0 license, and modifications. - plugins/openai-docs/ — Claude source manifest (.claude-plugin/plugin.json), generated runtime manifests (.codex-plugin/, .cursor-plugin/, root plugin.json, .mcp.json, mcp_config.json), README, and skills/openai-docs/ (SKILL.md, references/, scripts/resolve-latest-model-info.js, LICENSE.txt, NOTICE) - .claude-plugin/marketplace.json — new entry (source of truth) with relevance signals - .agents/plugins/marketplace.json, .cursor-plugin/marketplace.json — generated marketplace entries - release-please-config.json, .release-please-manifest.json — version tracking (1.0.0) - README.md — Built-in Plugins listing --- .agents/plugins/marketplace.json | 12 + .claude-plugin/marketplace.json | 20 ++ .cursor-plugin/marketplace.json | 5 + .release-please-manifest.json | 1 + README.md | 6 + .../openai-docs/.claude-plugin/plugin.json | 25 ++ plugins/openai-docs/.codex-plugin/plugin.json | 34 +++ .../openai-docs/.cursor-plugin/plugin.json | 30 +++ plugins/openai-docs/.mcp.json | 8 + plugins/openai-docs/README.md | 14 + plugins/openai-docs/mcp_config.json | 8 + plugins/openai-docs/plugin.json | 19 ++ .../skills/openai-docs/LICENSE.txt | 201 +++++++++++++++ plugins/openai-docs/skills/openai-docs/NOTICE | 25 ++ .../openai-docs/skills/openai-docs/SKILL.md | 87 +++++++ .../openai-docs/references/latest-model.md | 37 +++ .../openai-docs/references/prompting-guide.md | 244 ++++++++++++++++++ .../openai-docs/references/upgrade-guide.md | 181 +++++++++++++ .../scripts/resolve-latest-model-info.js | 147 +++++++++++ release-please-config.json | 26 ++ 20 files changed, 1130 insertions(+) create mode 100644 plugins/openai-docs/.claude-plugin/plugin.json create mode 100644 plugins/openai-docs/.codex-plugin/plugin.json create mode 100644 plugins/openai-docs/.cursor-plugin/plugin.json create mode 100644 plugins/openai-docs/.mcp.json create mode 100644 plugins/openai-docs/README.md create mode 100644 plugins/openai-docs/mcp_config.json create mode 100644 plugins/openai-docs/plugin.json create mode 100644 plugins/openai-docs/skills/openai-docs/LICENSE.txt create mode 100644 plugins/openai-docs/skills/openai-docs/NOTICE create mode 100644 plugins/openai-docs/skills/openai-docs/SKILL.md create mode 100644 plugins/openai-docs/skills/openai-docs/references/latest-model.md create mode 100644 plugins/openai-docs/skills/openai-docs/references/prompting-guide.md create mode 100644 plugins/openai-docs/skills/openai-docs/references/upgrade-guide.md create mode 100644 plugins/openai-docs/skills/openai-docs/scripts/resolve-latest-model-info.js diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json index 4f6812e1..9d7ea892 100644 --- a/.agents/plugins/marketplace.json +++ b/.agents/plugins/marketplace.json @@ -556,6 +556,18 @@ }, "category": "Tooling" }, + { + "name": "openai-docs", + "source": { + "source": "local", + "path": "./plugins/openai-docs" + }, + "policy": { + "installation": "AVAILABLE", + "authentication": "ON_INSTALL" + }, + "category": "Tooling" + }, { "name": "semble", "source": { diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 8c7742a3..07b0cdbb 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -761,6 +761,26 @@ "tags": ["mcp", "web"], "source": "./plugins/fetch" }, + { + "name": "openai-docs", + "description": "Authoritative, current guidance from official OpenAI developer docs, model selection, and model/prompt migration — backed by the OpenAI Developer Docs MCP server.", + "category": "tooling", + "keywords": ["openai", "docs", "mcp", "model-selection", "api"], + "tags": ["mcp", "docs"], + "source": "./plugins/openai-docs", + "relevance": { + "topic": "OpenAI docs", + "signals": { + "hosts": ["developers.openai.com", "platform.openai.com", "api.openai.com"], + "manifestDeps": [ + { + "file": "[/\\\\]package\\.json$", + "pattern": "\"openai\"\\s*:" + } + ] + } + } + }, { "name": "claude-code-docs", "description": "Fetch Claude Code docs as markdown - rewrites code.claude.com/docs page URLs to their .md source before WebFetch runs", diff --git a/.cursor-plugin/marketplace.json b/.cursor-plugin/marketplace.json index 79063db2..79b7286b 100644 --- a/.cursor-plugin/marketplace.json +++ b/.cursor-plugin/marketplace.json @@ -194,6 +194,11 @@ "source": "./plugins/fetch", "description": "Fetch web content in multiple formats - HTML, JSON, plain text, Markdown, readable articles, and YouTube transcripts" }, + { + "name": "openai-docs", + "source": "./plugins/openai-docs", + "description": "Authoritative, current guidance from official OpenAI developer docs, model selection, and model/prompt migration — backed by the OpenAI Developer Docs MCP server." + }, { "name": "semble", "source": "./plugins/semble", diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 60a28e1f..ef735178 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -56,6 +56,7 @@ "plugins/claude-md-management": "1.1.0", "plugins/cubic": "1.1.0", "plugins/fetch": "1.2.0", + "plugins/openai-docs": "1.0.0", "plugins/java-development": "1.1.0", "plugins/mcp-dev": "1.1.0", "plugins/vercel-sandbox": "1.2.0", diff --git a/README.md b/README.md index 5e380356..78171cdb 100644 --- a/README.md +++ b/README.md @@ -382,6 +382,12 @@ Fetch web content in multiple formats - HTML, JSON, plain text, Markdown, readab **Install:** `/plugin install fetch@pleaseai` | **Source:** [plugins/fetch](https://github.com/pleaseai/claude-code-plugins/tree/main/plugins/fetch) +#### OpenAI Docs + +Authoritative, current guidance from official OpenAI developer docs, model selection, and model/prompt migration - backed by the OpenAI Developer Docs MCP server. + +**Install:** `/plugin install openai-docs@pleaseai` | **Source:** [plugins/openai-docs](https://github.com/pleaseai/claude-code-plugins/tree/main/plugins/openai-docs) + #### Java Development [![tessl](https://img.shields.io/endpoint?url=https%3A%2F%2Fapi.tessl.io%2Fv1%2Fbadges%2Fpleaseai%2Fjava-development)](https://tessl.io/registry/pleaseai/java-development) diff --git a/plugins/openai-docs/.claude-plugin/plugin.json b/plugins/openai-docs/.claude-plugin/plugin.json new file mode 100644 index 00000000..0c046b61 --- /dev/null +++ b/plugins/openai-docs/.claude-plugin/plugin.json @@ -0,0 +1,25 @@ +{ + "name": "openai-docs", + "version": "1.0.0", + "description": "Authoritative, current guidance from official OpenAI developer docs, model selection, and model/prompt migration — backed by the OpenAI Developer Docs MCP server.", + "author": { + "name": "OpenAI", + "url": "https://github.com/openai/codex" + }, + "homepage": "https://developers.openai.com", + "repository": "https://github.com/openai/codex", + "license": "Apache-2.0", + "keywords": [ + "openai", + "docs", + "mcp", + "model-selection", + "api" + ], + "mcpServers": { + "openaiDeveloperDocs": { + "type": "http", + "url": "https://developers.openai.com/mcp" + } + } +} diff --git a/plugins/openai-docs/.codex-plugin/plugin.json b/plugins/openai-docs/.codex-plugin/plugin.json new file mode 100644 index 00000000..8d33af9c --- /dev/null +++ b/plugins/openai-docs/.codex-plugin/plugin.json @@ -0,0 +1,34 @@ +{ + "name": "openai-docs", + "version": "1.0.0", + "description": "Authoritative, current guidance from official OpenAI developer docs, model selection, and model/prompt migration — backed by the OpenAI Developer Docs MCP server.", + "author": { + "name": "OpenAI", + "url": "https://github.com/openai/codex" + }, + "interface": { + "displayName": "Openai Docs", + "shortDescription": "Authoritative, current guidance from official OpenAI developer docs, model selection, and model/prompt migration — backed by the OpenAI Developer Docs MCP se...", + "longDescription": "Authoritative, current guidance from official OpenAI developer docs, model selection, and model/prompt migration — backed by the OpenAI Developer Docs MCP server.", + "developerName": "OpenAI", + "category": "Tooling", + "capabilities": [ + "Tool" + ], + "defaultPrompt": [ + "Use Openai Docs for my current task." + ], + "websiteURL": "https://developers.openai.com" + }, + "homepage": "https://developers.openai.com", + "repository": "https://github.com/openai/codex", + "license": "Apache-2.0", + "keywords": [ + "openai", + "docs", + "mcp", + "model-selection", + "api" + ], + "mcpServers": "./.mcp.json" +} diff --git a/plugins/openai-docs/.cursor-plugin/plugin.json b/plugins/openai-docs/.cursor-plugin/plugin.json new file mode 100644 index 00000000..f8d88eeb --- /dev/null +++ b/plugins/openai-docs/.cursor-plugin/plugin.json @@ -0,0 +1,30 @@ +{ + "name": "openai-docs", + "displayName": "Openai Docs", + "description": "Authoritative, current guidance from official OpenAI developer docs, model selection, and model/prompt migration — backed by the OpenAI Developer Docs MCP server.", + "version": "1.0.0", + "author": { + "name": "OpenAI" + }, + "category": "Tooling", + "homepage": "https://developers.openai.com", + "repository": "https://github.com/openai/codex", + "license": "Apache-2.0", + "keywords": [ + "openai", + "docs", + "mcp", + "model-selection", + "api" + ], + "tags": [ + "mcp", + "docs" + ], + "mcpServers": { + "openaiDeveloperDocs": { + "type": "http", + "url": "https://developers.openai.com/mcp" + } + } +} diff --git a/plugins/openai-docs/.mcp.json b/plugins/openai-docs/.mcp.json new file mode 100644 index 00000000..fcde3746 --- /dev/null +++ b/plugins/openai-docs/.mcp.json @@ -0,0 +1,8 @@ +{ + "mcpServers": { + "openaiDeveloperDocs": { + "type": "http", + "url": "https://developers.openai.com/mcp" + } + } +} diff --git a/plugins/openai-docs/README.md b/plugins/openai-docs/README.md new file mode 100644 index 00000000..0fb15b3e --- /dev/null +++ b/plugins/openai-docs/README.md @@ -0,0 +1,14 @@ +# openai-docs + +Authoritative, current guidance from official OpenAI developer docs, model selection, and model/prompt migration — backed by the OpenAI Developer Docs MCP server (`https://developers.openai.com/mcp`). + +**Install:** `/plugin install openai-docs@pleaseai` + +## What's included + +- **`openai-docs` skill** — activates on OpenAI docs questions, model-selection and "latest model" queries, and model/prompt upgrade requests. Prefers official OpenAI docs via MCP, with bundled fallback references. +- **`openaiDeveloperDocs` MCP server** — remote HTTP server exposing `search_openai_docs`, `fetch_openai_doc`, `list_openai_docs`, and `get_openapi_spec`. + +## Notes + +- The skill is adapted from OpenAI's `openai-docs` skill sample (Apache-2.0, see `skills/openai-docs/LICENSE.txt`). Codex-agent-specific content (the Codex manual helper and `codex mcp add` install steps) has been removed for Claude Code; the `openaiDeveloperDocs` MCP server is provided by this plugin, so no manual install is required. diff --git a/plugins/openai-docs/mcp_config.json b/plugins/openai-docs/mcp_config.json new file mode 100644 index 00000000..fcde3746 --- /dev/null +++ b/plugins/openai-docs/mcp_config.json @@ -0,0 +1,8 @@ +{ + "mcpServers": { + "openaiDeveloperDocs": { + "type": "http", + "url": "https://developers.openai.com/mcp" + } + } +} diff --git a/plugins/openai-docs/plugin.json b/plugins/openai-docs/plugin.json new file mode 100644 index 00000000..4e24d355 --- /dev/null +++ b/plugins/openai-docs/plugin.json @@ -0,0 +1,19 @@ +{ + "name": "openai-docs", + "version": "1.0.0", + "description": "Authoritative, current guidance from official OpenAI developer docs, model selection, and model/prompt migration — backed by the OpenAI Developer Docs MCP server.", + "author": { + "name": "OpenAI", + "url": "https://github.com/openai/codex" + }, + "homepage": "https://developers.openai.com", + "repository": "https://github.com/openai/codex", + "license": "Apache-2.0", + "keywords": [ + "openai", + "docs", + "mcp", + "model-selection", + "api" + ] +} diff --git a/plugins/openai-docs/skills/openai-docs/LICENSE.txt b/plugins/openai-docs/skills/openai-docs/LICENSE.txt new file mode 100644 index 00000000..13e25df8 --- /dev/null +++ b/plugins/openai-docs/skills/openai-docs/LICENSE.txt @@ -0,0 +1,201 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf of + any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don\'t include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/plugins/openai-docs/skills/openai-docs/NOTICE b/plugins/openai-docs/skills/openai-docs/NOTICE new file mode 100644 index 00000000..77527841 --- /dev/null +++ b/plugins/openai-docs/skills/openai-docs/NOTICE @@ -0,0 +1,25 @@ +openai-docs skill +================== + +This skill is derived from OpenAI's "openai-docs" skill sample: + + Source: https://github.com/openai/codex + Path: codex-rs/skills/src/assets/samples/openai-docs + License: Apache License 2.0 (see LICENSE.txt in this directory) + +Modifications for the Claude Code plugin marketplace +---------------------------------------------------- +The original sample targets the Codex agent. For use as a Claude Code plugin +(pleaseai/claude-code-plugins), the following changes were made: + +- SKILL.md: removed the Codex-agent "self-knowledge" sections (Codex manual + helper, Source Route, Surface Map, Boundaries And Output) and rewrote the + "If the MCP server is unavailable" section for Claude Code (the plugin + provides the openaiDeveloperDocs MCP server, so `codex mcp add` steps were + removed). Frontmatter description updated accordingly. The OpenAI docs MCP + guidance, model-selection, migration, and prompting guidance are retained. +- Removed scripts/fetch-codex-manual.mjs (Codex manual fetch helper). +- Removed agents/openai.yaml and assets/ (Codex interface metadata and icons). + +Retained unchanged: references/latest-model.md, references/upgrade-guide.md, +references/prompting-guide.md, and scripts/resolve-latest-model-info.js. diff --git a/plugins/openai-docs/skills/openai-docs/SKILL.md b/plugins/openai-docs/skills/openai-docs/SKILL.md new file mode 100644 index 00000000..46ef30d3 --- /dev/null +++ b/plugins/openai-docs/skills/openai-docs/SKILL.md @@ -0,0 +1,87 @@ +--- +name: "openai-docs" +description: "Use when the user asks how to build with OpenAI products or APIs, needs up-to-date official OpenAI documentation with citations, help choosing the latest model for a use case, or model-upgrade and prompt-upgrade guidance; use the OpenAI docs MCP tools for docs questions, verify API shape with the OpenAPI spec, and restrict fallback browsing to official OpenAI domains." +--- + + +# OpenAI Docs + +Provide authoritative, current guidance from OpenAI developer docs using the developers.openai.com MCP server. "Docs MCP" means `mcp__openaiDeveloperDocs__search_openai_docs` and `mcp__openaiDeveloperDocs__fetch_openai_doc`; for API reference, schema, parameter, or required-field questions, also use `mcp__openaiDeveloperDocs__get_openapi_spec` when available. Official-domain web search is fallback after those tools are unavailable or unhelpful. This skill also owns model selection, API model migration, and prompt-upgrade guidance. + +## API Key Setup + +For requests to build, run, configure, debug, or implement an OpenAI API-backed app, script, CLI, generator, or tool, an API key is required. Confirm `OPENAI_API_KEY` is set in the environment before running anything that calls the API; if it is missing, ask the user to export it. Use this skill directly for docs-only questions, citations, model/API guidance, conceptual explanations, and examples that do not require building or running an API-backed artifact. + +## Workflow Configuration + +### Source Priority + +- Use `mcp__openaiDeveloperDocs__search_openai_docs` to find the most relevant doc pages. +- Fetch the relevant page with `mcp__openaiDeveloperDocs__fetch_openai_doc` before answering. If search is noisy, run a narrower Docs MCP search; when any plausible official OpenAI docs URL is known or found, try fetching that URL through Docs MCP before relying on web-search content. +- For API reference, schema, parameter, or required-field questions, use `mcp__openaiDeveloperDocs__get_openapi_spec` when available to verify the API shape alongside the relevant guide or reference page. +- Use `mcp__openaiDeveloperDocs__list_openai_docs` only when you need to browse or discover pages without a clear query. +- For model-selection, "latest model", or default-model questions, fetch `https://developers.openai.com/api/docs/guides/latest-model.md` first. If that is unavailable, load `references/latest-model.md`. +- For model upgrades or prompt upgrades, run `node scripts/resolve-latest-model-info.js` only when the target is latest/current/default or otherwise unspecified; otherwise preserve the explicitly requested target. +- Preserve explicit target requests: if the user names a target model like "migrate to GPT-5.4", keep that requested target even if `latest-model.md` names a newer model. Mention newer guidance only as optional. +- If current remote guidance is needed, fetch both the returned migration and prompting guide URLs directly. If direct fetch fails, use MCP/search fallback; if that also fails, use bundled fallback references and disclose the fallback. + +## OpenAI product snapshots + +1. Apps SDK: Build ChatGPT apps by providing a web component UI and an MCP server that exposes your app's tools to ChatGPT. +2. Responses API: A unified endpoint designed for stateful, multimodal, tool-using interactions in agentic workflows. +3. Chat Completions API: Generate a model response from a list of messages comprising a conversation. +4. Codex: OpenAI's coding agent for software development that can write, understand, review, and debug code. +5. gpt-oss: Open-weight OpenAI reasoning models (gpt-oss-120b and gpt-oss-20b) released under the Apache 2.0 license. +6. Realtime API: Build low-latency, multimodal experiences including natural speech-to-speech conversations. +7. Agents SDK: A toolkit for building agentic apps where a model can use tools and context, hand off to other agents, stream partial results, and keep a full trace. + +## If the MCP server is unavailable + +This plugin provides the `openaiDeveloperDocs` MCP server (remote HTTP, `https://developers.openai.com/mcp`). If its tools fail or no OpenAI docs resources are available: + +1. Check that the `openai-docs` plugin is installed and enabled, and that the `openaiDeveloperDocs` MCP server shows as connected (`/mcp`). +2. Restart Claude Code and re-run the doc search/fetch. +3. If the server is still unavailable, fall back to official-domain web search (developers.openai.com, platform.openai.com) and cite sources, or use the bundled `references/` files and disclose the fallback. + +## Workflow + +1. Clarify whether the request is general docs lookup, model selection, a model-string upgrade, prompt-upgrade guidance, or broader API/provider migration. +2. For model-selection or upgrade requests, prefer current remote docs over bundled references when the user asks for latest/current/default guidance. + - Fetch `https://developers.openai.com/api/docs/guides/latest-model.md`. + - Find the latest model ID and explicit migration or prompt-guidance links. + - Prefer explicit links from the latest-model page over derived URLs. + - For explicit named-model requests, preserve the requested model target. Mention newer remote guidance only as optional. + - For dynamic latest/current/default upgrades, run `node scripts/resolve-latest-model-info.js`, then fetch both returned guide URLs directly when possible. + - If direct guide fetch fails, use the developer-docs MCP tools or official OpenAI-domain search to find the same guide content. + - If remote docs are unavailable, use bundled fallback references and say that fallback guidance was used. +3. For model upgrades, keep changes narrow: update active OpenAI API model defaults and directly related prompts only when safe. +4. Leave historical docs, examples, eval baselines, fixtures, provider comparisons, provider registries, pricing tables, alias defaults, low-cost fallback paths, and ambiguous older model usage unchanged unless the user explicitly asks to upgrade them. +5. Keep SDK, tooling, IDE, plugin, shell, auth, and provider-environment migrations out of a model-and-prompt upgrade unless the user explicitly asks for them. +6. If an upgrade needs API-surface changes, schema rewiring, tool-handler changes, or implementation work beyond a literal model-string replacement and prompt edits, report it as blocked or confirmation-needed. +7. For general docs lookup, start with a compact, title-like search query of 2-6 essential terms. Do not turn the full user question into a keyword list. Fetch the best page and exact section needed, and answer with concise citations. + +## Reference map + +Read only what you need: + +- `https://developers.openai.com/api/docs/guides/latest-model.md` -> current model-selection and "best/latest/current model" questions. +- `scripts/resolve-latest-model-info.js` -> resolve the latest/current/default model ID plus its migration and prompting guide URLs. +- `references/latest-model.md` -> bundled fallback for model-selection and "best/latest/current model" questions. +- `references/upgrade-guide.md` -> bundled fallback for model upgrade and upgrade-planning requests. +- `references/prompting-guide.md` -> bundled fallback for prompt rewrites and prompt-behavior upgrades. + +## Quality rules + +- Treat OpenAI docs as the source of truth; avoid speculation. +- Keep migration changes narrow and behavior-preserving. +- Prefer prompt-only upgrades when possible. +- Avoid inventing pricing, availability, parameters, API changes, or breaking changes. +- Keep quotes short and within policy limits; prefer paraphrase with citations. +- If multiple pages differ, call out the difference and cite both. +- If docs do not cover the user's need, say so and offer next steps. + +## Tooling notes + +- Use MCP doc tools before web search for OpenAI-related markdown docs. +- If the MCP server is installed but returns no meaningful results, then use web search as a fallback. +- When falling back to web search, restrict to official OpenAI domains (developers.openai.com, platform.openai.com) and cite sources. diff --git a/plugins/openai-docs/skills/openai-docs/references/latest-model.md b/plugins/openai-docs/skills/openai-docs/references/latest-model.md new file mode 100644 index 00000000..a1ffbfbd --- /dev/null +++ b/plugins/openai-docs/skills/openai-docs/references/latest-model.md @@ -0,0 +1,37 @@ +# Latest model guide + +This file is a curated helper. Every recommendation here must be verified against current OpenAI docs before it is repeated to a user. + +## Current model map + +| Model ID | Use for | +| --- | --- | +| `gpt-5.5` | Latest/default text and reasoning model for most new apps, including coding and tool-heavy workflows | +| `gpt-5.5-pro` | Maximum reasoning or quality when latency and cost matter less | +| `gpt-5.4` | Previous default text and reasoning model; use for existing GPT-5.4 integrations | +| `gpt-5.4-mini` | Lower-cost testing and lighter production workflows | +| `gpt-5.4-nano` | High-throughput simple tasks and classification | +| `gpt-5.5` | Explicit no-reasoning text path via `reasoning.effort: none` | +| `gpt-4.1-mini` | Cheaper no-reasoning text | +| `gpt-4.1-nano` | Fastest and cheapest no-reasoning text | +| `gpt-5.3-codex` | Agentic coding, code editing, and tool-heavy coding workflows | +| `gpt-5.1-codex-mini` | Cheaper coding workflows | +| `gpt-image-2` | Best image generation and edit quality | +| `gpt-image-1.5` | Less expensive image generation and edit quality | +| `gpt-image-1-mini` | Cost-optimized image generation | +| `gpt-4o-mini-tts` | Text-to-speech | +| `gpt-4o-mini-transcribe` | Speech-to-text, fast and cost-efficient | +| `gpt-realtime-1.5` | Realtime voice and multimodal sessions | +| `gpt-realtime-mini` | Cheaper realtime sessions | +| `gpt-audio` | Chat Completions audio input and output | +| `gpt-audio-mini` | Cheaper Chat Completions audio workflows | +| `sora-2` | Faster iteration and draft video generation | +| `sora-2-pro` | Higher-quality production video | +| `omni-moderation-latest` | Text and image moderation | +| `text-embedding-3-large` | Higher-quality retrieval embeddings; default in this skill because no best-specific row exists | +| `text-embedding-3-small` | Lower-cost embeddings | + +## Maintenance notes + +- This file will drift unless it is periodically re-verified against current OpenAI docs. +- If this file conflicts with current docs, the docs win. diff --git a/plugins/openai-docs/skills/openai-docs/references/prompting-guide.md b/plugins/openai-docs/skills/openai-docs/references/prompting-guide.md new file mode 100644 index 00000000..0d9273ce --- /dev/null +++ b/plugins/openai-docs/skills/openai-docs/references/prompting-guide.md @@ -0,0 +1,244 @@ +GPT-5.5 works best when prompts define the outcome and leave room for the model to choose an efficient solution path. Compared with earlier models, you can often use shorter, more outcome-oriented prompts: describe what good looks like, what constraints matter, what evidence is available, and what the final answer should contain. + +Avoid carrying over every instruction from an older prompt stack. Legacy prompts often over-specify the process because earlier models needed more help staying on track. With GPT-5.5, that can add noise, narrow the model's search space, or lead to overly mechanical answers. + +For more detail on GPT-5.5 behavior changes, start with the [Using GPT-5.5 guide](/api/docs/guides/latest-model). This guide focuses on prompt changes that follow from those behavior changes. + +The patterns here are starting points. Adapt them to your product surface, tools, evals, and user experience goals. + +## Personality and behavior + +GPT-5.5's default style is efficient, direct, and task-oriented. This is useful for production systems: responses stay focused, behavior is easier to steer, and the model avoids unnecessary conversational padding. + +For customer-facing assistants, support workflows, coaching experiences, and other conversational products, define both personality and collaboration style. + +- **Personality** controls how the assistant sounds: tone, warmth, directness, formality, humor, empathy, and level of polish. +- **Collaboration style** controls how the assistant works: when it asks questions, when it makes assumptions, how proactive it should be, how much context it gives, when it checks work, and how it handles uncertainty or risk. + +Keep both short. Personality instructions should shape the user experience. Collaboration instructions should shape task behavior. Neither should replace clear goals, success criteria, tool rules, or stopping conditions. + +Example personality block for a steady task-focused assistant: + +```text +# Personality +You are a capable collaborator: approachable, steady, and direct. Assume the user is competent and acting in good faith, and respond with patience, respect, and practical helpfulness. + +Prefer making progress over stopping for clarification when the request is already clear enough to attempt. Use context and reasonable assumptions to move forward. Ask for clarification only when the missing information would materially change the answer or create meaningful risk, and keep any question narrow. + +Stay concise without becoming curt. Give enough context for the user to understand and trust the answer, then stop. Use examples, comparisons, or simple analogies when they make the point easier to grasp. When correcting the user or disagreeing, be candid but constructive. When an error is pointed out, acknowledge it plainly and focus on fixing it. + +Match the user's tone within professional bounds. Avoid emojis and profanity by default, unless the user explicitly asks for that style or has clearly established it as appropriate for the conversation. +``` + +Example personality block for an expressive collaborative assistant: + +```text +# Personality +Adopt a vivid conversational presence: intelligent, curious, playful when appropriate, and attentive to the user's thinking. Ask good questions when the problem is blurry, then become decisive once there is enough context. + +Be warm, collaborative, and polished. Conversation should feel easy and alive, but not chatty for its own sake. Offer a real point of view rather than merely mirroring the user, while staying responsive to their goals and constraints. + +Be thoughtful and grounded when the task calls for synthesis or advice. State a clear recommendation when you have enough context, explain important tradeoffs, and name uncertainty without becoming evasive. +``` + +For more expressive products, add warmth, curiosity, humor, or point of view explicitly, but keep the block short. Use personality to shape the experience, not to compensate for unclear goals or missing task instructions. + +## Improve time to first visible token with a preamble + +In streaming applications, users notice how long it takes before the first visible response appears. GPT-5.5 may spend time reasoning, planning, or preparing tool calls before emitting visible text. + +For longer or tool-heavy tasks, prompt the model to start with a short preamble: a brief visible update that acknowledges the request and states the first step. This can improve perceived responsiveness without changing the underlying task. + +Use this pattern when the task may take more than one step, require tool calls, or involve a long-running agent workflow. + +```text +Before any tool calls for a multi-step task, send a short user-visible update that acknowledges the request and states the first step. Keep it to one or two sentences. +``` + +For coding agents that expose separate message phases, you can be more explicit: + +```text +You must always start with an intermediary update before any content in the analysis channel if the task will require calling tools. The user update should acknowledge the request and explain your first step. +``` + +## Outcome-first prompts and stopping conditions + +GPT-5.5 is strongest when the prompt defines the target outcome, success criteria, constraints, and available context, then lets the model choose the path. + +For many tasks, describe the destination rather than every step. This gives the model room to choose the right search, tool, or reasoning strategy for the task. + +Prefer this: + +```text +Resolve the customer's issue end to end. + +Success means: +- the eligibility decision is made from the available policy and account data +- any allowed action is completed before responding +- the final answer includes completed_actions, customer_message, and blockers +- if evidence is missing, ask for the smallest missing field +``` + +**Avoid unnecessary absolute rules.** Older prompts often use strict instructions like `ALWAYS`, `NEVER`, `must`, and `only` to control model behavior. Use those words for true invariants, such as safety rules, required output fields, or actions that should never happen. For judgment calls, such as when to search, ask for clarification, use a tool, or keep iterating, prefer decision rules instead. + +Avoid this style of instruction unless every step is truly required: + +```text +First inspect A, then inspect B, then compare every field, then think through +all possible exceptions, then decide which tool to call, then call the tool, +then explain the entire process to the user. +``` + +Add explicit stopping conditions: + +```text +Resolve the user query in the fewest useful tool loops, but do not let loop minimization outrank correctness, accessible fallback evidence, calculations, or required citation tags for factual claims. + +After each result, ask: "Can I answer the user's core request now with useful evidence and citations for the factual claims?" If yes, answer. +``` + +Define missing-evidence behavior: + +```text +Use the minimum evidence sufficient to answer correctly, cite it precisely, then stop. +``` + +## Formatting + +GPT-5.5 is highly steerable on output format and structure. Use that control when it improves comprehension or product fit. + +Set `text.verbosity`, describe the expected output shape, and reserve heavier structure for cases where it improves comprehension or your product UI needs a stable artifact. The API default for `text.verbosity` is `medium`; use `low` when you prefer shorter, more concise responses. + +Plain conversational formatting: + +```text +Let formatting serve comprehension. Use plain paragraphs as the default format for normal conversation, explanations, reports, documentation, and technical writeups. Keep the presentation clean and readable without making the structure feel heavier than the content. + +Use headers, bold text, bullets, and numbered lists sparingly. Reach for them when the user requests them, when the answer needs clear comparison or ranking, or when the information would be harder to scan as prose. Otherwise, favor short paragraphs and natural transitions. + +Respect formatting preferences from the user. If they ask for a terse answer, minimal formatting, no bullets, no headers, or a specific structure, follow that preference unless there is a strong reason not to. +``` + +Add explicit audience and length guidance: + +```text +Write for a senior business audience. Keep the answer under 400 words. Use short paragraphs and only include bullets when they improve scannability. Prioritize the conclusion first, then the reasoning, then caveats. +``` + +For editing, rewriting, summaries, or customer-facing messages, tell the model what to preserve before asking it to improve style. This pattern is useful when you want polish without expansion. + +```text +Preserve the requested artifact, length, structure, and genre first. Quietly improve clarity, flow, and correctness. Do not add new claims, extra sections, or a more promotional tone unless explicitly requested. +``` + +## Grounding, citations, and retrieval budgets + +For grounded answers, citation behavior should be part of the prompt. Define what needs support, what counts as enough evidence, and how the model should behave when evidence is missing. Absence of evidence shouldn't automatically become a factual "no." For more details and examples, see the [citation formatting guide](/api/docs/guides/citation-formatting). + +### Add an explicit retrieval budget + +Retrieval budgets are stopping rules for search. They tell the model when enough evidence is enough. + +```text +For ordinary Q&A, start with one broad search using short, discriminative keywords. If the top results contain enough citable support for the core request, answer from those results instead of searching again. + +Make another retrieval call only when: +- The top results do not answer the core question. +- A required fact, parameter, owner, date, ID, or source is missing. +- The user asked for exhaustive coverage, a comparison, or a comprehensive list. +- A specific document, URL, email, meeting, record, or code artifact must be read. +- The answer would otherwise contain an important unsupported factual claim. + +Do not search again to improve phrasing, add examples, cite nonessential details, or support wording that can safely be made more generic. +``` + +## Creative drafting guardrails + +For drafting tasks, tell the model which claims must come from sources and which parts may be creatively written. This is especially important for slides, launch copy, customer summaries, talk tracks, leadership blurbs, and narrative framing. + +```text +For creative or generative requests such as slides, leadership blurbs, outbound copy, summaries for sharing, talk tracks, or narrative framing, distinguish source-backed facts from creative wording. + +- Use retrieved or provided facts for concrete product, customer, metric, roadmap, date, capability, and competitive claims, and cite those claims. +- Do not invent specific names, first-party data claims, metrics, roadmap status, customer outcomes, or product capabilities to make the draft sound stronger. +- If there is little or no citable support, write a useful generic draft with placeholders or clearly labeled assumptions rather than unsupported specifics. +``` + +## Frontend engineering and visual taste + +For frontend work, refer to the [example instructions](/api/docs/guides/frontend-prompt) for practical ways to steer UI quality. They cover product and user context, design-system alignment, first-screen usability, familiar controls, expected states, responsive behavior, and common generated-UI defaults to avoid, such as generic heroes, nested cards, decorative gradients, visible instructional text, and broken layouts. + +## Prompt the model to check its work + +Give GPT-5.5 access to tools that let it check outputs when validation is possible. + +For coding agents, ask for concrete validation commands: + +```text +After making changes, run the most relevant validation available: +- targeted unit tests for changed behavior +- type checks or lint checks when applicable +- build checks for affected packages +- a minimal smoke test when full validation is too expensive + +If validation cannot be run, explain why and describe the next best check. +``` + +For visual artifacts, ask for inspection after rendering: + +```text +Render the artifact before finalizing. Inspect the rendered output for layout, clipping, spacing, missing content, and visual consistency. Revise until the rendered output matches the requirements. +``` + +For engineering and planning tasks, make implementation plans traceable: + +```text +For implementation plans, include: +- requirements and where each is addressed +- named resources, files, APIs, or systems involved +- state transitions or data flow where relevant +- validation commands or checks +- failure behavior +- privacy and security considerations +- open questions that materially affect implementation +``` + +## Phase parameter + +Starting with GPT-5.4, long-running or tool-heavy Responses workflows can use assistant-item `phase` values to distinguish intermediate updates from final answers. GPT-5.5 uses the same pattern. + +If you use `previous_response_id`, the API preserves prior assistant state automatically. If your application manually replays assistant output items into the next request, preserve each original `phase` value and pass it back unchanged. This matters most when a response includes preambles, repeated tool calls, or a final answer after intermediate assistant updates. + +```text +If manually replaying assistant items: +- Preserve assistant `phase` values exactly. +- Use `phase: "commentary"` for intermediate user-visible updates. +- Use `phase: "final_answer"` for the completed answer. +- Do not add `phase` to user messages. +``` + +## Suggested prompt structure + +Use this structure as a starting point for complex prompts. Keep each section short. Add detail only where it changes behavior. + +```text +Role: [1-2 sentences defining the model's function, context, and job] + +# Personality +[tone, demeanor, and collaboration style] + +# Goal +[user-visible outcome] + +# Success criteria +[what must be true before the final answer] + +# Constraints +[policy, safety, business, evidence, and side-effect limits] + +# Output +[sections, length, and tone] + +# Stop rules +[when to retry, fallback, abstain, ask, or stop] +``` diff --git a/plugins/openai-docs/skills/openai-docs/references/upgrade-guide.md b/plugins/openai-docs/skills/openai-docs/references/upgrade-guide.md new file mode 100644 index 00000000..b29f137b --- /dev/null +++ b/plugins/openai-docs/skills/openai-docs/references/upgrade-guide.md @@ -0,0 +1,181 @@ +# Upgrading to GPT-5.5 + +Use this guide when the user explicitly asks to upgrade an existing integration to GPT-5.5. Pair it with current OpenAI docs lookups. The default target string is `gpt-5.5`. + +## Freshness check + +Before applying this bundled guide for a latest/current/default model upgrade, run `node scripts/resolve-latest-model-info.js` from the OpenAI Docs skill directory. + +- If the command returns `modelSlug: "gpt-5p5"`, continue with this bundled guide and use `references/prompting-guide.md` when prompt updates are needed. +- If the command returns a different `modelSlug`, fetch both the returned `migrationGuideUrl` and `promptingGuideUrl` and use them as the current source of truth instead of the bundled references. +- If the command fails, metadata is missing, or either remote guide cannot be fetched, continue with bundled fallback references and say the remote freshness check was unavailable. +- If the user explicitly named a target model, preserve that target and use current docs only to check compatibility or caveats. + +## Upgrade posture + +Upgrade with the narrowest safe change set: + +- replace the model string first +- update only the prompts that are directly tied to that model usage +- do not automatically upgrade older or ambiguous model usages that may be intentionally pinned, such as historical docs, examples, tests, eval baselines, comparison code, or low-cost fallback/routing paths. Unless the user explicitly asks to upgrade all model usage, leave those sites unchanged and list them as confirmation-needed +- prefer prompt-only upgrades when possible +- if the upgrade would require API-surface changes, parameter rewrites, tool rewiring, provider migration, or broader code edits, mark it as blocked instead of stretching the scope + +## Upgrade workflow + +1. Inventory current model usage. + - Search for model strings, client calls, and prompt-bearing files. + - Include inline prompts, prompt templates, YAML or JSON configs, Markdown docs, and saved prompts when they are clearly tied to a model usage site. +2. Pair each model usage with its prompt surface. + - Prefer the closest prompt surface first: inline system or developer text, then adjacent prompt files, then shared templates. + - If you cannot confidently tie a prompt to the model usage, say so instead of guessing. +3. Classify the source model family. + - Common buckets: GPT-5.4, GPT-5.3-Codex or GPT-5.2-Codex, earlier GPT-5.x, GPT-4o or GPT-4.1, reasoning models such as o1 or o3 or o4-mini, third-party model, or mixed and unclear. +4. Decide the upgrade class. + - `model string only` + - `model string + light prompt rewrite` + - `blocked without code changes` +5. Run the compatibility gate. + - Check whether the current integration can accept `gpt-5.5` without API-surface changes or implementation changes. + - Check whether structured outputs, tool schemas, function names, and downstream parsers can remain unchanged. + - For long-running Responses or tool-heavy agents, check whether `phase` is already preserved or round-tripped when the host replays assistant items or uses preambles. + - If compatibility depends on code changes, return `blocked`. + - If compatibility is unclear, return `unknown` rather than improvising. +6. Apply the upgrade when it is in scope. + - Default replacement string: `gpt-5.5`. + - Keep the intervention small and behavior-preserving. + - Start from the current reasoning effort when it is visible unless there is a measured reason to change it. + - For in-scope changes, update the model string and directly related prompts. + - For blocked or unknown changes, do not edit; report the blocker or uncertainty. +7. Summarize the result. + - `Current model usage` + - `Model-string updates` + - `Reasoning-effort handling` + - `Prompt updates` + - `Structured output and formatting assessment` + - `Tool-use assessment` when the flow uses tools, retrieval, or terminal actions + - `Phase assessment` when the flow is long-running, replayed, or tool-heavy + - `Compatibility check` + - `Validation performed` + +Output rule: + +- For each usage site, state the starting reasoning-effort recommendation. +- If the repo exposes the current reasoning setting, recommend preserving it first unless current OpenAI docs say otherwise. +- If the repo does not expose the current setting, recommend not adding one unless current OpenAI docs require it. + +## Upgrade outcomes + +### `model string only` + +Choose this when: + +- the source model is GPT-5.4 +- the existing prompts are already short, explicit, and task-bounded +- the workflow does not rely on strict output formats, tool-call behavior, batch completeness, or long-horizon execution that should be validated after the upgrade +- there are no obvious compatibility blockers + +Default action: + +- replace the model string with `gpt-5.5` +- preserve the current reasoning effort +- keep prompts unchanged +- validate behavior with existing tests, realistic spot checks, or an existing eval suite when one is already available + +### `model string + light prompt rewrite` + +Choose this when: + +- the task needs stronger completeness, citation discipline, verification, or dependency handling +- the upgraded model becomes too verbose, too dense, or hard to scan unless formatting is constrained +- the workflow has strict output shape requirements and lacks an explicit format contract, schema, or parser validation +- the workflow is research-heavy and needs stronger handling of sparse or empty retrieval results +- the workflow is coding-oriented, terminal-based, tool-heavy, or multi-agent, but the existing API surface and tool definitions can remain unchanged + +Default action: + +- replace the model string with `gpt-5.5` +- preserve the current reasoning effort for the first pass +- make only the smallest prompt edits needed for the observed workflow risk +- read the [GPT-5.5 prompting guide](/api/docs/guides/prompt-guidance?model=gpt-5.5) to choose the smallest prompt changes that recover or improve behavior +- avoid broad prompt cleanup unrelated to the upgrade +- for research workflows, add citation rules, retrieval budgets, missing-evidence behavior, and validation guidance from the prompting guide +- for dependency-aware or tool-heavy workflows, add prerequisite checks, missing-context handling, explicit tool budgets, stop conditions, and validation guidance +- for coding or terminal workflows, add repo-specific constraints, acceptance criteria, and concrete validation commands +- for multi-agent support or triage workflows, add task ownership, handoff, completeness, and stopping criteria +- for long-running Responses agents with preambles or multiple assistant messages, explicitly review whether `phase` is already handled; if adding or preserving `phase` would require code edits, mark the path as `blocked` +- do not classify a coding or tool-using Responses workflow as `blocked` just because the visible snippet is minimal; prefer `model string + light prompt rewrite` unless the repo clearly shows that a safe GPT-5.5 path would require host-side code changes + +### `blocked` + +Choose this when: + +- the upgrade appears to require API-surface changes +- the upgrade appears to require parameter rewrites or reasoning-setting changes that are not exposed outside implementation code +- the upgrade would require changing tool definitions, tool handler wiring, or schema contracts +- the user is asking for a tooling, IDE, plugin, shell, or environment migration rather than a model and prompt migration +- the integration depends on provider-specific APIs that do not map to the current OpenAI API surface without implementation work +- you cannot confidently identify the prompt surface tied to the model usage + +Default action: + +- do not improvise a broader upgrade +- report the blocker and explain that the fix is out of scope for this guide +- if useful, describe the smallest follow-up implementation task that would unblock the migration + +## Compatibility checklist + +Before applying or recommending a model-and-prompt-only upgrade, check: + +1. Can the current host accept the `gpt-5.5` model string without changing client code or API surface? +2. Are the related prompts identifiable and editable? +3. Does the host depend on behavior that likely needs API-surface changes, parameter rewrites, provider migration, or tool rewiring? +4. Would the likely fix be prompt-only, or would it need implementation changes? +5. Is the prompt surface close enough to the model usage that you can make a targeted change instead of a broad cleanup? +6. Do strict structured outputs, schemas, or downstream parsers still have an explicit contract? +7. For long-running Responses or tool-heavy agents, is `phase` already preserved if the host relies on preambles, replayed assistant items, or multiple assistant messages? +8. Are latency, token, or price assumptions validated by tests, realistic spot checks, or an existing eval suite rather than inferred from general model positioning? + +If item 1 is no, items 3 through 4 point to implementation work, or item 7 is no and the fix needs code changes, return `blocked`. + +If item 2 is no, return `unknown` unless the user can point to the prompt location. + +Important: + +- Existing use of tools, agents, or multiple usage sites is not by itself a blocker. +- If the current host can keep the same API surface and the same tool definitions, prefer `model string + light prompt rewrite` over `blocked`. +- Reserve `blocked` for cases that truly require implementation changes, not cases that only need stronger prompt steering. +- Do not claim token savings without task-level validation. + +## Scope boundaries + +This guide may: + +- update or recommend updated model strings +- update or recommend updated prompts +- inspect code and prompt files to understand where those changes belong +- inspect whether existing Responses flows already preserve `phase` +- flag compatibility blockers +- propose validation with existing tests, realistic spot checks, or existing eval suites + +This guide may not: + +- move Chat Completions code to Responses +- move Responses code to another API surface +- migrate SDKs, APIs, IDE configuration, shell hooks, plugins, or provider-specific tooling +- rewrite parameter shapes +- change tool definitions or tool-call handling +- change structured-output wiring +- add or retrofit `phase` handling in implementation code +- edit business logic, orchestration logic, SDK usage, IDE configuration, shell hooks, or plugin integration behavior except for model-string replacements and directly related prompt edits + +If a safe GPT-5.5 upgrade requires any of those changes, mark the path as blocked and out of scope. + +## Validation plan + +- Validate each upgraded usage site with existing tests, realistic spot checks, or an existing eval suite when one is already available. +- Compare against the current GPT-5.4 baseline when available. +- Check task success, retry count, tool-call count, total tokens, latency, output shape, and user-visible quality. +- For specialized workflows, validate the contract that matters most instead of judging only general output quality. +- If prompt edits were added, confirm each block is doing real work instead of adding noise. +- If the workflow has downstream impact, add a lightweight verification pass before finalization. diff --git a/plugins/openai-docs/skills/openai-docs/scripts/resolve-latest-model-info.js b/plugins/openai-docs/skills/openai-docs/scripts/resolve-latest-model-info.js new file mode 100644 index 00000000..1bd16ac9 --- /dev/null +++ b/plugins/openai-docs/skills/openai-docs/scripts/resolve-latest-model-info.js @@ -0,0 +1,147 @@ +#!/usr/bin/env node + +const fs = require("node:fs/promises"); +const path = require("node:path"); + +const DEFAULT_URL = + "https://developers.openai.com/api/docs/guides/latest-model.md"; +const DEFAULT_BASE_URL = "https://developers.openai.com"; + +function parseArgs(argv) { + const args = { + source: process.env.LATEST_MODEL_URL || DEFAULT_URL, + baseUrl: process.env.LATEST_MODEL_BASE_URL || DEFAULT_BASE_URL, + }; + + for (let i = 2; i < argv.length; i += 1) { + const arg = argv[i]; + if (arg === "--source" || arg === "--url") { + args.source = argv[i + 1]; + i += 1; + } else if (arg === "--base-url") { + args.baseUrl = argv[i + 1]; + i += 1; + } + } + + return args; +} + +async function readSource(source) { + if (source.startsWith("file://")) { + return fs.readFile(new URL(source), "utf8"); + } + + if (!/^https?:\/\//.test(source)) { + return fs.readFile(path.resolve(source), "utf8"); + } + + const response = await fetch(source, { + headers: { accept: "text/markdown,text/plain,*/*" }, + }); + + if (!response.ok) { + throw new Error(`failed to fetch ${source}: ${response.status}`); + } + + return response.text(); +} + +function parseIndentedInfo(lines, startIndex) { + const info = {}; + + for (let i = startIndex + 1; i < lines.length; i += 1) { + const line = lines[i]; + if (!line.trim()) { + continue; + } + + const match = line.match(/^ {2}([A-Za-z][A-Za-z0-9_-]*):\s*(.+?)\s*$/); + if (!match) { + break; + } + + info[match[1]] = match[2].replace(/^["']|["']$/g, ""); + } + + return info; +} + +function parseFlatInfo(block) { + const info = {}; + + for (const line of block.split(/\r?\n/)) { + const match = line.match(/^\s*([A-Za-z][A-Za-z0-9_-]*):\s*(.+?)\s*$/); + if (match) { + info[match[1]] = match[2].replace(/^["']|["']$/g, ""); + } + } + + return info; +} + +function extractLatestModelInfo(markdown) { + const lines = markdown.split(/\r?\n/); + const latestModelInfoIndex = lines.findIndex((line) => + /^latestModelInfo:\s*$/.test(line) + ); + + if (latestModelInfoIndex >= 0) { + return parseIndentedInfo(lines, latestModelInfoIndex); + } + + const commentMatch = markdown.match( + //m + ); + if (commentMatch) { + return parseFlatInfo(commentMatch[1]); + } + + return undefined; +} + +function modelToSkillSlug(model) { + return model.trim().replace(/\./g, "p"); +} + +function absoluteUrl(baseUrl, value) { + return new URL(value, baseUrl).toString(); +} + +function normalizeInfo(info, baseUrl) { + const model = info?.model?.trim(); + const migrationGuide = info?.migrationGuide?.trim(); + const promptingGuide = info?.promptingGuide?.trim(); + + if (!model || !migrationGuide || !promptingGuide) { + throw new Error( + "latestModelInfo must include model, migrationGuide, and promptingGuide" + ); + } + + return { + model, + modelSlug: modelToSkillSlug(model), + migrationGuideUrl: absoluteUrl(baseUrl, migrationGuide), + promptingGuideUrl: absoluteUrl(baseUrl, promptingGuide), + }; +} + +async function main() { + const { source, baseUrl } = parseArgs(process.argv); + const markdown = await readSource(source); + const info = extractLatestModelInfo(markdown); + + if (!info) { + throw new Error(`latestModelInfo block not found in ${source}`); + } + + process.stdout.write( + `${JSON.stringify(normalizeInfo(info, baseUrl), null, 2)}\n` + ); +} + +main().catch((error) => { + console.error(error.message); + process.exit(1); +}); diff --git a/release-please-config.json b/release-please-config.json index f47c5d3d..ff626d23 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -898,6 +898,32 @@ } ] }, + "plugins/openai-docs": { + "release-type": "simple", + "component": "openai-docs", + "extra-files": [ + { + "type": "json", + "path": ".claude-plugin/plugin.json", + "jsonpath": "$.version" + }, + { + "type": "json", + "path": ".codex-plugin/plugin.json", + "jsonpath": "$.version" + }, + { + "type": "json", + "path": "plugin.json", + "jsonpath": "$.version" + }, + { + "type": "json", + "path": ".cursor-plugin/plugin.json", + "jsonpath": "$.version" + } + ] + }, "plugins/java-development": { "release-type": "simple", "component": "java-development", From 858b6a1f87da8e37e9a8dff687eae8df6dc8042d Mon Sep 17 00:00:00 2001 From: Minsu Lee Date: Tue, 7 Jul 2026 12:54:07 +0900 Subject: [PATCH 2/4] fix(openai-docs): validate CLI-supplied path in latest-model resolver Confine a CLI/env-supplied local source path to the current working directory before reading it, addressing SonarCloud jssecurity:S8707 (path canonicalized from CLI-controlled data must be validated). The default remote URL path and in-tree reference reads are unaffected. NOTICE updated to record the hardening. --- plugins/openai-docs/skills/openai-docs/NOTICE | 6 +++++- .../openai-docs/scripts/resolve-latest-model-info.js | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/plugins/openai-docs/skills/openai-docs/NOTICE b/plugins/openai-docs/skills/openai-docs/NOTICE index 77527841..903cd06a 100644 --- a/plugins/openai-docs/skills/openai-docs/NOTICE +++ b/plugins/openai-docs/skills/openai-docs/NOTICE @@ -20,6 +20,10 @@ The original sample targets the Codex agent. For use as a Claude Code plugin guidance, model-selection, migration, and prompting guidance are retained. - Removed scripts/fetch-codex-manual.mjs (Codex manual fetch helper). - Removed agents/openai.yaml and assets/ (Codex interface metadata and icons). +- scripts/resolve-latest-model-info.js: added a path-validation guard so a + CLI/env-supplied local source path is confined to the current working + directory before it is read (static-analysis hardening; behavior for the + default remote URL and normal in-tree reference paths is unchanged). Retained unchanged: references/latest-model.md, references/upgrade-guide.md, -references/prompting-guide.md, and scripts/resolve-latest-model-info.js. +and references/prompting-guide.md. diff --git a/plugins/openai-docs/skills/openai-docs/scripts/resolve-latest-model-info.js b/plugins/openai-docs/skills/openai-docs/scripts/resolve-latest-model-info.js index 1bd16ac9..1cce80f3 100644 --- a/plugins/openai-docs/skills/openai-docs/scripts/resolve-latest-model-info.js +++ b/plugins/openai-docs/skills/openai-docs/scripts/resolve-latest-model-info.js @@ -33,7 +33,14 @@ async function readSource(source) { } if (!/^https?:\/\//.test(source)) { - return fs.readFile(path.resolve(source), "utf8"); + // `source` is CLI/env-controlled; validate the canonicalized path stays + // within the current working directory before reading (guards traversal). + const allowedBase = path.resolve(process.cwd()); + const resolved = path.resolve(allowedBase, source); + if (resolved !== allowedBase && !resolved.startsWith(allowedBase + path.sep)) { + throw new Error(`refusing to read outside ${allowedBase}: ${resolved}`); + } + return fs.readFile(resolved, "utf8"); } const response = await fetch(source, { From f188a6d29bd548afc37592cb04608c43c2521897 Mon Sep 17 00:00:00 2001 From: Minsu Lee Date: Tue, 7 Jul 2026 12:59:27 +0900 Subject: [PATCH 3/4] chore(openai-docs): exclude vendored openai-docs skill from Codacy The openai-docs skill is vendored from openai/codex (Apache-2.0). Codacy's heuristic rules (detect-non-literal-fs-filename, detect-object-injection) flag its resolve-latest-model-info.js regardless of validation. Follow the repo's documented convention for vendored code and exclude the skill path, matching the existing skillopt-sleep / external-plugins exclusions. --- .codacy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.codacy.yml b/.codacy.yml index 73dadcf7..d118449a 100644 --- a/.codacy.yml +++ b/.codacy.yml @@ -3,4 +3,5 @@ # so exclude it from Codacy static analysis. exclude_paths: - "plugins/skillopt-sleep/skillopt_sleep/**" + - "plugins/openai-docs/skills/openai-docs/**" - "external-plugins/**" From 3e5417a93a9a2e70127b2126fc5c21004ab11a98 Mon Sep 17 00:00:00 2001 From: Minsu Lee Date: Tue, 7 Jul 2026 13:29:23 +0900 Subject: [PATCH 4/4] chore(openai-docs): apply AI code review suggestions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - readSource: confine file:// URLs to the working directory too (the guard previously only covered plain paths, so a file:// source could still read arbitrary host files) — Greptile P1 / cubic P1 - parseArgs: throw a clear error when --source/--url/--base-url is given without a value instead of passing undefined downstream — Gemini - NOTICE updated to record the expanded hardening --- plugins/openai-docs/skills/openai-docs/NOTICE | 8 ++++--- .../scripts/resolve-latest-model-info.js | 22 +++++++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/plugins/openai-docs/skills/openai-docs/NOTICE b/plugins/openai-docs/skills/openai-docs/NOTICE index 903cd06a..7578f6b4 100644 --- a/plugins/openai-docs/skills/openai-docs/NOTICE +++ b/plugins/openai-docs/skills/openai-docs/NOTICE @@ -21,9 +21,11 @@ The original sample targets the Codex agent. For use as a Claude Code plugin - Removed scripts/fetch-codex-manual.mjs (Codex manual fetch helper). - Removed agents/openai.yaml and assets/ (Codex interface metadata and icons). - scripts/resolve-latest-model-info.js: added a path-validation guard so a - CLI/env-supplied local source path is confined to the current working - directory before it is read (static-analysis hardening; behavior for the - default remote URL and normal in-tree reference paths is unchanged). + CLI/env-supplied local source path — both plain paths and `file://` URLs — + is confined to the current working directory before it is read, and added + missing-value validation for the --source/--url/--base-url options + (static-analysis and review hardening; behavior for the default remote URL + and normal in-tree reference paths is unchanged). Retained unchanged: references/latest-model.md, references/upgrade-guide.md, and references/prompting-guide.md. diff --git a/plugins/openai-docs/skills/openai-docs/scripts/resolve-latest-model-info.js b/plugins/openai-docs/skills/openai-docs/scripts/resolve-latest-model-info.js index 1cce80f3..d9f7bedd 100644 --- a/plugins/openai-docs/skills/openai-docs/scripts/resolve-latest-model-info.js +++ b/plugins/openai-docs/skills/openai-docs/scripts/resolve-latest-model-info.js @@ -2,6 +2,7 @@ const fs = require("node:fs/promises"); const path = require("node:path"); +const { fileURLToPath } = require("node:url"); const DEFAULT_URL = "https://developers.openai.com/api/docs/guides/latest-model.md"; @@ -16,9 +17,15 @@ function parseArgs(argv) { for (let i = 2; i < argv.length; i += 1) { const arg = argv[i]; if (arg === "--source" || arg === "--url") { + if (i + 1 >= argv.length) { + throw new Error(`missing value for option ${arg}`); + } args.source = argv[i + 1]; i += 1; } else if (arg === "--base-url") { + if (i + 1 >= argv.length) { + throw new Error(`missing value for option ${arg}`); + } args.baseUrl = argv[i + 1]; i += 1; } @@ -28,15 +35,16 @@ function parseArgs(argv) { } async function readSource(source) { - if (source.startsWith("file://")) { - return fs.readFile(new URL(source), "utf8"); - } - if (!/^https?:\/\//.test(source)) { - // `source` is CLI/env-controlled; validate the canonicalized path stays - // within the current working directory before reading (guards traversal). + // Local read. `source` is CLI/env-controlled, so resolve both plain paths + // and `file://` URLs to a real filesystem path and confine it to the + // current working directory before reading (guards path traversal — a + // `file://` URL must not escape the guard the way a plain path cannot). + const localPath = source.startsWith("file://") + ? fileURLToPath(source) + : source; const allowedBase = path.resolve(process.cwd()); - const resolved = path.resolve(allowedBase, source); + const resolved = path.resolve(allowedBase, localPath); if (resolved !== allowedBase && !resolved.startsWith(allowedBase + path.sep)) { throw new Error(`refusing to read outside ${allowedBase}: ${resolved}`); }