create-wp-ai-plugin
v0.1.0
Published
Scaffold a new WordPress plugin from wp-agentic-kit, configured for agentic engineering with Claude Code. Run via `npm create wp-ai-plugin <target>`.
Maintainers
Readme
create-wp-ai-plugin
Interactive scaffolder for wp-agentic-kit. Fetches the kit at the requested git ref and replaces the example plugin identity with values you choose.
Usage
npm create wp-ai-plugin my-cool-plugin
# or
npx create-wp-ai-plugin my-cool-pluginYou'll be prompted for:
- Plugin name — free text, e.g.
My Cool Plugin - Vendor prefix — optional, e.g.
pl,acme - One-sentence description — optional, fills the placeholder in
CLAUDE.md/AGENTS.md - Author — optional, fills the
Author:line - Minimum WordPress version — pick from 6.6 / 6.7 / 6.8 / 7.0
- Minimum PHP version — pick from 8.0 / 8.1 / 8.2 / 8.3 / 8.4
The CLI derives the slug, namespace, and constant/function prefixes from your inputs, then substitutes every occurrence across the kit's files.
Pinning a release
npm create wp-ai-plugin my-cool-plugin -- --ref v0.2.0Any branch, tag, or commit SHA on the upstream repo works.
Requirements
- Node.js 18+ and
npm - PHP 8.0+ and
composer giton$PATH(used to initialise a fresh repo with ascaffoldtag on the initial commit)
Missing composer or npm doesn't abort the scaffold — the corresponding install step is skipped and surfaced in the final summary so you can run it manually.
What it does
- Fetches the repo tarball from
codeload.github.comat the requested ref. - Removes kit-only artifacts (
cli/,docs/,.github/). - Substitutes:
pl-example→ your slugPLExample→ your namespacePL_EXAMPLE_*→ your constant prefixpl_example_*→ your function prefixExample Plugin→ your plugin name**WordPress:** 6.7+andminimum_supported_wp_version→ your WP version**PHP:** 8.2+,composer.json#require.php, andtestVersion→ your PHP version- placeholder description / author sentences if you supply them
- Strips kit-meta HTML comments from
CLAUDE.mdandAGENTS.md. - Runs
composer installandnpm installforegrounded with a spinner. Each step's full output is captured to/tmp/setup-<step>-<slug>.logand only surfaced on failure. - Runs three foreground indexing / sync steps with spinners (also logged to
/tmp/setup-<step>-<slug>.log):- Clones WordPress/agent-skills (
trunk) into.claude/skills/, preserving any skill dir already present in the scaffold. wp-devdocs-mcpindexes fresh WP 7.0 sources (wp-ai-client, abilities-api).wp-blockmarkup-mcpindexes Gutenberg core blocks.
- Clones WordPress/agent-skills (
- Initialises a fresh git repo and tags the initial commit
scaffoldsogit reset --hard scaffoldhas a stable anchor.
License
MIT
