builder2
Generates a complete multi-page WordPress site from a one-line prompt: a block
theme (theme.json + templates + header/footer parts + the preview screenshot
WordPress shows on the theme card) plus a companion content plugin that seeds
every generated page on activation and removes them on deactivation. The site
spec carries a page tree (home, menu, about, …); every page gets its own
planned and generated sections. Optionally turns the
AI_IMAGE placeholders it emits into real assets via Google Gemini (through
the WPCOM AI proxy).
The split is deliberate: design lives in the theme, content lives in
projects/<slug>/plugin/ (static seeder code + pages.json manifest +
pages/<slug>.html block markup + images/ content images, which the
seeder imports into the media library on activation). The homepage is a seeded page too —
page_on_front points at it; there is no front-page.html template.
Setup
cp .env.example .env
# Text/code LLM (default Anthropic): ANTHROPIC_API_KEY
# Or xAI Grok: LLM_PROVIDER=xai, XAI_API_KEY, LLM_MODEL=grok-4.6 (and per-step models)
# Or OpenRouter: LLM_PROVIDER=openrouter, OPENROUTER_API_KEY (models come from config/models.json)
# Or Baseten (Kimi/GLM/DeepSeek via the wpcom AI proxy): LLM_PROVIDER=baseten, BASETEN_API_KEY
# Images (optional): GOOGLE_VERTEX_API_TOKEN
composer install
npm ci # optional; installs Playground, screenshot helpers, and block-fixer oracle tooling
Standalone theme generation and block fixing require PHP 8.1+ and the Composer
dependencies installed in vendor/. Embedding hosts may provide those
dependencies through their own autoloader instead.
The block fixer is implemented entirely in PHP and needs neither Node nor
node_modules. WordPress Playground previews and screenshot tooling still use
Node. Use php bin/build.php "…" --no-serve for a PHP-only build.
Install as a plugin
Use .claude-plugin/marketplace.json as the
marketplace entry point and install the site-builder plugin. The plugin ships
the site-build Skill for driving this repository
from a supported coding-agent harness.
Breaking change for downstream consumers: the Node block fixer is gone —
NodeBlockFixer and Package::blockFixerScript() no longer exist. Any host
that vendors this package and wrapped the Node script in a sandbox or adapter
must delete or rewire that adapter in the same change as the re-vendor.
PhpBlockFixer runs in-process with zero runtime dependencies; the frozen
compatibility artifacts and their regeneration path are documented in
docs/block-fixer-oracle.md.
Build a site
php bin/build.php "A cozy neighborhood bakery"
php bin/build.php "A cozy neighborhood bakery" --with-images # also generate images
php bin/build.php "A cozy neighborhood bakery" --provider=openai # Use Astra and Terra.
php bin/build.php "A cozy neighborhood bakery" --html-first # author an HTML+CSS design, then convert it to blocks
php bin/build.php "A cozy neighborhood bakery" --blocks-first # author block markup directly (the default)
php bin/build.php "A cozy neighborhood bakery" --multi-page # let the site plan inner pages beyond the homepage
php bin/build.php "A cozy neighborhood bakery" --multi-page --pages="Home, Menu, About, Visit" # fix the page list yourself (first = homepage)
php bin/build.php "A Persian poetry archive" --writing-direction=rtl --hero-canvas=framed --hero-media-modes=none,foreground-image --max-hero-images=1
--with-images generates every homepage image (including shared header/footer
imagery and the site logo) and existing hero images on interior pages. Other
interior images use neutral local placeholders in their authored shape and
format, without an image-generation request. A text-only hero stays text-only.
The same policy applies to bin/images.php and embedding hosts using
GenerateImagesStep, on both build graphs. Deferred images retain their authored
specs in images.json with status: "placeholder"; reruns keep those placeholders
without spending more image requests. php bin/images.php <slug> --all ignores the
policy and generates every pending image, which is how an eval or a demo gets a
fully imaged build. An image whose source parts the plan does not name is generated
rather than deferred, and recorded in warnings.json. This limits which images
generate, rather than imposing a numeric ceiling on homepage imagery.