upstream-patches

upstream-patches is a skill for Claude Code, Codex from pulumi/agent-skills. It costs 58 tokens per session (1,352 once invoked), scanned A, original, Apache-2.0.

A guide for managing patches applied to a Terraform provider kept in a Git submodule. It uses the repository's upstream script to create, edit, remove, and rebase those patches.

In plain words
What is it for?
Use it to find the patch responsible for a change, amend an existing patch, resolve conflicts during an upstream rebase, or write edited patches back to the repository.
Why use it?
It prevents changes from being made directly in the upstream checkout, where they may be lost or fail to become part of the maintained patch set.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./scripts/upstream.sh checkout.

Part of the pulumi-package-maintenance plugin — 2 skills shipped together

Good fit Use it to find the patch responsible for a change, amend an existing patch, resolve conflicts during an upstream rebase, or write edited patches back to the repository.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/pulumi/agent-skills
agentmods
npx agentmods add skills/pulumi/agent-skills/upstream-patches

Made for: Claude Code, Codex.

Or install pulumi-package-maintenance, the plugin that ships this one along with the rest of its 2 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for upstream-patches

README.md
[![agentmods](https://agentmods.dev/badge/skills/pulumi/agent-skills/upstream-patches/github.svg)](https://agentmods.dev/skills/pulumi/agent-skills/upstream-patches)
Your own site
<a href="https://agentmods.dev/skills/pulumi/agent-skills/upstream-patches"><img src="https://agentmods.dev/badge/skills/pulumi/agent-skills/upstream-patches/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for upstream-patches

Your own site · 80×15
<a href="https://agentmods.dev/skills/pulumi/agent-skills/upstream-patches"><img src="https://agentmods.dev/badge/skills/pulumi/agent-skills/upstream-patches.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,352 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 31 Mar 2026
  • Snyk warn 31 Mar 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 106
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00058 $0.01352
Opus 5 $0.00029 $0.00676
Sonnet 5 $0.00012 $0.00270
Haiku 4.5 $0.00006 $0.00135

Measured 11d ago against content hash 56a593f44d1b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

upstream-patches scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

package-maintenance/skills/upstream-patches/SKILL.md · 173 lines

How it starts

The opening of the file, as written. The whole thing — 173 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Upstream Patches

upstream/ is a git submodule pointing to the upstream Terraform provider. patches/ contains patch files applied on top of it. Use ./scripts/upstream.sh to manage patch state.

Default Behavior

  • If fixing a regression introduced by an existing patch, amend the owning patch commit.
  • Do not create a new patch unless the user explicitly asks.

Commands Reference

Command Description
./scripts/upstream.sh init Initialize upstream and apply patches to working directory
./scripts/upstream.sh init -f Destructively discard checkout/rebase state and re-initialize upstream
./scripts/upstream.sh checkout Create branch with patches as commits for editing
./scripts/upstream.sh rebase -i Interactively edit patch commits
./scripts/upstream.sh rebase -o <commit> Rebase patches onto a new upstream commit
./scripts/upstream.sh check_in Write commits back to patches and exit checkout mode

Guardrails

  • Never commit directly to upstream/ without checkout/check_in.
  • Direct edits under upstream/ outside checkout are ephemeral during upgrade-provider; the tool resets submodule state.
  • Do not hand-edit patches/*.patch unless intentionally doing raw patch surgery.
  • Prefer non-interactive rewrite flow over interactive rebase for agents.

Find Owning Patch First

Before editing patch content, identify the owning patch/commit.

./scripts/upstream.sh checkout

# Find candidate patch files by touched file path or unique hunk text
rg -n "path/to/file|unique_symbol" patches/*.patch

# Optional: inspect candidate patch header/hunks
sed -n '1,120p' patches/00NN-Example.patch

# Map patch file to commit in upstream checkout branch
patch=patches/00NN-Example.patch
subject=$(sed -n 's/^Subject: \[PATCH\] //p' "$patch" | head -n1)
cd upstream
git log --oneline pulumi/patch-checkout --grep "$subject"

# If needed, disambiguate by touched path
git log --oneline pulumi/patch-checkout -- path/to/file
cd ..

Read the full file on GitHub · 173 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 173 lines · 58 tokens per session scan A 56a593f44d1b

Subscribe to this mod's changes

upstream-patches is a skill published in the GitHub repository pulumi/agent-skills (68 stars, last pushed today), licensed Apache-2.0. It adds 58 tokens to every session and 1,352 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

infra-as-code

Manage infrastructure in version control so it's reviewable, reproducible, and rollback-able. Invoke when provisioning new infra or cleaning up ad-hoc resources.

orlando-japan/claude-code-setting · 34 tokens

infrastructure-as-code-guardian

Universal Infrastructure as Code (IaC) agent skill for authoring, securing, and managing cloud infrastructure across Terraform, Pulumi, CloudFormation, Ansible, and Bicep. Provides cross-tool security hardening, state management best practices, cost optimization, drift detection, and CI/CD integration. Covers AWS…

JPeetz/agent-skills · 254 tokens

commit

Git commit workflow with precommit hook handling, lint/type checking, README updates, and API reference updates. Use when the user wants to commit changes. Handles precommit hooks that modify files (formatting, linting) by re-staging and retrying. Runs ruff lint and pyright type checks on staged Python files, and…

ReflexioAI/claude-smart · 122 tokens

update-pr

Update an existing pull request with new changes. Use when the user wants to update a PR, push follow-up changes to a PR, refresh a PR description, or sync a PR with latest commits. Triggers on: update pr, update-pr, update the pr, push to pr, refresh pr, sync pr, update pull request.

ReflexioAI/claude-smart · 71 tokens

smart-rebase

Smart partial rebase for squash-merge repositories. Auto-detect which commits to keep/drop when base branch was squash-merged into target. Use when: user says 'rebase', 'partial rebase', 'base already merged', 'smart rebase', or /smart-rebase. Not for: simple git rebase (the developer runs it — Claude never executes…

sd0xdev/sd0x-harness · 131 tokens

next-step

Change-aware next step advisor. Use when: user asks what to do next, workflow progression is unclear, session just started with dirty worktree. Not for: executing the suggested command (user decides), auto-loop decisions (hooks handle that). Output: findings-based suggestions or session summary with commit seed.

sd0xdev/sd0x-harness · 63 tokens