dev

작성자: automattic

WordPress ActivityPub 플러그인의 개발 워크플로우로, wp-env 설정, 테스트 명령어, 린팅, 빌드 프로세스를 포함합니다. 개발 환경을 설정할 때 사용하세요.

npx skills add https://github.com/automattic/wordpress-activitypub --skill dev

ActivityPub Development Cycle

Quick reference for common development workflows in the WordPress ActivityPub plugin.

Quick Reference

Environment Management

npm run env-start    # Start WordPress at http://localhost:8888.
npm run env-stop     # Stop WordPress environment.

Testing Commands

npm run env-test                      # Run all PHP tests.
npm run env-test -- --filter=pattern  # Run tests matching pattern.
npm run env-test -- path/to/test.php  # Run specific test file.
npm run env-test -- --group=name      # Run tests with @group annotation.
npm run test:e2e                      # Run Playwright E2E tests.
npm run test:e2e:debug                # Debug E2E tests.

Code Quality

composer lint         # Check PHP coding standards.
composer lint:fix     # Auto-fix PHP issues.
npm run lint:js       # Check JavaScript.
npm run lint:css      # Check CSS styles.
npm run format        # Format all code (wp-scripts).

Building Assets

npm run build         # Build for production (formatted and minified).
npm run dev           # Start development watch mode.

Code Coverage

npm run env-start -- --xdebug=coverage    # Start with coverage support.
npm run env-test -- --coverage-text       # Generate text coverage report.
npm run env-test -- --coverage-html ./coverage  # Generate HTML report.

Comprehensive Documentation

See docs/development-environment.md for detailed setup instructions.

See tests/README.md for comprehensive testing guidance.

See docs/code-linting.md for linting configuration and standards.

Pre-commit Hooks

The repository uses automated pre-commit hooks (.githooks/pre-commit) that run automatically on git commit:

  1. Sort PHP imports - Automatically organizes use statements.
  2. Check unused imports - Prevents unused use statements.
  3. Validate test patterns - Blocks remove_all_filters('pre_http_request').
  4. Run PHPCS auto-fix - Applies coding standards automatically.
  5. Format JavaScript - Runs wp-scripts formatter.

IMPORTANT: Hooks modify staged files automatically. Always review changes before committing. If hooks make changes, you'll need to stage them and commit again.

Setup: Hooks are installed by npm run prepare (runs automatically after npm install).

Common Development Workflows

Initial Setup

git clone git@github.com:Automattic/wordpress-activitypub.git
cd wordpress-activitypub
npm install           # Also runs 'npm run prepare' to install hooks.
composer install
npm run env-start     # WordPress at http://localhost:8888.

Making Changes Workflow

# 1. Make code changes.

# 2. Run relevant tests.
npm run env-test -- --filter=FeatureName

# 3. Check code quality (optional - pre-commit hook does this).
composer lint
npm run lint:js

# 4. Commit (pre-commit hook runs automatically).
git add .
git commit -m "Description"
# Hook may modify files - review and stage again if needed.

Before Creating PR

# Run full test suite.
npm run env-test

# Build assets.
npm run build

# Final lint check.
composer lint
npm run lint:js

Debugging Failing Tests

# Run with verbose output.
npm run env-test -- --verbose --filter=test_name

# Run single test file to isolate issue.
npm run env-test -- tests/phpunit/tests/path/to/test.php

# Check test groups.
npm run env-test -- --list-groups
npm run env-test -- --group=specific_group

Fresh Environment

npm run env-stop
npm run env-start
# wp-env automatically sets up WordPress with debug mode and test users.

Key Files

  • package.json - npm scripts and dependencies.
  • composer.json - PHP dependencies and lint scripts.
  • .wp-env.json - wp-env configuration.
  • phpcs.xml - PHP coding standards (custom WordPress rules).
  • .githooks/pre-commit - Pre-commit automation.

automattic의 다른 스킬

wp-phpstan
automattic
WordPress 프로젝트(플러그인/테마/사이트)에서 PHPStan 정적 분석을 설정, 실행 또는 수정할 때 사용: phpstan.neon 설정, 기준선,…
official
wp-playground
automattic
WordPress Playground 워크플로우에 사용: 브라우저 또는 @wp-playground/cli(서버, run-blueprint, build-snapshot)를 통해 로컬에서 빠르게 일회용 WP 인스턴스를 실행합니다.
official
wp-plugin-development
automattic
WordPress 플러그인 개발 시 사용: 아키텍처 및 훅, 활성화/비활성화/제거, 관리자 UI 및 설정 API, 데이터 저장, 크론/작업, 보안…
official
wp-project-triage
automattic
WordPress 저장소(플러그인/테마/블록 테마/WP 코어/Gutenberg/전체 사이트)의 도구/테스트/버전 등을 포함한 결정론적 검사가 필요할 때 사용합니다.
official
wp-rest-api
automattic
WordPress REST API 엔드포인트/라우트를 구축, 확장 또는 디버깅할 때 사용: register_rest_route, WP_REST_Controller/컨트롤러 클래스, 스키마/인수…
official
wp-wpcli-and-ops
automattic
WP-CLI(wp)를 사용하여 WordPress 작업을 수행할 때 사용: 안전한 검색-바꾸기, DB 내보내기/가져오기, 플러그인/테마/사용자/콘텐츠 관리, 크론, 캐시 플러싱 등
official
wpds
automattic
WordPress 디자인 시스템(WPDS)과 그 컴포넌트, 토큰, 패턴 등을 활용하여 UI를 구축할 때 사용합니다.
official
woocommerce-finalize
automattic
WooCommerce 플러그인을 위한 사전 릴리스 코드 건강 및 추적성 감사. 코드 리뷰 후 실행되며, 죽은 코드, 중복, 구조적 복잡성 등을 중점적으로 확인합니다…
official