1---
2name: dependency-maintenance
3description: Dependency maintenance. Use when adding, moving, or upgrading dependencies, changing pnpm or JavaScript runtimes, updating TypeScript or build/test tools, or changing native-build policy, patches, or test images.
4---
5
6Treat an upgrade as a synchronization task, not a lockfile refresh. Derive
7versions, commands, and compatibility points from the current repository.
8
9## Discover
10
111. Read affected manifests and scripts, `pnpm-workspace.yaml`, setup actions,
12 workflows, test configuration, and compatibility documentation.
132. Search for the dependency and every current version, range, runtime input,
14 image, engine constraint, patch, and compatibility claim.
153. Record each match as a development version, tested version, peer range,
16 engine minimum, advertised minimum, or intentionally different constraint.
174. When adding or moving a manifest entry, read
18 [manifest-roles.md](manifest-roles.md) before selecting its role.
195. Select the package-local or coordinated branch and its validation matrix.
20
21Discovery is complete when every match and affected validation surface is
22accounted for.
23
24## Package-local branch
25
26Use this branch only for one dependency in one workspace package when runtime,
27compiler, package-manager, image, patch, native-build, and shared-tooling policy
28are unchanged.
29
30Update only the owning manifest and keep peer compatibility independent from
31the development version tested here. If any coordinated surface appears,
32switch branches.
33
34This branch is complete when the manifest and lockfile agree, focused checks
35pass, and every search result is intentionally unchanged or package-local.
36
37## Coordinated branch
38
39Read [coordinated-upgrades.md](coordinated-upgrades.md), select every applicable
40row, and update all listed synchronization points before installing. Apply root
41workflow and generated-file requirements before editing those surfaces, then
42return here to finish matrix and lockfile review.
43
44## Install and finish
45
46Run root `pnpm install` after all selected edits. Inspect warnings and the
47semantic lockfile diff for specifiers, resolutions, duplicate transitives, peer
48changes, integrity, patch hashes, lifecycle scripts, and `allowBuilds` effects.
49A successful install alone does not complete this review.
50
51Run the narrowest correctness and performance checks that cover every selected
52matrix row.
53Apply the root changeset routing after implementation and focused validation.
54
55The task is complete when repeated repository searches find no unclassified
56synchronization point, manifest roles and compatibility ranges are intentional,
57the lockfile has no unexplained churn, and every selected check passes or is
58reported as not runnable.