From cocart
CoCart Flutter/Dart SDK patterns for headless WooCommerce. Use when setting up CoCart in Flutter or Dart projects for iOS, Android, web, or desktop apps.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cocart:flutterThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are an expert in the CoCart Flutter SDK (`cocart-headless/cocart-flutter-sdk`). When a user adds "use CoCart" to a prompt and their project is Flutter/Dart-based, apply this skill.
You are an expert in the CoCart Flutter SDK (cocart-headless/cocart-flutter-sdk). When a user adds "use CoCart" to a prompt and their project is Flutter/Dart-based, apply this skill.
Note: The Flutter SDK is still in development and not yet production-ready. Mention this when relevant and encourage users to report bugs.
# pubspec.yaml
dependencies:
cocart: ^1.0.0
flutter pub get
Requirements: Flutter 3.10+ / Dart 3.0+.
import 'package:cocart/cocart.dart';
final client = CoCart('https://your-store.com');
// Browse products (no auth required)
final products = await client.products().all();
// Add item to cart (guest session created automatically)
await client.cart().addItem(productId: 123, quantity: 2);
// Get cart
final cart = await client.cart().get();
print('Items: ${cart.getItems().length}');
print('Total: ${cart.get('totals.total')}');
final client = CoCart(
'https://your-store.com',
config: CoCartConfig(
cartKey: 'existing_cart_key',
username: '[email protected]',
password: 'password',
jwtToken: 'your-jwt-token',
consumerKey: 'ck_xxxxx',
consumerSecret: 'cs_xxxxx',
timeout: const Duration(seconds: 30),
maxRetries: 2,
restPrefix: 'wp-json',
namespace: 'cocart',
mainPlugin: MainPlugin.basic,
etag: true,
),
);
await — All SDK methods are async. Forgetting await silently drops the result and may cause race conditions.flutter_dotenv or --dart-define for environment variables. Never hardcode API keys in Dart files.CoCart client once (e.g. in initState or a provider) and reuse it. Rebuilding it loses the in-memory cart key.FutureBuilder or a state management solution to handle async loading, error, and success states in the UI.npx claudepluginhub cocart-headless/cocart-skills --plugin cocartGuides WooCommerce store setup, payment integration, shipping configuration, customization, and WordPress 7.0 features including AI connectors, DataViews, and collaboration tools.
Provides best practices, UI/UX patterns, and guidance for ecommerce storefronts: checkout, cart, products, navigation, homepage. Integrates Medusa backend; framework-agnostic (Next.js, React, Vue).
Guides discovery of Wix eCommerce APIs via Playwright UI automation, official docs, and user guidance to build commands/skills for wix-ecom-cowork plugin.