Synthèse automatique
Guide un agent pour exécuter l'outil upgrade-provider de Pulumi sur un dépôt de provider et itérer sur les erreurs jusqu'à la création de la pull request de mise à niveau.
Points forts
- Automatise la boucle de mise à niveau avec un délai maximal explicite de 10 minutes et un suivi des erreurs pour éviter les boucles infinies.
- Définit des conditions d'arrêt claires, notamment l'échec d'environnement lorsque la commande est introuvable (code 127).
- Prévoit une étape post-exécution pour examiner les conflits de patches et les commits upstream appliqués.
- Maintient les opérations git en lecture seule et laisse l'outil gérer les branches, commits et PR.
Limites
- Suppose que le binaire upgrade-provider et l'environnement Go sont déjà installés et configurés, sans solution de repli.
- Les correctifs précis dépendent d'un fichier de référence externe (references/upgrade-provider-errors.md) non fourni ici.
- S'applique uniquement aux dépôts de providers Pulumi et nécessite un accès shell avec des commandes longues.
À utiliser pour mettre à niveau un dépôt de provider Pulumi vers une nouvelle version upstream avec l'outil upgrade-provider.
À ne pas utiliser pour des dépôts non Pulumi, une première installation de l'outil ou un environnement sans exécution de commandes shell longues.
Analyse de sécurité
PrudenceThe skill automates a legitimate Pulumi provider upgrade workflow. It does not contain destructive or exfiltrating commands, but it does execute third-party code and perform network-based write operations, which warrant caution.
- •Installs and runs a third-party Go tool from GitHub via `go install`, introducing supply chain risk.
- •Uses `gh api` to modify the PR body, which is a write operation to GitHub.
- •Relies on network access for tool installation and GitHub CLI commands.
Exemples
Run upgrade-provider on pulumi/pulumi-aws from the repo root and fix any errors it reports until the upgrade PR is created.The upgrade-provider run for pulumi/pulumi-gcp failed with a patch conflict; inspect the output, apply a fix, and rerun it.After the Pulumi provider upgrade, run ./scripts/upstream.sh checkout and summarize the intent and risk of each applied upstream commit.name: pulumi-upgrade-provider
description: 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.
Pulumi Upgrade Provider
Prerequisites
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:
- Do NOT try to modify PATH or use absolute paths to run the tool
- Do NOT try to find where the tool was installed
- Just run
upgrade-providerdirectly after installing - if it's not found (exit code 127), report this as an environment configuration issue and stop
CRITICAL: Session Completion Requirements
DO NOT end this session until one of these conditions is met:
- Success: The
upgrade-providercommand completes successfully AND you have retrieved the PR URL - Explicit failure: You have hit a stopping condition listed in "When to Stop and Report Failure" below
You MUST NOT end the session if:
- A command is still running or you haven't checked its output
- You encountered an error but haven't attempted to fix it
- You haven't yet run
upgrade-providerat least once - The upgrade-provider command failed but you haven't exhausted the error-fixing loop
Long-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.
Overview
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.
Error Tracking
Track errors across iterations to avoid infinite loops:
- Maintain a mental list of errors encountered and fixes attempted
- An error is "the same" if it has the same error message and affects the same file/resource
- After 3 failed attempts at the same error, stop and report failure
Run Loop
- Create the output directory first:
mkdir -p .pulumi
- Run the upgrade tool from the repo root with a 10-minute timeout:
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
- Scan the output for lines starting with
error:. - If failed:
- Compare the error to previous attempts
- If you've seen the same error 3 times, stop and report failure (see "When to Stop")
- If this is a new/different error, fix it using
references/upgrade-provider-errors.md - Rerun the command (go back to step 2)
- If a conflict was fixed, report exactly what changed (file paths + concrete edits or kept intent).
- If the upgrade required changes to patches, run
./scripts/upstream.sh checkoutand review the applied commits:- List commit SHAs/titles from
upstream. - Summarize the intent of each commit in plain language.
- Call out any behavioral changes or risks.
- List commit SHAs/titles from
- When the tool completes successfully, proceed to Post-run Tasks.
When to Stop and Report Failure
Stop iterating and exit with failure if any of these conditions are met:
- Command not found (exit code 127): The
upgrade-providertool is not in PATH. This is an environment configuration issue - do NOT try to install the tool yourself - Same error 3 times: You've attempted to fix the same error 3 times without success
- Unknown error pattern: The error is not covered in
references/upgrade-provider-errors.mdand you cannot determine a safe fix - Requires human judgment: The fix requires decisions that need human input, such as:
- Choosing between multiple valid approaches
- Breaking changes that affect public API
- Deprecation strategies
- Architectural decisions about module organization
- Circular issues: Fix A causes error B, fix B causes error A
- Complexity escalation: Each fix attempt reveals more issues, suggesting deeper problems
When stopping, you MUST report:
- The error(s) encountered
- What fixes were attempted (with file paths and changes)
- Why you believe human intervention is needed
- Any partial progress that was made
Post-run Tasks
The tool creates a PR when the upgrade completes successfully.
- MUST fetch the PR URL for the current branch using read-only commands:
gh pr view --json url --jq .url || gh pr list --head "$(git branch --show-current)" --json url --jq '.[0].url'
- MUST append a "Fixes applied to unblock upgrade" section to the existing PR body if any fixes were applied (do not overwrite):
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.
Notes
git rebase --continue --no-editis not supported in older git versions. Usegit rebase --continueand accept the existing commit message when prompted.- To avoid the editor prompt during
git rebase --continue, run it withGIT_EDITOR=true(orGIT_EDITOR=:).
Working Directory
IMPORTANT: Always run commands from the repository root. Do NOT use cd to change directories - it causes state confusion and is not allowed.
Working with the upstream submodule
The 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
Guardrails
- Never commit, push, or create branches manually; only run read-only git commands.
./scripts/upstream.sh checkout|rebase|check_inare allowed because the tool manages git state.- Do not stash changes; the tool manages git state.
- Do not use
cd- always work from the repository root.
References
- Use this skill's
references/upgrade-provider-errors.mdfor patch conflict and new module mapping fixes.
Final Reminder
Before ending this session, verify:
- [ ] You ran
upgrade-providerand waited for it to complete - [ ] If it failed, you attempted fixes per the error reference guide
- [ ] If it succeeded, you retrieved and reported the PR URL
- [ ] If stopping due to failure, you documented the error, attempted fixes, and why human intervention is needed
Do not end the session without completing one of the outcomes above.
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/pulumi-provider-upgrade-automation-mu99jolf/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/pulumi-provider-upgrade-automation-mu99jolf/download' --output '.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf/SKILL.md.part' && mv '.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf/SKILL.md.part' '.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Extrait original : Prerequisites
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:
- Do NOT try to modify PATH or use absolute paths to run the tool
- Do NOT try to find where the tool was installed
- Just run
upgrade-providerdirectly after installing - if it's not found (exit code 127), report this as an environment configuration issue and stop
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf/SKILL.md' && test -s '.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/pulumi-upgrade-provider' && cp -R '.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf' '.claude/skills/pulumi-upgrade-provider'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/pulumi-provider-upgrade-automation-mu99jolf'openskills read 'pulumi-provider-upgrade-automation-mu99jolf'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/pulumi-provider-upgrade-automation-mu99jolf/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Configurer un canal de discussion avec SecretRefs
DevOps
Configurez des canaux de discussion avec des commandes non interactives, les secrets étant uniquement des SecretRefs. Couvre les étapes de collecte, modification, réparation et vérification.
Enquêter sur les échecs CI de ClickHouse
DevOps
Investigue un échec CI de ClickHouse de bout en bout à partir d'une URL de PR ou de rapport S3. Récupère les tests échoués, classe flaky vs vraie régression, et cherche des issues/fixes existants.
Revue de PR Ansible
DevOps
Examine une PR Ansible selon le processus standardisé du projet, incluant la validation des changelogs, la couverture de tests et le suivi des commentaires.