update-packages
Update project dependencies to the latest version that is more than 8 days old, preferring pnpm over npm and enforcing installer age gates
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- update-packages
- type
- execution
- version
- v0.0
- description
- Update project dependencies to the latest version that is more than 8 days old, preferring pnpm over npm and enforcing installer age gates
- argument-hint
- [package names, workspace scope, or --all]
03 SKILL.md 正文
Update Packages
Invoke as $update-packages.
Use this skill when a project needs dependency updates but should avoid newly published versions that may still be unstable or compromised. The default target is the newest package version whose publish timestamp is more than 8 days old. When the project uses npm, try to migrate it to pnpm first unless project constraints make that unsafe. Every mutation run must also leave behind package-manager configuration that enforces the same age gate for future installs.
Process
-
Plan and scope the update.
- Inspect repository instructions,
package.jsonfiles, workspace config, and lockfiles. - Use
update_planfor non-trivial updates, especially monorepos, package-manager migration, or updates spanning multiple apps/packages. - Treat explicit package names or workspace filters from the user as the scope. If no scope is provided, default to all direct dependencies and devDependencies in the active project or workspace.
- Check for existing dirty files before editing and avoid staging unrelated work.
- Inspect repository instructions,
-
Resolve package manager strategy.
- Prefer pnpm when the project is JavaScript/TypeScript and does not already have a stronger package-manager requirement.
- If
pnpm-lock.yamlorpackageManager: "pnpm@..."exists, use pnpm. - If only npm is present (
package-lock.json, npm scripts, orpackageManager: "npm@..."), migrate to pnpm when practical:- Add or update
packageManagerto a stable pnpm version already used by the repo/toolchain when discoverable. - Do not default to
pnpm@latest; use an existing repo-pinned pnpm version or an explicitly age-eligible pnpm version, and document the proof. - Before recommending a new
packageManager: "pnpm@..."value, prove the chosen pnpm version is older than 8 full days by using retained project evidence, an existing project pin, or registry publish-time evidence such asnpm view pnpm@<version> time.version. If you only know a local/toolchain pnpm version but have not verified its publish time, mark it provisional and make the registry check a blocker before mutation instead of presenting it as final. - Generate
pnpm-lock.yamlusing pnpm. - Remove npm lockfile only after pnpm install/update succeeds and the repo does not explicitly require npm.
- Add or update
- If npm must remain, record the reason and continue with npm commands without inventing a pnpm migration.
- In monorepo parallel-agent contexts, do not run commands that mutate shared lockfiles. Stop and route dependency changes to a single serial session.
-
Add the installer age gate.
- Create or update the project-root
.npmrcbefore dependency updates, preserving existing registry/auth settings. - Add npm's relative age gate:
min-release-age=8. - Add pnpm's 8-day equivalent in minutes for pnpm versions/configurations that read
.npmrc:minimum-release-age=11520. - If the active pnpm version uses
pnpm-workspace.yamlorpnpm configfor non-auth settings, also add or updateminimumReleaseAge: 11520in the projectpnpm-workspace.yamlor documented pnpm project config. Do this in addition to.npmrc, not instead of it, so npm and pnpm installs are both covered. - When documenting the settings, keep their ownership clear:
min-release-age=8is the npm relative-age guard, whileminimum-release-age=11520andminimumReleaseAge: 11520are pnpm coverage for the same 8-day policy where supported. - Avoid overwriting private registry tokens, scoped registry lines, or unrelated project config.
- If an existing config deliberately excludes packages from the age gate, keep only exclusions that are documented and necessary; otherwise remove or narrow exclusions before updating.
- Create or update the project-root
-
Discover eligible versions.
- For each target package, query the registry for version metadata and publish times.
- Select the highest semver version whose published timestamp is strictly older than 8 full days from the current date/time.
- Include stable releases by default. Include prerelease/dist-tag targets only when the existing dependency already tracks that prerelease channel or the user explicitly requests it.
- Skip packages when no eligible version is older than 8 days, when the package is pinned for a documented reason, or when peer constraints make the update unsafe.
- Record the current version, selected version, publish date, and reason for skips.
-
Apply updates in safe batches.
- Update manifests through package-manager commands where practical (
pnpm up,pnpm add -D, workspace filters) so manifests and lockfiles stay consistent. - Prefer small batches for major upgrades, framework packages, build tooling, and peer-sensitive groups such as React, Next.js, ESLint, TypeScript, Vite, Vitest, Playwright, Prisma, database clients, and SDKs.
- For every major, framework, build-tool, or peer-sensitive update, write an explicit risk section before applying it:
- batch order and whether the package should move alone or with a peer group;
- peer/config compatibility checks, such as React renderer/framework compatibility, Vitest/Vite/TypeScript config compatibility, ESLint/parser compatibility, Prisma/database client generation, or SDK API changes;
- focused smoke checks tied to the package's runtime surface, not only generic install/test/build commands;
- stop conditions that route broad compatibility work to
$migrate <package or framework>instead of hiding it inside the package update.
- For npm-to-pnpm migration, first establish a clean pnpm install, then perform dependency upgrades.
- For non-trivial or plan-first dependency updates, write a batch execution checklist before mutating files. Each batch must include:
- exact mutation command(s) or file edits for that batch;
- exact verification command(s) to run before moving on;
- expected proof or artifact, such as
packageManager,.npmrc, lockfile creation, selected package version, or smoke-test output; - a "do not proceed on red" gate and a stop condition that routes broad compatibility work to
$migrate <package or framework>.
- For npm-to-pnpm migrations, make the package-manager migration Batch 0, then put low-risk minors/patches before framework, runtime, test-runner, or build-tool majors unless peer constraints require a different order.
- For Vitest and other test-runner migrations, prefer the project script (
pnpm test,pnpm run test, or the discovered package-manager equivalent) plus a discovered single-file or config smoke check. Do not recommend Jest-only or version-uncertain flags unless you have verified that the selected runner version supports them. - Do not edit lockfiles by hand.
- Update manifests through package-manager commands where practical (
-
Verify after updates.
- Confirm
.npmrccontainsmin-release-age=8and, for pnpm coverage,minimum-release-age=11520unless the project has a documented reason to store pnpm settings only inpnpm-workspace.yamlor pnpm config. - For pnpm projects, confirm
minimumReleaseAge: 11520is present inpnpm-workspace.yamlor equivalent project pnpm config when required by the active pnpm version. - Run the repo's install/update command, typecheck, tests, lint, build, and any focused smoke checks implied by changed packages.
- For major/framework/build-tool updates, run or document package-specific compatibility checks and smoke tests before calling the update complete.
- If verification fails, diagnose the root cause. Apply the smallest durable fix when it is clearly inside the dependency update scope.
- If a failure requires broad migration work, stop, report the blocker, and route to
$migrate <package or framework>. - Re-run verification after fixes.
- Confirm
-
Document and ship.
- Summarize packages updated, versions selected, publish dates, packages skipped, package-manager changes, and verification.
- Include the age-gate config files changed and the exact setting values.
- Update task docs or changelogs when the repository workflow requires it.
- If tracked files changed, commit and push on the repository primary branch unless the user explicitly says not to.
Output
- Package manager: before and after, including any npm-to-pnpm migration result.
- Age gate:
.npmrcand pnpm config files changed, includingmin-release-age=8andminimum-release-age/minimumReleaseAgevalues. - Updated packages: package, old version, new version, selected publish date, and batch.
- Skipped packages: package and reason.
- Major-upgrade risk handling: affected packages, batch order, compatibility checks, focused smoke checks, and any stop route to
$migrate <target>. - Batch execution checklist: for each batch, list the mutation command or edit, verification command, expected proof/artifact, and stop gate before proceeding.
- Verification: install/update, typecheck, tests, lint, build, and smoke checks with pass/fail.
- Next work:
none,$migrate <target>, or another exact follow-up command.
Constraints
- Never select a package version published within the last 8 days unless the user explicitly overrides the safety gate.
- Do not finish a mutation run without adding or verifying the package-manager age gate, unless the user explicitly declines it or the package manager cannot support it; document either exception.
- Do not run package-manager commands that mutate a shared lockfile while acting as one of multiple parallel agents.
- Do not hand-edit generated lockfiles.
- Do not remove npm support when scripts, deployment docs, CI, or hosting constraints explicitly require npm.
- Do not create or modify GitHub Actions workflows.
Default Shipping Contract
Follow the shared shipping contract convention in CLAUDE.md.
04 同仓库更多 Skills
source-checkout-allowed
Valid source-checkout-only fixture.
deck-install-valid
Valid deck install fixture.
codex-pack-guard-valid
Valid Codex Pack Availability Guard fixture.
codex-missing-skill-valid
Valid Codex missing skill fallback fixture.
codex-base-skill-fallback-valid
Valid Codex base skill fallback fixture.
claude-pack-guard-valid
Valid Claude Pack Availability Guard fixture.