Skip to content
Skill

Upstream patches

Lets an agent create, amend, remove and rebase Terraform provider submodule patches

Upstream patches is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
82
Last commit
License
Apache-2.0
Listing updated

Similar skills

About Upstream patches

This skill manages a set of patch files that sit on top of an upstream Terraform provider git submodule. It walks the agent through finding which patch owns a given file or hunk, then amending that patch commit rather than adding a new one, so regressions get fixed in place. It also covers deleting a whole patch, stripping selected hunks or files out of a patch, and rebasing the patch stack onto a newer upstream commit.

The workflow is built around the upstream.sh helper, which switches the submodule into a checkout mode where patches become commits, and then writes them back to patch files on check-in. The guide prefers non-interactive history rewriting with cherry-picks and warns against hand-editing patch files, interactive rebases and destructive re-initialization. It also gives a checklist for verifying patch counts before and after check-in and explains how to recover an interrupted checkout.

It expects a Terraform provider repository laid out with an upstream/ submodule and a patches/ folder, plus git and ripgrep or grep available in the shell.

When your agent uses it

Create, amend, remove, and rebase patches for Terraform provider submodules using `./scripts/upstream.sh`. Use when `upgrade-provider` or manual patch work needs owning-patch lookup, patch conflict fixes, patch/hunk removal, or upstream rebase.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 3 files (6 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the pulumi plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add pulumi/agent-skills
/plugin install pulumi@pulumi-agent-skills

Or copy only this skill to ~/.claude/skills/upstream-patches:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pulumi/agent-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/upstream-patches &&
cp -R "$tmp/package-maintenance/skills/upstream-patches" ~/.claude/skills/upstream-patches &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/upstream-patches inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/upstream-patches to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pulumi/agent-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/upstream-patches &&
cp -R "$tmp/package-maintenance/skills/upstream-patches" ~/.agents/skills/upstream-patches &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/upstream-patches inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/upstream-patches to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pulumi/agent-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/upstream-patches &&
cp -R "$tmp/package-maintenance/skills/upstream-patches" ~/.cursor/skills/upstream-patches &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/upstream-patches inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/pulumi/agent-skills.git --path package-maintenance/skills/upstream-patches

Or copy the folder to ~/.gemini/skills/upstream-patches yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/upstream-patches:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/pulumi/agent-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/upstream-patches &&
cp -R "$tmp/package-maintenance/skills/upstream-patches" ~/.copilot/skills/upstream-patches &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/upstream-patches inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/pulumi/agent-skills.git

Then copy agent-skills/package-maintenance/skills/upstream-patches into your agent's skills folder as upstream-patches. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Owning patch lookup
Finds which patch file and commit touched a given path or unique code snippet.
Amend existing patches
Rewrites the owning patch commit and replays later patches so fixes stay in the right place.
Remove patches or hunks
Deletes a full patch file or reverts selected files and hunks from one patch.
Rebase onto upstream
Moves the patch stack onto a new upstream commit and writes updated patch files.
Checkout and check-in flow
Uses upstream.sh to switch the submodule into patch-editing mode and back.
Recovery guidance
Explains how to resume an interrupted checkout or rebase without losing work.

Good for

  • Fix a regression introduced by an earlier provider patch
  • Remove a patch that is no longer needed after an upstream change
  • Strip unwanted doc changes out of an existing patch
  • Rebase the provider patches onto a new upstream release
  • Find which patch modifies a particular file in the provider

Upstream patches FAQ

When does Upstream patches trigger?

It is meant for upgrade-provider runs or manual patch work that needs owning-patch lookup, patch conflict fixes, patch or hunk removal, or an upstream rebase.

Will Upstream patches create new patches by default?

No. The guide says to amend the owning patch for regressions and to create a new patch only when the user explicitly asks.

Does Upstream patches require any scripts?

It relies on ./scripts/upstream.sh in the provider repository; the skill folder itself contains no scripts.

Are edits under upstream/ kept?

Edits made outside checkout mode are ephemeral during upgrade-provider, because the tool resets submodule state.

How do I install Upstream patches in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/upstream-patches to use it in all your projects, or to .claude/skills/upstream-patches in one project. Or install the pulumi plugin, which includes it: /plugin marketplace add pulumi/agent-skills, then /plugin install pulumi@pulumi-agent-skills.

Does Upstream patches run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Upstream patches?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Upstream patches?

The closest alternatives to Upstream patches are Pulumi upgrade provider, Patching bugs, Using knowledge patch, Rebase current branch and Provider upgrade.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from pulumi/agent-skills

  1. Hands the current coding thread off to a new Pulumi Neo task

    • Open source
    • 82 GitHub stars
    • Cloud and infrastructure
  2. Guides an agent through converting AWS CloudFormation stacks into Pulumi programs

    • Open source
    • 82 GitHub stars
    • Cloud and infrastructure
  3. Guides an agent through converting or importing Azure ARM and Bicep templates into Pulumi

    • Open source
    • 82 GitHub stars
    • Cloud and infrastructure
  4. Guides an agent through migrating an AWS CDK app to Pulumi with a PR-ready report

    • Open source
    • 82 GitHub stars
    • Cloud and infrastructure
  5. Guides an agent through migrating Terraform or OpenTofu projects and state into Pulumi

    • Open source
    • 82 GitHub stars
    • Cloud and infrastructure