Prompt Buddy logoPrompt Buddy

openai · OpenAI Platform Docs

Apply Patch

Teaches how to implement an iterative code editing workflow using the applypatch tool, including calling the Responses API, executing patch operations in a local environment, and reporting results back to the model.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Apply Patch

Teaches how to implement an iterative code editing workflow using the applypatch tool, including calling the Responses API, executing patch operations in a local environment, and reporting results back to the model.

When To Use

Use when you need to implement an agentic workflow that allows a model to perform multi-file refactors, bug fixes, or automated migrations by emitting and applying structured diffs to a codebase.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/apply-patch-workflow-guide.mdA guide explaining how to use the apply-patch tool to create, update, and delete files in a codebase using structured diffs.Questions about a guide explaining how to use the apply-patch tool to create, update, and delete files in a codebase using structured...

What This Skill Covers

  • The applypatch tool lets GPT-5.1 create, update, and delete files in your codebase using structured diffs. Instead of just suggesting edits, the model emits...
  • Main sections: When to use, Use apply patch tool with Responses API, Example: Renaming a function with Apply Patch Tool, Apply patch operations, Implementing the patch harness.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.openai.com/api/docs/guides/tools-apply-patch.md