home / skills / microck / ordinary-claude-skills / woocommerce-dev-cycle

woocommerce-dev-cycle skill

/skills_all/woocommerce-dev-cycle

This skill guides WooCommerce development by running tests, linting, and quality checks, improving code reliability and workflow efficiency.

npx playbooks add skill microck/ordinary-claude-skills --skill woocommerce-dev-cycle

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

Files (2)
SKILL.md
1.6 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.
---

# 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

## 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 helps you run tests, linting, and quality checks for WooCommerce development. I document the standard workflow and practical commands for PHP and JavaScript testing, lint fixes, and common linting patterns. Use it to keep changes small, tested, and style-compliant before committing.

How this skill works

I guide you through the development cycle: run targeted tests, run linting and type checks for branch changes, apply automated fixes, and interpret test output. The test environment automates WordPress and WooCommerce setup so you can focus on tests and code quality. Commands are provided for filtering tests and fixing only the code in your current branch.

When to use it

  • After making code changes to verify behavior
  • Before committing to ensure linting and type checks pass
  • When a CI job fails to reproduce local errors
  • When adding or updating PHP or JavaScript tests
  • When preparing a pull request to meet repository standards

Best practices

  • Run specific test filters during development to save time (e.g., --filter YourTestClass).
  • Run linting only for files changed on your branch to limit noise and scope of fixes.
  • Fix lint issues with automated commands before committing to keep diffs clean.
  • Treat test failures as authoritative; read expected vs actual output to locate regressions.
  • Commit only after tests and lint checks succeed locally to reduce CI failures.

Example use cases

  • Run PHP unit tests for a single class while developing a bug fix.
  • Apply PHP code style fixes for only the files changed on a feature branch.
  • Troubleshoot a flaky test using the detailed output that shows expected and actual values.
  • Run markdown linting to clean up documentation before publishing.
  • Use the automated test environment to validate WordPress/WooCommerce integration changes locally.

FAQ

What command runs PHP tests for a specific test class?

Use pnpm run test:php:env -- --filter YourTestClass to run only that class in the test environment.

How do I apply code style fixes for my branch only?

Run pnpm run lint:changes:branch:php to check changes and pnpm run lint:php:fix to apply fixes; both focus on branch files.