[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FK7RGVNKJ12083FV59RPCE":3,"skill-same:01M6FK7RGVNKJ12083FV59RPCE":47},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M6FK7RGVNKJ12083FV59RPCE","gutenberg-blocks",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fwprig\u002Fwprig\u002Fgutenberg-blocks\u002FSKILL.md",[],[18,19],"blocks","gutenberg blocks","2026-11-10 10:12:30",false,"# Gutenberg Blocks in WP Rig\n\nWP Rig features a built-in system for creating and managing theme-scoped Gutenberg blocks, powered by `@wordpress\u002Fcreate-block` and fully integrated with the theme's build system.\n\n## Configuration & Support\n\nBefore scaffolding or modifying blocks, you **MUST** reference the `config\u002Fconfig.json`.\n\n*   **Check Support:** Verify that `theme.enableBlocks` is set to `true`.\n*   **Action Required:** If `enableBlocks` is `false`, you cannot scaffold blocks. Instruct the user to run `npm run theme:enable-blocks` before proceeding.\n\n## Scaffolding a New Block\n\nUse the `block:new` script to create a new block. By default, blocks are created in `assets\u002Fblocks\u002F\u003Cslug>\u002F`.\n\n### Basic Command\n```bash\nnpm run block:new -- \u003Cslug> --title=\"Block Title\"\n```\n*Note: Include the `--` before arguments when using `npm run`.*\n\n### Options\n- `-d, --dynamic`: Create a dynamic block (server-side rendered via `render.php`).\n- `--ts`: Use TypeScript for the block's source files (`.tsx`).\n- `--view`: Add a frontend-only script (`view.js`).\n- `--category \u003Cstring>`: Block category (defaults to `widgets`).\n- `--icon \u003Cstring>`: Dashicon or SVG icon name.\n\n**Example: Dynamic TypeScript Block**\n```bash\nnpm run block:new -- my-hero --title=\"Hero Image\" --dynamic --ts\n```\n\n## Filesystem Layout\n\nEach block lives in its own directory under `assets\u002Fblocks\u002F`:\n- `block.json`: Metadata and asset registration.\n- `src\u002Findex.(js|ts|tsx)`: Editor entry point.\n- `src\u002Fedit.(js|ts|tsx)`: Block edit component.\n- `style.css`: Frontend styles.\n- `editor.css`: Editor-only styles.\n- `render.php`: PHP template (only for dynamic blocks).\n- `build\u002F`: Compiled assets (generated automatically).\n\n## Auto-Registration\n\nWP Rig automatically discovers and registers blocks. You do **not** need to manually add PHP code to register your block if it's in the `assets\u002Fblocks` directory.\n\nThe `inc\u002FBlocks\u002FComponent.php` class:\n1. Scans `assets\u002Fblocks\u002F*\u002Fblock.json` on the `init` hook.\n2. Automatically includes `render.php` if it exists.\n3. Calls `register_block_type()` for each directory.\n\n## Block Attributes & Wrapper\n\nUse the provided template tags for consistent block output in `render.php`:\n\n```php\n\u003C?php\n\u002F\u002F render.php example\n$wrapper_attributes = wp_rig()->block_wrapper_attributes( [ 'my-custom-class' ], $attributes );\n?>\n\u003Cdiv \u003C?php echo $wrapper_attributes; ?>>\n    \u003Ch2>\u003C?php echo esc_html( $attributes['title'] ?? '' ); ?>\u003C\u002Fh2>\n\u003C\u002Fdiv>\n```\n\n## Verification & Iteration (Ralph Loop)\n\nTo ensure your block works as expected, leverage E2E testing:\n\n1.  **Frontend Rendering**: Create a test in `tests\u002Fe2e\u002Fspecs\u002F` to verify the block renders on a page.\n2.  **Visual Regression**: Use `npm run test:e2e:screenshot --SCREENSHOT_SELECTOR=\".wp-block-wp-rig-my-block\"` to verify the block's appearance.\n3.  **Editor Integration**: Verify the block can be added in the editor and its attributes can be modified.\n\n## Best Practices for Agents\n\n1. **Always use the CLI**: Use `npm run block:new` instead of creating block files manually.\n2. **Theme-scoped only**: Blocks should live in the theme, not as separate plugins, unless explicitly requested.\n3. **Dynamic vs Static**: Use `--dynamic` when the block needs to display content that might change (like latest posts) or requires complex server-side logic.\n4. **Namespace**: The namespace defaults to the theme slug. Do not override it unless necessary.\n5. **Build Integration**: Always ensure `npm run dev` or `npm run build` is run after making changes to block source files.\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fwprig\u002Fwprig\u002Fgutenberg-blocks",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill gutenberg-blocks",{"tool":39,"command":40},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill gutenberg-blocks",{"tool":42,"command":43},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill gutenberg-blocks","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fwprig\u002Fwprig\u002Fgutenberg-blocks\u002FSKILL.md",true,[],[48,57,66,75,81,87],{"skillNo":49,"name":50,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":20},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[54,55,56],"model","model hierarchy","model hierarchy skill",{"skillNo":58,"name":59,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":20},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[63,64,65],"MCP","zoom","zoom mcp",{"skillNo":67,"name":68,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":20},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[72,73,74,64],"sdk","zoom apps sdk","apps",{"skillNo":76,"name":77,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":20},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[77],{"skillNo":82,"name":83,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":20},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[83],{"skillNo":88,"name":89,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":20},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[89]]