opencode-skills-antigravity 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wordpress-woocommerce-development
3
- description: "WooCommerce store development workflow covering store setup, payment integration, shipping configuration, and customization."
3
+ description: "WooCommerce store development workflow covering store setup, payment integration, shipping configuration, customization, and WordPress 7.0 features: AI connectors, DataViews, and collaboration tools."
4
4
  category: granular-workflow-bundle
5
5
  risk: safe
6
6
  source: personal
@@ -11,7 +11,34 @@ date_added: "2026-02-27"
11
11
 
12
12
  ## Overview
13
13
 
14
- Specialized workflow for building WooCommerce stores including setup, payment gateway integration, shipping configuration, custom product types, and store optimization.
14
+ Specialized workflow for building WooCommerce stores including setup, payment gateway integration, shipping configuration, custom product types, store optimization, and WordPress 7.0 enhancements.
15
+
16
+ ## WordPress 7.0 + WooCommerce Features
17
+
18
+ 1. **AI Integration**
19
+ - Auto-generate product descriptions
20
+ - AI-powered customer service responses
21
+ - Product summary generation
22
+ - Marketing copy assistance
23
+
24
+ 2. **DataViews for Orders**
25
+ - Modern order management interfaces
26
+ - Enhanced filtering and sorting
27
+ - Activity layout for order history
28
+
29
+ 3. **Real-Time Collaboration**
30
+ - Collaborative order editing
31
+ - Team notes and communication
32
+ - Live inventory updates
33
+
34
+ 4. **Admin Refresh**
35
+ - Consistent WooCommerce admin styling
36
+ - View transitions between screens
37
+
38
+ 5. **Abilities API**
39
+ - AI-powered order processing
40
+ - Automated inventory management
41
+ - Smart shipping recommendations
15
42
 
16
43
  ## When to Use This Workflow
17
44
 
@@ -21,6 +48,7 @@ Use this workflow when:
21
48
  - Configuring shipping methods
22
49
  - Creating custom product types
23
50
  - Building subscription products
51
+ - Implementing AI-powered features (WP 7.0)
24
52
 
25
53
  ## Workflow Phases
26
54
 
@@ -36,6 +64,18 @@ Use this workflow when:
36
64
  3. Configure store settings
37
65
  4. Set up tax rules
38
66
  5. Configure currency
67
+ 6. Test with WordPress 7.0 admin
68
+
69
+ #### WordPress 7.0 + WooCommerce Setup
70
+ ```php
71
+ // Minimum requirements for WP 7.0 + WooCommerce
72
+ // Add to wp-config.php for collaboration settings
73
+ define('WP_COLLABORATION_MAX_USERS', 10);
74
+
75
+ // AI features are enabled by installing a provider plugin
76
+ // Install OpenAI, Anthropic, or Gemini connector from WordPress.org
77
+ // Then configure via Settings > Connectors in admin panel
78
+ ```
39
79
 
40
80
  #### Copy-Paste Prompts
41
81
  ```
@@ -54,6 +94,50 @@ Use @app-builder to set up WooCommerce store
54
94
  4. Set up variable products
55
95
  5. Add product images
56
96
 
97
+ #### AI-Powered Product Descriptions (WP 7.0)
98
+ ```php
99
+ // Auto-generate product descriptions with AI
100
+ add_action('woocommerce_new_product', 'generate_ai_description', 10, 2);
101
+
102
+ function generate_ai_product_description($product_id, $product) {
103
+ if ($product->get_description()) {
104
+ return; // Skip if description exists
105
+ }
106
+
107
+ // Check if AI client is available
108
+ if (!function_exists('wp_ai_client_prompt')) {
109
+ return;
110
+ }
111
+
112
+ $title = $product->get_name();
113
+ $short_description = $product->get_short_description();
114
+
115
+ $prompt = sprintf(
116
+ 'Write a compelling WooCommerce product description for "%s" that highlights key features and benefits. Make it SEO-friendly and persuasive.',
117
+ $title
118
+ );
119
+
120
+ if ($short_description) {
121
+ $prompt .= "\n\nShort description: " . $short_description;
122
+ }
123
+
124
+ $result = wp_ai_client_prompt($prompt);
125
+
126
+ if (is_wp_error($result)) {
127
+ return;
128
+ }
129
+
130
+ // Use temperature for consistent output
131
+ $result->using_temperature(0.3);
132
+ $description = $result->generate_text();
133
+
134
+ if ($description && !is_wp_error($description)) {
135
+ $product->set_description($description);
136
+ $product->save();
137
+ }
138
+ }
139
+ ```
140
+
57
141
  #### Copy-Paste Prompts
58
142
  ```
