Scaffold WordPress plugins using WP-CLI commands (wp scaffold plugin, wp scaffold plugin-tests). Use this skill when creating new WordPress plugins or adding test infrastructure to existing plugins.
View on GitHubemdashcodes/wp-ability-toolkit
wordpress-plugin-scaffold
claude-code-plugins/wordpress-plugin-scaffold/skills/wordpress-plugin-scaffold/SKILL.md
January 20, 2026
Select agents to install to:
npx add-skill https://github.com/emdashcodes/wp-ability-toolkit/blob/main/claude-code-plugins/wordpress-plugin-scaffold/skills/wordpress-plugin-scaffold/SKILL.md -a claude-code --skill wordpress-plugin-scaffoldInstallation paths:
.claude/skills/wordpress-plugin-scaffold/# WordPress Plugin Scaffold This skill provides guidance for scaffolding WordPress plugins using WP-CLI's scaffold commands. It supports both creating new plugins from scratch and adding test infrastructure to existing plugins. **Note:** This skill works seamlessly with the **wp-env skill (if available)**. When wp-env setup or management is needed, activate the wp-env skill for comprehensive environment handling. ## About WP-CLI Scaffold Commands WP-CLI provides two primary scaffolding commands for plugin development: ### wp scaffold plugin Generates starter code for a new plugin, including: - Main plugin PHP file - `readme.txt` for WordPress.org - `package.json` with Grunt tasks for i18n and readme conversion - Editor configuration files (`.editorconfig`, `.gitignore`, `.distignore`) - Optional: PHPUnit test suite, CI configuration, and PHP_CodeSniffer rules ### wp scaffold plugin-tests Adds PHPUnit test infrastructure to an existing plugin, including: - `phpunit.xml.dist` configuration - CI configuration (CircleCI, GitHub Actions, GitLab, Bitbucket) - `bin/install-wp-tests.sh` for WordPress test suite setup - `tests/bootstrap.php` to activate the plugin during tests - `tests/test-sample.php` with example test cases - `.phpcs.xml.dist` for PHP_CodeSniffer rules ## Prerequisites Verify WP-CLI is installed and accessible: ```bash wp --version ``` If WP-CLI is not installed, see [references/wp-cli-installation.md](references/wp-cli-installation.md) for comprehensive installation instructions across all platforms. ## Environment Detection **IMPORTANT:** Before running any scaffold commands, detect which WordPress environment is available: ### Detection Strategy 1. **Check for existing WordPress installation** (preferred): ```bash wp core version 2>/dev/null ``` - If successful → Use `wp scaffold plugin` directly - You're already in a WordPress installation, no additional setup needed 2. **Check for wp-env configuration**: ```bash