size-chart-sync
Skill1 starsChanged 3 months agoMITView on GitHub
Use when syncing size charts to TikTok Shop listings for a Shopify merchant - fetching products, resolving listing IDs, categorizing by product type, generating batch payloads, checking DB for missing size charts, and updating Notion progress docs.
In this repository9 other files it gives its agents.
- channels-releaseSkill
- codexSkill
- harnessSkill
- product-video-promptSkill
- reviewSkill
- size-chart-auditSkill
- skill-writerSkill
- variant-swatch-imageSkill
- verifySkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Use --no-cache to force re-fetch
- Distinctive: line 37
Not all products will resolve (some may not have listings)
- Very specific: line 44
Remove rows without listing_id
- Very specific: line 45
If merchant has multiple size charts by category: add category and size_chart_url columns
- Very specific: line 49
Use Shopify product_type field to classify.
- Very specific: line 64
Create JSON payload files in generated_size_charts/{store_name}/payloads/.
- Distinctive: line 107
Update the merchant's Notion page with:
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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
Size Chart Sync Workflow
End-to-end workflow for syncing size chart images to TikTok Shop listings for Shopify merchants.
Workflow Steps
1. Fetch Products
Fetch all products from the Shopify store via paginated /collections/all/products.json API.
GET {store_url}/collections/all/products.json?limit=250&page={n}- Cache results to
data/{store_name}_products.json - Use
--no-cacheto force re-fetch - Key fields:
id(shopify_product_id),handle,title,product_type
2. Resolve Listing IDs
Map Shopify product IDs to AfterShip listing IDs via 3-step DB chain:
shopify_product_id (external_product_id)
-> connectors-p-product.product_id (connectors_product_id)
-> products-p-core.product_id (products_center_product_id)
-> products-p-listings.product_listing_id (listing_id)- Query in batches of 50
- Filter by
organization_idin step 1 - Not all products will resolve (some may not have listings)
3. Write CSV
Output to data/{store_name}_products.csv with columns:
listing_id,shopify_product_id,handle,title- Remove rows without
listing_id - If merchant has multiple size charts by category: add
categoryandsize_chart_urlcolumns
4. Categorize Products (if needed)
Use Shopify product_type field to classify. Fall back to title/handle keywords for empty types.
Typical mapping:
| product_type | category |
| tops, outerwear, jackets & vest, kimonos & cardigans | tops |
| bottoms | bottoms |
| dresses & rompers | dresses |
| shoes | shoes |
| jeans (title contains "jean") | denim |
| accessories | skip (no size chart) |
5. Generate Batch Payloads
Create JSON payload files in generated_size_charts/{store_name}/payloads/.
Payload format:
{
"group_name": "batch_edit_product_listings_product_attributes",
"organization_id": "{org_id}",
"store_key": "{store_key}",
"platform": "shopify",
"inputs": {
"edit_attributes_task": {
"product_listing_ids": ["id1", "id2", ...],
"size_chart": {
"images": [{
"sales_channel_id": "",
"url": "{size_chart_image_url}"
}]
}
}
}
}Grouping rules:
- Same size chart URL -> same payload file
- Split into batches (typically 50 or 200 per file)
- File naming:
{category}.jsonor{category}_batch_{nn}.json
6. Check Existing Size Charts
Query products-p-listings to find which listings already have size charts:
SELECT product_listing_id, product FROM product_listings
WHERE product_listing_id IN (...) LIMIT NSize chart is in the product JSON field at product.size_chart.images. Empty array = no size chart.
Generate separate payloads for missing ones in payloads_missing/ directory.
7. Update Notion
Update the merchant's Notion page with:
- Total active listings count
- Category breakdown with counts
- Size chart URLs used
- Completion status
Required Inputs from User
- Store URL: Shopify store domain (e.g.,
https://example.com) - Organization ID: AfterShip org_id
- Store Key: AfterShip store_key for payloads
- Size Chart URLs: GCS URLs for size chart images (one universal or per-category)
- Notion page URL: For progress tracking (optional)
Key Directories
data/- CSV files and cached product JSONgenerated_size_charts/{store_name}/payloads/- Batch payload filesscripts/- Per-store fetch scripts
DB Access
Uses Go query tool at ~/.claude/skills/database/scripts/go/:
go run query_any_db.go -db {db_name} -q "{sql}"Databases: connectors-p-product, products-p-core, products-p-listings
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.