59
143
  Use @wordpress-penetration-testing to configure WooCommerce products
@@ -73,6 +157,44 @@ Use @wordpress-penetration-testing to configure WooCommerce products
73
157
  4. Add offline payments
74
158
  5. Test payment flows
75
159
 
160
+ #### WordPress 7.0 AI for Payments
161
+ ```php
162
+ // AI-powered fraud detection
163
+ // Note: This is a demonstration - implement proper fraud detection with multiple signals
164
+
165
+ // Use AI to analyze order for fraud indicators
166
+ function ai_check_order_fraud($order_id) {
167
+ // Check if AI client is available
168
+ if (!function_exists('wp_ai_client_prompt')) {
169
+ return false; // Default to no suspicion if AI unavailable
170
+ }
171
+
172
+ $order = wc_get_order($order_id);
173
+ if (!$order) {
174
+ return false;
175
+ }
176
+
177
+ $prompt = sprintf(
178
+ 'Analyze this order for potential fraud. Order total: $%s. Shipping address: %s, %s. Billing: %s. Is this suspicious? Return only "suspicious" or "clean" without explanation.',
179
+ $order->get_total(),
180
+ $order->get_shipping_address_1(),
181
+ $order->get_shipping_city(),
182
+ $order->get_billing_email()
183
+ );
184
+
185
+ $result = wp_ai_client_prompt($prompt);
186
+
187
+ if (is_wp_error($result)) {
188
+ return false;
189
+ }
190
+
191
+ $result->using_temperature(0.1); // Low temp for consistent classification
192
+ $analysis = $result->generate_text();
193
+
194
+ return (strpos($analysis, 'suspicious') !== false);
195
+ }
196
+ ```
197
+
76
198
  #### Copy-Paste Prompts
77
199
  ```
78
200
  Use @stripe-integration to integrate Stripe payments
@@ -94,6 +216,43 @@ Use @paypal-integration to integrate PayPal
94
216
  4. Set up free shipping
95
217
  5. Integrate carriers
96
218
 
219
+ #### AI Shipping Recommendations (WP 7.0)
220
+ ```php
221
+ // AI-powered shipping recommendations
222
+ add_action('woocommerce_after_checkout_form', 'ai_shipping_recommendations');
223
+
224
+ function ai_shipping_recommendations($checkout) {
225
+ // Check if AI client is available
226
+ if (!function_exists('wp_ai_client_prompt')) {
227
+ return;
228
+ }
229
+
230
+ $cart = WC()->cart;
231
+ if ($cart->is_empty() || !$cart->get_cart_contents_weight()) {
232
+ return;
233
+ }
234
+
235
+ $prompt = sprintf(
236
+ 'Based on this cart (total weight: %d kg, destination: %s), recommend the best shipping method from: free shipping (orders over $100), flat rate ($9.99), or express ($24.99). Consider delivery time and cost efficiency. Respond with just the recommended method name.',
237
+ $cart->get_cart_contents_weight(),
238
+ WC()->customer->get_shipping_country()
239
+ );
240
+
241
+ $result = wp_ai_client_prompt($prompt);
242
+
243
+ if (is_wp_error($result)) {
244
+ return;
245
+ }
246
+
247
+ $result->using_temperature(0.1); // Low temp for consistent recommendation
248
+ $recommendation = $result->generate_text();
249
+
250
+ if (strpos($recommendation, 'express') !== false) {
251
+ wc_add_notice(esc_html__('AI Recommendation: Consider Express shipping for faster delivery!', 'woocommerce'), 'info');
252
+ }
253
+ }
254
+ ```
255
+
97
256
  #### Copy-Paste Prompts
98
257
  ```
99
258
  Use @wordpress-penetration-testing to configure shipping
