[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75KNT6YD8J9J156EJZ47AS3":3,"skill-same:01M75KNT6YD8J9J156EJZ47AS3":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M75KNT6YD8J9J156EJZ47AS3","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.","agisota\u002Fold-one","agisota","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F121413592?v=4","01M75B4BRNT67EC1NDRT8QZEP2","01M75B4BS7QR9VP580MSCPTS3X",3,"MIT","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fwp-rest-api\u002FSKILL.md",[],[],"2026-11-12 13:55:43",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 6.9+ (PHP 7.2.24+). 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 6.9, 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 6.9, 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":23},"Targets WordPress 6.9+ (PHP 7.2.24+). Filesystem-based agent with bash + node. Some workflows require WP-CLI.","main","f37de8f681f0c0ca0e0ebab6e5fddf764ca7553d","skills\u002Fwp-rest-api",1,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one","https:\u002F\u002Fagisota.github.io\u002Fold-one\u002F","https:\u002F\u002Fgithub.com\u002Fagisota","pzd.world","2026-07-04 22:32:06",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add agisota\u002Fold-one --skill wp-rest-api",{"tool":39,"command":40},"bunx","bunx skills add agisota\u002Fold-one --skill wp-rest-api",{"tool":42,"command":43},"pnpm","pnpm dlx skills add agisota\u002Fold-one --skill wp-rest-api","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fwp-rest-api\u002FSKILL.md",true,[47,53,57,61,65,69],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Fauthentication.md","REFERENCE","参考文档",627,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fwp-rest-api\u002Freferences\u002Fauthentication.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fcustom-content-types.md",760,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fwp-rest-api\u002Freferences\u002Fcustom-content-types.md",{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Fdiscovery-and-params.md",730,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fwp-rest-api\u002Freferences\u002Fdiscovery-and-params.md",{"path":62,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Fresponses-and-fields.md",1091,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fwp-rest-api\u002Freferences\u002Fresponses-and-fields.md",{"path":66,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Froutes-and-endpoints.md",1370,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fwp-rest-api\u002Freferences\u002Froutes-and-endpoints.md",{"path":70,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fschema.md",964,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fwp-rest-api\u002Freferences\u002Fschema.md",[74,81,88,97,104,111],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":18},"01M75KRGZWQWE9JDBS6RX42NWV","zoom-out","Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fzoom-out\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M75KRCZHKE0ZYAQFFYHS0YNP","zeroize-audit","Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C\u002FC++\u002FRust code handling secrets, keys, passwords, or other sensitive data.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fzeroize-audit\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":92,"licenseFileUrl":93,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":18},"01M75KR94KYQ30DTE1P9WNDAE0","yeet","Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":18},"01M75KR3H13YJ9QHMD49818FA1","yara-rule-authoring","Guides authoring of high-quality YARA-X detection rules for malware identification. Use when writing, reviewing, or optimizing YARA rules. Covers naming conventions, string selection, performance optimization, migration from legacy YARA, and false positive reduction. Triggers on: YARA, YARA-X, malware detection, threat hunting, IOC, signature, crx module, dex module.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyara-rule-authoring\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":18},"01M75KQMPY8A4Y8XTDD2DT0M9T","x-twitter-growth","X\u002FTwitter growth engine for building audience, crafting viral content, and analyzing engagement. Use when the user wants to grow on X\u002FTwitter, write tweets or threads, analyze their X profile, research competitors on X, plan a posting strategy, or optimize engagement. Complements social-content (generic multi-platform) with X-specific depth: algorithm mechanics, thread engineering, reply strategy, profile optimization, and competitive intelligence via web search.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fx-twitter-growth\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":18},"01M75KQHNZ0ANZNJGZY6M8MDAK","x-api","X\u002FTwitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fx-api\u002FSKILL.md",[],[]]