Skip to content

Commit 4225523

Browse files
chore: add update-packages Copilot CLI skill (#103)
* chore: add update-packages skill for Copilot CLI Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: move update-packages skill to .claude/skills Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: remove repo-specific workflow from update-packages skill Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: remove Copilot co-author trailer from skill example Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: generalize major version omit guidance in update-packages skill Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8781b1a commit 4225523

1 file changed

Lines changed: 102 additions & 0 deletions

File tree

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
name: update-packages
3+
description: >
4+
Update all npm packages to their latest versions using the update-packages
5+
script. Use this when asked to update, upgrade, or consolidate dependencies,
6+
or to close dependabot PRs.
7+
---
8+
9+
## Update Packages Workflow
10+
11+
Follow these steps in order.
12+
13+
### 1. Create a GitHub issue to track the update
14+
15+
```bash
16+
gh issue create --title "chore: update all packages to latest" --body "..."
17+
```
18+
19+
Note the issue number (e.g. #42).
20+
21+
### 2. Create a branch off main
22+
23+
```bash
24+
git checkout main && git pull
25+
git checkout -b feat/consolidate-deps-<issue-number>
26+
```
27+
28+
### 3. Run the update-packages script
29+
30+
Use `--omit` to skip any packages with known breaking changes or major version
31+
bumps that need separate handling. Major version upgrades should be omitted by
32+
default unless you've verified they are safe.
33+
34+
```bash
35+
npx ts-node ./tools/update-packages/src/main.ts --omit typescript --interactive false
36+
```
37+
38+
The script will:
39+
40+
- Detect all outdated packages via `pnpm outdated`
41+
- Run `nx migrate <pkg>@latest` for each one
42+
- Merge any generated migrations into `migrations.json`
43+
- Print next steps (install + run migrations if needed)
44+
45+
### 4. Install updated packages
46+
47+
```bash
48+
pnpm install --no-frozen-lockfile
49+
```
50+
51+
If the install fails, check for postinstall build errors (e.g. tsconfig
52+
issues in `tools/builders/dotnet-builder`).
53+
54+
### 5. Run migrations (only if migrations.json was updated)
55+
56+
```bash
57+
npx nx migrate --run-migrations
58+
```
59+
60+
### 6. Run all tests
61+
62+
```bash
63+
nx reset
64+
nx run-many -t build,test
65+
```
66+
67+
All 9 projects must pass before committing.
68+
69+
### 7. Commit
70+
71+
```bash
72+
git add -A
73+
git commit -m "chore: update all packages to latest (closes #<issue-number>)"
74+
```
75+
76+
### 8. Push and open PR
77+
78+
```bash
79+
git push origin feat/consolidate-deps-<issue-number>
80+
gh pr create --title "chore: update all packages to latest" --body "Closes #<issue-number> ..."
81+
```
82+
83+
### 9. Close stale dependabot PRs
84+
85+
Close any open dependabot PRs that are now covered by this update:
86+
87+
```bash
88+
gh pr list --author "app/dependabot" --json number,title
89+
gh pr close <number> --comment "Covered by consolidated update PR" --delete-branch
90+
```
91+
92+
Leave open any dependabot PRs for packages that were intentionally omitted
93+
(e.g. TypeScript major version bumps).
94+
95+
## Notes
96+
97+
- Omit packages with major version bumps by default — run them separately once
98+
you've confirmed they are safe (e.g. no breaking changes affecting the codebase)
99+
- If a package is a transitive dep not shown by `pnpm outdated`, use
100+
`pnpm.overrides` in `package.json` to force the version
101+
- After merging, watch for new dependabot PRs — dependabot may recreate stale
102+
ones; close them if the package was already updated

0 commit comments

Comments
 (0)