Wp theme dev init
Initialize WordPress theme development environment (classic or block) with templates, PHPCS, PHPStan, PHPUnit, i18n, GitHub Actions, and build scriptsFrom its SKILL.md
npx -y skills add oberonlai/everything-wp --skill wp-theme-dev-initAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 8 stars8 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
9.2 KB, as published. Nobody here has run it
WordPress Theme Development Initialization Skill
This skill scaffolds a complete WordPress theme — classic (PHP template
hierarchy) or block (HTML block templates + theme.json) — and its
development tooling, following the official WordPress Theme Handbook conventions.
Note on theme type: WordPress officially recommends block themes as the modern method; classic themes (PHP template hierarchy:
index.php,header.php,single.php, …) remain fully supported for projects that need the traditional templating model. This skill supports both — the type is chosen by the user (Greenfield) or auto-detected viatemplates/index.html(Augment).
For block theme reference knowledge (theme.json details, patterns, style variations, Site Editor debugging), see the
wp-block-themesskill.
Trigger Keywords
This skill is triggered when the user says any of the following:
- "Initialize WordPress theme development"
- "Set up WordPress classic theme"
- "Scaffold a classic WordPress theme"
- "Set up a block theme" / "Scaffold a WordPress block theme"
- "請幫我初始化 WordPress 佈景主題開發"
- "建立傳統主題開發環境"
- "建立區塊主題(block theme)開發環境"
Features
-
Detect Theme Information (Augment mode)
- Reads the
style.cssheader of an existing theme - Extracts theme name, slug (text domain), version, and type
(
blockiftemplates/index.htmlexists, elseclassic)
- Reads the
-
Scaffold Classic Theme Files (Greenfield mode, classic)
style.css(theme header + starter CSS),index.php(required)functions.php+inc/setup.php+inc/enqueue.php- Template hierarchy:
header.php,footer.php,sidebar.php,single.php,page.php,archive.php,search.php,404.php,comments.php template-parts/content.php,template-parts/content-none.php
2b. Scaffold Block Theme Files (Greenfield mode, block) — templates in
templates/block/
style.css(theme header only — global styles live intheme.json)theme.json(v3 schema: layout, typography, color palette, template parts)- Minimal
functions.php(text domain, editor style, stylesheet enqueue) - Block templates:
templates/index.html(required),single.html,page.html,archive.html,search.html,404.html - Template parts:
parts/header.html,parts/footer.html
-
Configure Coding Standards
- Installs PHP_CodeSniffer + WordPress Coding Standards (WPCS)
- Adds PHPCompatibility for cross-version PHP checks
- Generates
.phpcs.xml.distwith text-domain and prefix enforcement
-
Configure Static Analysis (PHPStan)
- Installs
phpstan/phpstan+szepeviktor/phpstan-wordpress - Generates
phpstan.neon(level 5; classic scansfunctions.php,inc/,template-parts/— block scansfunctions.phponly, viablock/phpstan.neon.template)
- Installs
-
Configure Unit Testing (PHPUnit)
- Installs
phpunit/phpunit:^9.6,wp-phpunit/wp-phpunit,yoast/phpunit-polyfills - Ships
phpunit.xml.dist, a theme-awaretests/bootstrap.php(registers and activates the theme under test), a sample test, and the canonicalbin/install-wp-tests.sh
- Installs
-
Set Up Internationalization (i18n)
- Creates
languages/and generates a.potviawp i18n make-pot(also extracts strings fromtheme.jsonand block template HTML) - Wires
load_theme_textdomain()andDomain Path: /languages
- Creates
-
Set Up GitHub Actions
qajob (PHPCS + PHPStan) +testjob (PHPUnit matrix on MySQL) →releasejob (build ZIP on tag, create Release)- Version read from the
style.cssheader
-
Create Build Script
scripts/build.phpproduces a distributable ZIP, excluding dev files
Official Recommended Route (Block Theme)
Grounded in the WordPress Theme Handbook:
style.css— required, same header rules as classic. Global styles do NOT go here; they live intheme.json.templates/index.html— required. Its presence is what makes WordPress treat the theme as a block theme.theme.json— the heart of a block theme: settings (layout, typography, color, spacing), styles, and template-part registration. Use"version": 3(WordPress 6.6+).parts/— reusable template parts (header, footer) referenced by templates via<!-- wp:template-part /-->.functions.php— optional and minimal; most classic theme supports (title-tag,html5,post-thumbnails, …) are automatic in block themes.- Site Editor — end users customize templates visually; keep the shipped
templates simple and let
theme.jsondrive the design.
Official Recommended Route (Classic Theme)
Grounded in the WordPress Theme Handbook:
style.css— required. Carries the theme header (Theme Name, Version, Text Domain, License, etc.). Required header fields for the theme directory: Theme Name, Author, Description, Version, Requires at least, Tested up to, Requires PHP, License, License URI, Text Domain.index.php— required. The ultimate fallback in the template hierarchy; its presence is what makes the folder a usable theme.functions.php— strongly recommended. Register theme support in a function hooked toafter_setup_theme(title-tag,post-thumbnails,html5,custom-logo,automatic-feed-links,responsive-embeds),register_nav_menus(),load_theme_textdomain(), and enqueue assets viawp_enqueue_scripts.- Template hierarchy files — implement only what you need; WordPress
cascades down to
index.php. screenshot.png— recommended 1200×900 (a binary file the skill cannot generate; add it manually).- Theme Check — before submitting to WordPress.org, install the official Theme Check plugin and run it in the admin.
Usage
In your theme directory, tell the AI assistant:
Initialize WordPress theme development
Or run the /init-theme command.
Manual Execution (Augment mode only)
bash skills/wp-theme-dev-init/scripts/init.sh
init.sh only supports the Augment path (an existing theme with a
style.css header). The Greenfield path (a brand-new theme) is executed by
the agent following commands/init-theme.md, generating files from templates.
Requirements
- Composer
- WP-CLI (for
wp i18n make-pot; optional but recommended) - MySQL/MariaDB + Subversion (svn) — for the PHPUnit
test:installstep - Git
PHPUnit version: pinned to
^9.6. The WordPress test suite is not compatible with PHPUnit 10/11, andyoast/phpunit-polyfills:^2.0targets PHPUnit 9. Do not bump PHPUnit past 9.x.
Output
After completion, the following may be created:
- Classic:
style.css,index.php,functions.phpand the template hierarchy,inc/setup.php,inc/enqueue.php,template-parts/content.php,template-parts/content-none.php - Block:
style.css,theme.json, minimalfunctions.php,templates/*.html,parts/header.html,parts/footer.html composer.json(PHPCS + PHPStan + PHPUnit dev tools + scripts).phpcs.xml.dist,phpstan.neon,phpunit.xml.disttests/bootstrap.php,tests/test-sample.php,bin/install-wp-tests.sh.github/workflows/release.ymlscripts/build.phplanguages/{{TEXT_DOMAIN}}.potreadme.txt
Placeholders
| Placeholder | Description |
|---|---|
{{THEME_NAME}} | Display name (e.g., "My Cool Theme") |
{{THEME_SLUG}} | Directory / text-domain slug (e.g., "my-cool-theme") |
{{THEME_VERSION}} | Version (e.g., "1.0.0") |
{{THEME_DESCRIPTION}} | Short description |
{{THEME_URI}} | Theme homepage URL |
{{AUTHOR_NAME}} / {{AUTHOR_URI}} | Author name / URL |
{{REQUIRES_WP}} | Minimum WordPress version (Requires at least) |
{{TESTED_UP_TO}} | Tested up to WordPress version |
{{REQUIRES_PHP}} | Minimum PHP version |
{{LICENSE}} / {{LICENSE_URI}} | License name / URL |
{{TAGS}} | Comma-separated theme tags |
{{TEXT_DOMAIN}} | i18n text domain (same as slug) |
{{FUNCTION_PREFIX}} | snake_case function prefix (e.g., "my_cool_theme") |
{{CONST_PREFIX}} | UPPER_SNAKE constant prefix (e.g., "MY_COOL_THEME") |
Coding Standards Notes
The generated .phpcs.xml.dist uses the WordPress standard plus
PHPCompatibilityWP. It enforces the theme text domain on all i18n calls and
requires the theme prefix on global functions, classes, and constants. Run
composer phpcbf to auto-fix most violations.
Troubleshooting
-
dealerdirect/phpcodesniffer-composer-installerblocked- Composer 2.2+ requires allow-listing plugins.
setup-composer.phpadds it toconfig.allow-pluginsautomatically.
- Composer 2.2+ requires allow-listing plugins.
-
wp: command not foundduring i18n- Install WP-CLI, or run
composer make-potlater once WP-CLI is available.
- Install WP-CLI, or run
-
GitHub Actions release 403
- The workflow already sets
permissions: contents: writeon the release job.
- The workflow already sets
-
Theme rejected by Theme Check
- Theme Check is a runtime admin plugin, not a Composer package. Install it in WordPress and run it before submitting to WordPress.org.