Full-Site Generation

Safe Full-Site Generation: From Plain-English Description to a Deployed Block Theme

⏱ 17 min

This is the moment everything else in this course has been building toward: an AI coding agent generating an entire block theme from a description of the site you want, not a single function or hook. It’s also the moment where skipping every guardrail from this course is most tempting, because the output looks impressively complete in seconds. This lesson is a structured workflow that gets you the speed without skipping the review, ending at your local Studio site, never at production.

What you'll learn in this lesson
The anatomy of a block theme
style.css, theme.json, templates/, parts/, and patterns/, what an agent needs to generate correctly.
Turning a plain-English brief into a structured prompt
The specific details that separate a usable generation from a guess.
A staged generation workflow
theme.json and structure first, templates second, content and patterns last.
Where review happens, every time
Local Studio site only, before any consideration of a real deploy.
Prerequisites

A local Studio site (Lesson 1), Claude Code or Cursor connected and working inside that site’s wp-content/themes/ directory (Lesson 2), and the wp-secure-code skill from Lesson 4 active in the theme’s repo.

Step 1: know what you’re actually asking the agent to produce

A WordPress block theme (built for the Site Editor) is a specific, well-defined file structure, not an open-ended pile of PHP:

my-generated-theme/
├── style.css              # Theme header comment, required
├── theme.json             # Global styles, color palette, layout settings
├── templates/
│   ├── index.html         # Fallback template, required
│   ├── single.html
│   └── page.html
├── parts/
│   ├── header.html
│   └── footer.html
└── patterns/
    └── hero-section.php

Knowing this structure matters because it lets you ask for the theme in stages that match how the Site Editor actually reads a theme, rather than one enormous undifferentiated request.

Step 2: turn the plain-English brief into a structured prompt

A vague brief produces a vague, generic theme. Add the specifics an agent actually needs to make real decisions:

Vague:
"Build me a theme for a small bakery."

Structured:
"Generate a WordPress block theme for a small neighborhood bakery called
'Maple & Rye'. Warm, earthy color palette (terracotta, cream, deep brown),
serif display font for headings, sans-serif for body text. Pages needed:
Home (hero image, About teaser, hours, CTA to order), Menu (a list of
items with price, using a reusable pattern), Contact (address, hours,
embedded map placeholder). Use theme.json for the color palette and
typography, don't hardcode colors in template markup. Base the header and
footer as separate template parts so they're editable independently."

The structured version gives the agent a name, a palette, specific pages, and an explicit instruction about where configuration should live (theme.json, not inline styles), which is exactly the kind of decision an ungoverned generation tends to get wrong by scattering hardcoded values through every template instead.

Step 3: generate in stages, not all at once

A staged generation workflow
1
Generate theme.json and style.css first
Palette, typography, spacing scale, and the required theme header. Review this before anything else gets built on top of it.
2
Generate parts/header.html and parts/footer.html next
These get reused across every template, get them right before templates reference them.
3
Generate templates/index.html and any page-specific templates
Now referencing the confirmed header and footer parts.
4
Generate reusable patterns last
Hero sections, pricing lists, anything meant to be inserted repeatedly, built on the confirmed theme.json values.

Staging the generation this way means a bad decision in theme.json (the wrong palette, a typography choice that doesn’t match the brief) gets caught before it’s baked into ten templates, instead of after.

// File: theme.json (excerpt, generated in stage 1)
{
  "version": 2,
  "settings": {
    "color": {
      "palette": [
        { "slug": "terracotta", "color": "#c1633c", "name": "Terracotta" },
        { "slug": "cream", "color": "#f5efe3", "name": "Cream" },
        { "slug": "deep-brown", "color": "#3a2b22", "name": "Deep brown" }
      ]
    },
    "typography": {
      "fontFamilies": [
        { "slug": "heading-serif", "fontFamily": "\"Playfair Display\", serif", "name": "Heading serif" },
        { "slug": "body-sans", "fontFamily": "\"Inter\", sans-serif", "name": "Body sans" }
      ]
    }
  }
}

Step 4: install and view the generated theme, locally only

Copy or have the agent write the generated theme directly into your local Studio site’s wp-content/themes/ directory, since that’s the folder you granted it access to in Lesson 2. Activate it from wp-admin like any other theme, then open the Site Editor to actually look at what got generated.

# Context: local Studio site path, not a hosted or production site
wp-content/themes/maple-and-rye/
What to look at first in the Site Editor
Does the palette in the editor match what you asked for?
theme.json values should show up as real color swatches, not hardcoded overrides.
Do the header and footer parts render on every page?
Confirms templates are actually referencing the shared parts, not duplicating markup.
Are patterns actually insertable from the pattern picker?
A pattern file with the wrong header comment won't show up there at all.
Does anything look structurally broken?
Missing index.html, a template referencing a part that doesn't exist, anything the editor visibly complains about.

Step 5: this is where the workflow stops, until you’ve reviewed it

Nothing generated here goes anywhere near a production site yet. The next lesson is the actual review checklist, escaping, capability checks, nonce usage, accessibility, that a theme has to pass before you’d consider it done. Treat the local Studio install as the entire scope of “safe full-site generation” for now, deploying is a separate, deliberate, human-triggered action using Studio’s sync feature from Lesson 1, never something folded into the generation step itself.

An agent that offers to deploy for you is not a shortcut worth taking

If a coding agent suggests pushing the generated theme straight to a live site because it “looks done,” decline. A theme that renders correctly in the Site Editor has cleared exactly one bar, it hasn’t been checked for escaping, capability checks, or accessibility yet, all of which the next lesson covers.

Recap

Generating a full block theme from a plain-English brief works best staged, theme.json and structure first, shared parts second, templates third, patterns last, with a specific, detail-rich prompt instead of a vague one. Every stage gets installed and reviewed on your local Studio site, and nothing here authorizes a deploy to production, that stays a manual, human-triggered step using Studio’s sync feature, and only after the theme passes the hardening checklist in the next lesson.

Resources & further reading

← Adding Slash Commands for Common WordPress Tasks Reviewing and Hardening AI-Generated Theme Code →