@@ -112,6 +271,91 @@ Use @wordpress-penetration-testing to configure shipping
112
271
  4. Create custom templates
113
272
  5. Add custom fields
114
273
 
274
+ #### WordPress 7.0 Template Customization
275
+ ```php
276
+ // Custom product template with WP 7.0 blocks
277
+ add_action('woocommerce_after_main_content', 'add_product_ai_chat');
278
+
279
+ function add_product_ai_chat() {
280
+ if (!is_product()) return;
281
+
282
+ global $product;
283
+ ?>
284
+ <div class="product-ai-assistant">
285
+ <h3>AI Shopping Assistant</h3>
286
+ <button id="ai-chat-toggle" type="button">Ask about this product</button>
287
+ <div id="ai-chat-panel" style="display:none;">
288
+ <div id="ai-chat-messages"></div>
289
+ <input type="text" id="ai-chat-input" placeholder="Ask about sizing, materials, etc.">
290
+ </div>
291
+ </div>
292
+ <script>
293
+ document.getElementById('ai-chat-toggle').addEventListener('click', function() {
294
+ const panel = document.getElementById('ai-chat-panel');
295
+ panel.style.display = panel.style.display === 'none' ? 'block' : 'none';
296
+ });
297
+ </script>
298
+ <?php
299
+ }
300
+
301
+ // AI-powered product Q&A
302
+ add_action('wp_ajax_ai_product_question', 'handle_ai_product_question');
303
+ add_action('wp_ajax_nopriv_ai_product_question', 'handle_ai_product_question');
304
+
305
+ function handle_ai_product_question() {
306
+ // Verify nonce for security
307
+ if (!check_ajax_referer('ai_product_question_nonce', 'nonce', false)) {
308
+ wp_send_json_error(['message' => 'Security check failed']);
309
+ }
310
+
311
+ $question = isset($_POST['question']) ? sanitize_text_field($_POST['question']) : '';
312
+ $product_id = isset($_POST['product_id']) ? intval($_POST['product_id']) : 0;
313
+
314
+ if (empty($question) || empty($product_id)) {
315
+ wp_send_json_error(['message' => 'Missing required fields']);
316
+ }
317
+
318
+ $product = wc_get_product($product_id);
319
+ if (!$product) {
320
+ wp_send_json_error(['message' => 'Product not found']);
321
+ }
322
+
323
+ // Check if AI client is available
324
+ if (!function_exists('wp_ai_client_prompt')) {
325
+ wp_send_json_error(['message' => 'AI service unavailable']);
326
+ }
327
+
328
+ $prompt = sprintf(
329
+ 'Customer question about "%s": %s\n\nProduct details:
330
+ - Price: $%s
331
+ - SKU: %s
332
+ - Stock: %s
333
+
334
+ Answer helpfully, accurately, and concisely:',
335
+ $product->get_name(),
336
+ $question,
337
+ $product->get_price(),
338
+ $product->get_sku(),
339
+ $product->get_stock_status()
340
+ );
341
+
342
+ $result = wp_ai_client_prompt($prompt);
343
+
344
+ if (is_wp_error($result)) {
345
+ wp_send_json_error(['message' => $result->get_error_message()]);
346
+ }
347
+
348
+ $result->using_temperature(0.4); // Slightly higher for more varied responses
349
+ $answer = $result->generate_text();
350
+
351
+ if (is_wp_error($answer)) {
352
+ wp_send_json_error(['message' => 'Failed to generate response']);
353
+ }
354
+
355
+ wp_send_json_success(['answer' => $answer]);
356
+ }
357
+ ```
358
+
115
359
  #### Copy-Paste Prompts
