Top 5 Handiest AI Skills in WP Rig

WP Rig includes a highly advanced, pre-packaged directory of **AI Skills** inside its long-term memory configuration (`.ai/skills/`). These skill files provide specialized, localized instructions that teach AI assistants how to write bug-free code matching WP Rig’s coding standards.

In this lesson, we will explore the **Top 5 Handiest AI Skills** available inside WP Rig.


πŸš€ The Top 5 AI Skills

1. The Styles & Breakpoints Skill (`skills/styles/`)

2. The Gutenberg Block Development Skill (`skills/gutenberg-blocks/`)

3. The PHP Filters & Hooks Skill (`skills/php-filters/`)

4. The WP-CLI Automation Skill (`skills/wp-cli/`)

5. The Testing & Pre-Flight Standards Skill (`skills/code-quality-standards/`)


How to Trigger AI Skill Loading

If your AI coding client (such as Cursor or VS Code) supports workspace indexing: 1. Reference the skill file path directly in your prompt chat (e.g., typing `@SKILL.md` or linking `.ai/skills/styles/SKILL.md`). 2. Use explicit directive statements in your prompt, e.g.: *”Please read `.ai/skills/php-filters/SKILL.md` before refactoring this action hook.”*

By loading these localized guidelines, your AI coding assistant stays aligned with WP Rig’s high-performance architectural patterns, saving you hours of troubleshooting!

Sections:

Block-Based Concerns & React Blocks

When developing block themes or hybrid layouts in WP Rig, you must understand standard Gutenberg engineering practices.

In this lesson, we will explore managing Full Site Editing (FSE) theme style variations, registering block styles, and authoring custom React blocks.


1. Theme Style Variations (`/styles`)

WordPress FSE themes allow you to offer multiple pre-packaged color and typography schemes. These are known as **Style Variations**.

Creating a Style Variation


2. Managing Custom Block Styles & Variations

You can extend existing core WordPress blocks without building complete custom blocks from scratch.

Custom Block Styles

register_block_style(
    'core/button',
    array(
        'name'         => 'dotted-border',
        'label'        => __( 'Dotted Border', 'wp-rig' ),
        'inline_style' => '.is-style-dotted-border { border: 2px dashed var(--color-primary); }',
    )
);

Custom Block Variations


3. Authoring Custom React Blocks

For complex custom elements requiring advanced frontend behavior, authoring custom React-based Gutenberg blocks is necessary.

Scaffolding a React Block

Example: A Minimal `edit.js`

export default function Edit( { attributes, setAttributes } ) { const blockProps = useBlockProps(); return (

setAttributes( { heading: val } ) } placeholder=”Enter card heading…” />
); } “`

Example: A Minimal `save.js`

export default function Save( { attributes } ) { const blockProps = useBlockProps.save(); return (

); } “`

By mastering these block layout approaches, you can build visually stunning editorial designs that remain highly customizable for site authors!

Sections:

WP Rig for Child Theming

WP Rig is an exceptional starter boilerplate for parent themes, but it is also fully optimized for **Child Theme Development**.

In this lesson, you will learn how to leverage the automated `childify` command to create lightweight child themes that inherit parent functionality while keeping WP Rig’s high-efficiency build pipeline!


1. What is WP Rig "Childification"?

In standard WordPress setups, developing a child theme manually means setting up a new folder, writing a `style.css` header referencing the parent, and enqueuing parent styles in PHP. While simple, you lose access to modern CSS, Javascript, and block compilers for your custom child styles.

WP Rig resolves this by incorporating a dedicated **childify** script.

When you run childify, WP Rig: * Converts your active development workspace into an optimized child theme configuration. * Enforces template inheritance in `functions.php`. * Keeps all source folders (`assets/css/src/`, `assets/js/src/`) and **compiler setups (Bun / Lightning CSS)** active locally.

This allows you to write optimized CSS/JS on top of any parent theme (like Twenty Twenty-Five) while letting WP Rig build, compile, and bundle your child theme files dynamically!


2. Running the Childify Script

To convert your WP Rig theme into a lightweight child theme, execute the following steps in your terminal:

