feat(onboarding): add catalog-hygiene-audit skill - #136
Open
yani-c wants to merge 1 commit into
Open
Conversation
Adds a read-only catalog integrity sweep that ranks data defects by customer-visible impact and applies only user-approved fixes, one product at a time. Five rules: duplicate SKU across distinct products, defective slug shipped live, inconsistent family naming, image reused across products, and zero or missing price on a purchasable product.
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.
What
Adds
onboarding/catalog-hygiene-audit— a read-only catalog integrity sweep thatfinds the defects a post-import catalog ships with, ranks them by customer-visible
impact, and applies only what the user approves, one product at a time.
Five detection rules:
-copy,copy-of-,^untitled, title mismatch)image_urlacross distinct products (reported, never auto-fixed)0/null price on a product that is active and purchasable right nowWhy
These defects are invisible in the admin list view and loud to a customer. A
product left at
$0.00is buyable at zero until someone notices; a slug like…/products/widget-2-copyis an admin duplicate that shipped to the public URL.A shared SKU is quieter and worse — it breaks inventory decrementing and merges
two products in every revenue report.
The skill is deliberately conservative: read-only until an explicit per-product
approval, no bulk writes, no deletions (archive is proposed instead, and
"remove" is never silently read as "delete"), and no invented prices.
Validated against a live catalog
Run end to end on a real 51-product catalog. Found 4 unpriced live products, 2
SKU collisions, 2 defective slugs, a family with 3 competing slug patterns for
one qualifier, and 2 image-reuse cases needing a merchandising judgment call —
42 products clean. One fix was taken through the approval gate and verified by
re-read.
Three findings from that run are baked into the skill:
custom_slugtrap.PATCH /api/v202604/company/products/{id}with aslugbut nocustom_slug: truereturns 200 with the OLD slug — the APIregenerates from the title and silently discards yours. An agent following the
obvious path reports a success that did not happen. This is why the skill
mandates a re-read before claiming any fix, and why Step 5 says a 200 is not
proof.
skuat product level is usuallynull; the real value isdefault_variant.sku. Deduplicating on the product field finds nothing on acatalog full of duplicate SKUs.
keeps
price: "0.0"andbuyable: true, so republishing reintroduces thedefect. The skill has to report that residual rather than implying the data is
now correct.
Rules also suppress two classes of false positive that a naive implementation
gets wrong: a trailing digit that is a model number (
widget-2for "Widget 2")is not an admin counter, and a refurbished listing reusing its retail parent's
hero image is normal, not a merchandising gap.
How to test
Expect
catalog validation passed: 42 skills, 6 workflowsand 16 testsOK.Note that neither validator actually inspects a new skill's body — frontmatter is
not validated, and the banned-fragment scan runs only against the 14 hardcoded
SHARED_CONTRACT_FILES. So the green check confirms the manifest entry, not thecontent. The skill carries no company-specific names, product ids, SKUs, or
currencies; examples use a neutral
widget-2.Category
Filed under
onboardingbecause its nearest neighbour isonboarding/fluid-product-admin-import— this audits what that import produced.It is not exclusively a post-import skill, though, so if maintainers would rather
see a new top-level
catalogcategory (the way #96 addedportal), it is aone-line change in the manifest entry and the file path. Happy either way.
Known limitations
particular needs a human to distinguish a legitimate refurb reusing its parent's
image from a differently-branded listing that needs its own photography.
pricing behind a login, for instance) the skill reports it as awaiting a
decision and offers reversible archival as the interim fix.
mobile widgets for references and states the blast radius on the approval card,
but it cannot see every external inbound link.