agentleFS
wake-engineeringwake-engineering/ai-plugin/skills/wake-product-variants/SKILL.md

wake-product-variants

Skill4 starsChanged 8 months agoMITView on GitHub

Wake Commerce variant resolution and add-to-cart. Use when building product detail pages, resolving variants via attributeSelections, or handling customizations and subscriptions. Triggers on: variants, attributeSelections, matrix, selectedVariant, customizations, subscriptionGroups, add-to-cart.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When selectedVariant is non-null, use productVariantId for add-to-cart.

    line 43
  2. Very specific:

    If selectedVariant is null: Do not add.

    line 59
  3. Very specific:

    Use selectedVariant.productVariantId (or root productVariantId for single-variant).

    line 60
  4. Distinctive:

    Single-variant product: No attributeSelections needed.

    line 67
  5. Distinctive:

    Required customization missing: Add-to-cart fails; collect customization values first.

    line 68
  6. Distinctive:

    Subscription required: Must select subscriptionGroupId and recurringTypeId.

    line 69

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Wake Product Variants

Forbidden: api.fbits.net (and any *.fbits.net). Canonical source: https://wakecommerce.readme.io/docs/schema

Variant resolution, attribute matrix, customizations, and subscriptions for Wake Commerce product detail pages and add-to-cart flows.

When to Use

  • Building product detail pages with variant selection (e.g. size, color)
  • Resolving selectedVariant from user attribute selections
  • Handling product customizations (e.g. engraving)
  • Supporting subscription products
  • Implementing add-to-cart with variants

Core Concepts

attributeSelections(selected)

Pass the user's selected attribute values to resolve the variant:

product(productId: $productId) {
  attributeSelections(selected: $selections) {
    canBeMatrix
    matrix { ... }
    selectedVariant { productVariantId prices { ... } }
    selections { attributeId name values { value selected } }
  }
}
  • selections: Array of { attributeId, value } or equivalent per AttributeFilterInput.
  • selectedVariant: Resolved when selections match a variant; null when invalid or incomplete.
  • matrix: Attribute combinations; use for building variant picker UI. See references/attribute-matrix.md.

selectedVariant

When selectedVariant is non-null, use productVariantId for add-to-cart. When null:

  • Selections may be invalid or incomplete
  • Product may have no variants (single-variant: use root productVariantId)
  • Inform user to complete selection before add-to-cart

customizations

Products may require customizations (e.g. engraving text). Check customizations { customizationId, cost, name, type, values }. When present, include customization values in add-to-cart. See references/customizations.md.

subscriptionGroups

For subscription products, subscriptionGroups { recurringTypes, subscriptionGroupId, subscriptionOnly } defines recurring options. Pass subscriptionGroupId and recurringTypeId when adding subscription to cart.

Add-to-Cart with Variants

  1. Resolve variant: Call product with attributeSelections(selected: $selections).
  2. If selectedVariant is null: Do not add; prompt user to complete selection.
  3. Use selectedVariant.productVariantId (or root productVariantId for single-variant).
  4. Include customizations and subscriptionGroups when required.
  5. Pass productVariantId, quantity, selections, and optional customization/subscription data to createCheckout or checkoutAddProduct.

Error Handling

  • selectedVariant null: Selections don't match; check matrix for valid combinations.
  • Single-variant product: No attributeSelections needed; use root productVariantId.
  • Required customization missing: Add-to-cart fails; collect customization values first.
  • Subscription required: Must select subscriptionGroupId and recurringTypeId.

References

  • Attribute matrix: attributeSelections, matrix, selectedVariant
  • Customizations and subscriptions
  • Wake Commerce: wakecommerce.readme.io

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.