Pattern: create or update WordPress block patterns (starter pages, templates, template parts, Query Loop layouts), review pattern registration, block markup, categories, accessibility, or i18n/escaping, or improve pattern design quality. Route custom blocks to wp-block-development; route frontend interactivity to wp-interactivity-api.
67
80%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./skills/wp-patterns/SKILL.mdtheme.json presets for colors, typography, spacing, layout, and gradients.Block markup only — express all visual design through block comment attributes and preset slugs. No inline <style> tags, no custom CSS classes, no arbitrary HTML outside of block wrappers. Read references/design-with-tokens.md for the core principle.
No JavaScript — patterns are static block markup. For interactivity, use blocks that natively support it (Navigation, Search, Query Loop).
Registration-time PHP — pattern files execute PHP once during registration, not at render. Read references/pattern-registration.md for safe output functions, i18n, and functions to avoid.
Valid nesting — read references/block-markup-reference.md for comment syntax and nesting rules.
Native blocks for behavior — use Query Loop, Search, Navigation, Social Icons, or an existing form block instead of custom PHP/HTML behavior. For newsletter, donation, payment, or map behavior, create a CTA/placeholder or use an existing block/plugin.
Local assets — use get_theme_file_uri() with esc_url(); no external placeholder URLs unless the user approves. Read references/pattern-registration.md and references/anti-patterns.md for examples.
node skills/wp-project-triage/scripts/detect_wp_project.mjsnode skills/wp-block-themes/scripts/detect_block_themes.mjspatterns/ directory or needs manual plugin registration.If the user did not provide required inputs, infer only low-risk defaults. Ask before inventing a theme slug, text domain, asset path, custom post type, taxonomy, event date field, or theme-specific preset. If theme.json is missing or presets cannot be verified, use conservative core presets or ask before using theme-specific slugs.
Done when: target theme/plugin root, pattern type, and registration path are confirmed.
Make five deliberate design decisions — purpose, tone, spatial composition, typography hierarchy, and color strategy — before writing block markup.
Read references/design-with-tokens.md for the decision framework and preset mapping.
For pattern-type metadata (starter pages, template patterns, template parts, query loops, forms/CTAs, comparison/pricing, social/navigation/search, 404), read references/pattern-categories-and-types.md — including the Query Loop patterns section when using core/query.
When the request calls for a visually distinctive composition, read references/visual-composition.md.
Done when: all five design decisions are made and recorded before markup.
Sketch the nesting tree before writing markup. Example for a hero pattern:
Group (full-width, constrained layout, dark bg, vertical padding 80)
Group (constrained inner, flex vertical, center align)
Paragraph (uppercase label, small, letter-spacing, accent color)
Heading (h2, xx-large, heading font, tight line-height)
Paragraph (lead text, large, secondary color)
Buttons (flex, center)
Button (primary bg, base text)
Button (outline style)Done when: nesting tree is sketched and hierarchy is intentional before writing comment tags.
Assemble the PHP header and block markup. Read references/pattern-registration.md for header fields, PHP rules, manual registration, and file examples.
Use categories and template types from step 1. Read references/pattern-categories-and-types.md when header metadata was not decided in step 1.
Block markup body:
preset slugs for colors, font sizes, spacingDone when: PHP header and block markup file are written.
Review against the Design Quality Checklist in references/anti-patterns.md. Every item must pass.
Done when: every Design Quality Checklist item passes.
Review against the Technical Validation Checklist in references/anti-patterns.md. Every item must pass.
Done when: every Technical Validation Checklist item passes.
Test the pattern in a real WordPress environment:
Using WordPress Playground (recommended):
npx @wp-playground/cli@latest server --auto-mountMount the theme directory and verify:
templateLock is used, locked elements resist editingFor template patterns, verify the Site Editor offers the pattern in the expected template replacement flow. If Inserter: no is used, confirm it is hidden from the general inserter but still available where intended.
Manual check:
Run the repo's existing lint, build, or test commands if the pattern change touches assets, generated files, or registration code.
When updating an existing pattern, remember that inserted pattern content is copied into posts/templates. Changing the pattern file does not retroactively update already inserted content, and changing block names or saved markup can create recovery prompts for newly inserted content.
For PR or package review, confirm the diff is scoped to the intended pattern files, references, scripts, and eval scenarios. Do not mix unrelated repo updates into a pattern change.
Start with references/block-markup-reference.md, references/pattern-registration.md, and references/anti-patterns.md.
Common failures:
Title, Slug, and Categories headers; confirm the file is under patterns/*.php; confirm Inserter: no is not hiding it.theme-slug/pattern-name or plugin-slug/pattern-name.esc_html_e(), esc_html__(), esc_attr_e(), esc_attr__(), or esc_url() as appropriate.get_posts(), the_title(), wp_get_current_user()) and use blocks such as Query Loop instead.core/post-template, post title/excerpt/date/image blocks, pagination when needed, and core/query-no-results fallback.preset slugs exist in theme.json; avoid unsupported theme-specific slugs unless documented.init, categories are registered before patterns, and pattern content remains static block markup.Stop and ask for help or consult canonical docs when:
preset slugs, text domains, asset paths, or pattern categories cannot be verified.Read references/example-prompts.md.
d87ee69
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.