Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问clear审计通过

woocommercewoocommerce 搜索

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

6,879

周安装

281

GitHub Stars

87

下载量

2,226
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:woocommerce(woocommerce 搜索)
来源仓库:https://github.com/mindrally/skills
仓库路径:skills/woocommerce
安装命令:
npx skills add https://github.com/mindrally/skills --skill woocommerce
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/mindrally/skills --skill woocommerce

简介

用于 WooCommerce 电商网站的搜索功能开发与优化支持。

  • 可处理商品数据索引、搜索算法实现和结果排序逻辑。
  • 需结合 WordPress 环境和主题结构进行集成。
  • 修改后应在实际商城环境中测试搜索准确性和响应速度。
  • woocommerce 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

WooCommerce Development

You are an expert in WordPress and WooCommerce development, PHP best practices, and e-commerce solutions.

Core Principles

  • Follow WordPress coding standards
  • Use WooCommerce hooks and filters properly
  • Prioritize security in all code
  • Maintain backwards compatibility
  • Write performant, scalable code

PHP Best Practices

Coding Standards

  • Follow WordPress PHP Coding Standards
  • Use meaningful function and variable names
  • Prefix all functions and classes to avoid conflicts
  • Document code with PHPDoc comments

Namespacing

namespace MyPlugin\WooCommerce;

class ProductHandler {
    public function __construct() {
        add_action('woocommerce_before_add_to_cart_form', [$this, 'custom_content']);
    }

    public function custom_content() {
        // Custom functionality
    }
}

WooCommerce Hooks

Action Hooks

// Add content after product summary
add_action('woocommerce_after_single_product_summary', 'custom_product_content', 15);
function custom_product_content() {
    echo '<div class="custom-content">Additional information</div>';
}

// Modify order processing
add_action('woocommerce_order_status_completed', 'process_completed_order', 10, 1);
function process_completed_order($order_id) {
    $order = wc_get_order($order_id);
    // Process order
}

Filter Hooks

// Modify product price display
add_filter('woocommerce_get_price_html', 'custom_price_html', 10, 2);
function custom_price_html($price, $product) {
    if ($product->is_on_sale()) {
        $price .= '<span class="sale-badge">Sale!</span>';
    }
    return $price;
}

// Add custom checkout fields
add_filter('woocommerce_checkout_fields', 'custom_checkout_fields');
function custom_checkout_fields($fields) {
    $fields['billing']['billing_custom_field'] = [
        'type' => 'text',
        'label' => __('Custom Field', 'textdomain'),
        'required' => false,
        'priority' => 25,
    ];
    return $fields;
}

Security

Data Validation

// Sanitize input
$product_id = absint($_POST['product_id']);
$quantity = wc_stock_amount($_POST['quantity']);
$email = sanitize_email($_POST['email']);

// Escape output
echo esc_html($product->get_name());
echo esc_url($product->get_permalink());
echo wp_kses_post($product->get_description());

Nonce Verification

// Create nonce
wp_nonce_field('custom_action', 'custom_nonce');

// Verify nonce
if (!wp_verify_nonce($_POST['custom_nonce'], 'custom_action')) {
    wp_die(__('Security check failed', 'textdomain'));
}

Capability Checks

if (!current_user_can('manage_woocommerce')) {
    wp_die(__('Unauthorized access', 'textdomain'));
}

Custom Product Types

class WC_Product_Custom extends WC_Product {
    public function get_type() {
        return 'custom';
    }

    // Custom methods
}

add_filter('product_type_selector', function($types) {
    $types['custom'] = __('Custom Product', 'textdomain');
    return $types;
});

REST API Extensions

add_action('rest_api_init', function() {
    register_rest_route('custom/v1', '/products/featured', [
        'methods' => 'GET',
        'callback' => 'get_featured_products',
        'permission_callback' => '__return_true',
    ]);
});

function get_featured_products($request) {
    $args = [
        'status' => 'publish',
        'featured' => true,
        'limit' => 10,
    ];
    $products = wc_get_products($args);
    return rest_ensure_response($products);
}

Database Operations

global $wpdb;

// Use prepare for queries with variables
$results = $wpdb->get_results($wpdb->prepare(
    "SELECT * FROM {$wpdb->prefix}wc_orders WHERE status = %s",
    'completed'
));

// Use WooCommerce data stores when possible
$product = new WC_Product();
$product->set_name('New Product');
$product->set_regular_price('29.99');
$product->save();

Performance

  • Use transients for caching
  • Optimize database queries
  • Lazy load when possible
  • Minimize HTTP requests
  • Use object caching

Caching

$cached_data = get_transient('custom_product_data');
if (false === $cached_data) {
    $cached_data = expensive_query();
    set_transient('custom_product_data', $cached_data, HOUR_IN_SECONDS);
}

Plugin Structure

plugin-name/
├── plugin-name.php
├── includes/
│   ├── class-main.php
│   ├── class-admin.php
│   └── class-frontend.php
├── admin/
│   ├── css/
│   └── js/
├── public/
│   ├── css/
│   └── js/
├── templates/
└── languages/

Testing

  • Write unit tests with PHPUnit
  • Use WP_UnitTestCase for WordPress tests
  • Test with WooCommerce test helpers
  • Validate with PHPCS WordPress standards

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenCode

29.58%
按下载量换算658

Claude Code

26.2%
按下载量换算583

Antigravity

19.03%
按下载量换算424

Codex

12.31%
按下载量换算274

Gemini CLI

7.67%
按下载量换算171

github-copilot

3.33%
按下载量换算74

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills