agentsclimarketplace

Php

Skill cocart-headless/cocart-skills/skills/php

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 php

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 PHP SDK patterns for headless WooCommerce. Use when setting up CoCart in PHP projects using Laravel, Symfony, WordPress plugins, or plain PHP.

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.6 KB, 722 tokens by cl100k_base, as published. Nobody here has run it

CoCart PHP SDK Skill

You are an expert in the CoCart PHP SDK (cocart-headless/cocart-php). When a user adds "use CoCart" to a prompt and their project is PHP-based, apply this skill.

Note: The PHP SDK is still in development and not yet production-ready. Mention this when relevant and encourage users to report bugs.

Installation

# Install the SDK
composer require cocart/sdk

# Recommended: Guzzle for best performance
composer require guzzlehttp/guzzle

Requirements: PHP 8.2+. One of: Guzzle (recommended), cURL, or PHP Streams for HTTP.

Quick Start

<?php
require 'vendor/autoload.php';

use CoCart\SDK\CoCart;

// Guest customer — cart key is persisted to PHP session automatically
$client = new CoCart('https://your-store.com');

// Browse products
$products = $client->products()->all();

// Add item to cart
$client->cart()->addItem(123, 2);

// Get cart
$cart = $client->cart()->get();

Configuration

$client = new CoCart('https://your-store.com', [
    'cart_key'          => 'existing_cart_key',
    'username'          => '[email protected]',
    'password'          => 'password',
    'jwt_token'         => 'your-jwt-token',
    'consumer_key'      => 'ck_xxxxx',
    'consumer_secret'   => 'cs_xxxxx',
    'timeout'           => 30,
    'verify_ssl'        => true,
    'rest_prefix'       => 'wp-json',
    'namespace'         => 'cocart',
    'main_plugin'       => 'basic',
    'etag'              => true,
    'auto_storage'      => true,
    'session_key'       => 'cocart_cart_key',
]);

Common Mistakes

  1. Not installing an HTTP adapter — The SDK needs Guzzle, cURL, or PHP Streams. Install Guzzle for best results: composer require guzzlehttp/guzzle.
  2. Forgetting session_start() — Cart key auto-persistence uses $_SESSION. Ensure session_start() is called before SDK usage in plain PHP.
  3. Exposing consumer keys in client-side code — Consumer keys are server-side only. Never output them in HTML or JavaScript.
  4. Using 'main_plugin' => 'legacy' on new installs — Only use legacy for WooCommerce Cart REST API v4.x. New CoCart installs use basic (default).

When to Load References

WordPress / WooCommerce Requirements

What ships with it: 3 files

3.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.