Use when running any PNPM custom script command to verify it exists first
This skill ensures you ALWAYS verify custom PNPM scripts exist in package.json before running them. This prevents "command not found" errors and ensures you understand what each script does.
Use this skill BEFORE running ANY custom PNPM script. This includes:
Note: This skill applies to custom scripts only, not native PNPM commands like pnpm install, pnpm add, etc.
This is a PNPM monorepo:
D:\Coding\lightcraft\lightcraft\
โโโ package.json # Root workspace
โโโ spark/frontend/my-vite-app/package.json # Frontend workspace
โโโ spark/cloudflare/workers/file-delivery/package.json # Worker workspace
Workspace filters:
vite โ spark/frontend/my-vite-appworker โ spark/cloudflare/workers/file-deliveryALWAYS follow these steps before running ANY custom PNPM script:
package.jsonpnpm --filter vite [script]: Check frontend package.jsonpnpm --filter worker [script]: Check worker package.jsonpackage.jsonUse the Read tool to open the relevant package.json and find the "scripts" section.
Check if the exact script name exists in the "scripts" object.
Common mistake: Looking for sb:dev:reset in workspace package.json when it's only in root.
Read the script definition to understand:
Example:
"sb:dev:reset": "cd spark/frontend/my-vite-app && pnpm sb:dev:reset"
This root script changes directory to frontend workspace and runs the frontend's sb:dev:reset script.
Use the correct command from the correct location.
| Pattern | Purpose | Location |
|---|---|---|
dev, build, check |
Main commands | Root (delegates to workspaces) |
dev:fe, build:fe, check:fe |
Frontend-specific | Root (uses --filter vite) |
dev:w, w:deploy:* |
Worker-specific | Root |
sb:* |
Supabase commands | Both root and frontend |
| Bare commands | Direct execution | Workspace package.json |
Root Scripts (Delegation Pattern):
// Root package.json
{
"scripts": {
"sb:dev:start": "cd spark/frontend/my-vite-app && pnpm sb:dev:start",
"dev:f": "pnpm --filter vite dev"
}
}
These scripts change directory or use --filter to run workspace scripts.
Workspace Scripts (Direct Execution):
// Frontend package.json
{
"scripts": {
"sb:dev:start": "supabase start",
"dev": "vite"
}
}
These scripts execute actual commands, not delegation.
pnpm --filterWhen using pnpm --filter, you're running scripts from a workspace's package.json:
# This runs the "dev" script from frontend package.json
pnpm --filter vite dev
# NOT from root package.json
User asks: "Run the Supabase reset command"
Your process:
sb:dev:reset"sb:dev:reset": "cd spark/frontend/my-vite-app && pnpm sb:dev:reset""sb:dev:reset": "supabase db reset --local"pnpm sb:dev:reset from root (or the appropriate location)Key: You verified the script exists in BOTH locations (root and frontend) before running.
For detailed examples: .claude/skills/general-pnpm-scripts/examples.md