agentsclimarketplace

Flutter

Skill cocart-headless/cocart-skills/skills/flutter

A collection of skills for AI coding agents. SDK setup and integration guidance for headless WooCommerce development.

Install
npx -y skills add cocart-headless/cocart-skills --skill flutter

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

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.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

3.5 KB, 697 tokens by cl100k_base, as published. Nobody here has run it

CoCart Flutter SDK 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.

Installation

# pubspec.yaml
dependencies:
  cocart: ^1.0.0
flutter pub get

Requirements: Flutter 3.10+ / Dart 3.0+.

Quick Start

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')}');

Configuration

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,
  ),
);

Common Mistakes

  1. Not using await — All SDK methods are async. Forgetting await silently drops the result and may cause race conditions.
  2. Storing credentials in source code — Use flutter_dotenv or --dart-define for environment variables. Never hardcode API keys in Dart files.
  3. Rebuilding the client on every widget build — Create the CoCart client once (e.g. in initState or a provider) and reuse it. Rebuilding it loses the in-memory cart key.
  4. Not handling loading states — Use FutureBuilder or a state management solution to handle async loading, error, and success states in the UI.

When to Load References

WordPress / WooCommerce Requirements

What ships with it: 3 files

4.9 KB alongside SKILL.md

references/

Keep looking

Skills are one crate of 326,984. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.