.ai/skills/woocommerce-local-env/SKILL.md
Use this skill to get WooCommerce Core running locally without re-reading plugins/woocommerce/README.md and .wp-env.json.
Prefer short root scripts when present. Fall back to filtered package commands if the aliases are not available.
Use this ownership model when deciding whether to run a command or tell the user what to run:
wp-env start/stop commands from the agent when useful for the task. These commands should complete and return control.watch:* commands as user-owned long-running processes. Tell the user to run the relevant watcher in a separate terminal unless a short, temporary watcher session is explicitly needed for active verification.Run these from the repository root:
# Start the wp-env development environment at http://localhost:8888/.
pnpm wc:env
# Stop or restart wp-env.
pnpm wc:env:stop
pnpm wc:env:restart
# Watch all WooCommerce Core build outputs.
pnpm wc:watch
# Watch targeted build outputs.
pnpm wc:watch:admin
pnpm wc:watch:blocks
pnpm wc:watch:classic-assets
# Build all or targeted outputs once.
pnpm wc:build
pnpm wc:build:admin
pnpm wc:build:blocks
pnpm wc:build:classic-assets
pnpm wc:env:restart destroys and recreates the wp-env containers, so use it only when a clean restart is intended.
Fallback commands from the WooCommerce package:
pnpm --filter='@woocommerce/plugin-woocommerce' env:dev
pnpm --filter='@woocommerce/plugin-woocommerce' env:stop
pnpm --filter='@woocommerce/plugin-woocommerce' env:restart
pnpm --filter='@woocommerce/plugin-woocommerce' build
pnpm --filter='@woocommerce/plugin-woocommerce' watch:build
pnpm --filter='@woocommerce/plugin-woocommerce' watch:build:admin
pnpm --filter='@woocommerce/plugin-woocommerce' watch:build:blocks
pnpm --filter='@woocommerce/plugin-woocommerce' watch:build:classic-assets
From plugins/woocommerce/, run the package scripts directly, for example pnpm env:dev or pnpm watch:build.
Check prerequisites when setup fails or when the user asks for first-time setup:
node --version
pnpm --version
php --version
composer --version
docker --version
docker info
Install dependencies from the repository root only when dependencies are missing or stale:
pnpm install
Start the environment:
pnpm wc:env
Tell the user to start a watcher in a separate terminal if frontend or asset changes need live rebuilds:
pnpm wc:watch
Recommend targeted watchers for focused work to reduce noise and startup time:
pnpm wc:watch:adminpnpm wc:watch:blockspnpm wc:watch:classic-assetshttp://localhost:8888/8086plugins/woocommerce/.wp-env.json8.1@woocommerce/plugin-woocommerceplugins/woocommerce/README.mdAfter starting wp-env, verify the site responds:
curl -I http://localhost:8888/
For browser-based verification, open http://localhost:8888/ with the Browser plugin when the user asks to inspect or test the local site.
docker info fails, ask the user to start Docker Desktop and retry.pnpm wc:env fails after dependency changes, run pnpm install, then retry.wp-env containers look stale, run pnpm wc:env:restart only after confirming a destructive environment reset is acceptable.woocommerce-dev-cycle; do not start a full browser workflow unless needed.