update-bun-packages
Scans, updates, and upgrades Bun dependencies and packages across the AI workspace (L0) or standalone project (L2/L3) while ensuring lockfile consistency, package.json version bumps, and security compliance. Use when: updating bun dependencies, upgrading packages to @latest, checking outdated packages in workspace or templates.
- License 许可
- AGPL-3.0
- 最近更新
- 2026-11-14
- Stars
- ★ 25
- Forks
- 9
01 前言 Front Matter
- name
- update-bun-packages
- owner
- pm
- scope
- common
- status
- active
- version
- 1.3.1
- metadata
- { "type": "process", "triggers": [ "update bun packages", "upgrade bun packages", "bun update", "update dependencies", "upgrade dependencies" ] }
- description
- Scans, updates, and upgrades Bun dependencies and packages across the AI workspace (L0) or standalone project (L2/L3) while ensuring lockfile consistency, package.json version bumps, and security compliance. Use when: updating bun dependencies, upgrading packages to @latest, checking outdated packages in workspace or templates.
- last_reviewed
- 1788912000000
03 SKILL.md 正文
Overview
This skill provides a layer-aware methodology for auditing, updating, and upgrading Bun packages and dependencies. It automatically detects whether it is running in L0 (Workspace Maintainer) or L2/L3 (Standalone Project) context and adapts its scope accordingly:
- L0 Mode (Workspace Maintainer): Audits workspace root
package.json,templates/common/package.json, and variant overlaytemplates/co-*/package.json, then propagates changes viabun run propagate:apply. - L2/L3 Mode (Standalone Project): Audits local project
./package.json(and./scripts/package.jsonif present) without referencing non-existent template paths or attempting L0-only template propagation.
When to Use This Skill
- Routine Maintenance: Regular dependency updates (
bun updatefor in-range semver updates). - Major Upgrades: Upgrading pinned exact versions or major releases to
@latest(bun add <package>@latest/bun add -d <package>@latest). - Security Patches: Upgrading vulnerable packages reported by security advisories (
gitleaks,bun audit, CVEs). - Template Synchronization (L0 Mode): Aligning package versions between workspace root (
package.json) andtemplates/common/package.json. - Project Dependency Refresh (L2/L3 Mode): Refreshing dependencies in scaffolded or variant-based projects.
Step 0: Layer Context Auto-Detection
Before scanning, determine the execution context by checking for the existence of templates/common/:
# Check execution layer
if [ -d "templates/common" ]; then
MODE="L0_WORKSPACE_ROOT"
else
MODE="L2_L3_STANDALONE_PROJECT"
fi
- If
MODE == L0_WORKSPACE_ROOT: Follow L0 Workspace Root steps below. - If
MODE == L2_L3_STANDALONE_PROJECT: Follow L2/L3 Standalone Project steps below.
Step 1: Scan & Audit Outdated Packages
L0 Workspace Root Mode
-
Target Locations:
- Workspace Root:
./package.json - Common Template:
./templates/common/package.json - Variant Overlays:
./templates/co-*/package.json
- Workspace Root:
-
Run Outdated Scan:
$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; bun outdated
L2/L3 Standalone Project Mode
-
Target Locations:
- Project Root:
./package.json - Script Subdirectory (if present):
./scripts/package.json
- Project Root:
-
Run Outdated Scan:
$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; bun outdated -
Categorize Update Types:
- In-Range Semver Updates (
bun update): Updates within existing caret/tilde ranges (e.g.^4.3.0→4.3.1). - Major / Pinned Upgrades (
bun add <pkg>@latest): Note that exact pinned versions inpackage.json(without^or~) are ignored bybun update. They require explicitbun add <pkg>@latestorpackage.jsonversion string edits to upgrade to@latest.
- In-Range Semver Updates (
Step 2: Security & Compatibility Assessment
-
License Audit: Ensure all new or updated packages use OSI-approved licenses (MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, MPL-2.0, LGPL-2.1+). Avoid GPL-3.0/AGPL-3.0/SSPL per Coding Guidelines §8.5.
-
Core System Contracts: Preserve essential type safety and build tooling:
bun-types/@types/node(TypeScript type safety)js-yaml(YAML frontmatter parsing)gitleaks(Secret scanning)
-
Breaking Change Verification: If upgrading major versions, search for target package imports using
grep_searchto verify API compatibility before modifyingpackage.json.
Step 3: Execute Package Updates & Lockfile Sync
L0 Workspace Root Mode
- In-Range Update:
$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; bun update - Major / Pinned Upgrade to
@latest: To upgrade pinned dependencies to their latest releases (e.g.js-yaml,typescript,@types/node):$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; bun add <package-name>@latest $OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; bun add -d <dev-package-name>@latest - Align Root/Common/Variant Template Dependencies:
Use the dedicated alignment helper so root-template dependency strings are not patched by hand:
Review the diff forbun scripts/sync-template-deps.ts --applypackage.json,templates/common/package.json, and anytemplates/co-*/package.jsonoverlays before continuing. - Propagate to Templates:
$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; bun run propagate:apply
L2/L3 Standalone Project Mode
- In-Range & Pinned Update:
$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; bun update $OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; bun add <package-name>@latest - Lockfile Refresh:
$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; bun install - (Skip L0
propagate:apply— L2/L3 projects operate independently).
Step 4: Verification & Quality Gate
L0 Workspace Root Mode
- Run full workspace audit:
$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; bun scripts/audit.ts - Validate template integrity:
$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; bun scripts/validate-templates.ts - Run integration test suite:
$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; bun test - Execute
/syncpipeline:$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; bun scripts/dev-sync.ts --body-file ".git/sync-pr-body.md" "chore(deps): update bun packages to @latest and sync templates"
L2/L3 Standalone Project Mode
- Run local project QA gate / tests:
$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; bun test - Execute local
/syncpipeline:$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; bun scripts/dev-sync.ts --body-file ".git/sync-pr-body.md" "chore(deps): update bun packages"
04 同仓库更多 Skills
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.