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.
In this repository8 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- wake-checkout-flowSkill
- wake-hotsite-bannersSkill
- wake-scribanSkill
- wake-storefront-apiSkill
- wake-storefront-reference-patternsSkill
- wake-templateSkill
- web-performance-auditSkill
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
- Very specific: line 43
When selectedVariant is non-null, use productVariantId for add-to-cart.
- Very specific: line 59
If selectedVariant is null: Do not add.
- Very specific: line 60
Use selectedVariant.productVariantId (or root productVariantId for single-variant).
- Distinctive: line 67
Single-variant product: No attributeSelections needed.
- Distinctive: line 68
Required customization missing: Add-to-cart fails; collect customization values first.
- Distinctive: line 69
Subscription required: Must select subscriptionGroupId and recurringTypeId.
≈ “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.
Files
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
- Resolve variant: Call product with
attributeSelections(selected: $selections). - If
selectedVariantis null: Do not add; prompt user to complete selection. - Use
selectedVariant.productVariantId(or rootproductVariantIdfor single-variant). - Include
customizationsandsubscriptionGroupswhen required. - 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
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
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.

