90-Minute Interactive Workshop

Building Modern WordPress Themes with WP Rig & AI

A Hands-On Engineering & AI-Native Architecture Masterclass

Onboarding Guide: wprig.io > Learn V3
git clone https://github.com/wprig/wprig.git wprig-workshop
cd wprig-workshop && npm install && npm run dev
Press Space / Right Arrow to Begin

Rob Ruiz

WP Rig Lead & Core Contributor

15 years of custom WordPress development

Custom plugins, custom themes, headless, custom blocks, you name it.

Multiple Anthropic Certifications

Thanks and disclaimer

Thanks to all other contributors

  • Jan Tack
  • Carl Brubaker
This is mostly a solo passion project currently.

Dev has been fast and testing has been limited. Please submit issues and/or PRs on Github if you find anything.

Workshop Roadmap

90 Minutes | 5 Core Milestones

  • 0. Setup & Architecture Concepts (15 mins)
  • 1. Scenario 1: Agency Corporate Theme (25 mins)
  • 2. Scenario 2: Free Block Theme (WP.org) (20 mins)
  • 3. Scenario 3: Custom Child Theme Vibe Coding (20 mins)
  • 5. Live Q&A & Ecosystem Wrap-Up (10 mins)

The Theme Dilemma

Part 1: Classic Starter Themes

  • Monolithic functions.php with procedural spaghetti code
  • Outdated or complete absence of build systems
  • Zero built-in quality gates for accessibility, standards, or PHP quality
  • Lack of direction, convention, automations, or QOL features.
  • Little to no configurability – one model

The Theme Dilemma

Part 2: Pure Modern Block Themes

  • Hard to build custom interactive features without heavy JavaScript
  • Fragile site-editor layouts dependent on third-party plugins
  • Lack of strict architectural patterns for enterprise custom builds

The Problem with AI Code

Without strict rails, AI coding assistants hallucinate, drift, and break theme conventions.

“AI is confident and eager — WP Rig provides direction, opinions, and assertions.”

AI Rails 01

Model Context Protocol

npm run mcp

A dynamic Model Context Protocol server providing AI agents real-time, zero-latency access to WP Rig documentation, theme configuration, and architectural rules.

AI Rails 02

Agent Skills & Protocol

.ai/skills/ & .ai/agent-state.md

Version-controlled instructions for Architecture, Feature Specs (SPEC.md), and Scaffolding—preventing context rot across multi-step dev sessions.

Core Engine 01

esbuild + Lightning CSS

Sub-Second Asset Compilation

Lightning-fast TypeScript and CSS transpilation delivering optimized, minified assets instantly. Custom build scripts provide QOL enhancements like hot module reloading, custom media breakpoints (variable-based breakpoints) and dynamic theme asset referencing in CSS.

Core Engine 02

Modular OOP PHP

Namespaced Components in inc/Components/

Clean, modular PHP architecture where every theme feature is a self-contained, namespaced PHP component with strict single responsibility.

Architecture Pillar 01

Purpose-Focused Components

  • Located in inc/Components/
  • Explicit KDoc contracts for every class and method
  • Clean dependency injection and zero global scope pollution
Architecture Pillar 02

Cookie-Based Critical CSS

  • wprig_critical_cached cookie mechanism
  • Inlines critical styles on first page load for sub-100ms FCP
  • Seamlessly switches to cached stylesheet link on repeat visits
Architecture Pillar 03

Front-End Dev Toolbar

  • Element selector and prompt builder
  • A11y violation detection and remediation including light/dark mode toggling.
  • Template usage breakdown

Dev Toolbar Prompt Generator

  • Extracts computed DOM layout metrics & template paths
  • One-click “Copy Agent Prompt” for instant AI chat context
  • Generates precise CSS fix snippets directly from browser state
Architecture Pillar 04

Pre-Flight Quality Gates