116
360
  ```
117
361
  Use @frontend-developer to customize WooCommerce templates
@@ -129,6 +373,107 @@ Use @frontend-developer to customize WooCommerce templates
129
373
  4. Add memberships
130
374
  5. Integrate marketplace
131
375
 
376
+ #### Abilities API for WooCommerce (WP 7.0)
377
+ ```php
378
+ // Register ability categories first
379
+ add_action('wp_abilities_api_categories_init', function() {
380
+ wp_register_ability_category('ecommerce', [
381
+ 'label' => __('E-Commerce', 'woocommerce'),
382
+ 'description' => __('WooCommerce store management and operations', 'woocommerce'),
383
+ ]);
384
+ });
385
+
386
+ // Register abilities
387
+ add_action('wp_abilities_api_init', function() {
388
+ // Register ability to update inventory
389
+ wp_register_ability('woocommerce/update-inventory', [
390
+ 'label' => __('Update Inventory', 'woocommerce'),
391
+ 'description' => __('Update product stock quantity', 'woocommerce'),
392
+ 'category' => 'ecommerce',
393
+ 'input_schema' => [
394
+ 'type' => 'object',
395
+ 'properties' => [
396
+ 'product_id' => ['type' => 'integer', 'description' => 'Product ID to update'],
397
+ 'quantity' => ['type' => 'integer', 'description' => 'New stock quantity']
398
+ ],
399
+ 'required' => ['product_id', 'quantity']
400
+ ],
401
+ 'output_schema' => [
402
+ 'type' => 'object',
403
+ 'properties' => [
404
+ 'success' => ['type' => 'boolean'],
405
+ 'new_quantity' => ['type' => 'integer']
406
+ ]
407
+ ],
408
+ 'execute_callback' => 'woocommerce_update_inventory_handler',
409
+ 'permission_callback' => function() {
410
+ return current_user_can('manage_woocommerce');
411
+ }
412
+ ]);
413
+
414
+ // Register ability to process orders
415
+ wp_register_ability('woocommerce/process-order', [
416
+ 'label' => __('Process Order', 'woocommerce'),
417
+ 'description' => __('Mark order as processing and trigger fulfillment', 'woocommerce'),
418
+ 'category' => 'ecommerce',
419
+ 'input_schema' => [
420
+ 'type' => 'object',
421
+ 'properties' => [
422
+ 'order_id' => ['type' => 'integer', 'description' => 'Order ID to process']
423
+ ],
424
+ 'required' => ['order_id']
425
+ ],
426
+ 'output_schema' => [
427
+ 'type' => 'object',
428
+ 'properties' => [
429
+ 'success' => ['type' => 'boolean'],
430
+ 'status' => ['type' => 'string']
431
+ ]
432
+ ],
433
+ 'execute_callback' => 'woocommerce_process_order_handler',
434
+ 'permission_callback' => function() {
435
+ return current_user_can('manage_woocommerce');
436
+ }
437
+ ]);
438
+ });
439
+
440
+ // Handler for inventory update
441
+ function woocommerce_update_inventory_handler($input) {
442
+ $product_id = isset($input['product_id']) ? absint($input['product_id']) : 0;
443
+ $quantity = isset($input['quantity']) ? absint($input['quantity']) : 0;
444
+
445
+ $product = wc_get_product($product_id);
446
+ if (!$product) {
447
+ return new WP_Error('invalid_product', 'Product not found');
448
+ }
449
+
450
+ // Update stock
451
+ wc_update_product_stock($product, $quantity);
452
+
453
+ return [
454
+ 'success' => true,
455
+ 'new_quantity' => $product->get_stock_quantity()
456
+ ];
457
+ }
458
+
459
+ // Handler for order processing
460
+ function woocommerce_process_order_handler($input) {
461
+ $order_id = isset($input['order_id']) ? absint($input['order_id']) : 0;
462
+
463
+ $order = wc_get_order($order_id);
464
+ if (!$order) {
465
+ return new WP_Error('invalid_order', 'Order not found');
466
+ }
467
+
468
+ $order->update_status('processing');
469
+
470
+ return [
471
+ 'success' => true,
472
+ 'status' => 'processing'
473
+ ];
474
+ }
475
+ ```
476
+
132
477
  #### Copy-Paste Prompts
133
478
  ```
134
479
  Use @wordpress-penetration-testing to configure WooCommerce extensions
@@ -147,6 +492,12 @@ Use @wordpress-penetration-testing to configure WooCommerce extensions
147
492
  4. Configure CDN
148
493
  5. Set up lazy loading
149
494
 
495
+ #### WordPress 7.0 Performance
496
+ - Client-side media processing
497
+ - Font Library enabled
498
+ - Responsive grid block
499
+ - View transitions for perceived performance
500
+
150
501
  #### Copy-Paste Prompts
