Keeps pnpm and CI workflows updated by aligning versions in package.json and GitHub Action configs.
Install
mkdir -p .claude/skills/pnpm-upgrade && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2295" && unzip -o skill.zip -d .claude/skills/pnpm-upgrade && rm skill.zipInstalls to .claude/skills/pnpm-upgrade
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Keep pnpm current: run pnpm self-update/corepack prepare, align packageManager in package.json, and bump pnpm/action-setup + pinned pnpm versions in .github/workflows to the latest release. Use this when refreshing the pnpm toolchain manually or in automation.Key capabilities
- →Performs version synchronization with corepack
- →Resolves SHA512 integrity hashes for packageManager fields
- →Automates GitHub Action workflow update pins
- →Queries npm registry for latest stable version releases
- →Syncs immutable commit SHAs for action-setup
How it works
It iterates through local version detection, npm registry metadata verification, and Git tag resolution to safely bump toolchain versions.
Inputs & outputs
When to use pnpm-upgrade
- →Upgrade pnpm to the latest stable version
- →Sync pnpm package integrity in project files
- →Update GitHub Actions pnpm/action-setup pin
- →Automate toolchain maintenance
About this skill
pnpm Upgrade
Use these steps to update pnpm and CI pins without blunt search/replace.
Steps (run from repo root)
-
Resolve the target pnpm release
- Query the npm registry before changing the local toolchain:
PNPM_VERSION=$(curl -fsSL https://registry.npmjs.org/pnpm/latest | jq -r .version). - Abort if the version is missing.
- Resolve the exact package integrity:
curl -fsSL "https://registry.npmjs.org/pnpm/${PNPM_VERSION}" | jq -r .dist.integrity. - Store the result as
PNPM_INTEGRITY. - Abort if the integrity is missing or does not start with
sha512-. - Convert the base64 digest after
sha512-to lowercase hex, for example:printf '%s' "${PNPM_INTEGRITY#sha512-}" | base64 -d | xxd -p -c 256 - Store the result as
PNPM_SHA512_HEX.
- Query the npm registry before changing the local toolchain:
-
Find the target pnpm/action-setup release
- Query GitHub API:
curl -fsSL https://api.github.com/repos/pnpm/action-setup/releases/latest | jq -r .tag_name. - Use
GITHUB_TOKEN/GH_TOKENif available for higher rate limits. - Store as
ACTION_TAG(e.g.,v4.2.0). Abort if missing.
- Query GitHub API:
-
Resolve the action tag to an immutable commit SHA
- Run
git ls-remote https://github.com/pnpm/action-setup "refs/tags/${ACTION_TAG}^{}"and capture the SHA asACTION_SHA. - If the dereferenced tag is missing, fall back to
git ls-remote https://github.com/pnpm/action-setup "refs/tags/${ACTION_TAG}". - Abort if
ACTION_SHAis empty.
- Run
-
Preflight the release and CI installation path
- Run
node .agents/skills/pnpm-upgrade/scripts/preflight.mjs --version "${PNPM_VERSION}" --action-ref "${ACTION_SHA}". - The script first rejects published pnpm manifests with non-empty
dependenciesordevDependencies. pnpm bundles its runtime dependencies, so these fields indicate a broken publication such as[email protected]. - It then reproduces both
pnpm/action-setupinstallation paths in separate temporary directories: install the regularpnpmbootstrap frompnpm-lock.jsonand the standalone@pnpm/exebootstrap fromexe-lock.json, set isolatedPNPM_HOMEdirectories, and self-update each bootstrap toPNPM_VERSION. - Abort the upgrade on any failure. Do not bypass this check with a direct local install; the preflight exists to exercise the CI-only bootstrap path.
- Run
-
Update pnpm locally
- Run
pnpm self-update "${PNPM_VERSION}". - If pnpm is missing or self-update fails only because the current installation cannot update itself, run
corepack prepare "pnpm@${PNPM_VERSION}" --activate. Do not use this fallback to bypass a failed preflight. - Confirm
pnpm -vexactly matchesPNPM_VERSION.
- Run
-
Align package.json
- Open
package.jsonand setpackageManagertopnpm@${PNPM_VERSION}+sha512.${PNPM_SHA512_HEX}(preserve trailing newline and formatting).
- Open
-
Update workflows carefully (no broad regex)
- Files: everything under
.github/workflows/that usespnpm/action-setup. - For each file, edit by hand:
- Set
uses: pnpm/action-setup@${ACTION_SHA}. - If a
with: version:field exists, set it to${PNPM_VERSION}(keep quoting style/indent).
- Set
- Do not touch unrelated steps. Avoid multiline sed/perl one-liners.
- Files: everything under
-
Verify
- Run
pnpm -vand confirm it matches the version portion ofpackageManager. - Confirm
packageManagerkeeps the exact+sha512.${PNPM_SHA512_HEX}suffix. git diffto ensure only intended workflow/package.json changes.
- Run
-
Follow-up
- If runtime code/build/test config was changed (not typical here), run
$code-change-verification; otherwise, a light check is enough. - Commit with
chore: upgrade pnpm toolchainand open a PR (automation may do this).
- If runtime code/build/test config was changed (not typical here), run
Notes
- Tools needed:
curl,jq,base64,xxd,node,npm, andpnpm/corepack. Install if missing. - Keep edits minimal and readable—prefer explicit file edits over global replacements.
- GitHub Actions must stay pinned to commit SHAs, not tags. Use the latest release tag only to discover the commit SHA to pin.
- If GitHub API is rate-limited, retry with a token or bail out rather than guessing the tag.
When not to use it
- →Managing non-pnpm dependency managers
- →Projects using locked proprietary versioning systems
Prerequisites
Limitations
- →Requires network access to registry and GitHub APIs
- →Requires manual confirmation for workflow changes
How it compares
It performs integrity-aware updates and immutable commit pinning rather than basic version strings.
Compared to similar skills
pnpm-upgrade side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| pnpm-upgrade (this skill) | 2 | 3mo | Review | Intermediate |
| turborepo | 61 | 2mo | Review | Intermediate |
| upgrading-expo | 3 | 4mo | Review | Intermediate |
| pnpm | 4 | 6mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by openai
View all by openai →You might also like
turborepo
vercel
Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries. Use when user: configures tasks/workflows/pipelines, creates packages, sets up monorepo, shares code between apps, runs changed/affected packages, debugs cache, or has apps/packages directories.
upgrading-expo
sickn33
Upgrade Expo SDK versions
pnpm
antfu
Node.js package manager with strict dependency resolution. Use when running pnpm specific commands, configuring workspaces, or managing dependencies with catalogs, patches, or overrides.
windsurf-linting-config
jeremylongshore
Configure and enforce code quality with AI-assisted linting. Activate when users mention "configure linting", "eslint setup", "code quality rules", "linting configuration", or "code standards". Handles linting tool configuration. Use when configuring systems or services. Trigger with phrases like "windsurf linting config", "windsurf config", "windsurf".
pnpm
valibali
Use when managing Node.js dependencies with pnpm - provides workspace setup, catalogs, CLI commands, overrides, and CI configuration
playwright-interactive
ComeOnOliver
Use a persistent `js_repl` Playwright session to debug local web or Electron apps, keep the same handles alive across iterations, and run functional plus visual QA without restarting the whole toolchain unless the process ownership changed.