npm run ai:check

  • PHPCS (WordPress Coding Standards)
  • PHPStan (Static Analysis)
  • ESLint (JavaScript Standards)
  • Stylelint (CSS Rules)

Contract Specs & Verification

  • Authoring SPEC.md before writing code prevents scope drift
  • Pre-written Playwright E2E tests provide automated criteria
  • AI agents autonomously run, verify, and self-correct in a loop

One Engine, 3 Scenarios

Today’s Hands-On Workshop Focus Areas

1. Solo Contributor: Free Block Theme for WP.org
2. Agency Team: Lightweight Custom Corporate Theme
3. DIY Marketer: Vibe Coding a Child Theme for Ollie / 2025

Agencies should build custom themes – easier!

“Agencies used to resist developing custom themes because the build vs buy did not make sense. AI has changed this rapidly and dramatically.”
Scenario 01

The Agency Team

Goal: Bespoke Corporate Web & Scalable Engineering

  • Design system consistency matching strict Figma branding
  • Fast multi-developer build execution
  • Strict pre-flight CI/CD quality gates
Scenario 01 Config

Central Configuration

config/config.json

Single source of truth for build settings, theme metadata, OKLCH color pipelines, and component toggles across team developers.

Scenario 01 Governance

Agency PHPCS & Agent Skills

  • Customizable PHPCS sniffs in phpcs.xml.dist for agency standards
  • Version-controlled agent skills in .ai/skills/ committed to Git
Scenario 01 Reusability

Open Component Registry

npm run rig

Discover, pull/inject, publish, and share modular, DRY theme components across multiple theme projects without code duplication. For agencies, a private component registry can be easily configured.

Scenario 01 Diagnostics

Dev Toolbar & Cache Purging

  • Shadow DOM React Developer Toolbar (dev-toolbar.js)
  • One-click front-end AJAX cache purging via wp_ajax_wprig_purge_cache
Scenario 01 Nav System

Dev Nav Lock & Nav Testing

  • Alt / Option key shortcut locks mobile navigation open during CSS styling
  • CSS WP Rig comes with a rigorous navigation testing system to help you iterate on your navigation, as this is one of the most important parts of a WP theme.
Scenario 01 Testing

E2E Navigation & Visual Gates

  • Playwright E2E mobile navigation suite
  • Lighthouse CI performance budgets (npm run test:perf)
  • Pixel-match visual regression snapshots (npm run test:e2e:screenshot)
Scenario 01 Lab

Hands-On Walkthrough

  1. Use Alt/Option nav lock while editing header CSS
  2. Inspect OKLCH colors & template bounds in Dev Toolbar
  3. Register SVG icon set in inc/Components/SVG/
  4. Pull shared Bento component via npm run rig

We should help creative web designers more easily contribute block-based themes to WordPress.org

“We want more block-based themes. However, between the nuances with block-based theme development fear of rejection by the theme review team, serious barriers exist for these invividuals.”
Scenario 02

The Solo Contributor

Goal: 100% WordPress.org Directory Standards Compliance

  • 100% WordPress Core standards compliance
  • Zero third-party runtime JavaScript bloat
  • Accessibility out of the box
Scenario 02 Architecture

