wp-patterns

작성자: wordpress

기술적으로 정확하고 디자인이 독특한 WordPress 블록 패턴을 생성합니다. 블록 패턴, 시작 페이지 패턴, 템플릿 패턴, 템플릿을 만들 때 사용하세요…

npx skills add https://github.com/wordpress/agent-skills --skill wp-patterns

WordPress Block Patterns

Inputs required

  • Repo root and target theme/plugin directory.
  • Pattern type: section, starter page, template, template part, or manually registered plugin pattern.
  • Theme/plugin slug, pattern slug, and text domain.
  • Pattern title, categories, keywords, block types, template types, and inserter visibility.
  • Target WordPress version if it differs from this repo's compatibility contract.
  • Available theme.json presets for colors, typography, spacing, layout, and gradients.
  • Asset paths for images/icons, including whether assets are decorative or informational.
  • Verification environment: WordPress Playground, wp-env, local WordPress, or manual Code Editor check.
  • If updating an existing pattern: current slug, current file path, and whether existing inserted content must remain compatible.
  • For child themes: child theme slug, text domain, and asset root; do not reuse the parent namespace unless explicitly intended.

Guardrails

  1. 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.

  2. No JavaScript — patterns are static block markup. For interactivity, use blocks that natively support it (Navigation, Search, Query Loop).

  3. 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.

  4. Valid nesting — read references/block-markup-reference.md for comment syntax and nesting rules.

  5. 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.

  6. 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.

Procedure

0) Triage and locate the pattern target

  1. Run triage when working in a repository:
    • node skills/wp-project-triage/scripts/detect_wp_project.mjs
  2. For block themes, locate the target theme root:
    • node skills/wp-block-themes/scripts/detect_block_themes.mjs
  3. Confirm the pattern belongs in a theme patterns/ directory or needs manual plugin registration.
  4. If multiple themes/plugins exist, scope all changes to the requested target.

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.

1) Design thinking

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.

2) Plan block structure

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.

3) Write the pattern file

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:

  • Follow the nesting tree from step 2
  • Use preset slugs for colors, font sizes, spacing
  • Use placeholder text that reflects real content — not "Lorem ipsum"

Done when: PHP header and block markup file are written.

4) Design quality check

Review against the Design Quality Checklist in references/anti-patterns.md. Every item must pass.

Done when: every Design Quality Checklist item passes.

5) Technical validation

Review against the Technical Validation Checklist in references/anti-patterns.md. Every item must pass.

Done when: every Technical Validation Checklist item passes.

Verification

Test the pattern in a real WordPress environment:

Using WordPress Playground (recommended):

npx @wp-playground/cli@latest server --auto-mount

Mount the theme directory and verify:

  • Pattern appears in inserter under specified categories
  • Pattern inserts without block validation errors
  • Layout renders correctly at desktop and mobile widths
  • Content is editable (text, images, buttons)
  • If templateLock is used, locked elements resist editing

For 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:

  • Paste block markup into the Code Editor view in WordPress
  • Switch to Visual Editor — blocks should parse without "Attempt Block Recovery" prompts
  • If recovery is needed, the markup has syntax errors

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.

Failure modes / debugging

Start with references/block-markup-reference.md, references/pattern-registration.md, and references/anti-patterns.md.