1. Set the Parent Theme Variable

{
  "theme": {
    "parent": "twentytwentyfive"
  }
}

2. Run the Command

3. Review the Script Execution


3. Developing inside a Child Theme

Once childified: 1. **Write Styles Globally:** Add custom styles to `assets/css/src/global.css` or specific block style overrides. 2. **Run Dev Compilers:** Run `npm run dev` to watch child changes and inject them into your local browser window. 3. **Bundle child Theme:** When ready for production deployment, run `npm run bundle` to output an optimized, directory-ready child theme zip archive!

Sections:

Mastering Custom CSS & Styling Capabilities

WP Rig’s PostCSS compilation pipeline enables you to write highly structured, modern CSS with powerful design capabilities out of the box.

In this lesson, you will learn how to use pre-defined custom media queries, build an integrated dark mode, and reference theme image assets dynamically inside your stylesheets.


1. Custom Media Queries

Instead of repeating complex, error-prone pixel values inside media queries (e.g., `@media (max-width: 768px)`), WP Rig uses standard-compliant **Custom Media Queries**.

Breakpoints Definition

Usage inside Stylesheets

@media (–medium-query) { .card { width: 50%; } } “`


2. Dynamic Theme Image Referencing in CSS

Referencing images inside your CSS files is notoriously brittle in WordPress because theme URLs change based on site environments. WP Rig provides a custom PostCSS function helper to resolve theme image URLs dynamically!

How to Reference Dynamic Images


3. Built-In Dark Mode Capabilities

Providing a dark mode ensures premium, accessible visual designs. You can implement dark mode easily using native CSS custom properties.

System-Based Dark Mode

“`css :root { –color-bg: #ffffff; –color-text: #1a202c; –color-primary: #3182ce; }

@media (prefers-color-scheme: dark) { :root { –color-bg: #1a202c; –color-text: #f7fafc; –color-primary: #63b3ed; } } “`

Class-Based Toggle

body.dark-mode {
    --color-bg: #1a202c;
    --color-text: #f7fafc;
    --color-primary: #63b3ed;
}

By leveraging these built-in CSS capabilities, your design remains modern, fast, and fully responsive across all device sizes and color preferences!

Sections:

Optimizing Image & Font Assets

Performance and optimization are core pillars of WP Rig. In this lesson, we will explore how WP Rig handles automatic image compression and how to configure privacy-first, locally-hosted web fonts.


1. Automatic Image Compression via `sharp`

High-resolution images are the biggest contributor to slow page weights and poor Core Web Vitals. WP Rig resolves this by integrating **sharp** β€” an extremely fast, high-performance Node.js image processing library powered by `libvips`.

How the Pipeline Works

During builds or development watch runs, WP Rig automatically: 1. **Compresses & Minifies:** Compresses image sizes while preserving visual quality. 2. **Performs Lossless Auditing:** Truncates metadata profiles and converts assets. 3. **Generates Optimized Output:** Outputs compressed images straight to `assets/images/` as production-ready artifacts.

Triggers


2. Privacy-First Google Fonts Integration

Loading fonts directly from Google’s CDNs (`fonts.googleapis.com`) violates GDPR compliance regulations and triggers external network connection delays. WP Rig uses a **locally-hosted, privacy-first font loader**.

The Font Downloading Engine

How to Configure Custom Fonts

By serving your images and web fonts locally from your host server, you guarantee maximum performance, perfect GDPR compliance, and sub-second page rendering!

Sections:

Tailoring Configurations & Theme Settings

In this final lesson, we will explore the underlying configuration parameters that define WP Rig’s development behaviors, design tokens, and production bundler.


1. Customizing Theme Meta

Under `config/config.json`, you define configuration settings that govern the overall theme name, directories, and assets:

{
  "theme": {
    "slug": "excalibur",
    "name": "Excalibur Theme",
    "author": "My Web Studio"
  }
}

During initialization or compilation, WP Rig dynamically parses this file to: * Perform global search-and-replace naming operations across files. * Update theme directory names. * Write appropriate comments and standard style metadata headers inside `style.css`.


2. Managing Design Tokens

WP Rig integrates design configurations inside `config/tokens.json` (or standard `theme.json`). This centralized file controls: * **Typography:** Registering custom web fonts, defining font weights, line-height scales, and letter spacing values. * **Colors:** Specifying your brand color palettes, theme backgrounds, and gradients. * **Layout Grid:** Declaring custom widths, gutter sizes, margins, and section padding systems.

By updating your properties inside this JSON index, your style compilers automatically lower these settings into **CSS Custom Properties** (`var(–color-primary)`) globally, allowing you to re-brand the theme visually in seconds!


3. Bundling for Production

Once development is complete and you are ready to upload your theme to a live staging or production environment, run:

npm run bundle

This command triggers a comprehensive production compilation sequence: 1. Compiles, minifies, and prefixes all CSS and Javascript source files, deleting source folders inside the production build. 2. Compresses and optimizes theme images (SVG, PNG, JPG). 3. Performs strict security checks on PHP classes. 4. Generates a clean, production-ready zip archive under `/artifacts/` named `[theme-slug].zip`.

You can upload this zip file directly to any production WordPress site via the native installer!


πŸŽ‰ Congratulations!

You have successfully completed the WP Rig v3 onboarding curriculum!

You are now equipped with the advanced knowledge required to build lighting-fast, standards-compliant, and AI-accelerated block-enabled themes. Keep this guide bookmarked for quick command lookups, and happy theme coding!

Sections:

Launching the Dev Server & Asset Directories

With your theme active and fully scaffolded, you are ready to enter your daily development routine. In this lesson, we will explore starting the local dev server and how to navigate WP Rig’s source asset folders.


1. Start the Dev Server

Every time you sit down to develop, run this command in your terminal inside the theme directory:

npm run dev

This command: 1. Initiates asset compilers in **watch mode**. 2. Spins up a BrowserSync proxy server. 3. Automatically opens your default web browser to the proxy URL (e.g., `https://wprig.io/`). 4. Launches a live reload loop: CSS modifications are injected instantly into the DOM without refreshing; PHP/JS saves trigger automated browser reloads.


2. Navigating the Source Directories

WP Rig follows a strict **Source vs. Compiled Artifacts** pattern. You **MUST** edit files exclusively under source directories. Never edit files in the root `assets/` directory directly, as they are overwritten by compilers during builds!

Look inside `assets/`:

assets/
β”œβ”€β”€ css/
β”‚   β”œβ”€β”€ src/             <-- EDIT THESE FILES ONLY
β”‚   β”‚   β”œβ”€β”€ editor.css
β”‚   β”‚   β”œβ”€β”€ global.css
β”‚   β”‚   └── navigation.css
β”‚   └── (compiled files) <-- NEVER EDIT THESE (Overwritten)
└── js/
    β”œβ”€β”€ src/             <-- EDIT THESE FILES ONLY
    β”‚   β”œβ”€β”€ global.ts
    β”‚   └── navigation.ts
    └── (compiled files) <-- NEVER EDIT THESE (Overwritten)

CSS Architecture & PostCSS

JavaScript Compilation


The Build Watch Cycle

Whenever you save a file in a `/src/` folder: 1. The compiler catches the save event in less than 50ms. 2. It parses syntax, processes imports, low-level bundles, and minifies the results. 3. BrowserSync injects the updated files directly into your active browser tabs instantly!

In our next lesson, we will explore setting up your local AI agent to accelerate your development inside this workspace!

Sections:

Verification & Installation of System Runtimes

Before diving into theme engineering, you must ensure your local development machine has the required system runtimes installed. WP Rig relies on modern compiler libraries and package managers to achieve fast, optimized asset builds and static PHP analysis.

In this lesson, you will learn how to verify and install the core dependencies of WP Rig v3.


The Required Runtimes

Ensure your terminal can access the following five system packages:

1. Git (Source Control)

2. Node.js (v20+ or newer)

3. Bun (High-Performance Runtime)

4. PHP (v8.1 or higher – v8.3 Recommended)

5. Composer (PHP Dependency Manager)


Summary Checklist

Run this command in your terminal to verify that everything is configured correctly:

git --version && node --version && bun --version && php --version && composer --version

If all commands output successful version strings, your development machine is fully primed! In the next lesson, we will set up your local WordPress development site.

Sections:

Creating Custom Components & PHP-Only Blocks

WP Rig excels at providing pre-configured structures, but its true power lies in its modular extensibility. In this lesson, we will explore generating custom OOP PHP components and developing modern, zero-JS custom Gutenberg blocks.


1. Generating Custom PHP Components

Every core feature in WP Rig (Styles, Fonts, sidebars, Menus) is organized into a modular **Component** class under `inc/`.

To create a new custom PHP feature (for example, registering a custom post type or third-party API tracker), do not write procedural code in `functions.php`. Instead, generate a new component!

Generate via CLI

“`php namespace WP_RigWP_RigMy_Tracker;

use WP_RigWP_RigComponent_Interface;

class Component implements Component_Interface { public function get_slug(): string { return ‘my-tracker’; } public function initialize(): void { add_action( ‘init’, array( $this, ‘register_hooks’ ) ); } public function register_hooks(): void { // Your OOP Hook Logic Here } } “`

WP Rig’s core theme bootstrap automatically registers this class on boot, keeping your theme modular, organized, and trace-friendly!


2. Developing Custom Blocks

WP Rig includes a built-in block scaffolding engine that makes block development extremely simple.

Traditional React-based Block

WordPress 7.0 PHP-Only Block (Zero JS)


3. Server-Side Block Manifest Compilation

Registering blocks individually via filesystem directory scanning can degrade site speeds on every page hit. To optimize performance, WP Rig v3 uses a pre-compiled **Block Manifest** (`assets/blocks/blocks-manifest.php`).

When you compile your blocks: “`bash npm run build:blocks “` WP Rig scans all configurations and writes them into a unified, memory-cacheable PHP array, loading custom blocks near-instantaneously!

In our final lesson, we will master the layered configuration parameters and tokens to customize your theme designs!

Sections:

Setting Up AI Agents for Accelerated Engineering

AI Coding Assistants (such as Cursor, VS Code Copilot, Windsurf, or Claude) can dramatically accelerate your theme development β€” but only if they have the proper context.

In this lesson, you will learn how to configure local AI coding assistants inside WP Rig and use our pre-packaged `.ai/` system to prevent model hallucinations.


The AI Challenge in WordPress

WordPress theme development historically relies on procedural scripts and global templates. When an AI assistant attempts to write code in a standard theme, it often: * Generates global namespace collisions. * Uses outdated or legacy PHP functions. * Writes custom CSS that overrides theme variables.

WP Rig v3 resolves this by incorporating an **AI-Native Framework**. By combining WP Rig’s strict PHP namespaces, OOP Components, and PSR-4 autoloading, AI agents can trace, read, and write code cleanly with near-zero errors!


Step-by-Step AI Agent Activation

To boot up and configure your local AI agent, run the following setup script inside the theme folder:

npm run ai:setup

This script scans your active project configurations and configures standard environment rules for your workspace (writing configurations for Cursor, Windsurf, Copilot, and Claude).


Navigating the `.ai/` Directory

WP Rig integrates a specialized directory to act as the “long-term memory” and command center for your AI assistant. Look under `./.ai/`:

.ai/
β”œβ”€β”€ agent-state.md         # Tracks onboarding status (Pending vs. Completed)
β”œβ”€β”€ developer-directions.md # Write your custom coding guidelines here
β”œβ”€β”€ PROJECT_RULES.md       # Chronological log of custom architectural learnings
└── skills/                # Core technical tutorials for AI (CSS, PHP, Blocks)

1. `developer-directions.md`

2. `PROJECT_RULES.md`

3. Contract-First specs


The Quality Check Sweep

After your AI writes PHP, CSS, or JS, have it run:

npm run ai:check

This runs automated lints, PHPStan static checks, and Playwright tests. If any check fails, the AI can read the console logs and debug/heal its own code autonomously!

In our next section, we will see how to leverage WP Rig’s built-in generators to scaffold OOP PHP components and blocks!

Sections: