store-add-product
Installation
SKILL.md
Store Catalog Management (add / edit / delete products)
Playbook for managing any store repo's catalog through its committed CLI scripts/add-product.mjs. All store specifics (language, sizes, collections, image conventions, tone) are discovered at runtime — never trust remembered values. Never mutate the catalog file, funnel config, or product images by hand; every change goes through the CLI.
1. Detect the store
- The target repo must contain
scripts/add-product.mjs; verify withls. - If absent: stop, explain the add-product CLI convention, and offer to bootstrap the store's script from this skill's
reference/directory (copyadd-product.mjs+catalog/and followreference/ADAPTATION.md). Once bootstrapped (verified with--helpandcapabilities --json), resume below. - If the script predates the management commands (nothing under
scripts/catalog/, nocapabilitiessupport), treat it as add-only: do not mutate the catalog any other way — explain the limitation and offer to upgrade the store's script from the bundled reference (section 8).
2. Discover the contract (always first)
- Run
node scripts/add-product.mjs --helpthennode scripts/add-product.mjs capabilities --json(cwd = repo).capabilitiesis authoritative: schemaVersion, supported commands and flags, editable fields, collections, tags, the product list, upsell status, and the current catalog revision (SHA-256). list --jsongives ids/slugs/names with colors and sizes;show <id-or-slug> --jsongives the full current product JSON.- Read the store's types file (commonly
lib/types.ts) for collection slugs and the size model, and the catalog file (commonlylib/data/products.ts) for insertion style and brand tone. Never assume baby sizes, French, or any store-specific detail (a shoe store: sizes 39-45, different collections). - Record the revision reported by show/capabilities — it is the
--expected-revisionvalue for guarded writes.