
catalog-pin-upgrade-dependencies
by yulolimum
A unified configuration repository that enables seamless collaboration between Cline and Claude Code AI assistants through shared memory banks and coding standards.
SKILL.md
name: catalog-pin-upgrade-dependencies description: Consolidates all monorepo dependencies into root catalog, pins versions, and upgrades to latest disable-model-invocation: true
Catalog, Pin, and Upgrade Dependencies
This skill consolidates all dependencies from a monorepo into a centralized catalog, pins their versions, and upgrades them to the latest versions one at a time.
Overview
- Catalog: Move all dependencies to root-level catalog (pnpm-workspace.yaml or bun's package.json catalog)
- Pin: Remove version prefixes (
^,~) to lock exact versions - Upgrade: Update each dependency to latest version one at a time
- Report: Display a comprehensive summary table
Execution Steps
Step 1: Detect Package Manager
Check for lock files to determine the package manager:
# Check in order of precedence
ls pnpm-lock.yaml 2>/dev/null && echo "pnpm"
ls bun.lockb 2>/dev/null && echo "bun"
ls yarn.lock 2>/dev/null && echo "yarn"
ls package-lock.json 2>/dev/null && echo "npm"
Supported package managers:
- pnpm: Uses
pnpm-workspace.yamlwithcatalog:section - bun: Uses
package.jsonwithcatalogfield at root
If neither pnpm nor bun is detected, inform the user this skill only supports pnpm and bun catalogs.
Step 2: Find All package.json Files
find . -name "package.json" -not -path "*/node_modules/*" -not -path "*/.git/*"
Read each package.json and extract:
dependenciesdevDependenciespeerDependencies(optional - ask user if they want to include these)
Step 3: Build Dependency Map
Create a map tracking:
- Package name
- All versions found across workspaces
- Which workspaces use it
- Whether it's a dev dependency
Example structure:
{
"react": {
versions: ["^18.2.0", "~18.1.0", "18.0.0"],
workspaces: ["packages/app", "packages/ui", "packages/web"],
devDep: false
}
}
Step 4: Determine Catalog Versions
For each dependency:
- If all workspaces use the same version (ignoring prefixes), use that version
- If versions differ, use the highest version found
- Pin the version by removing
^and~prefixes
Step 5: Update Catalog
For pnpm - Update pnpm-workspace.yaml:
catalog:
react: 18.2.0
typescript: 5.3.0
# ... all dependencies
For bun - Update root package.json:
{
"catalog": {
"react": "18.2.0",
"typescript": "5.3.0"
}
}
Step 6: Update Workspace package.json Files
Replace version specifiers with catalog references:
For pnpm:
{
"dependencies": {
"react": "catalog:"
}
}
For bun:
{
"dependencies": {
"react": "catalog:react"
}
}
Step 7: Upgrade Dependencies One at a Time
For each cataloged dependency:
For pnpm:
pnpm update <package-name> --latest
For bun:
bun update <package-name> --latest
After each upgrade:
- Record the new version
- Note if upgrade succeeded or failed
- Calculate version change type (patch/minor/major)
Step 8: Generate Summary Table
Display a markdown table with the following columns:
| Package | Cataloged | Pinned | Upgraded | Old Version | New Version | Change | Workspaces | Status |
|---|
Status Color Coding:
Use these indicators in the Status column:
- GREEN (
SAFE): Patch-level update only (e.g., 1.0.0 → 1.0.1) - ORANGE (
WARN): Minor-level update (e.g., 1.0.0 → 1.1.0) OR multiple workspaces had different minor versions - RED (
RISK): Major-level update (e.g., 1.0.0 → 2.0.0) OR multiple workspaces had different major versions
Change Type Column:
patch- Only patch version changedminor- Minor version changedmajor- Major version changednone- No change (already latest)
Example Output:
## Dependency Catalog Summary
Package Manager: pnpm
Total Dependencies Processed: 45
Workspaces Affected: 8
| Package | Cataloged | Pinned | Upgraded | Old Version | New Version | Change | Workspaces | Status |
|---------|-----------|--------|----------|-------------|-------------|--------|------------|--------|
| react | ✓ | ✓ | ✓ | 18.2.0 | 18.3.1 | minor | app, ui, web | WARN |
| typescript | ✓ | ✓ | ✓ | 5.3.0 | 5.4.0 | minor | * (all) | WARN |
| lodash | ✓ | ✓ | ✓ | 4.17.20 | 4.17.21 | patch | utils | SAFE |
| next | ✓ | ✓ | ✓ | 13.5.0 | 14.1.0 | major | app, web | RISK |
| zod | ✓ | ✓ | ✗ | 3.22.0 | 3.22.0 | none | api, shared | SAFE |
### Risk Summary
- SAFE (patch/none): 30 packages
- WARN (minor): 12 packages
- RISK (major): 3 packages
### Version Conflicts Detected
The following packages had different versions across workspaces:
- react: ^18.2.0 (app), ~18.1.0 (ui), 18.0.0 (web) → unified to 18.3.1
- lodash: ^4.17.20 (utils), ^4.17.19 (shared) → unified to 4.17.21
Important Notes
- Backup: Consider committing current state before running
- Lock File: The lock file will be regenerated after updates
- Breaking Changes: Pay attention to RED/RISK items - these may require code changes
- Testing: Run tests after completion to verify nothing broke
Error Handling
- If a package fails to upgrade, log the error and continue with the next package
- Include failed packages in the summary with an
✗in the Upgraded column - Suggest manual intervention for failed packages at the end
Post-Completion
After displaying the summary:
- Remind user to run tests
- Highlight any packages that failed to upgrade
- Suggest reviewing RED/RISK packages for breaking changes
- Offer to help investigate any specific package upgrade issues
Score
Total Score
Based on repository quality metrics
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
Reviews
Reviews coming soon