.claude/skills/pulumi-upgrade-provider/SKILL.md
Automate Pulumi provider repo upgrades with the `upgrade-provider` tool. Use when upgrading a pulumi provider repository to a new upstream version, running `upgrade-provider`, and addressing its common failure modes like patch conflicts or missing module mappings.
npx skillsauth add pulumi/pulumi-docker pulumi-upgrade-providerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
First, install the upgrade-provider tool:
go install github.com/pulumi/upgrade-provider@latest
After installation, the tool will be in your PATH and you can run it directly as upgrade-provider.
IMPORTANT:
upgrade-provider directly after installing - if it's not found (exit code 127), report this as an environment configuration issue and stopDO NOT end this session until one of these conditions is met:
upgrade-provider command completes successfully AND you have retrieved the PR URLYou MUST NOT end the session if:
upgrade-provider at least onceLong-running commands: The upgrade-provider command can take up to 10 minutes. You MUST wait for it to complete. Use timeout: 600000 when running it via Bash.
Drive Pulumi provider upgrades by running the upgrade-provider tool and iterating on failures until the tool succeeds. Keep all git operations read-only in the repo; the tool owns branches, commits, and PRs.
Track errors across iterations to avoid infinite loops:
mkdir -p .pulumi
upgrade-provider $ORG/$REPO --repo-path . > .pulumi/upgrade-provider-stdout.txt 2> /dev/null
Use timeout: 600000 (10 minutes) when invoking via Bash.
If exit code is 127 (command not found): This is an environment configuration issue. Report failure immediately - do NOT try to install the tool or find it manually.
Wait for the command to fully complete (can take up to 10 minutes). Do not proceed or end the session until you see the final output.
Read the output file to check for errors:
cat .pulumi/upgrade-provider-stdout.txt
error: .references/upgrade-provider-errors.md./scripts/upstream.sh checkout and review the applied commits:
upstream.Stop iterating and exit with failure if any of these conditions are met:
upgrade-provider tool is not in PATH. This is an environment configuration issue - do NOT try to install the tool yourselfreferences/upgrade-provider-errors.md and you cannot determine a safe fixWhen stopping, you MUST report:
The tool creates a PR when the upgrade completes successfully.
gh pr view --json url --jq .url || gh pr list --head "$(git branch --show-current)" --json url --jq '.[0].url'
repo=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
pr_number=$(gh pr view --json number --jq .number)
gh pr view --json body --jq .body > /tmp/pr_body.txt
cat <<'EOF' >> /tmp/pr_body.txt
---
### Fixes applied to unblock upgrade
- <list concrete unblocker edits here, with file paths and intent>
EOF
gh api -X PATCH "repos/$repo/pulls/$pr_number" --raw-field body="$(cat /tmp/pr_body.txt)"
Use REST (gh api) instead of gh pr edit to avoid GraphQL project-card errors. Keep the original content intact; only append the new section.
git rebase --continue --no-edit is not supported in older git versions. Use git rebase --continue and accept the existing commit message when prompted.git rebase --continue, run it with GIT_EDITOR=true (or GIT_EDITOR=:).IMPORTANT: Always run commands from the repository root. Do NOT use cd to change directories - it causes state confusion and is not allowed.
upstream submoduleThe upstream/ directory is a git submodule containing the Terraform provider source. Use these patterns:
Git commands - use -C upstream:
# Check status
git -C upstream status
# View log
git -C upstream log --oneline -10
# Check current branch
git -C upstream branch --show-current
# Continue a rebase (with auto-accept message)
GIT_EDITOR=: git -C upstream rebase --continue
# Stage files after resolving conflicts
git -C upstream add <file>
Reading files - use the Read tool with path from repo root:
Read upstream/docs/resources/droplet.md
Read upstream/go.mod
Editing files - use the Edit tool with path from repo root:
Edit upstream/docs/resources/droplet.md
Listing files - use full paths:
ls -la upstream/
ls -la upstream/vendor/github.com/digitalocean/godo/
Scripts - run from repo root:
./scripts/upstream.sh checkout
./scripts/upstream.sh rebase -o refs/tags/v2.75.0
./scripts/upstream.sh check_in
./scripts/upstream.sh checkout|rebase|check_in are allowed because the tool manages git state.cd - always work from the repository root.references/upgrade-provider-errors.md for patch conflict and new module mapping fixes.Before ending this session, verify:
upgrade-provider and waited for it to completeDo not end the session without completing one of the outcomes above.
devops
Working with upstream patches - creating, editing, deleting, and rebasing patches for the Terraform provider submodule in the upstream/ directory
development
Code review guidelines for Pulumi provider repositories - reviewing patches, resources.go changes, SDK changes, and CI workflows
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------