collection-audit-pipeline
Skill2 starsChanged 5 months agoMITView on GitHub
Site-wide collection audit orchestrator for Shopify stores. Pulls ALL collections via Shopify connector pagination, runs a 2-tier audit (Tier 1 metadata-only quick-scan on all collections + Tier 2 full collection-analyze deep-scan on bottom-quartile candidates), detects site-wide cannibal pairs via title/handle/product overlap matrix, surfaces 10 site-wide patterns, and produces a ranked portfolio report (HTML + per-collection JSON + ranked refresh queue). Use when user says "audit all collections", "site collection audit", "collection portfolio", "rank my collections", "find worst collections", or any whole-site Shopify category-page review.
In this repository7 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 52
Verify Shopify connector is authenticated and matches the site domain:
- Distinctive: line 56
If mismatch, fail fast with "switch-shop required" instruction.
- Very specific: line 141
If --no-gsc not set, mandate GSC pull for each.
- Distinctive: line 179
Does NOT push fixes to Shopify (audit-only)
- Distinctive: line 180
Does NOT pull full product list per collection (curation check stays deferred.
- Distinctive: line 182
Does NOT publish or modify any storefront data
- Very specific: line 183
Does NOT replace collection-analyze for single-page deep audits — that skill remains the canonical "I want to deep-dive THIS collection" …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
Collection Audit Pipeline: Site-Wide Portfolio Analyzer
Sister skill to blog-audit-pipeline but for Shopify collection pages.
Runs a 2-tier audit across ALL collections on a site (typically 50–300 for
mid-size Shopify stores), surfacing patterns + cannibal pairs + a prioritized
refresh queue.
Input Handling
- Site domain — e.g.
your-store.com(resolves to Shopify connector) - The pipeline assumes the Shopify connector is already authenticated for
the target shop. Verify with
get-shop-infobefore running.
Flags
--tier-2-top N(default: 20) — number of bottom-Tier-1 collections to promote to full Tier-2 deep-scan viacollection-analyze--no-tier-2— Tier 1 only (fastest, ~5 minutes for 200 collections)--no-gsc— skip GSC pull for Tier 2 collections--cannibal-only— skip scoring entirely, run only the cannibal detection matrix on all collections (~2 minutes)--format html|md|json— default html for portfolio dashboard; md for human-readable; json for downstream consumption
Pipeline Phases
Phase 0 — Connector check (10 sec)
Verify Shopify connector is authenticated and matches the site domain:
get-shop-info → confirm domain matches argv[1]If mismatch, fail fast with "switch-shop required" instruction.
Phase 1 — Bulk metadata pull (1–3 min for ≤300 collections)
Paginate search_collections 50/page until hasNextPage = false. Cache
to workspace/articles/[site]/_pipeline/shopify-collections-all.json.
Fields collected per collection:
id,handle,title,updatedAtproductsCountimage.urlor nullsortOrder(MANUAL / BEST_SELLING / ALPHA_ASC / etc)ruleSet.appliedDisjunctively+ruleSet.rules[]
Phase 2 — Tier detection (in-memory, fast)
For each collection, apply tier rules from collection-analyze SKILL.md:
- mega-hub: productsCount ≥ 2000 AND ruleSet OR-union ≥ 3 product-types
- hub: 1000–1999 or generic-category title
- brand: 100–999 + brand-prefix title
- sub: <100 + sub-collection naming
- tool: title contains "Kit"/"Device"/"Tool"/"Accessory"/"Hardware"
- new: published in last 30 days
Phase 3 — Tier 1 quick-scan score (in-memory)
For each collection, score against Shopify-metadata-only checks (no WebFetch needed):
| Check | Max | Detection |
| Image present (hub/brand) | 5 | image != null |
| Handle has no typo | 5 | Regex match common typos (colletion, doubled chars, etc) |
| Title is not "Do not DELETE" | 4 | Title doesn't contain debt markers |
| Sort order matches tier expectation | 3 | hub → BEST_SELLING / sub → MANUAL |
| Product count in tier range | 3 | hub ≥100 / brand 30-999 / sub 10-200 / tool 20-150 |
| Cross-brand contamination check (brand tier) | 3 | Smart rule has consistent VENDOR/TAG anchor |
| Smart rule complexity | 3 | OR-union ≤10 conditions; warn ≥10 |
| Has been updated recently | 2 | updatedAt within 90 days |
| Title format consistency | 2 | No "Colletion", no "Ver1/Ver 1/V1" mix, no all-caps mid-sentence |
Total Tier 1 max: 30 pts.
Phase 4 — Site-wide pattern statistics
Compute and report on the full collection set:
- % image:null by tier
- % handle typo
- % "Do not DELETE" admin debt
- Tier distribution (mega-hub / hub / brand / sub / tool / new counts)
- Sort-order distribution
- Smart-rule complexity histogram
- Most-recently-updated vs stale-90d split
Phase 5 — Site-wide cannibal detection
For every pair of collections (O(n²) but with cheap title-prefix bucketing):
- Title token Jaccard ≥ 0.5 → candidate
- Handle token Jaccard ≥ 0.5 → candidate
- Smart-rule tag overlap ≥ 0.5 → candidate
- Combined → cannibal-pair report with verdict suggestion (MERGE / DIFFERENTIATE / PARALLEL OK)
Output:
workspace/articles/[site]/_pipeline/cannibal-pairs.md
Special-case detection: explicit version naming (V1/V2/Ver1/Ver 2/B1) → default to DIFFERENTIATE. Field lesson: version-numbered collections (e.g. "{Product Line} V1" vs "{Product Line} V2") usually represent distinct product generations sold in parallel, not duplicate/cannibalizing pages — treat them as PARALLEL OK unless product overlap is near-total.
Phase 6 — Bottom-quartile selection for Tier 2
Sort all collections by Tier 1 score ascending. Pick bottom-N (default 20):
- Skip "Do not DELETE" admin debt (not real-traffic candidates)
- Skip Tier 1 score = 0 with productCount < 10 (probably orphaned)
- Surface 20 actionable candidates with biggest lift potential
Phase 7 — Tier 2 deep-scan dispatch
For each bottom-quartile collection, dispatch
collection-analyze <url> --tier <auto-detected> --strict and collect the
full 100-pt scorecard.
If --no-gsc not set, mandate GSC pull for each.
Phase 8 — Portfolio report assembly
Output:
workspace/articles/[site]/_pipeline/portfolio-report.md— main reportworkspace/articles/[site]/_pipeline/refresh-queue.md— ranked action listworkspace/articles/[site]/_pipeline/cannibal-pairs.md— detected pairsworkspace/articles/[site]/_pipeline/site-patterns.md— 10-pattern statsworkspace/articles/[site]/[handle]/collection-quality-score.md— per bottom-quartile collection (from Tier 2 dispatch)
Phase pre-requisites (don't skip)
| Phase | Exit criterion |
| 0 | Connector authenticated + domain matches |
| 1 | All collections in JSON cache, count >= 10 (else nothing to audit) |
| 2 | Every collection has tier assigned |
| 3 | Tier 1 scores in distribution |
| 4 | Pattern stats computed |
| 5 | Cannibal-pair list emitted |
| 6 | Bottom-N picked, list saved |
| 7 | Per-collection full scorecards saved (if Tier 2 enabled) |
| 8 | All report files written |
Cost estimate (rough, per mid-size site ≈ <N> collections)
- Phase 1 (pagination): ~6 Shopify connector calls
- Phase 2–6: in-memory, no API calls
- Phase 7 Tier 2 (default 20 collections): ~20 × (1 Shopify + 1 WebFetch + 1
GSC) = ~60 API calls. Optional skip with
--no-tier-2. - Phase 8: file writes only
Total: ~70 API calls + ~30 minutes wall-clock for the default config.
What this skill does NOT do
- Does NOT push fixes to Shopify (audit-only)
- Does NOT pull full product list per collection (curation check stays deferred; pipeline doesn't have time budget for it)
- Does NOT publish or modify any storefront data
- Does NOT replace
collection-analyzefor single-page deep audits — that skill remains the canonical "I want to deep-dive THIS collection" tool
Composition
- Calls:
collection-analyze(per bottom-quartile collection in Phase 7) - Reads from: Shopify connector + GSC connector
- Writes to:
workspace/articles/[site]/_pipeline/+ per-collection artifacts
Output convention
workspace/articles/[site]/_pipeline/
├── shopify-collections-all.json (Phase 1 cache)
├── tier-1-scores.json (Phase 3 output, all collections scored)
├── site-patterns.md (Phase 4 stats)
├── cannibal-pairs.md (Phase 5 detected pairs)
├── refresh-queue.md (Phase 6 ranked list)
└── portfolio-report.md (Phase 8 main deliverable)
workspace/articles/[site]/[handle]/
└── collection-quality-score.md (Phase 7, bottom-quartile only)Re-run / re-audit
Pass --resume to skip Phase 1 if JSON cache < 24h old. Useful when
iterating on report format or re-running Tier 2 only.
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.