Design Tokens & Variations

  • Global color palettes, typography scales, & spacing in theme.json
  • Multi-scheme styles/*.json variations (e.g. dark mode & typography presets)
  • Full Site Editing template parts in templates/
Scenario 02 CSS

CSS Container Queries

  • Solving nested block card layouts with @container queries
  • Fluid typography & spacing with responsive clamp() rules
  • Zero media query clutter for individual block cards
Scenario 02 Tooling

Block Scaffolding & Export

  • Scaffold custom blocks: npm run block:new
  • Auto-registration via inc/Blocks/Component.php
  • Promote block to standalone plugin: npm run block:promote-plugin
Scenario 02 Tooling

Classic-to-Block Conversion

npm run block-based

Automatically prunes classic PHP template hooks and aligns existing theme structures with Full Site Editing standards in a single command.

Scenario 02 Spotlight

Automated Accessibility (`axe-core`)

  • Integrated @axe-core/playwright test suite
  • Catches color contrast and ARIA errors during npm run ai:check
  • Documentation guide available in docs/accessibility-testing.md
Scenario 02 Spotlight

In-Browser A11y Inspector

  • Real-time color contrast ratio scoring (WCAG AA/AAA)
  • Touch-target size validation (44x44px min threshold)
  • Interactive remediation controls directly inside Dev Toolbar
Scenario 02 Lab

Hands-On Walkthrough

  1. Customize theme.json & add styles/dark.json
  2. Scaffold block with npm run block:new
  3. Inspect A11y & template bounds in Dev Toolbar
  4. Run npm run ai:check for zero warnings

Some people rely on a parent theme

“It would be nice if there was an easy drop-in way we could use the build systems of WP Rig for child theme development.”
Scenario 03

The DIY Marketer

Goal: Extending Ollie / 2025 Non-Destructively

  • Non-destructive customizations
  • Preserving parent theme update paths
  • Fast AI-assisted prototyping & vibe coding
Scenario 03 Automation

The `childify` Script

npm run childify

Converts WP Rig into a lean, production-ready child theme targeting Ollie, Twenty Twenty-Five, or classic parent themes in a single command.

Scenario 03 Runtime

Bun Runtime Support

bun run setup-child:bun

Choice of Node or ultra-fast Bun execution delivering instant asset compilation and zero-config child theme builds.

Scenario 03 Compatibility

Rector & Hybrid Architecture

  • Automated PHP upgrades via Rector (composer fix)
  • Hybrid OOP component architecture safely overrides classic or block parent themes
Scenario 03 Vibe Coding

Safe AI Vibe Coding

  • Vibe code new child components with zero risk to parent files
  • Copy DOM metrics & template paths from Dev Toolbar into AI chats
  • Instant hot-reload feedback loop reflects AI edits immediately
Scenario 03 Lab

Hands-On Walkthrough

  1. Run npm run childify targeting Ollie / Twenty Twenty-Five
  2. Prompt AI to vibe code an animated hero section
  3. Confirm parent theme files remain 100% untouched

Synthesizing the Three Paths

“Whether you’re shipping to the WP.org directory, leading an agency team on enterprise custom builds, or vibe coding a child theme for Ollie, WP Rig provides the exact same high-speed, standards-compliant engine.”

Three Scenarios, One Engine

Feature Free Block Theme Custom Agency Theme DIY Child Theme
Audience Solo Developer Agency Multi-Dev Team DIY Marketer / Creative
Focus WP.org Directory Standards Design System & Governance Non-Destructive Overrides
Key Tooling axe-core & Plugin Export Dev Toolbar & Registry (rig) childify Script & Bun Support
AI Guardrails Pre-Flight Gates (ai:check) Git Agent Skills (.ai/skills/) Safe AI Vibe Coding Sandbox

100% Free & Open Source

GPL Licensed | Zero Lock-In

  • 100% GPL Licensed: Completely free open-source framework
  • Zero SaaS Lock-in: No proprietary plugins, subscriptions, or paywalls
  • Complete Ownership: You own 100% of your source code

What else can WP Rig do?

This entire presentation was developed in a custom theme built with WP Rig

  • Completely authored in Gutenberg
  • Presentation features: A custom slide deck feature powered by Reveal.js and other custom JS.
  • Dogfooding WP Rig: This theme was built 3 weeks ago in about 3 hours containing this feature as a spec.

Live Q&A & Next Steps

Thank you for building with WP Rig!

Workshop Guide: wprig.io > Learn V3

GitHub Repo: github.com/wprig/wprig

Community: Join the WP Rig Discord & Discussions

Let’s Talk Themes!