Skip to content

Commit 007c6c7

Browse files
authored
docs(skills): preserve npm/nuget version ranges in upgrades (#175)
1 parent 5a58ad1 commit 007c6c7

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

  • .agents/skills/upgrade-dependencies

.agents/skills/upgrade-dependencies/SKILL.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ Create and switch:
6767
git switch -c $branchName
6868
```
6969

70+
## Version Range Preservation Rules
71+
Preserve existing version-range declarations when upgrading dependencies.
72+
73+
- npm: If the current declaration uses comparator-range syntax (for example `>=1.1.6 <2.0.0`), keep it unchanged and do not rewrite it to caret/tilde/exact forms.
74+
- Skip upgrade commands for dependencies already declared as ranges under the rules above.
75+
- You may still report recommended minimum-version bumps when vulnerabilities or critical fixes are identified.
76+
77+
7078
## Discover npm Manifests
7179
Discover package manifests under `packages/`, excluding `node_modules`.
7280

@@ -122,6 +130,11 @@ Notes:
122130
- Keep lockfile updates generated by npm commands.
123131
- Ignore nested lockfiles that do not have a sibling `package.json`.
124132

133+
Before running `npm install "$pkg@latest"` for each package, inspect the current declaration in `dependencies` or `devDependencies`:
134+
- If the current declaration uses comparator-range syntax (for example `>=1.1.6 <2.0.0`), skip that package and keep the declaration unchanged.
135+
- Do not rewrite comparator ranges to caret, tilde, or exact-version declarations.
136+
- Record skipped ranged npm packages and any recommended minimum-version bumps in both PR summary and final output.
137+
125138
## Resolve Upgrade Fallout
126139
Fix compatibility issues directly caused by dependency upgrades:
127140
- API or signature changes
@@ -194,6 +207,7 @@ __TRELLO_CARD_URL__
194207
195208
## Summary
196209
- <short summary of upgraded dependencies and compatibility fixes>
210+
- <skipped ranged dependencies kept unchanged, plus recommended minimum-version bumps (if any)>
197211
198212
## Validation
199213
- `packages/client`: <build/test result or not touched>
@@ -230,5 +244,6 @@ Provide a final summary with:
230244
- upgraded npm packages grouped by manifest path
231245
- compatibility fixes applied
232246
- results for each validation command
247+
- skipped ranged dependencies kept unchanged, with recommended minimum-version bumps when applicable.
233248
- pushed branch URL
234249
- PR URL, or exact manual fallback instructions when automated PR creation is unavailable

0 commit comments

Comments
 (0)