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+ 필요...

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

WP Abilities API

When to use

Use this skill when the task involves:

  • registering abilities or ability categories in PHP,
  • exposing abilities to clients via REST (wp-abilities/v1),
  • consuming abilities in JS (notably @wordpress/abilities),
  • diagnosing “ability doesn’t show up” / “client can’t see ability” / “REST returns empty”.

Inputs required

  • Repo root (run wp-project-triage first if you haven’t).
  • Target WordPress version(s) and whether this is WP core or a plugin/theme.
  • Where the change should live (plugin vs theme vs mu-plugin).

Procedure

Before deciding what to register, read references/domain-vs-projection.md — abilities live at the domain capability layer; MCP / Command Palette / REST exposure is a projection. Registration shape and exposure shape are different decisions, and conflating them forces re-registration every time a consumer's constraints change.

1) Confirm availability and version constraints

  • If this is WP core work, check signals.isWpCoreCheckout and versions.wordpress.core.
  • If the project targets WP < 6.9, you may need the Abilities API plugin/package rather than relying on core.

2) Find existing Abilities usage

Search for these in the repo:

  • wp_register_ability(
  • wp_register_ability_category(
  • wp_abilities_api_init
  • wp_abilities_api_categories_init
  • wp-abilities/v1
  • @wordpress/abilities

If none exist, decide whether you’re introducing Abilities API fresh (new registrations + client consumption) or only consuming.

3) Register categories (optional)

If you need a logical grouping, register an ability category early (see references/php-registration.md).

4) Register abilities (PHP)

For grouping decisions (how many abilities to register, and where to put filters vs. new ability names), read references/grouping-heuristic.md first — it keeps you from shipping one atomic ability per REST operation.

To avoid drift between the ability and the existing UI / REST code path, see references/shared-core-service.md — abilities, REST handlers, CLI commands, and UI controllers should be thin adapters over a shared service. The reference also covers the metric trap (REST handlers that emit usage telemetry) and the AGENTS.md rule for keeping registrations in sync when underlying code paths change.

For shared helper patterns when multiple execute callbacks delegate to existing REST controllers, see references/plugin-family-patterns.md (identify the shared-API-client vs zero-arg-controllers shape) and references/delegate-helper-pattern.md (one helper shape that works, and when not to use it).

For standardized WP_Error codes that let agents reason about retry vs. escalation, see references/error-code-vocabulary.md.

Implement the ability in PHP registration with:

  • stable id (namespaced),
  • label/description,
  • category,
  • meta:
    • add readonly: true when the ability is informational,
    • set show_in_rest: true for abilities you want visible to clients.

Use the documented init hooks for Abilities API registration so they load at the right time (see references/php-registration.md).

5) Confirm REST exposure

  • Verify the REST endpoints exist and return expected results (see references/rest-api.md).
  • If the client still can’t see the ability, confirm meta.show_in_rest is enabled and you’re querying the right endpoint.

6) Consume from JS (if needed)

  • Prefer @wordpress/abilities APIs for client-side access and checks.
  • Ensure build tooling includes the dependency and the project’s build pipeline bundles it.

Verification

  • wp-project-triage indicates signals.usesAbilitiesApi: true after your change (if applicable).
  • REST check (in a WP environment): endpoints under wp-abilities/v1 return your ability and category when expected.
  • If the repo has tests, add/update coverage near:
    • PHP: ability registration and meta exposure
    • JS: ability consumption and UI gating

Failure modes / debugging

  • Ability never appears:
    • registration code not running (wrong hook / file not loaded),
    • missing meta.show_in_rest,
    • incorrect category/ID mismatch.
  • REST shows ability but JS doesn’t:
    • wrong REST base/namespace,
    • JS dependency not bundled,
    • caching (object/page caches) masking changes.
  • Execute callback returns unexpected errors or silently ignores input:
    • input_schema defaults aren't being applied, pagination key drift between the ability and the backing, or empty()-based ID validation — see references/input-schema-gotchas.md.

Escalation

  • If you’re uncertain about version support, confirm target WP core versions and whether Abilities API is expected from core or as a plugin.
  • For canonical details, consult:
    • references/rest-api.md
    • references/php-registration.md

wordpress의 다른 스킬

blueprint
wordpress
WordPress Playground blueprint JSON 파일을 생성, 편집 또는 검토할 때 사용합니다. blueprint, Playground 구성 또는 요청에 대한 언급 시 트리거됩니다.
official
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
official
wp-abilities-audit
wordpress
WordPress 플러그인의 REST 표면을 감사하고 Abilities API 등록을 제안하는 표준화된 감사 문서를 생성합니다. YAML이 포함된 마크다운 문서를 산출합니다…
official
wp-abilities-verify
wordpress
WordPress 플러그인의 Abilities API 등록을 검증합니다: 능력을 열거하고, 콜백 동작이 각 주석의 주장(적대적…)과 일치하는지 확인합니다.
official
wp-block-development
wordpress
WordPress 블록 개발 for Gutenberg: 메타데이터, 등록, 렌더링 및 빌드 워크플로우. 블록 생성, block.json 구성, 정적 vs 동적 렌더링, register_block_type_from_metadata()를 사용한 서버 측 PHP 등록을 다룹니다. WordPress 6.9+ 호환성을 위해 apiVersion: 3을 적용하며, iframe 편집기 지원 및 스타일 격리를 포함합니다. 속성 직렬화, "잘못된 블록" 오류를 방지하기 위한 폐기/마이그레이션, 내부 블록 구성을 처리합니다. 포함...
official
wp-block-themes
wordpress
WordPress 블록 테마 개발: theme.json, 템플릿, 패턴 및 사이트 편집기 문제 해결. theme.json 편집(프리셋, 설정, 블록별 스타일), 템플릿 및 템플릿 부분, 패턴, WordPress 6.9+에서의 스타일 변형을 다룹니다. 테마 루트와 블록 테마 구조를 감지하는 트라이지 스크립트와 새 테마 생성 또는 클래식 테마 변환을 위한 안내 절차를 포함합니다. 스타일 계층 문제, 사용자 맞춤 재정의 및 사이트 편집기 관련 디버깅 워크플로우를 제공합니다.
official
wp-interactivity-api
wordpress
WordPress Interactivity API 기능(데이터-wp-* 지시문, @wordpress/interactivity 스토어/상태/액션, 블록 viewScriptModule…)을 구축하거나 디버깅할 때 사용합니다.
official
wp-patterns
wordpress
기술적으로 정확하고 디자인이 독특한 WordPress 블록 패턴을 생성합니다. 블록 패턴, 시작 페이지 패턴, 템플릿 패턴, 템플릿을 만들 때 사용하세요…
official