151
502
  ```
152
503
  Use @web-performance-optimization to optimize WooCommerce store
@@ -165,11 +516,98 @@ Use @web-performance-optimization to optimize WooCommerce store
165
516
  4. Check mobile experience
166
517
  5. Performance testing
167
518
 
519
+ #### WordPress 7.0 Testing
520
+ - Test with new admin interface
521
+ - Verify AI features work
522
+ - Test DataViews for orders
523
+ - Verify collaboration features
524
+
525
+ #### AI-Powered Store Testing
526
+ ```php
527
+ // Automated AI testing for fraud detection during checkout
528
+ add_action('woocommerce_after_checkout_validation', 'ai_validate_order', 20);
529
+
530
+ function ai_validate_order($fields, $errors) {
531
+ // Skip if AI is not available
532
+ if (!function_exists('wp_ai_client_prompt')) {
533
+ return;
534
+ }
535
+
536
+ // Skip for logged-in users (assumed trusted)
537
+ if (is_user_logged_in()) {
538
+ return;
539
+ }
540
+
541
+ $order_data = [
542
+ 'email' => isset($fields['billing_email']) ? $fields['billing_email'] : '',
543
+ 'phone' => isset($fields['billing_phone']) ? $fields['billing_phone'] : '',
544
+ 'address' => isset($fields['billing_address_1']) ? $fields['billing_address_1'] : '',
545
+ ];
546
+
547
+ // Skip if insufficient data
548
+ if (empty($order_data['email'])) {
549
+ return;
550
+ }
551
+
552
+ $prompt = sprintf(
553
+ 'This is a checkout validation. Check if these details seem legitimate: email=%s, phone=%s, address=%s. Return only "valid" or "suspicious" without additional text.',
554
+ sanitize_email($order_data['email']),
555
+ sanitize_text_field($order_data['phone']),
556
+ sanitize_text_field($order_data['address'])
557
+ );
558
+
559
+ $result = wp_ai_client_prompt($prompt);
560
+
561
+ if (is_wp_error($result)) {
562
+ // Don't block checkout on AI errors
563
+ return;
564
+ }
565
+
566
+ $result->using_temperature(0.1); // Low temp for consistent classification
567
+ $response = $result->generate_text();
568
+
569
+ if (is_wp_error($response)) {
570
+ return;
571
+ }
572
+
573
+ if (strpos($response, 'suspicious') !== false) {
574
+ $errors->add('validation', __('Additional verification may be needed for this order. We will contact you if needed.', 'woocommerce'));
575
+ }
576
+ }
577
+ ```
578
+
168
579
  #### Copy-Paste Prompts
169
580
  ```
170
581
  Use @playwright-skill to test WooCommerce checkout flow
171
582
  ```
172
583
 
584
+ ## WooCommerce + WordPress 7.0 AI Use Cases
585
+
586
+ 1. **Product Descriptions**
587
+ - Auto-generate from product attributes
588
+ - Translate descriptions
589
+ - SEO optimization
590
+
591
+ 2. **Customer Service**
592
+ - AI chatbot for common questions
593
+ - Order status lookup
594
+ - Return processing
595
+
596
+ 3. **Inventory Management**
597
+ - Demand forecasting
598
+ - Low stock alerts
599
+ - Reorder recommendations
600
+
601
+ 4. **Marketing**
602
+ - Personalized emails
603
+ - Product recommendations
604
+ - Abandoned cart recovery
605
+
606
+ 5. **Order Processing**
607
+ - Fraud detection
608
+ - Shipping optimization
609
+ - Invoice generation
610
+
173
611
  ## Quality Gates
174
612
 
175
613
  - [ ] Products displaying correctly
@@ -178,6 +616,8 @@ Use @playwright-skill to test WooCommerce checkout flow
178
616
  - [ ] Shipping calculating
179
617
  - [ ] Emails sending
180
618
  - [ ] Mobile responsive
619
+ - [ ] AI features tested (WP 7.0)
620
+ - [ ] DataViews working (WP 7.0)
181
621
 
182
622
  ## Related Workflow Bundles
183
623
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-skills-antigravity",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "OpenCode CLI plugin that automatically downloads and keeps Antigravity Awesome Skills up to date.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",