Index of every page on this site: llms.txt
All skills
indhuja avatar

/change-package-manager

@ddcc324
Run it yourself

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.

  • 1 file
  • 5 KB
  • Updated 3 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/indhuja/skilltopia/change-package-manager

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈59 tokens for metadata: the name and description. ≈1.2k when used: this file.

Description uses 2.9% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈235 characters, or 2.9%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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.

Command Mapping Reference

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

Step 1: Functional Config

package.json scripts

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.

tauri.conf.json

Read src-tauri/tauri.conf.json. Update beforeDevCommand and beforeBuildCommand.

GitHub Actions CI

Read .github/workflows/release.yml and apply the appropriate pattern:

Target: bun

  • Replace the Setup Node.js step with:
    - name: Setup Bun
      uses: oven-sh/setup-bun@v2
  • Replace npm ci with bun install --frozen-lockfile

Target: pnpm

  • Add a step before Setup Node.js:
    - name: Setup pnpm
      uses: pnpm/action-setup@v4
  • Change cache: 'npm' to cache: 'pnpm' in the setup-node step
  • Replace npm ci with pnpm install --frozen-lockfile

Target: npm

  • Ensure standard actions/setup-node@v4 with cache: 'npm'
  • Ensure npm ci for install step
  • Remove any pnpm/bun setup steps

Step 2: Lock File

  • Delete the old lock file (whichever of package-lock.json, bun.lock, pnpm-lock.yaml exists)
  • Run the target PM's install command to generate the new lock file

Step 3: AI Instructions & Codex Config

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.`
  • .Codex/skills/init/SKILL.md: Replace PM commands in verification/next-steps sections
  • .Codex/skills/check/SKILL.md: Replace PM commands
  • .Codex/agents/cleanup-analyzer.md: Replace PM commands
  • .Codex/settings.local.json: Update Bash(npm ...) permission patterns to use the new PM (e.g. Bash(bun run format:*))

Step 4: Documentation

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.md
  • docs/USING_THIS_TEMPLATE.md
  • docs/CONTRIBUTING.md
  • docs/SECURITY.md
  • All files under docs/developer/
  • scripts/prepare-release.js (help text)

Step 5: Verify

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).

Important Rules

  • Do NOT change .gitignore or .cursorignore — these intentionally list artifacts for all PMs
  • Do NOT change references to node_modules/ — all three PMs use this directory
  • Preserve natural prose in docs — make sentences read correctly, don't just swap words
  • npx → bunx (bun) or pnpm dlx (pnpm)
  • If the target PM is already in use, inform the user and stop

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at ddcc324. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 3 months ago
What it can do
Reads files Edits files Runs commands
user-invocable
true
argument-hint
<bun|pnpm|npm>
All 6 allowed tools
ReadEditWriteBashGlobGrep

README badge

README badge for indhuja/skilltopia/change-package-manager