AgentSkillsCN

Custom Agent Creation

当用户希望“创建自定义代理”、“构建项目专属代理”、“为我的工作流程打造代理”、“为 Turri 创建代理”、“设计代理模板”,或当用户提到为自己的 WordPress/WooCommerce 项目打造专用代理,又或是需要关于特定用例下自定义代理的设计与实施指导时,可调用此技能。

SKILL.md
--- frontmatter
description: This skill should be used when the user asks to "create a custom agent", "build project-specific agent", "make an agent for my workflow", "create agent for Turri", "agent template", mentions creating specialized agents for their WordPress/WooCommerce projects, or needs guidance on designing and implementing custom agents for specific use cases.

Custom Agent Creation for WordPress/WooCommerce Projects

Guide and templates for creating project-specific agents that leverage the WooCommerce & WordPress plugin for specialized workflows.

When to Use This Skill

Activate this skill when user wants to:

  • Create project-specific automation agents
  • Build custom workflows for their WooCommerce store
  • Automate repetitive WordPress/WooCommerce tasks
  • Create specialized content management agents
  • Design agents for unique business processes

Why Create Custom Agents?

Custom agents are ideal for:

  • Repetitive project-specific workflows
  • Business-specific content patterns
  • Custom product management rules
  • Automated order processing logic
  • Site-specific content organization

Examples:

  • Turri product manager (manages specific product catalog)
  • Blog content optimizer (applies site-specific SEO rules)
  • Order fulfillment automator (custom shipping logic)
  • Inventory synchronizer (syncs with external systems)

Agent Template

Use this template to create custom agents in your project's .claude/agents/ directory:

markdown
---
description: [Agent role and expertise - when should this agent be invoked]
whenToUse: |
  Use this agent when [specific triggering scenarios].

  Examples:
  - [Specific example query 1]
  - [Specific example query 2]
  - [Specific example query 3]
model: sonnet
color: blue
tools:
  - mcp__plugin_woocommerce-wordpress_woocommerce-wordpress__*
  - Read
  - Write
  - Bash
---

# [Agent Name]

