[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-d9faa248-d192-45a1-9322-c82ca8980ab4":3,"$fckLWseOqt4aIr3wc_p7yePmvFKAccl3dF7EVqsqqM7E":42},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":33},"d9faa248-d192-45a1-9322-c82ca8980ab4","wordpress","涵盖主题开发、插件创建、WooCommerce集成、性能优化和安全加固的完整WordPress开发工作流程。包括WordPress 7.0特性：实时协作、AI连接器、能力API、DataViews和仅PHP的块。","cat_coding_backend","mod_coding","sickn33,coding","---\nname: wordpress\ndescription: \"Complete WordPress development workflow covering theme development, plugin creation, WooCommerce integration, performance optimization, and security hardening. Includes WordPress 7.0 features: Real-Time Collaboration, AI Connectors, Abilities API, DataViews, and PHP-only blocks.\"\ncategory: workflow-bundle\nrisk: safe\nsource: personal\ndate_added: \"2026-02-27\"\n---\n\n# WordPress Development Workflow Bundle\n\n## Overview\n\nComprehensive WordPress development workflow covering theme development, plugin creation, WooCommerce integration, performance optimization, and security. This bundle orchestrates skills for building production-ready WordPress sites and applications.\n\n## WordPress 7.0 Features (Backward Compatible)\n\nWordPress 7.0 (April 9, 2026) introduces significant features while maintaining backward compatibility:\n\n### Real-Time Collaboration (RTC)\n- Multiple users can edit simultaneously using Yjs CRDT\n- HTTP polling provider (configurable via `WP_COLLABORATION_MAX_USERS`)\n- Custom transport via `sync.providers` filter\n- **Backward Compatibility**: Falls back to post locking when legacy meta boxes detected\n\n### AI Connectors API\n- Provider-agnostic AI interface in core (`wp_ai_client_prompt()`)\n- Settings > Connectors for centralized API credential management\n- Official providers: OpenAI, Anthropic Claude, Google Gemini\n- **Backward Compatibility**: Works with WordPress 6.9+ via plugin\n\n### Abilities API (Stable in 7.0)\n- Standardized capability declaration system\n- REST API endpoints: `\u002Fwp-json\u002Fabilities\u002Fv1\u002Fmanifest`\n- MCP adapter for AI agent integration\n- **Backward Compatibility**: Can be used as Composer package in 6.x\n\n### DataViews & DataForm\n- Replaces WP_List_Table on Posts, Pages, Media screens\n- New layouts: table, grid, list, activity\n- Client-side validation (pattern, minLength, maxLength, min, max)\n- **Backward Compatibility**: Plugins using old hooks still work\n\n### PHP-Only Block Registration\n- Register blocks entirely via PHP without JavaScript\n- Auto-generated Inspector controls\n- **Backward Compatibility**: Existing JS blocks continue to work\n\n### Interactivity API Updates\n- `watch()` replaces `effect` from @preact\u002Fsignals\n- State navigation changes\n- **Backward Compatibility**: Old syntax deprecated but functional\n\n### Admin Refresh\n- New default color scheme\n- View transitions between admin screens\n- **Backward Compatibility**: CSS-level changes, no breaking changes\n\n### Pattern Editing\n- ContentOnly mode defaults for unsynced patterns\n- `disableContentOnlyForUnsyncedPatterns` setting\n- **Backward Compatibility**: Existing patterns work\n\n## When to Use This Workflow\n\nUse this workflow when:\n- Building new WordPress websites\n- Creating custom themes\n- Developing WordPress plugins\n- Setting up WooCommerce stores\n- Optimizing WordPress performance\n- Hardening WordPress security\n- Implementing WordPress 7.0 features (RTC, AI, DataViews)\n\n## Workflow Phases\n\n### Phase 1: WordPress Setup\n\n#### Skills to Invoke\n- `app-builder` - Project scaffolding\n- `environment-setup-guide` - Development environment\n\n#### Actions\n1. Set up local development environment (LocalWP, Docker, or Valet)\n2. Install WordPress (recommend 7.0+ for new projects)\n3. Configure development database\n4. Set up version control\n5. Configure wp-config.php for development\n\n#### WordPress 7.0 Configuration\n```php\n\u002F\u002F wp-config.php - Collaboration settings\ndefine('WP_COLLABORATION_MAX_USERS', 5);\n\n\u002F\u002F AI Connector is enabled by installing a provider plugin\n\u002F\u002F (e.g., OpenAI, Anthropic Claude, or Google Gemini connector)\n\u002F\u002F No constant needed - configure via Settings > Connectors in admin\n```\n\n#### Copy-Paste Prompts\n```\nUse @app-builder to scaffold a new WordPress project with modern tooling\n```\n\n### Phase 2: Theme Development\n\n#### Skills to Invoke\n- `frontend-developer` - Component development\n- `frontend-design` - UI implementation\n- `tailwind-patterns` - Styling\n- `web-performance-optimization` - Performance\n\n#### Actions\n1. Design theme architecture\n2. Create theme files (style.css, functions.php, index.php)\n3. Implement template hierarchy\n4. Create custom page templates\n5. Add custom post types and taxonomies\n6. Implement theme customization options\n7. Add responsive design\n8. Test with WordPress 7.0 admin refresh\n\n#### WordPress 7.0 Theme Considerations\n- Block API v3 now reference model\n- Pseudo-element support in theme.json\n- Global Styles custom CSS honors block-defined selectors\n- View transitions for admin navigation\n\n#### Theme Structure\n```\ntheme-name\u002F\n├── style.css\n├── functions.php\n├── index.php\n├── header.php\n├── footer.php\n├── sidebar.php\n├── single.php\n├── page.php\n├── archive.php\n├── search.php\n├── 404.php\n├── template-parts\u002F\n├── inc\u002F\n├── assets\u002F\n│   ├── css\u002F\n│   ├── js\u002F\n│   └── images\u002F\n└── languages\u002F\n```\n\n#### Copy-Paste Prompts\n```\nUse @frontend-developer to create a custom WordPress theme with React components\n```\n\n```\nUse @tailwind-patterns to style WordPress theme with modern CSS\n```\n\n### Phase 3: Plugin Development\n\n#### Skills to Invoke\n- `backend-dev-guidelines` - Backend standards\n- `api-design-principles` - API design\n- `auth-implementation-patterns` - Authentication\n\n#### Actions\n1. Design plugin architecture\n2. Create plugin boilerplate\n3. Implement hooks (actions and filters)\n4. Create admin interfaces\n5. Add custom database tables\n6. Implement REST API endpoints\n7. Add settings and options pages\n\n#### WordPress 7.0 Plugin Considerations\n- **RTC Compatibility**: Register post meta with `show_in_rest => true`\n- **AI Integration**: Use `wp_ai_client_prompt()` for AI features\n- **DataViews**: Consider new admin UI patterns\n- **Meta Boxes**: Migrate to block-based UIs for collaboration support\n\n#### RTC-Compatible Post Meta Registration\n```php\nregister_post_meta('post', 'custom_field', [\n    'type' => 'string',\n    'single' => true,\n    'show_in_rest' => true,  \u002F\u002F Required for RTC\n    'sanitize_callback' => 'sanitize_text_field',\n]);\n```\n\n#### AI Connector Example\n```php\n\u002F\u002F Using WordPress 7.0 AI Connector\n\u002F\u002F Note: Requires an AI provider plugin (OpenAI, Claude, or Gemini) to be installed and configured\n\n\u002F\u002F Basic text generation\n$response = wp_ai_client_prompt('Summarize this content.')\n    ->generate_text();\n\n\u002F\u002F With temperature for deterministic output\n$response = wp_ai_client_prompt('Summarize this content.')\n    ->using_temperature(0.2)\n    ->generate_text();\n\n\u002F\u002F With model preference (tries first available in list)\n$response = wp_ai_client_prompt('Summarize this content.')\n    ->using_model_preference('gpt-4', 'claude-3-opus', 'gemini-2-pro')\n    ->generate_text();\n\n\u002F\u002F For JSON structured output\n$schema = [\n    'type' => 'object',\n    'properties' => [\n        'summary' => ['type' => 'string'],\n        'keywords' => ['type' => 'array', 'items' => ['type' => 'string']]\n    ],\n    'required' => ['summary']\n];\n$response = wp_ai_client_prompt('Analyze this content and return JSON.')\n    ->using_system_instruction('You are a content analyzer.')\n    ->as_json_response($schema)\n    ->generate_text();\n```\n\n#### Plugin Structure\n```\nplugin-name\u002F\n├── plugin-name.php\n├── includes\u002F\n│   ├── class-plugin-activator.php\n│   ├── class-plugin-deactivator.php\n│   ├── class-plugin-loader.php\n│   └── class-plugin.php\n├── admin\u002F\n│   ├── class-plugin-admin.php\n│   ├── css\u002F\n│   └── js\u002F\n├── public\u002F\n│   ├── class-plugin-public.php\n│   ├── css\u002F\n│   └── js\u002F\n└── languages\u002F\n```\n\n#### Copy-Paste Prompts\n```\nUse @backend-dev-guidelines to create a WordPress plugin with proper architecture\n```\n\n### Phase 4: WooCommerce Integration\n\n#### Skills to Invoke\n- `payment-integration` - Payment processing\n- `stripe-integration` - Stripe payments\n- `billing-automation` - Billing workflows\n\n#### Actions\n1. Install and configure WooCommerce\n2. Create custom product types\n3. Customize checkout flow\n4. Integrate payment gateways\n5. Set up shipping methods\n6. Create custom order statuses\n7. Implement subscription products\n8. Add custom email templates\n\n#### WordPress 7.0 + WooCommerce Considerations\n- Test checkout with new admin interfaces\n- AI connectors for product descriptions\n- DataViews for order management screens\n- RTC for collaborative order editing\n\n#### Copy-Paste Prompts\n```\nUse @payment-integration to set up WooCommerce with Stripe\n```\n\n```\nUse @billing-automation to create subscription products in WooCommerce\n```\n\n### Phase 5: Performance Optimization\n\n#### Skills to Invoke\n- `web-performance-optimization` - Performance optimization\n- `database-optimizer` - Database optimization\n\n#### Actions\n1. Implement caching (object, page, browser)\n2. Optimize images (lazy loading, WebP)\n3. Minify and combine assets\n4. Enable CDN\n5. Optimize database queries\n6. Implement lazy loading\n7. Configure OPcache\n8. Set up Redis\u002FMemcached\n\n#### WordPress 7.0 Performance\n- Client-side media processing\n- Font Library enabled for all themes\n- Responsive grid block optimizations\n- View transitions reduce perceived load time\n\n#### Performance Checklist\n- [ ] Page load time \u003C 3 seconds\n- [ ] Time to First Byte \u003C 200ms\n- [ ] Largest Contentful Paint \u003C 2.5s\n- [ ] Cumulative Layout Shift \u003C 0.1\n- [ ] First Input Delay \u003C 100ms\n\n#### Copy-Paste Prompts\n```\nUse @web-performance-optimization to audit and improve WordPress performance\n```\n\n### Phase 6: Security Hardening\n\n#### Skills to Invoke\n- `security-auditor` - Security audit\n- `wordpress-penetration-testing` - WordPress security testing\n- `sast-configuration` - Static analysis\n\n#### Actions\n1. Update WordPress core, themes, plugins\n2. Implement security headers\n3. Configure file permissions\n4. Set up firewall rules\n5. Enable two-factor authentication\n6. Implement rate limiting\n7. Configure security logging\n8. Set up malware scanning\n\n#### WordPress 7.0 Security Considerations\n- PHP 7.4 minimum (drops 7.2\u002F7.3 support)\n- Test Abilities API permission boundaries\n- Verify collaboration data isolation\n- AI connector credential security\n\n#### Security Checklist\n- [ ] WordPress core updated (7.0+ recommended)\n- [ ] All plugins\u002Fthemes updated\n- [ ] Strong passwords enforced\n- [ ] Two-factor authentication enabled\n- [ ] Security headers configured\n- [ ] XML-RPC disabled or protected\n- [ ] File editing disabled\n- [ ] Database prefix changed\n- [ ] Regular backups configured\n\n#### Copy-Paste Prompts\n```\nUse @wordpress-penetration-testing to audit WordPress security\n```\n\n```\nUse @security-auditor to perform comprehensive security review\n```\n\n### Phase 7: Testing\n\n#### Skills to Invoke\n- `test-automator` - Test automation\n- `playwright-skill` - E2E testing\n- `webapp-testing` - Web app testing\n\n#### Actions\n1. Write unit tests for custom code\n2. Create integration tests\n3. Set up E2E tests\n4. Test cross-browser compatibility\n5. Test responsive design\n6. Performance testing\n7. Security testing\n\n#### WordPress 7.0 Testing Priorities\n- Test with iframed post editor\n- Verify DataViews integration\n- Test collaboration (RTC) workflows\n- Validate AI connector functionality\n- Test Interactivity API with watch()\n\n#### Copy-Paste Prompts\n```\nUse @playwright-skill to create E2E tests for WordPress site\n```\n\n### Phase 8: Deployment\n\n#### Skills to Invoke\n- `deployment-engineer` - Deployment\n- `cicd-automation-workflow-automate` - CI\u002FCD\n- `github-actions-templates` - GitHub Actions\n\n#### Actions\n1. Set up staging environment\n2. Configure deployment pipeline\n3. Set up database migrations\n4. Configure environment variables\n5. Enable maintenance mode during deployment\n6. Deploy to production\n7. Verify deployment\n8. Monitor post-deployment\n\n#### Copy-Paste Prompts\n```\nUse @deployment-engineer to set up WordPress deployment pipeline\n```\n\n## WordPress-Specific Workflows\n\n### Custom Post Type Development (RTC-Compatible)\n```php\nregister_post_type('book', [\n    'labels' => [...],\n    'public' => true,\n    'has_archive' => true,\n    'supports' => ['title', 'editor', 'thumbnail', 'excerpt'],\n    'menu_icon' => 'dashicons-book',\n    'show_in_rest' => true,  \u002F\u002F Enable for RTC\n]);\n\n\u002F\u002F Register meta with REST API for collaboration\nregister_post_meta('book', 'isbn', [\n    'type' => 'string',\n    'single' => true,\n    'show_in_rest' => true,\n    'sanitize_callback' => 'sanitize_text_field',\n]);\n```\n\n### Custom REST API Endpoint\n```php\nadd_action('rest_api_init', function() {\n    register_rest_route('myplugin\u002Fv1', '\u002Fbooks', [\n        'methods' => 'GET',\n        'callback' => 'get_books',\n        'permission_callback' => '__return_true',\n    ]);\n});\n```\n\n### WordPress 7.0 AI Connector Usage\n```php\n\u002F\u002F Auto-generate post excerpt with AI\nadd_action('save_post', function($post_id, $post) {\n    if (wp_is_post_autosave($post_id) || wp_is_post_revision($post_id)) {\n        return;\n    }\n    \n    \u002F\u002F Skip if excerpt already exists\n    if (!empty($post->post_excerpt)) {\n        return;\n    }\n    \n    $content = strip_tags($post->post_content);\n    if (empty($content)) {\n        return;\n    }\n    \n    \u002F\u002F Check if AI client is available\n    if (!function_exists('wp_ai_client_prompt')) {\n        return;\n    }\n    \n    \u002F\u002F Build prompt with input\n    $result = wp_ai_client_prompt(\n        'Create a brief 2-sentence summary of this content: ' . substr($content, 0, 1000)\n    );\n    \n    if (is_wp_error($result)) {\n        return; \u002F\u002F Silently fail - don't block post saving\n    }\n    \n    \u002F\u002F Use temperature for consistent output\n    $result->using_temperature(0.3);\n    $summary = $result->generate_text();\n    \n    if ($summary && !is_wp_error($summary)) {\n        wp_update_post([\n            'ID' => $post_id,\n            'post_excerpt' => sanitize_textarea_field($summary)\n        ]);\n    }\n}, 10, 2);\n```\n\n### PHP-Only Block Registration (WordPress 7.0)\n```php\n\u002F\u002F Register block entirely in PHP\nregister_block_type('my-plugin\u002Fhello-world', [\n    'render_callback' => function($attributes, $content) {\n        return '\u003Cp class=\"hello-world\">Hello, World!\u003C\u002Fp>';\n    },\n    'attributes' => [\n        'message' => ['type' => 'string', 'default' => 'Hello!']\n    ],\n]);\n```\n\n### Abilities API Registration\n```php\n\u002F\u002F Register ability category on correct hook\nadd_action('wp_abilities_api_categories_init', function() {\n    wp_register_ability_category('content-creation', [\n        'label' => __('Content Creation', 'my-plugin'),\n        'description' => __('Abilities for generating and managing content', 'my-plugin'),\n    ]);\n});\n\n\u002F\u002F Register abilities on correct hook\nadd_action('wp_abilities_api_init', function() {\n    wp_register_ability('my-plugin\u002Fgenerate-summary', [\n        'label' => __('Generate Post Summary', 'my-plugin'),\n        'description' => __('Creates an AI-powered summary of a post', 'my-plugin'),\n        'category' => 'content-creation',\n        'input_schema' => [\n            'type' => 'object',\n            'properties' => [\n                'post_id' => ['type' => 'integer', 'description' => 'The post ID to summarize']\n            ],\n            'required' => ['post_id']\n        ],\n        'output_schema' => [\n            'type' => 'object',\n            'properties' => [\n                'summary' => ['type' => 'string', 'description' => 'The generated summary']\n            ]\n        ],\n        'execute_callback' => 'my_plugin_generate_summary_handler',\n        'permission_callback' => function() {\n            return current_user_can('edit_posts');\n        }\n    ]);\n});\n\n\u002F\u002F Handler function for the ability\nfunction my_plugin_generate_summary_handler($input) {\n    $post_id = isset($input['post_id']) ? absint($input['post_id']) : 0;\n    $post = get_post($post_id);\n    \n    if (!$post) {\n        return new WP_Error('invalid_post', 'Post not found');\n    }\n    \n    $content = strip_tags($post->post_content);\n    if (empty($content)) {\n        return ['summary' => ''];\n    }\n    \n    if (!function_exists('wp_ai_client_prompt')) {\n        return new WP_Error('ai_unavailable', 'AI client not available');\n    }\n    \n    $result = wp_ai_client_prompt('Summarize in 2 sentences: ' . substr($content, 0, 1000))\n        ->using_temperature(0.3)\n        ->generate_text();\n    \n    if (is_wp_error($result)) {\n        return $result;\n    }\n    \n    return ['summary' => sanitize_textarea_field($result)];\n}\n```\n\n### WooCommerce Custom Product Type\n```php\nadd_action('init', function() {\n    class WC_Product_Custom extends WC_Product {\n        \u002F\u002F Custom product implementation\n    }\n});\n```\n\n## Quality Gates\n\nBefore moving to next phase, verify:\n- [ ] All custom code tested\n- [ ] Security scan passed\n- [ ] Performance targets met\n- [ ] Cross-browser tested\n- [ ] Mobile responsive verified\n- [ ] Accessibility checked (WCAG 2.1)\n- [ ] WordPress 7.0 compatibility verified (for new projects)\n\n## Related Workflow Bundles\n\n- `development` - General web development\n- `security-audit` - Security testing\n- `testing-qa` - Testing workflow\n- `ecommerce` - E-commerce development\n\n(End of file - total 440 lines)\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,154,406,"2026-05-16 13:47:25",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":25,"skillCount":32,"createdAt":26},"后端开发","backend","mdi-server","API、数据库、服务端架构",296,[34],{"id":35,"skillId":4,"version":36,"fileName":37,"fileSize":38,"filePath":39,"fileHash":40,"manifest":41,"createdAt":19},"3845c721-71ad-4ea0-bed7-05082af81a54","1.0.0","wordpress.zip",6041,"uploads\u002Fskills\u002Fd9faa248-d192-45a1-9322-c82ca8980ab4\u002Fwordpress.zip","752959b38e780bfb6000a3e8763ff35774836c250a8a303d511eacf58cf92922","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":17411}]",{"code":43,"message":44,"data":45},200,"success",{"items":46,"stats":47,"page":50},[],{"averageRating":48,"totalRatings":48,"ratingCounts":49},0,[48,48,48,48,48],{"limit":51,"offset":48,"hasMore":52,"nextOffset":51,"ratedOnly":16},15,false]