fix(skills): correct five places where the skills contradict the API - #8
Merged
Merged
Conversation
Building the Food Universe and Photo Store storefronts turned up places
where following a skill produces a wrong call. Each one below was checked
against the live API before changing the text.
Price lists (pricing/references/price-lists-and-markets.md)
The example sent `priceVariants: ["retail"]`, `selectedProductVariants:
{ type: ALL }` and a `targetAudience` without `type`. Every one of those
is rejected. Introspection of both Core and the legacy PIM API shows
`priceVariants: [{ identifier, modifier }]`, `type: ALL_SKUS | SOME_SKUS`
with per-SKU `variants`, and a required `targetAudience.type` of
`EVERYONE | SOME`. The example now uses Core `createPriceList`, with a
table of the input shapes and a SOME_SKUS example.
Checkout (mutation/references/shop-api-mutations.md, shop-api-order-mutations.md)
The flow listed `fulfill` as a step after `createFromCart`. The Shop API
schema describes `fulfill` as "change its state and assign the orderId".
`createFromCart` already does both: all 8 food-universe orders, created by
a storefront that never calls `fulfill`, have carts that are `ordered`
with `orderId` equal to the cart's own id, updated within about half a
second of the order.
The step is gone. `fulfill` is described as linking a cart to an order
created some other way.
Publishing for vector ranking (vector-ranking, mutation/references/core-api.md)
The pipeline recommended `publishItems` right before indexing.
`publishItems` returns a `PublishItemsRequest`, and both storefront
projects found that it can return before the items are published. The
pipeline now uses `publishItem` per item and language, which returns the
published version or an error for that item.
Numeric decimalPlaces (mass-operations/references/limits.md, create-shape-api.md)
limits.md gave the range as 0-64. Mass-operation validation rejects 0
("Too small: expected number to be >0"). The range is now 1-64, with
the advice to leave the key out for integers.
Vocabulary argument type (vector-ranking)
The skill only described the enum. On a tenant with no indexed
vocabulary (checked on `furniture`), `nearestTo.vocabulary` and
`userTaste.vocabulary` are typed String and a query fails with
"Vocabulary taste not found". On `food-universe`, after indexing, they
are the enum. Both forms are now documented, with a failure-mode row
for the String case.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two storefront builds on Crystallize (Food Universe, B2B with three languages, and Photo Store, B2C/B2B on Discovery vectors) turned up places where following a skill produces a call the API rejects, or a step the API doesn't need. This PR fixes the five places where a skill contradicts the API. Gaps, where a skill just doesn't mention something, come in later PRs.
Every change was checked against the live API before the text was written.
What changes
priceVariants: ["retail"],selectedProductVariants: { type: ALL },targetAudiencewithouttypepriceVariants: [{ identifier, modifier }],type: ALL_SKUS | SOME_SKUSwith per-SKUvariants, andtargetAudience.type(EVERYONE | SOME) is requiredcreateFromCart, thenfulfillcreateFromCartalready moves the cart toorderedand setsorderId; the order id is the cart idcreateFromCartby a storefront that never callsfulfill: every cart isorderedwithorderId= its own id, updated 150–550 ms after the order was created. The Shop API schema describesfulfillas "change its state and assign the orderId", which is exactly whatcreateFromCartalready didpublishItems, then indexpublishItemsreturns aPublishItemsRequest, and both projects found it returns before the items are published.publishItemanswers per itemdecimalPlacesrange 0–64Too small: expected number to be >0build-mass-operationString, and a query fails withVocabulary taste not foundNearestToInput/UserTasteInputonfood-universe(enum) andfurniture(String), plus the error onfurnitureFiles
pricing/references/price-lists-and-markets.md: CorecreatePriceListexample, a table of the input shapes, aSOME_SKUSexample, and a note on the PIM API and the mass-operation intentmutation/references/shop-api-mutations.md: cart state table, the Fulfill section and the checkout flowmutation/references/shop-api-order-mutations.md: a note after thecreateFromCartexamplemutation/references/core-api.md,vector-ranking/SKILL.md,vector-ranking/references/vocabulary-authoring.md:publishItemper item and language; both forms of the vocabulary argumentmass-operations/references/limits.md,content-model/references/create-shape-api.md:decimalPlaces1–64Deliberately cautious
Two claims are worded no stronger than what was verified:
fulfillaftercreateFromCart. The skill now says the step isn't needed. It doesn't say thatfulfillfails afterwards, which is what the Food Universe finding reports, because that call wasn't run in this verification. Photo Store calls it and swallows the error with.catch(() => undefined), which points the same way.publishItemsasynchronous. The skill says its return "is not proof that the items are published yet", not that it is always asynchronous.Merge note
No plugin version bump. Several skill PRs follow from the same findings, so one bump on whichever merges last avoids conflicts.
mcp-servers/crystallize/package.jsonis still on 3.5.0 while the plugin manifests are on 3.6.0 (#3 missed it); that bump should fix it too.make codecleanleaves the skills unchanged (oxfmt --check use-crystallize/skillspasses).🤖 Generated with Claude Code