en un clic
change-package-manager
// Switch the project's package manager between npm, bun, and pnpm. Updates all config, scripts, documentation, CI workflows, and AI instructions. Use when initializing from template or switching package managers.
// Switch the project's package manager between npm, bun, and pnpm. Updates all config, scripts, documentation, CI workflows, and AI instructions. Use when initializing from template or switching package managers.
Check work for adherence with architecture, run quality checks, and suggest a commit message. Use after completing work on a feature or bug fix.
Run static analysis tools (knip, jscpd, check:all), get intelligent recommendations for cleanup, and optionally create a task document.
One-time template initialization. Collects app name, description, and package manager preference, then updates all project files. Run once when starting a new project from this template.
| name | change-package-manager |
| description | Switch the project's package manager between npm, bun, and pnpm. Updates all config, scripts, documentation, CI workflows, and AI instructions. Use when initializing from template or switching package managers. |
| user-invocable | true |
| argument-hint | <bun|pnpm|npm> |
| allowed-tools | ["Read","Edit","Write","Bash","Glob","Grep"] |
Switch this project's package manager to $ARGUMENTS.
If $ARGUMENTS is not exactly bun, pnpm, or npm, ask the user which package manager they want.
Detect the current package manager from AGENTS.md or package.json scripts. Use this table for all replacements:
| Context | npm | bun | pnpm |
|---|---|---|---|
| Install deps | npm install | bun install | pnpm install |
| Run script | npm run X | bun run X | pnpm run X |
| CI frozen install | npm ci | bun install --frozen-lockfile | pnpm install --frozen-lockfile |
| Add dep | npm install pkg | bun add pkg | pnpm add pkg |
| Add dev dep | npm install -D pkg | bun add -D pkg | pnpm add -D pkg |
| Remove dep | npm uninstall pkg | bun remove pkg | pnpm remove pkg |
| Audit | npm audit | bun audit | pnpm audit |
| Global install | npm install -g pkg | bun install -g pkg | pnpm add -g pkg |
| Execute binary | npx | bunx | pnpm dlx |
| Lock file | package-lock.json | bun.lock | pnpm-lock.yaml |
Read package.json. Replace the current PM's run command with the target PM's in all script values. For example, npm run typecheck becomes bun run typecheck.
Read src-tauri/tauri.conf.json. Update beforeDevCommand and beforeBuildCommand.
Read .github/workflows/release.yml and apply the appropriate pattern:
Target: bun
Setup Node.js step with:
- name: Setup Bun
uses: oven-sh/setup-bun@v2
npm ci with bun install --frozen-lockfileTarget: pnpm
Setup Node.js:
- name: Setup pnpm
uses: pnpm/action-setup@v4
cache: 'npm' to cache: 'pnpm' in the setup-node stepnpm ci with pnpm install --frozen-lockfileTarget: npm
actions/setup-node@v4 with cache: 'npm'npm ci for install steppackage-lock.json, bun.lock, pnpm-lock.yaml exists)Update these files, replacing PM commands contextually:
AGENTS.md: Update rule 0 (the "Use npm only" line) to reflect the new PM. For example: 0. **Use bun only**: This project uses \bun`, NOT `npm`. Always use `bun install`, `bun run`, etc.`.claude/skills/init/SKILL.md: Replace PM commands in verification/next-steps sections.claude/skills/check/SKILL.md: Replace PM commands.claude/agents/cleanup-analyzer.md: Replace PM commands.claude/settings.local.json: Update Bash(npm ...) permission patterns to use the new PM (e.g. Bash(bun run format:*))Use Grep to find all remaining references to the old PM across the codebase. Update every documentation file, making sentences read naturally — don't do blind find-replace on prose.
Key files to check:
README.mddocs/USING_THIS_TEMPLATE.mddocs/CONTRIBUTING.mddocs/SECURITY.mddocs/tasks.mddocs/developer/scripts/prepare-release.js (help text)Run a final search for any remaining references to the old PM:
grep -rn "OLD_PM_NAME" --include="*.md" --include="*.json" --include="*.yml" --include="*.js" --include="*.ts" . | grep -v node_modules | grep -v ".lock"
Review any remaining hits — some are intentional (.gitignore entries, .cursorignore patterns listing all PM artifacts).
.gitignore or .cursorignore — these intentionally list artifacts for all PMsnode_modules/ — all three PMs use this directorybunx (bun) or pnpm dlx (pnpm)