Back to Skills

wordpress-plugin-scaffold

verified

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 GitHub

Marketplace

emdashcodes-wp-ability-toolkit

emdashcodes/wp-ability-toolkit

Plugin

wordpress-plugin-scaffold

development-tools

Repository

emdashcodes/wp-ability-toolkit
6stars

claude-code-plugins/wordpress-plugin-scaffold/skills/wordpress-plugin-scaffold/SKILL.md

Last Verified

January 20, 2026

Install Skill

Select agents to install to:

Scope:
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-scaffold

Installation paths:

Claude
.claude/skills/wordpress-plugin-scaffold/
Powered by add-skill CLI

Instructions

# 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

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
10214 chars