home / skills / secondsky / claude-skills / woocommerce-dev-cycle

This skill guides WooCommerce development by running tests, enforcing code quality, and troubleshooting to accelerate reliable releases.

npx playbooks add skill secondsky/claude-skills --skill woocommerce-dev-cycle

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.7 KB
---
name: woocommerce-dev-cycle
description: Run tests, linting, and quality checks for WooCommerce development. Use when running tests, fixing code style, or following the development workflow in WooCommerce projects.
---

# WooCommerce Development Cycle

This skill provides guidance for the WooCommerce development workflow, including running tests, code quality checks, and troubleshooting.

## Instructions

Follow these guidelines for WooCommerce development workflow:

1. **Running tests**: See [running-tests.md](running-tests.md) for PHP and JavaScript test commands, test environment setup, and troubleshooting
2. **Code quality**: See [code-quality.md](code-quality.md) for linting and code style fixes
3. **PHP linting patterns**: See [php-linting-patterns.md](php-linting-patterns.md) for common PHP linting issues and fixes
4. **Markdown linting**: See [markdown-linting.md](markdown-linting.md) for markdown file linting and formatting

## Development Workflow

The standard development workflow:

1. Make code changes
2. Run relevant tests: `pnpm run test:php:env -- --filter YourTestClass`
3. Run linting/type checking: `pnpm run lint:changes:branch:php`
4. Fix any issues: `pnpm run lint:php:fix`
5. Commit changes only after tests pass

**Note**: WooCommerce uses pnpm for its build system. For other Node.js projects, prefer bun over npm/pnpm.

## Key Principles

- Always run tests after making changes to verify functionality
- Use specific test filters to run relevant tests during development
- Fix linting errors solely for code in your current branch
- Test failures provide detailed output showing expected vs actual values
- The test environment handles WordPress/WooCommerce setup automatically

Overview

This skill guides the WooCommerce development cycle for running tests, linting, and quality checks. It helps developers validate changes, fix code style issues, and follow the standard workflow used in WooCommerce projects.

How this skill works

The skill outlines commands and patterns to run PHP and JavaScript tests, perform linting, and apply automatic fixes where available. It describes how the test environment sets up WordPress/WooCommerce automatically, how to filter tests for faster feedback, and how to run branch-scoped lint checks. It emphasizes using pnpm as the primary build tool for WooCommerce projects.

When to use it

  • After making code changes to verify behavior and prevent regressions
  • When fixing code style, formatting, or linting issues before committing
  • While troubleshooting failing tests to get expected vs actual output
  • Before creating a pull request to ensure branch-scoped checks pass

Best practices

  • Run targeted tests with filters to speed up development feedback loops
  • Run lint/type checks scoped to your branch to avoid unrelated changes
  • Apply automatic lint fixes for code in your branch before committing
  • Always ensure tests pass locally before pushing or opening PRs
  • Prefer pnpm for WooCommerce builds; use bun for other Node.js projects when applicable

Example use cases

  • Run a single PHP test class after implementing a bug fix to confirm resolution
  • Execute branch-scoped linting to catch style violations introduced by your changes
  • Run PHP and JS test suites in CI to validate cross-language interactions
  • Apply automatic PHP lint fixes to clean up code style before commit
  • Reproduce a failing test locally to inspect detailed expected vs actual output

FAQ

How do I speed up test runs during development?

Use test filters to run only relevant tests or individual test classes to get faster feedback.

Should I run linting across the entire repo?

Prefer running lint checks scoped to your branch so you only fix issues introduced by your changes.