AI-Powered Pattern Page Builder for Block Themes
Waygate lets you assemble WordPress pages from block patterns — manually or via a natural-language AI prompt powered by the WordPress AI Client (WordPress 7.0+). Works with any block theme; Elayne is the primary supported theme.
Beta — v0.9.0. Use on staging/development sites; not yet recommended for production.
- Pattern catalog — Browse registered block patterns with slug, title, and categories; filter by category
- AI page generation — Describe the page you want; the AI picks patterns and creates a draft
- Themed text personalization — A second AI call rewrites all headings, paragraphs, and button labels inside the selected patterns to match your topic; uncheck the option for a faster single-call result with original placeholder text
- AI reasoning — The AI's one-sentence explanation of its pattern choices is shown after generation and persisted as post meta on the created page
- Developer debug info — When
WP_ENV=development, the page editor sidebar and the generation notice also show the ordered pattern slugs and generation timestamp - Prompt templates — Six built-in page templates (Homepage, About, Services, Contact, Landing Page, Portfolio) pre-fill the AI prompt; extend via the
waygate_prompt_templatesfilter - Feature detection — AI form is hidden automatically when no provider supports text generation
- Abilities API — Exposes
elayne/list-patternsandelayne/create-pageserver abilities plus awaygate/insert-patternclient-side ability for the block editor (WP 7.0+) - REST API —
GET /wp-json/waygate/v1/patternsandPOST /wp-json/waygate/v1/pagesfor headless and external tool integration - Multi-provider — Works with Mistral, Claude, OpenAI, or Gemini via WP AI Client
- Any block theme — Default prefix is
elayne/; extend via thewaygate_pattern_prefixesfilter
| Requirement | Version |
|---|---|
| PHP | 8.3+ |
| WordPress | 7.0+ |
| Block theme | Any; Elayne recommended |
| WordPress AI Client | 7.0+ (required for AI features) |
composer require imagewize/waygate- Download the latest release zip from GitHub Releases
- Upload and activate via Plugins → Add New → Upload Plugin
AI page generation requires a running AI provider. WordPress 7.0+ supports Mistral, Claude (Anthropic), OpenAI, and Gemini via its built-in Connectors system.
Installing provider plugins (Bedrock / Composer):
composer require wp-plugin/ai-provider-for-mistral
composer require wp-plugin/ai-provider-for-anthropic
# OpenAI and Gemini can be installed from Settings → Connectors in the WP adminConfiguring API keys — every provider supports two methods; environment variable takes priority over the database:
| Provider | Env var | Admin UI |
|---|---|---|
| Mistral | MISTRAL_API_KEY in .env |
Settings → Connectors |
| Claude (Anthropic) | ANTHROPIC_API_KEY in .env |
Settings → Connectors |
| OpenAI | OPENAI_API_KEY in .env |
Settings → Connectors |
| Google (Gemini) | GOOGLE_API_KEY in .env |
Settings → Connectors |
On Bedrock, add the key to your site .env and it is picked up automatically. On standard WordPress installs, enter the key directly in Settings → Connectors and it is stored in the database.
Mistral via Composer library (non-Bedrock, without the WP plugin):
composer require saarnilauri/ai-provider-for-mistralWaygate registers this provider manually since the library distribution excludes plugin.php. Set MISTRAL_API_KEY as a server environment variable.
- Go to Tools → Waygate in the WordPress admin
- Browse registered patterns in the catalog; use the category dropdown to filter
- Optionally pick a Quick template to pre-fill the description, then customise it
- Check Rewrite pattern text to match my description (default: on) to have the AI personalize all headings, paragraphs, and button labels to your topic — uncheck for a faster single-call result with original placeholder text
- Click Generate Page to create an AI-assembled draft
- Open the draft in the block editor, adjust as needed, and publish
When WordPress 7.0's Abilities API is available, Waygate registers three abilities:
| Ability | Type | Description |
|---|---|---|
elayne/list-patterns |
Server | Returns patterns, optionally filtered by category |
elayne/create-page |
Server | Creates a draft page from an ordered list of pattern slugs |
waygate/insert-pattern |
Client (editor) | Inserts a pattern block at the current cursor position in the block editor |
The client-side ability is registered via @wordpress/abilities and is available whenever the block editor is open. Pass a slug parameter (e.g. "elayne/hero-centered") to insert any registered pattern.
Waygate exposes two REST endpoints under /wp-json/waygate/v1/:
| Method | Endpoint | Permission | Description |
|---|---|---|---|
GET |
/patterns |
edit_posts |
List all registered patterns; optional ?category=hero filter |
POST |
/pages |
publish_pages |
Create a draft page from pattern slugs (max 10 req/min per user) |
Example — list patterns filtered by category:
curl -u admin:password https://example.com/wp-json/waygate/v1/patterns?category=heroExample — create a page:
curl -u admin:password -X POST https://example.com/wp-json/waygate/v1/pages \
-H "Content-Type: application/json" \
-d '{"title":"My Page","patterns":["elayne/hero","elayne/features","elayne/cta"],"status":"draft"}'Response:
{ "page_id": 42, "edit_url": "https://example.com/wp-admin/post.php?post=42&action=edit", "view_url": "https://example.com/?page_id=42" }git clone https://github.com/imagewize/waygate.git
cd waygate
composer install
vendor/bin/phpunit --configuration phpunit.xmlGPL-2.0-or-later — see LICENSE.