This guide describes how to use the npm scripts defined in WP Rig's package.json for development, building, and maintenance.
Core Development Scripts
npm run dev: Starts the primary development workflow. It builds all assets and watches for changes.
npm run build: Performs a one-time build of all CSS, JS, and block assets.
npm run start: An alias for starting the dev process.
Build Scripts
npm run build:css: Builds only CSS files using build-css.js.
npm run build:js: Builds only JS/TS files using build-js.js.
npm run build:blocks: Builds all WordPress blocks located in the theme.
npm run bundle: Creates a production-ready theme bundle in the parent directory.
npm run bundle:phpcs: Same as bundle, but also runs PHPCS checks.
Initialization and Setup
npm run rig-init: Installs both npm and composer dependencies and initializes the theme. Use this for the first setup.
npm run setup-child: Initializes the theme and creates a child theme using childify.js.
Code Quality and Linting
npm run lint:css: Lints all CSS files in assets/css/src/.
npm run lint:js: Lints all JS/TS files in assets/js/src/.
npm run build:phpcs: Runs PHPCS on the project.
WordPress Blocks
npm run block:new: Interactive command to create a new WordPress block.
npm run block:new:dynamic: Create a new dynamic (PHP-rendered) WordPress block.
npm run block:list: Lists all blocks in the theme.
npm run block:remove: Interactive command to remove a block.
npm run start:blocks: Watches and rebuilds blocks on change.
Testing
npm run test:e2e: Runs Playwright End-to-End tests.
npm run test:e2e:ui: Opens Playwright UI for debugging tests.
npm run test:e2e:screenshot: Captures regression screenshots using Playwright.
Utility Scripts
npm run images: Optimizes images in the assets/images/ directory.
npm run create-rig-component: Helper to create a new WP Rig component class in inc/.
npm run mcp: Starts the Model Context Protocol server for documentation access.
npm run generateCert: Generates local SSL certificates for development.
Best Practices for Agents
Always use npm run dev when making changes to CSS or JS files to ensure they are compiled and you can see the results.
Use npm run block:new instead of manually creating block folders to ensure WP Rig's block structure is followed.
Run npm run lint:css and npm run lint:js before submitting changes to ensure code style consistency.
Use npm run create-rig-component to scaffold new PHP components in the inc/ directory.
1---2name: npm-scripts3description: WP Rig npm scripts4---5# WP Rig npm scripts67This guide describes how to use the npm scripts defined in WP Rig's `package.json` for development, building, and maintenance.89## Core Development Scripts1011* `npm run dev`: Starts the primary development workflow. It builds all assets and watches for changes.12* `npm run build`: Performs a one-time build of all CSS, JS, and block assets.13* `npm run start`: An alias for starting the dev process.1415## Build Scripts1617* `npm run build:css`: Builds only CSS files using `build-css.js`.18* `npm run build:js`: Builds only JS/TS files using `build-js.js`.19* `npm run build:blocks`: Builds all WordPress blocks located in the theme.20* `npm run bundle`: Creates a production-ready theme bundle in the parent directory.21* `npm run bundle:phpcs`: Same as bundle, but also runs PHPCS checks.2223## Initialization and Setup2425* `npm run rig-init`: Installs both npm and composer dependencies and initializes the theme. Use this for the first setup.26* `npm run setup-child`: Initializes the theme and creates a child theme using `childify.js`.2728## Code Quality and Linting2930* `npm run lint:css`: Lints all CSS files in `assets/css/src/`.31* `npm run lint:js`: Lints all JS/TS files in `assets/js/src/`.32* `npm run build:phpcs`: Runs PHPCS on the project.3334## WordPress Blocks3536* `npm run block:new`: Interactive command to create a new WordPress block.37* `npm run block:new:dynamic`: Create a new dynamic (PHP-rendered) WordPress block.38* `npm run block:list`: Lists all blocks in the theme.39* `npm run block:remove`: Interactive command to remove a block.40* `npm run start:blocks`: Watches and rebuilds blocks on change.4142## Testing4344* `npm run test:e2e`: Runs Playwright End-to-End tests.45* `npm run test:e2e:ui`: Opens Playwright UI for debugging tests.46* `npm run test:e2e:screenshot`: Captures regression screenshots using Playwright.4748## Utility Scripts4950* `npm run images`: Optimizes images in the `assets/images/` directory.51* `npm run create-rig-component`: Helper to create a new WP Rig component class in `inc/`.52* `npm run mcp`: Starts the Model Context Protocol server for documentation access.53* `npm run generateCert`: Generates local SSL certificates for development.5455## Best Practices for Agents56571. **Always use `npm run dev`** when making changes to CSS or JS files to ensure they are compiled and you can see the results.582. **Use `npm run block:new`** instead of manually creating block folders to ensure WP Rig's block structure is followed.593. **Run `npm run lint:css` and `npm run lint:js`** before submitting changes to ensure code style consistency.604. **Use `npm run create-rig-component`** to scaffold new PHP components in the `inc/` directory.
Run npx skillmds@latest add comeonoliver/npm-scripts in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
WP Rig npm scripts It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
ComeOnOliver (@comeonoliver) published this skill. Their other Agent Skills are listed on their SkillMD profile.