Dev package json

From Takazudo/claude-resources · View interactive version

Dev package json is an AI agent skill from the GitHub repository Takazudo/claude-resources. Organize package.json scripts and pnpm config: dev/serve scripts, kill-port, port rotation, corepack pinning, pnpm build-script security. Use when editing scripts or on 'Ignored build scripts' warnings.

How to use this skill

Skill file

package.json & pnpm config

1. Scripts organization

Separator keys — unused JSON keys as section dividers: "// ── Name ───…": "", padded with ─ to ~50 chars, placed before the first script of each section.

"// ── Core ─────────────────────────────────────────": "",
"dev": "next dev",
"build": "next build",
"// ── Testing ─────────────────────────────────────": "",
"test": "jest"

Multi-process commands — when a script starts 2+ background processes, extract it to scripts/*.sh from the template scripts/multi-process-dev.sh.template (trap-based cleanup so Ctrl+C takes every child down). chmod +x it.

Multi-environment dev:

"// ── Dev with API (3 environments) ───────────────": "",
"dev:full": "API_MODE=local ./scripts/dev-full.sh",
"dev:full:preview": "API_MODE=preview pnpm dev",
"dev:full:prod": "API_MODE=production pnpm dev"

Section names, suffix conventions, monorepo namespace prefixes, _ internal scripts: references/patterns.md.

2. Serve / dev scripts

Read references/serve-scripts.md before changing any server-starting script. It covers:

Invoked with no flag and no clear intent: ask which tweak to apply. Prefer rotation over kill when worktrees/second checkouts run side by side or the port may belong to something the user wants alive.

3. pnpm version via corepack

Pin in package.json: "packageManager": "pnpm@10.30.2+sha512.…". Once per machine: corepack enable.

4. Dependency build-script security

pnpm 10+ blocks dependency lifecycle scripts by default. Verdicts go in the allowBuilds map in pnpm-workspace.yaml (true = run, false = deny + silence the warning) — NOT .npmrc, where such keys are silent no-ops. Never bulk-approve; evaluate each package.

Workflow for "Ignored build scripts" warnings, decision criteria, known-package verdict table, strictDepBuilds: references/build-scripts.md.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.