[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72WMATAMRTB3D9CC1K84V7Z":3,"skill-same:01M72WMATAMRTB3D9CC1K84V7Z":72},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M72WMATAMRTB3D9CC1K84V7Z","wp-rest-api",null,"Use when building, extending, or debugging WordPress REST API endpoints\u002Froutes: register_rest_route, WP_REST_Controller\u002Fcontroller classes, schema\u002Fargument validation, permission_callback\u002Fauthentication, response shaping, register_rest_field\u002Fregister_meta, or exposing CPTs\u002Ftaxonomies via show_in_rest.","procyon-creative\u002Fwp-dario-provider","procyon-creative","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F108539561?v=4","01M72WGVJQCTY3JENE9DDREJ61","Procyon Creative","01M72WGVKC11SWCNQBV05FHJ6D",0,"GPL-2.0","https:\u002F\u002Fgithub.com\u002Fprocyon-creative\u002Fwp-dario-provider\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwp-rest-api\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: wp-rest-api\ndescription: \"Use when building, extending, or debugging WordPress REST API endpoints\u002Froutes: register_rest_route, WP_REST_Controller\u002Fcontroller classes, schema\u002Fargument validation, permission_callback\u002Fauthentication, response shaping, register_rest_field\u002Fregister_meta, or exposing CPTs\u002Ftaxonomies via show_in_rest.\"\ncompatibility: \"Targets WordPress 7.0+ (PHP 7.4.0+). Filesystem-based agent with bash + node. Some workflows require WP-CLI.\"\n---\n\n# WP REST API\n\n## When to use\n\nUse this skill when you need to:\n\n- create or update REST routes\u002Fendpoints\n- debug 401\u002F403\u002F404 errors or permission\u002Fnonce issues\n- add custom fields\u002Fmeta to REST responses\n- expose custom post types or taxonomies via REST\n- implement schema + argument validation\n- adjust response links\u002Fembedding\u002Fpagination\n\n## Inputs required\n\n- Repo root + target plugin\u002Ftheme\u002Fmu-plugin (path to entrypoint).\n- Desired namespace + version (e.g. `my-plugin\u002Fv1`) and routes.\n- Authentication mode (cookie + nonce vs application passwords vs auth plugin).\n- Target WordPress version constraints (if below 7.0, call out).\n\n## Procedure\n\n### 0) Triage and locate REST usage\n\n1. Run triage:\n   - `node skills\u002Fwp-project-triage\u002Fscripts\u002Fdetect_wp_project.mjs`\n2. Search for existing REST usage:\n   - `register_rest_route`\n   - `WP_REST_Controller`\n   - `rest_api_init`\n   - `show_in_rest`, `rest_base`, `rest_controller_class`\n\nIf this is a full site repo, pick the specific plugin\u002Ftheme before changing code.\n\n### 1) Choose the right approach\n\n- **Expose CPT\u002Ftaxonomy in `wp\u002Fv2`:**\n  - Use `show_in_rest => true` + `rest_base` if needed.\n  - Optionally provide `rest_controller_class`.\n  - Read `references\u002Fcustom-content-types.md`.\n- **Custom endpoints:**\n  - Use `register_rest_route()` on `rest_api_init`.\n  - Prefer a controller class (`WP_REST_Controller` subclass) for anything non-trivial.\n  - Read `references\u002Froutes-and-endpoints.md` and `references\u002Fschema.md`.\n\n### 2) Register routes safely (namespaces, methods, permissions)\n\n- Use a unique namespace `vendor\u002Fv1`; avoid `wp\u002F*` unless core.\n- Always provide `permission_callback` (use `__return_true` for public endpoints).\n- Use `WP_REST_Server::READABLE\u002FCREATABLE\u002FEDITABLE\u002FDELETABLE` constants.\n- Return data via `rest_ensure_response()` or `WP_REST_Response`.\n- Return errors via `WP_Error` with an explicit `status`.\n\nRead `references\u002Froutes-and-endpoints.md`.\n\n### 3) Validate\u002Fsanitize request args\n\n- Define `args` with `type`, `default`, `required`, `validate_callback`, `sanitize_callback`.\n- Prefer JSON Schema validation with `rest_validate_value_from_schema` then `rest_sanitize_value_from_schema`.\n- Never read `$_GET`\u002F`$_POST` directly inside endpoints; use `WP_REST_Request`.\n\nRead `references\u002Fschema.md`.\n\n### 4) Responses, fields, and links\n\n- Do **not** remove core fields from default endpoints; add fields instead.\n- Use `register_rest_field` for computed fields; `register_meta` with `show_in_rest` for meta.\n- For `object`\u002F`array` meta, define schema in `show_in_rest.schema`.\n- If you need unfiltered post content (e.g., ToC plugins injecting HTML), request `?context=edit` to access `content.raw` (auth required). Pair with `_fields=content.raw` to keep responses small.\n- Add related resource links via `WP_REST_Response::add_link()`.\n\nRead `references\u002Fresponses-and-fields.md`.\n\n### 5) Authentication and authorization\n\n- For wp-admin\u002FJS: cookie auth + `X-WP-Nonce` (action `wp_rest`).\n- For external clients: application passwords (basic auth) or an auth plugin.\n- Use capability checks in `permission_callback` (authorization), not just “logged in”.\n\nRead `references\u002Fauthentication.md`.\n\n### 6) Client-facing behavior (discovery, pagination, embeds)\n\n- Ensure discovery works (`Link` header or `\u003Clink rel=\"https:\u002F\u002Fapi.w.org\u002F\">`).\n- Support `_fields`, `_embed`, `_method`, `_envelope`, pagination headers.\n- Remember `per_page` is capped at 100.\n\nRead `references\u002Fdiscovery-and-params.md`.\n\n## Verification\n\n- `\u002Fwp-json\u002F` index includes your namespace.\n- `OPTIONS` on your route returns schema (when provided).\n- Endpoint returns expected data; permission failures return 401\u002F403 as appropriate.\n- CPT\u002Ftaxonomy routes appear under `wp\u002Fv2` when `show_in_rest` is true.\n- Run repo lint\u002Ftests and any PHP\u002FJS build steps.\n\n## Failure modes \u002F debugging\n\n- 404: `rest_api_init` not firing, route typo, or permalinks off (use `?rest_route=`).\n- 401\u002F403: missing nonce\u002Fauth, or `permission_callback` too strict.\n- `_doing_it_wrong` for missing `permission_callback`: add it (use `__return_true` if public).\n- Invalid params: missing\u002Fincorrect `args` schema or validation callbacks.\n- Fields missing: `show_in_rest` false, meta not registered, or CPT lacks `custom-fields` support.\n\n## Escalation\n\nIf version support or behavior is unclear, consult the REST API Handbook and core docs before inventing patterns.\n","# WP REST API\n\n## When to use\n\nUse this skill when you need to:\n\n- create or update REST routes\u002Fendpoints\n- debug 401\u002F403\u002F404 errors or permission\u002Fnonce issues\n- add custom fields\u002Fmeta to REST responses\n- expose custom post types or taxonomies via REST\n- implement schema + argument validation\n- adjust response links\u002Fembedding\u002Fpagination\n\n## Inputs required\n\n- Repo root + target plugin\u002Ftheme\u002Fmu-plugin (path to entrypoint).\n- Desired namespace + version (e.g. `my-plugin\u002Fv1`) and routes.\n- Authentication mode (cookie + nonce vs application passwords vs auth plugin).\n- Target WordPress version constraints (if below 7.0, call out).\n\n## Procedure\n\n### 0) Triage and locate REST usage\n\n1. Run triage:\n   - `node skills\u002Fwp-project-triage\u002Fscripts\u002Fdetect_wp_project.mjs`\n2. Search for existing REST usage:\n   - `register_rest_route`\n   - `WP_REST_Controller`\n   - `rest_api_init`\n   - `show_in_rest`, `rest_base`, `rest_controller_class`\n\nIf this is a full site repo, pick the specific plugin\u002Ftheme before changing code.\n\n### 1) Choose the right approach\n\n- **Expose CPT\u002Ftaxonomy in `wp\u002Fv2`:**\n  - Use `show_in_rest => true` + `rest_base` if needed.\n  - Optionally provide `rest_controller_class`.\n  - Read `references\u002Fcustom-content-types.md`.\n- **Custom endpoints:**\n  - Use `register_rest_route()` on `rest_api_init`.\n  - Prefer a controller class (`WP_REST_Controller` subclass) for anything non-trivial.\n  - Read `references\u002Froutes-and-endpoints.md` and `references\u002Fschema.md`.\n\n### 2) Register routes safely (namespaces, methods, permissions)\n\n- Use a unique namespace `vendor\u002Fv1`; avoid `wp\u002F*` unless core.\n- Always provide `permission_callback` (use `__return_true` for public endpoints).\n- Use `WP_REST_Server::READABLE\u002FCREATABLE\u002FEDITABLE\u002FDELETABLE` constants.\n- Return data via `rest_ensure_response()` or `WP_REST_Response`.\n- Return errors via `WP_Error` with an explicit `status`.\n\nRead `references\u002Froutes-and-endpoints.md`.\n\n### 3) Validate\u002Fsanitize request args\n\n- Define `args` with `type`, `default`, `required`, `validate_callback`, `sanitize_callback`.\n- Prefer JSON Schema validation with `rest_validate_value_from_schema` then `rest_sanitize_value_from_schema`.\n- Never read `$_GET`\u002F`$_POST` directly inside endpoints; use `WP_REST_Request`.\n\nRead `references\u002Fschema.md`.\n\n### 4) Responses, fields, and links\n\n- Do **not** remove core fields from default endpoints; add fields instead.\n- Use `register_rest_field` for computed fields; `register_meta` with `show_in_rest` for meta.\n- For `object`\u002F`array` meta, define schema in `show_in_rest.schema`.\n- If you need unfiltered post content (e.g., ToC plugins injecting HTML), request `?context=edit` to access `content.raw` (auth required). Pair with `_fields=content.raw` to keep responses small.\n- Add related resource links via `WP_REST_Response::add_link()`.\n\nRead `references\u002Fresponses-and-fields.md`.\n\n### 5) Authentication and authorization\n\n- For wp-admin\u002FJS: cookie auth + `X-WP-Nonce` (action `wp_rest`).\n- For external clients: application passwords (basic auth) or an auth plugin.\n- Use capability checks in `permission_callback` (authorization), not just “logged in”.\n\nRead `references\u002Fauthentication.md`.\n\n### 6) Client-facing behavior (discovery, pagination, embeds)\n\n- Ensure discovery works (`Link` header or `\u003Clink rel=\"https:\u002F\u002Fapi.w.org\u002F\">`).\n- Support `_fields`, `_embed`, `_method`, `_envelope`, pagination headers.\n- Remember `per_page` is capped at 100.\n\nRead `references\u002Fdiscovery-and-params.md`.\n\n## Verification\n\n- `\u002Fwp-json\u002F` index includes your namespace.\n- `OPTIONS` on your route returns schema (when provided).\n- Endpoint returns expected data; permission failures return 401\u002F403 as appropriate.\n- CPT\u002Ftaxonomy routes appear under `wp\u002Fv2` when `show_in_rest` is true.\n- Run repo lint\u002Ftests and any PHP\u002FJS build steps.\n\n## Failure modes \u002F debugging\n\n- 404: `rest_api_init` not firing, route typo, or permalinks off (use `?rest_route=`).\n- 401\u002F403: missing nonce\u002Fauth, or `permission_callback` too strict.\n- `_doing_it_wrong` for missing `permission_callback`: add it (use `__return_true` if public).\n- Invalid params: missing\u002Fincorrect `args` schema or validation callbacks.\n- Fields missing: `show_in_rest` false, meta not registered, or CPT lacks `custom-fields` support.\n\n## Escalation\n\nIf version support or behavior is unclear, consult the REST API Handbook and core docs before inventing patterns.\n",{"name":5,"description":7,"compatibility":24},"Targets WordPress 7.0+ (PHP 7.4.0+). Filesystem-based agent with bash + node. Some workflows require WP-CLI.","main","f817b1049ffbf34e5609b8222a18dd91365c08fc",".agents\u002Fskills\u002Fwp-rest-api","https:\u002F\u002Fgithub.com\u002Fprocyon-creative\u002Fwp-dario-provider","https:\u002F\u002Fgithub.com\u002Fprocyon-creative","procyoncreative.com","2026-10-08 08:08:11",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add procyon-creative\u002Fwp-dario-provider --skill wp-rest-api",{"tool":38,"command":39},"bunx","bunx skills add procyon-creative\u002Fwp-dario-provider --skill wp-rest-api",{"tool":41,"command":42},"pnpm","pnpm dlx skills add procyon-creative\u002Fwp-dario-provider --skill wp-rest-api","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fprocyon-creative\u002Fwp-dario-provider\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwp-rest-api\u002FSKILL.md",true,[46,52,56,60,64,68],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fauthentication.md","REFERENCE","参考文档",627,"https:\u002F\u002Fgithub.com\u002Fprocyon-creative\u002Fwp-dario-provider\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwp-rest-api\u002Freferences\u002Fauthentication.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fcustom-content-types.md",760,"https:\u002F\u002Fgithub.com\u002Fprocyon-creative\u002Fwp-dario-provider\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwp-rest-api\u002Freferences\u002Fcustom-content-types.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Fdiscovery-and-params.md",730,"https:\u002F\u002Fgithub.com\u002Fprocyon-creative\u002Fwp-dario-provider\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwp-rest-api\u002Freferences\u002Fdiscovery-and-params.md",{"path":61,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fresponses-and-fields.md",1091,"https:\u002F\u002Fgithub.com\u002Fprocyon-creative\u002Fwp-dario-provider\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwp-rest-api\u002Freferences\u002Fresponses-and-fields.md",{"path":65,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Froutes-and-endpoints.md",1370,"https:\u002F\u002Fgithub.com\u002Fprocyon-creative\u002Fwp-dario-provider\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwp-rest-api\u002Freferences\u002Froutes-and-endpoints.md",{"path":69,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fschema.md",964,"https:\u002F\u002Fgithub.com\u002Fprocyon-creative\u002Fwp-dario-provider\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwp-rest-api\u002Freferences\u002Fschema.md",[73,80,87,94,101,108],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M72WMR8AJ6E3XP3BPW1RVZ6Y","writing-shape","Writing, exploit: shape raw material into an article, paragraph by paragraph.","https:\u002F\u002Fgithub.com\u002Fprocyon-creative\u002Fwp-dario-provider\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwriting-shape\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M72WMQ162SMJ423XYP93VK0G","writing-fragments","Writing, explore: mine raw fragments, no structure yet.","https:\u002F\u002Fgithub.com\u002Fprocyon-creative\u002Fwp-dario-provider\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwriting-fragments\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M72WMN27YT9F31ZTTRZ898NN","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","https:\u002F\u002Fgithub.com\u002Fprocyon-creative\u002Fwp-dario-provider\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M72WMKJEJQXHR67PW7KEE5YB","writing-beats","Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.","https:\u002F\u002Fgithub.com\u002Fprocyon-creative\u002Fwp-dario-provider\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwriting-beats\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M72WMHMM3GQD4P2TJ3EQQCC5","wpds","Use when building UIs leveraging the WordPress Design System (WPDS) and its components, tokens, patterns, etc.","https:\u002F\u002Fgithub.com\u002Fprocyon-creative\u002Fwp-dario-provider\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwpds\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":19},"01M72WMECG0CCPPSQ1BTCFWY7E","wp-wpcli-and-ops","Use when working with WP-CLI (wp) for WordPress operations: safe search-replace, db export\u002Fimport, plugin\u002Ftheme\u002Fuser\u002Fcontent management, cron, cache flushing, multisite, and scripting\u002Fautomation with wp-cli.yml.","https:\u002F\u002Fgithub.com\u002Fprocyon-creative\u002Fwp-dario-provider\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fwp-wpcli-and-ops\u002FSKILL.md",[],[]]