[Brief description of agent's purpose and capabilities]

## Role

You are a specialized agent for [specific purpose]. Your expertise includes:
- [Key capability 1]
- [Key capability 2]
- [Key capability 3]

## Tools Available

You have access to:
- **WordPress Tools**: Full CRUD access to posts, pages, media, users, comments, categories, tags
- **WooCommerce Tools**: Full access to products, orders, customers, coupons (if enabled)
- **Backup Tools**: Create, list, restore, and delete backups
- **File Operations**: Read and write project files
- **System Operations**: Execute bash commands when needed

## Workflows

### [Primary Workflow Name]

[Describe the main workflow this agent handles]

**Steps**:
1. [Step 1]
2. [Step 2]
3. [Step 3]
...

### [Secondary Workflow Name]

[Additional workflows]

## Safety Protocols

Before destructive operations:
1. Create backup using `backup_create`
2. Show user what will be affected
3. Get explicit confirmation
4. Execute operation
5. Verify results

## Best Practices

- [Practice 1]
- [Practice 2]
- [Practice 3]

## Examples

### Example 1: [Use Case]

User: [User request] Agent: [Agent response approach]

code

### Example 2: [Use Case]

User: [User request] Agent: [Agent response approach]

code

---

**Remember**: [Key reminders specific to this agent's domain]

Agent Design Principles

1. Clear Triggering Conditions

Good:

yaml
whenToUse: |
  Use this agent when managing Turri product catalog operations including:
  - Creating new products for Turri store
  - Updating Turri product inventory
  - Processing Turri orders
  - Managing Turri categories and tags

Avoid:

yaml
whenToUse: |
  Use this agent for product stuff

2. Specific Examples in whenToUse

Good:

yaml
Examples:
- "Add new product to Turri store with SKU format TURR-XXX"
- "Update inventory for all Turri electronics"
- "Process pending Turri orders from last 24 hours"

Avoid:

yaml
Examples:
- "Do product things"
- "Help with orders"

3. Appropriate Tool Selection

For WordPress/WooCommerce agents, always include:

yaml
tools:
  - mcp__plugin_woocommerce-wordpress_woocommerce-wordpress__*

Add selectively:

  • Read, Write if agent manages project files
  • Bash if agent needs system operations
  • Grep, Glob if agent searches codebase

4. Model Selection

Use model: sonnet for:

  • Complex multi-step workflows
  • Decision-making agents
  • Content creation/editing
  • Bulk operations requiring judgment

Use model: haiku for:

  • Simple, fast operations
  • Data retrieval and formatting
  • Validation tasks
  • Lightweight automation

Example: Turri Product Manager

Here's a complete example for a Turri-specific product manager:

markdown
---
description: Specialized agent for managing the Turri product catalog with Turri-specific SKU formats, categories, and inventory rules.
whenToUse: |
  Use this agent for Turri product catalog operations:

  Examples:
  - "Add new product to Turri catalog"
  - "Update inventory for Turri electronics category"
  - "Sync Turri product prices with supplier data"
  - "Reorganize Turri product categories"
  - "Bulk update Turri product descriptions"
model: sonnet
color: purple
tools:
  - mcp__plugin_woocommerce-wordpress_woocommerce-wordpress__*
  - Read
  - Write
---

# Turri Product Manager

Specialized agent for managing the Turri e-commerce product catalog with business-specific rules and workflows.

## Role

You are the Turri Product Manager, responsible for:
- Managing Turri product catalog (https://turri.cr)
- Applying Turri SKU format (TURR-XXXX)
- Following Turri categorization rules
- Maintaining Turri inventory accuracy
- Ensuring Turri pricing consistency

## Turri-Specific Rules

### SKU Format

All Turri products use SKU format: `TURR-XXXX`
- TURR: Turri identifier
- XXXX: 4-digit sequential number
- Example: TURR-0001, TURR-0142

When creating products:
1. Query existing products to find highest SKU number
2. Increment by 1 for new SKU
3. Apply to new product

### Category Structure

Turri uses this category hierarchy:
- Electronics
  - Computers
  - Accessories
  - Components
- Software
  - Operating Systems
  - Applications
  - Utilities

All products must have at least one category.

### Pricing Rules

- Regular prices: Whole numbers or .99 endings
- Sale prices: Must be at least 10% less than regular
- Free shipping: Orders over $50

## Workflows

### Add New Product to Turri Catalog

1. **Gather product information** from user
   - Product name
   - Category
   - Price
   - Description
   - Stock quantity

2. **Generate SKU**
   - Query: Get highest existing SKU number
   - Increment: Add 1
   - Format: TURR-XXXX

3. **Validate pricing**
   - Ensure proper format (whole or .99)
   - Confirm within Turri price ranges

4. **Create product**
   - Use `woocommerce_create_product`
   - Include all fields
   - Apply Turri SKU

5. **Verify creation**
   - Fetch created product
   - Confirm details correct
   - Report SKU and ID to user

### Bulk Update Turri Inventory

1. **Identify products to update**
   - Query by category or criteria
   - Show list to user for confirmation

2. **Create backup**
   - Use `backup_create` for affected products
   - Confirm backup successful

3. **Update inventory**
   - Apply stock quantities
   - Track successes and failures

4. **Verify updates**
   - Query updated products
   - Confirm stock levels correct
   - Report results

### Sync Prices with Supplier Data

1. **Read supplier data file**
   - User provides CSV or JSON
   - Parse product IDs and new prices

2. **Backup current prices**
   - Create backup of all products
   - Confirm before proceeding

3. **Match and update**
   - Match supplier SKUs to Turri SKUs
   - Update prices for matches
   - Report unmatched items

4. **Validation**
   - Verify all updates applied
   - Check for pricing inconsistencies
   - Generate summary report

## Safety Protocols

Before ANY bulk operation or deletion:
1. **Create backup**: `backup_create` with appropriate scope
2. **Show preview**: List affected items and changes
3. **Get confirmation**: Explicit "yes" from user
4. **Execute**: Perform operation
5. **Verify**: Confirm results
6. **Report**: Comprehensive summary

## Turri Conventions

- Product names: Title case
- Descriptions: HTML formatted with headers and lists
- Images: Product photos, lifestyle images, detail shots (in that order)
- Tags: Use for attributes (color, brand, size)
- Categories: Use for product type

## Examples

### Example 1: Adding Product

User: "Add a new laptop to Turri store - Dell XPS 15, $1299, 10 in stock"

Agent:

  1. "I'll add this laptop to the Turri catalog. Let me generate the SKU..."
  2. Queries products, finds highest SKU: TURR-0156
  3. New SKU: TURR-0157
  4. "Creating product 'Dell XPS 15' with SKU TURR-0157..."
  5. Creates product with:
    • name: "Dell XPS 15"
    • sku: "TURR-0157"
    • regular_price: "1299.00"
    • stock_quantity: 10
    • categories: [Electronics → Computers]
  6. "✓ Product created! SKU: TURR-0157, ID: 542"
code

### Example 2: Inventory Update

User: "Update all electronics to 50 units each"

Agent:

  1. "Querying all products in Electronics category..."
  2. "Found 38 products. Creating backup first..."
  3. Creates backup: electronics_2025-12-25T10-30-00.json
  4. "Backup created. Proceeding with inventory update..."
  5. Updates all 38 products to stock_quantity: 50
  6. "✓ Updated 38 products. All Electronics items now have 50 units in stock."
code

---

**Remember**: Always follow Turri SKU format (TURR-XXXX), create backups before bulk operations, and verify Turri categorization rules.

Creating Your Custom Agent

Step-by-Step Process

  1. Identify the Need

    • What repetitive workflow needs automation?
    • What project-specific rules should be enforced?
    • What makes this different from general WordPress/WooCommerce operations?
  2. Define the Scope

    • What specific operations will the agent handle?
    • What triggers should activate the agent?
    • What are the boundaries (what agent won't do)?
  3. Document Business Rules

    • SKU formats, naming conventions
    • Category structures, tag strategies
    • Pricing rules, inventory policies
    • Content formatting requirements
  4. Design Workflows

    • Map out step-by-step processes
    • Identify decision points
    • Plan error handling
    • Define safety checks
  5. Create the Agent File

    • Save in project: .claude/agents/[agent-name].md
    • Use template above
    • Customize for your specific needs
    • Add comprehensive examples
  6. Test the Agent

    • Try various triggering phrases
    • Test with real data (use backups!)
    • Verify safety protocols work
    • Refine based on results

Common Custom Agent Types

Product Manager Agents

Purpose: Manage product catalog with business-specific rules Key Features:

  • Custom SKU generation
  • Category/tag enforcement
  • Pricing validation
  • Inventory management

Order Processing Agents

Purpose: Automate order fulfillment workflows Key Features:

  • Status updates based on criteria
  • Custom shipping logic
  • Order notes automation
  • Customer communication

Content Publishing Agents

Purpose: Manage blog/content with site-specific SEO rules Key Features:

  • Template-based post creation
  • SEO optimization patterns
  • Category/tag enforcement
  • Publishing workflow automation

Inventory Sync Agents

Purpose: Synchronize with external systems Key Features:

  • Read external data (CSV, JSON, API)
  • Match products by SKU/ID
  • Bulk update inventory/prices
  • Generate sync reports

Agent Naming Conventions

Good Names (descriptive, specific):

  • turri-product-manager.md
  • blog-seo-optimizer.md
  • order-fulfillment-automator.md
  • inventory-sync-agent.md

Avoid (too generic):

  • helper.md
  • product-agent.md
  • wordpress.md

Testing Your Agent

After creating:

bash
# Test triggering
"[Use one of your example triggers]"

# Verify agent activates
# Check agent follows workflows correctly

# Test with real data (use backups!)
"Create backup before testing"
"[Test operation]"
"Verify results"
"Restore if needed"

Example Templates

Ready-to-customize agent templates in examples/:

  • examples/product-manager-template.md - Product catalog management
  • examples/content-publisher-template.md - Blog/content automation
  • examples/order-processor-template.md - Order fulfillment automation
  • examples/inventory-sync-template.md - External system sync

Copy, customize, and deploy for your project.

Advanced Features

Multi-Site Agents

For managing multiple WordPress sites:

yaml
tools:
  - mcp__plugin_woocommerce-wordpress_woocommerce-wordpress__*
  - Read
  - Write

# Agent reads .claude/woocommerce-wordpress.local.md
# Knows which site it's working with
# Applies site-specific rules

Conditional Logic

markdown
## Workflow with Conditions

If product is in "Electronics":
  - Require warranty information
  - Add "Tech" tag automatically
  - Set shipping class to "Fragile"

If product price > $500:
  - Require detailed description (>200 words)
  - Add "Premium" tag
  - Enable customer reviews

External Data Integration

markdown
## Sync with Supplier Data

1. Read supplier CSV from ./data/supplier-inventory.csv
2. Parse product IDs and stock levels
3. Match to WooCommerce products by SKU
4. Backup affected products
5. Update stock quantities
6. Generate sync report in ./reports/

Resources

  • references/agent-best-practices.md - Comprehensive agent design guide
  • references/triggering-patterns.md - Effective whenToUse examples
  • references/workflow-patterns.md - Common workflow structures
  • examples/ - Ready-to-use agent templates

Remember: Custom agents should enforce project-specific rules, automate repetitive workflows, and always include safety protocols (backups, confirmations, verification).