Setup PHP WordPress
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Generate (or bring up to date) a WordPress plugin or block theme repository on this catalog’s PHP toolchain: a small real code skeleton plus the build, test, lint and packaging configuration, verified with its own gates before it reports success.
Purpose
iru-setup-php-wordpress treats the repository root as the plugin or theme directory. With flavor: plugin it writes
the main plugin file (full header, ABSPATH guard, version constant), a namespaced PSR-4 src/ (composition root,
filter service with a documented custom hook, settings page whose admin-post.php handler checks nonce and
capability, REST route with a permission_callback), uninstall.php, languages/, a WordPress.org readme.txt
and .distignore; blocks: yes additionally adds a blocks/ source directory built by @wordpress/scripts and a first dynamic block. With
flavor: theme it writes a block theme (style.css header, theme.json v3, templates, parts, translatable patterns
and a minimal functions.php). Both flavors get composer.json with the catalog’s shared scripts, phpcs.xml.dist
(WordPress-Extra, WordPress-Docs, PHPCompatibilityWP), phpstan.neon.dist (phpstan-wordpress, level 6), a Brain
Monkey unit suite, a WP_UnitTestCase integration suite running in a dedicated @wordpress/env environment,
sample tests, Clover/JUnit output under build/logs/, browser UI tests per the catalog’s UI contract (see Building user interfaces) and sonar-project.properties when Sonar is on. The UI tests are a .ui-quality.yml, a playwright.config.ts extending wp-scripts test-playwright against the wp-env tests instance, @axe-core/playwright, the shared tests/e2e/support/ui-screenshots.ts helper, a test-only RTL mu-plugin and a sample spec (the plugin’s ContentNotice component or the theme’s Index screen) that captures .ui-screenshots/ across left-to-right/right-to-left x light/dark with an accessibility check. With accessibility: none no accessibility tooling is installed and the templates omit assistive-technology attributes; otherwise they carry them.
Dependency versions, the PHP floor and the WordPress floor/tested-up-to versions are resolved live (Packagist, npm, php.net, api.wordpress.org) with a documented fallback table; PHPUnit stays on 9.6 because the WordPress test library still targets it. For every owned file that already exists the skill warns and asks Update / Keep as is / Replace.
Plugin
Shipped by the iru-php plugin of the ai-catalog marketplace (install with /plugin install iru-php@ai-catalog; see Plugins).
Invocation
/iru-setup-php-wordpress
/iru-setup-php-wordpress
flavor: plugin
name: Acme Loans
slug: acme-loans
Inputs
Optional args, one key: value per line (supplied by iru-setup-php-repository); unknown keys are ignored.
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
|
Detected from a |
|
No |
Identity of the plugin/theme: human name, kebab-case slug (also text domain and directory name), Composer vendor, PSR-4 namespace, snake_case function/option/hook prefix. |
Derived from the name, the git remote’s owner and existing files; confirmed or asked. |
|
No |
Header and |
Asked when missing. |
|
No |
SPDX id or |
Asked; GPL-2.0-or-later recommended. |
|
No |
PHP floor and WordPress floor ( |
PHP floor from php.net active branches; WordPress floor two releases behind the live tested-up-to version (raised
for |
|
No |
|
Asked; |
|
No |
Drive the license, Sonar recommendation and packaging notes. |
|
|
No |
|
|
|
No |
|
|
|
No |
|
|
|
No |
|
|
Outputs
-
The plugin or block theme skeleton and shared tooling files described above (created, updated, replaced, or kept as is per file).
-
.ui-quality.yml,playwright.config.ts,tests/e2e/support/ui-screenshots.ts,tests/e2e/mu-plugins/iru-ui-test-direction.phpand the sample spec(s) (ContentNotice.spec.ts, plus a block spec withblocks: yes; orIndex.spec.tsfor a theme); screenshots land in.ui-screenshots/as<state>--<direction>--<theme>.png. -
A generated
composer.lock/package-lock.jsonafter installing dependencies, and (withblocks: yes) a builtbuild/directory. -
Verification of the fast gates (unit tests, coverage, PHPStan, PHPCS) and, when Docker is available and the user agrees, the wp-env integration suite and browser UI tests (Chromium installed with
npx playwright install chromium; unverified without a browser), run under the repository-wide.integration-test.lock/. -
A report starting with the setup mode (created from scratch or updated) covering identity, floors and their sources, live versus fallback versions, the PHPUnit 9 decision, per-file action, gate results, and explicit warnings (review the files, WordPress.org slug approval and
Contributors:for store distribution, namespace prefixing before the first runtime Composer dependency, whatiru-setup-php-gitignoreandiru-setup-php-github-workflowsstill own). -
It never writes
.gitignore,README.md,CHANGELOG.md,LICENSE, workflows ordocs/.
Execution flow
Dependencies
Invokes
None — this skill is a leaf: it uses Composer, npm, PHP and Docker directly. It follows the conventions that
iru-php-code-one-task enforces later and produces a result the iru-php-test, iru-php-coverage,
iru-php-code-quality and iru-php-phpdoc gate skills run on unchanged, but it does not call them.
Invoked by
-
Setup PHP Repository — Step 5, scaffold for a WordPress plugin/theme, via the
iru-isolated-skill-executoragent.
Source
SKILL.md on GitHub — the file this page was generated from.