Common failures:

  • Pattern missing from inserter: check required Title, Slug, and Categories headers; confirm the file is under patterns/*.php; confirm Inserter: no is not hiding it.
  • Wrong pattern shown or overwritten: check for slug collisions and ensure the slug is namespaced as theme-slug/pattern-name or plugin-slug/pattern-name.
  • Block recovery prompt appears: validate block comment nesting, JSON syntax, and closing comments.
  • Strings are not translated or escaped: replace raw text/PHP output with esc_html_e(), esc_html__(), esc_attr_e(), esc_attr__(), or esc_url() as appropriate.
  • Translations do not load: verify the text domain matches the target theme/plugin.
  • Dynamic content is stale or unavailable: remove query-dependent PHP (get_posts(), the_title(), wp_get_current_user()) and use blocks such as Query Loop instead.
  • Query Loop output is incomplete: check for core/post-template, post title/excerpt/date/image blocks, pagination when needed, and core/query-no-results fallback.
  • Archive/search/category/author context is wrong: use inherited query context instead of hardcoded runtime PHP.
  • CPT or event listings are wrong: confirm post type slugs, taxonomy/date fields, and plugin-provided blocks before generating the pattern.
  • Styles do not match the theme: confirm preset slugs exist in theme.json; avoid unsupported theme-specific slugs unless documented.
  • Accessibility issues: fix skipped heading levels, empty alt text for informational images, low-contrast preset combinations, vague button/link text, social icon labels, search labels, and color-only emphasis.
  • Manual registration fails: confirm the code runs on init, categories are registered before patterns, and pattern content remains static block markup.

Escalation

Stop and ask for help or consult canonical docs when:

  • Theme-specific preset slugs, text domains, asset paths, or pattern categories cannot be verified.
  • Color contrast, image meaning, or content hierarchy needs human design/accessibility judgment.
  • Behavior depends on a WordPress/Gutenberg version not covered by this repo's compatibility contract.

Example prompts

Read references/example-prompts.md.

wordpress의 다른 스킬

blueprint
wordpress
WordPress Playground blueprint JSON 파일을 생성, 편집 또는 검토할 때 사용합니다. blueprint, Playground 구성 또는 요청에 대한 언급 시 트리거됩니다.
wordpress-router
wordpress
We need to translate the given text from English to Korean. The text describes a skill called "wordpress-router" but the instruction says not to include the name unless it appears in the source text. The name does appear in the source? Actually the source text starts with "Classify WordPress codebases..." and does not include "wordpress-router" in the provided text. The instruction says "Do not include the name unless it appears in the source text." So we should not add "wordpress-router" in the translation. The text is a description of the skill. We need to preserve product names like WordPress, WP-CLI, PHP, etc. Also preserve technical terms like "repo type", "plugin", "theme", "block theme", "Gutenberg blocks", "WP core", "bash/Node filesystem operations", "WP-CLI", "PHP 7.2.24+", "WordPress 6.9+". Also preserve numbers and URLs (none here). Translate the rest naturally into Korean. The text: "Classify WordPress codebases and
wp-abilities-api
wordpress
WordPress Abilities API 등록, REST 노출, WordPress 6.9+용 클라이언트 측 사용. PHP에서 wp_register_ability() 및 wp_register_ability_category()를 사용하여 안정적인 ID, 레이블, 메타데이터로 능력과 카테고리를 등록합니다. meta.show_in_rest: true를 설정하여 /wp-json/wp-abilities/v1/ REST 엔드포인트를 통해 클라이언트에 능력을 노출합니다. @wordpress/abilities 패키지를 사용하여 JavaScript에서 능력을 사용하고 클라이언트 측 접근 및 권한 확인을 수행합니다. WordPress 6.9+ 필요...
wp-abilities-audit
wordpress
WordPress 플러그인의 REST 표면을 감사하고 Abilities API 등록을 제안하는 표준화된 감사 문서를 생성합니다. YAML이 포함된 마크다운 문서를 산출합니다…
wp-abilities-verify
wordpress
WordPress 플러그인의 Abilities API 등록을 검증합니다: 능력을 열거하고, 콜백 동작이 각 주석의 주장(적대적…)과 일치하는지 확인합니다.
wp-block-development
wordpress
WordPress 블록 개발 for Gutenberg: 메타데이터, 등록, 렌더링 및 빌드 워크플로우. 블록 생성, block.json 구성, 정적 vs 동적 렌더링, register_block_type_from_metadata()를 사용한 서버 측 PHP 등록을 다룹니다. WordPress 6.9+ 호환성을 위해 apiVersion: 3을 적용하며, iframe 편집기 지원 및 스타일 격리를 포함합니다. 속성 직렬화, "잘못된 블록" 오류를 방지하기 위한 폐기/마이그레이션, 내부 블록 구성을 처리합니다. 포함...
wp-block-themes
wordpress
WordPress 블록 테마 개발: theme.json, 템플릿, 패턴 및 사이트 편집기 문제 해결. theme.json 편집(프리셋, 설정, 블록별 스타일), 템플릿 및 템플릿 부분, 패턴, WordPress 6.9+에서의 스타일 변형을 다룹니다. 테마 루트와 블록 테마 구조를 감지하는 트라이지 스크립트와 새 테마 생성 또는 클래식 테마 변환을 위한 안내 절차를 포함합니다. 스타일 계층 문제, 사용자 맞춤 재정의 및 사이트 편집기 관련 디버깅 워크플로우를 제공합니다.
wp-interactivity-api
wordpress
WordPress Interactivity API 기능(데이터-wp-* 지시문, @wordpress/interactivity 스토어/상태/액션, 블록 viewScriptModule…)을 구축하거나 디버깅할 때 사용합니다.