Shopify platform conventions and requirements. Auto-apply when working with metafields, metaobjects, GraphQL API calls, rate limiting, app store submission, or Built for Shopify compliance.
Cross-cutting concerns áp dụng cho toàn bộ codebase — admin, storefront, và backend.
Skill này cover 3 areas chính:
| Area | Reference | Khi nào apply |
|---|---|---|
| Metafields & Metaobjects | metafields.md | Khi define/read/write metafields, tạo metaobject definitions |
| Built for Shopify (BfS) | built-for-shopify.md | Khi review code quality, trước khi submit app, performance audit |
| API Throttle Handling | throttle.md |
| Khi gọi Shopify GraphQL/REST API, bulk operations, webhooks |
// KHÔNG BAO GIỜ gọi Shopify API mà không có retry logic
// Xem chi tiết: throttle.md
extensions.cost trong response// Namespace format: $app:<key> (app-owned) hoặc custom.<key> (merchant-editable)
// Xem chi tiết: metafields.md
$app:custom. namespace// Mọi feature mới đều phải pass BfS criteria trước khi merge
// Xem chi tiết: built-for-shopify.md
Cần store simple value trên product/order/customer?
→ Metafield
Cần store structured data với multiple fields?
→ Metaobject (nếu < 5 fields, consider JSON metafield trước)
Cần relationships giữa custom data?
→ Metaobject + mixed references
Cần merchant edit trong admin?
→ Metafield definition với pin = true (hiện trong admin UI)
Default: GraphQL (lower cost, flexible queries)
Exceptions:
- Webhook registration: REST simpler
- File uploads: REST required
- Simple CRUD on single resource: REST acceptable
Cache (Redis, 5-15 min):
- Shop info, theme info
- Product lists (non-realtime)
- Metafield definitions
- App settings
KHÔNG cache:
- Order data (realtime accuracy)
- Inventory levels
- Customer PII
- Pricing/billing info
$ARGUMENTS