/shopify-admin-gift-card-liability-report
Read-only: calculates total outstanding gift card balance as a financial liability, broken down by issue cohort and remaining balance band.
$ npx -y skills add 40rty-ai/shopify-admin-skills --skill shopify-admin-gift-card-liability-report --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/shopify-admin-gift-card-liability-report
Context preview
The summary Claude sees to decide when to auto-load this skill.
Read-only: calculates total outstanding gift card balance as a financial liability, broken down by issue cohort and remaining balance band.
SKILL.md
shopify-admin-gift-card-liability-report.SKILL.mdname: shopify-admin-gift-card-liability-report
role: finance
description: "Read-only: calculates total outstanding gift card balance as a financial liability, broken down by issue cohort and remaining balance band."
toolkit: shopify-admin, shopify-admin-execution
api_version: "2025-01"
graphql_operations:
- giftCards:query
status: stable
compatibility: Claude Code, Cursor, Codex, Gemini CLI
Purpose
Calculates the store's total outstanding gift card liability — the sum of unredeemed gift card balances that represent a future obligation to deliver goods. Breaks the liability down by **issue-month cohort** and **remaining-balance band** so finance can size the obligation, age it, and forecast breakage. This is the bookkeeping companion to `gift-card-balance-report` (which lists individual cards). Read-only — no mutations.
Prerequisites
- Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes read_gift_cards`
- API scopes: `read_gift_cards`
Parameters
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | store | string | yes | — | Store domain (e.g., mystore.myshopify.com) | | status | string | no | enabled | Filter by status: `enabled`, `disabled`, or `all` | | balance_bands | array | no | `[10, 50, 100, 250, 500]` | Upper edges of balance bands (in store currency) for distribution table | | stale_days | integer | no | 365 | Cards untouched longer than this are flagged as breakage candidates | | as_of | string | no | today (UTC) | ISO date for the "as of" snapshot label on the report | | format | string | no | human | Output format: `human` or `json` |
Safety
> ℹ️ Read-only skill — no mutations are executed. The dollar figure produced is the deferred-revenue liability for accounting purposes; review with your accountant before booking journal entries.
Liability Model
For every enabled gift card with `balance > 0`:
1. **Outstanding balance** = sum of `balance.amount` (the liability) 2. **Issue cohort** = year-month of `createdAt` 3. **Balance band** = first band edge ≥ remaining balance, or `>max` for cards above the largest edge 4. **Breakage candidate** = card with `balance > 0` and (`updatedAt` older than `stale_days` ago OR `expiresOn` within next 30 days)
Aggregations:
- Total outstanding (overall + per cohort + per band)
- Card counts per cohort and per band
- Weighted-average days since issue
- Breakage candidate total — useful for revenue recognition under ASC 606 / IFRS 15 for stores in jurisdictions where breakage can be recognized
Workflow Steps
1. **OPERATION:** `giftCards` — query **Inputs:** `query: "status:<status> balance:>0"`, `first: 250`, select `id`, `balance`, `initialValue`, `createdAt`, `updatedAt`, `expiresOn`, `enabled`, `lastCharacters`, pagination cursor **Expected output:** All gift cards with positive balance; paginate until `hasNextPage: false`
2. For each card, compute issue cohort, balance band, and breakage flag
3. Aggregate totals: overall liability, per-cohort table, per-band table, breakage candidate subtotal
4. Compute redeemed-to-date as `Σ(initialValue - balance)` for context
GraphQL Operations
# giftCards:query — validated against api_version 2025-01
query GiftCardLiability($query: String, $after: String) {
giftCards(first: 250, after: $after, query: $query) {
edges {
node {
id
balance {
amount
currencyCode
}
initialValue {
amount
currencyCode
}
enabled
createdAt
updatedAt
expiresOn
lastCharacters
customer {
id
displayName
defaultEmailAddress {
emailAddress
}
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}Session Tracking
**Claude MUST emit the following output at each stage. This is mandatory.**
**On start**, emit:
╔══════════════════════════════════════════════╗
║ SKILL: Gift Card Liability Report ║
║ Store: <store domain> ║
║ As of: <YYYY-MM-DD> ║
║ Started: <YYYY-MM-DD HH:MM UTC> ║
╚══════════════════════════════════════════════╝
**After each step**, emit:
[N/TOTAL] <QUERY|MUTATION> <OperationName>
→ Params: <brief summary of key inputs>
→ Result: <count or outcome>**On completion**, emit:
For `format: human` (default):
══════════════════════════════════════════════
GIFT CARD LIABILITY (as of <date>)
Active cards w/ balance: <n>
Total outstanding: $<amount>
Initial value issued: $<amount>
Redeemed to date: $<amount> (<pct>%)
Breakage candidates: <n> ($<amount>)
By issue cohort (YYYY-MM):
2024-12 Cards: <n> Liability: $<n>
2025-01 Cards: <n> Liability: $<n>
By balance band:
≤ $10 Cards: <n> Liability: $<n>
≤ $50 Cards: <n> Liability: $<n>
≤ $100 Cards: <n> Liability: $<n>
> $500 Cards: <n> Liability: $<n>
Output: gift_card_liability_<date>.csv
══════════════════════════════════════════════For `format: json`, emit:
{
"skill": "gift-card-liability-report",
"store": "<domain>",
"as_of": "<YYYY-MM-DD>",
"active_with_balance": 0,
"total_outstanding": 0,
"initial_value_issued": 0,
"redeemed_to_date": 0,
"redemption_rate_pct": 0,
"breakage_candidates_count": 0,
"breakage_candidates_value": 0,
"currency": "USD",
"by_cohort": [],
"by_band": [],
"output_file": "gift_card_liability_<date>.csv"
}Output Format
CSV file `gift_card_liability_<YYYY-MM-DD>.csv` with columns: `gift_card_id`, `last_characters`, `initial_value`, `balance`, `redeemed`, `currency`, `created_at`, `issue_cohort`, `balance_band`, `updated_at`, `expires_on`, `breakage_candidate`, `customer_email`
Error Handling
| Error | Cause | Recovery | |--
Read more
name: shopify-admin-gift-card-liability-report role: finance description: "Read-only: calculates total outstanding gift card balance as a financial liability, broken down by issue cohort and remaining balance band." toolkit: shopify-admin, shopify-admin-execution api_version: "2025-01" graphql_operations: - giftCards:query status: stable compatibility: Claude Code, Cursor, Codex, Gemini CLI
Purpose
Calculates the store's total outstanding gift card liability — the sum of unredeemed gift card balances that represent a future obligation to deliver goods. Breaks the liability down by **issue-month cohort** and **remaining-balance band** so finance can size the obligation, age it, and forecast breakage. This is the bookkeeping companion to `gift-card-balance-report` (which lists individual cards). Read-only — no mutations.
Prerequisites
- Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes read_gift_cards`
- API scopes: `read_gift_cards`
Parameters
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | store | string | yes | — | Store domain (e.g., mystore.myshopify.com) | | status | string | no | enabled | Filter by status: `enabled`, `disabled`, or `all` | | balance_bands | array | no | `[10, 50, 100, 250, 500]` | Upper edges of balance bands (in store currency) for distribution table | | stale_days | integer | no | 365 | Cards untouched longer than this are flagged as breakage candidates | | as_of | string | no | today (UTC) | ISO date for the "as of" snapshot label on the report | | format | string | no | human | Output format: `human` or `json` |
Safety
> ℹ️ Read-only skill — no mutations are executed. The dollar figure produced is the deferred-revenue liability for accounting purposes; review with your accountant before booking journal entries.
Liability Model
For every enabled gift card with `balance > 0`:
1. **Outstanding balance** = sum of `balance.amount` (the liability) 2. **Issue cohort** = year-month of `createdAt` 3. **Balance band** = first band edge ≥ remaining balance, or `>max` for cards above the largest edge 4. **Breakage candidate** = card with `balance > 0` and (`updatedAt` older than `stale_days` ago OR `expiresOn` within next 30 days)
Aggregations:
- Total outstanding (overall + per cohort + per band)
- Card counts per cohort and per band
- Weighted-average days since issue
- Breakage candidate total — useful for revenue recognition under ASC 606 / IFRS 15 for stores in jurisdictions where breakage can be recognized
Workflow Steps
1. **OPERATION:** `giftCards` — query **Inputs:** `query: "status:<status> balance:>0"`, `first: 250`, select `id`, `balance`, `initialValue`, `createdAt`, `updatedAt`, `expiresOn`, `enabled`, `lastCharacters`, pagination cursor **Expected output:** All gift cards with positive balance; paginate until `hasNextPage: false`
2. For each card, compute issue cohort, balance band, and breakage flag
3. Aggregate totals: overall liability, per-cohort table, per-band table, breakage candidate subtotal
4. Compute redeemed-to-date as `Σ(initialValue - balance)` for context
GraphQL Operations
# giftCards:query — validated against api_version 2025-01
query GiftCardLiability($query: String, $after: String) {
giftCards(first: 250, after: $after, query: $query) {
edges {
node {
id
balance {
amount
currencyCode
}
initialValue {
amount
currencyCode
}
enabled
createdAt
updatedAt
expiresOn
lastCharacters
customer {
id
displayName
defaultEmailAddress {
emailAddress
}
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}Session Tracking
**Claude MUST emit the following output at each stage. This is mandatory.**
**On start**, emit:
╔══════════════════════════════════════════════╗ ║ SKILL: Gift Card Liability Report ║ ║ Store: <store domain> ║ ║ As of: <YYYY-MM-DD> ║ ║ Started: <YYYY-MM-DD HH:MM UTC> ║ ╚══════════════════════════════════════════════╝
**After each step**, emit:
[N/TOTAL] <QUERY|MUTATION> <OperationName>
→ Params: <brief summary of key inputs>
→ Result: <count or outcome>**On completion**, emit:
For `format: human` (default):
══════════════════════════════════════════════
GIFT CARD LIABILITY (as of <date>)
Active cards w/ balance: <n>
Total outstanding: $<amount>
Initial value issued: $<amount>
Redeemed to date: $<amount> (<pct>%)
Breakage candidates: <n> ($<amount>)
By issue cohort (YYYY-MM):
2024-12 Cards: <n> Liability: $<n>
2025-01 Cards: <n> Liability: $<n>
By balance band:
≤ $10 Cards: <n> Liability: $<n>
≤ $50 Cards: <n> Liability: $<n>
≤ $100 Cards: <n> Liability: $<n>
> $500 Cards: <n> Liability: $<n>
Output: gift_card_liability_<date>.csv
══════════════════════════════════════════════For `format: json`, emit:
{
"skill": "gift-card-liability-report",
"store": "<domain>",
"as_of": "<YYYY-MM-DD>",
"active_with_balance": 0,
"total_outstanding": 0,
"initial_value_issued": 0,
"redeemed_to_date": 0,
"redemption_rate_pct": 0,
"breakage_candidates_count": 0,
"breakage_candidates_value": 0,
"currency": "USD",
"by_cohort": [],
"by_band": [],
"output_file": "gift_card_liability_<date>.csv"
}Output Format
CSV file `gift_card_liability_<YYYY-MM-DD>.csv` with columns: `gift_card_id`, `last_characters`, `initial_value`, `balance`, `redeemed`, `currency`, `created_at`, `issue_cohort`, `balance_band`, `updated_at`, `expires_on`, `breakage_candidate`, `customer_email`
Error Handling
| Error | Cause | Recovery | |--
Community-maintained AI agent skills for operating Shopify stores — workflows, optimization, reports and more
Other skills on shopify-admin-skills.
- /shopify-admin-agentic-crawler-access
Edit the theme's robots.txt.liquid to explicitly allow AI crawlers (GPTBot, ClaudeBot, PerplexityBot, Google-Extended, OAI-SearchBot, Amazonbot) so AI assistants are permitted to read the catalog.
Open skill - /shopify-admin-agentic-description-enrichment
Rewrite thin product descriptions into structured, fact-rich copy (materials, fit, use-cases, the words shoppers actually type) so AI agents have something concrete to quote and match.
Open skill - /shopify-admin-agentic-image-alt-text
Generate and set descriptive alt text on product images so AI agents (which can't 'see' pixels) can understand and recommend what each product looks like.
Open skill - /shopify-admin-agentic-llms-txt
Generate and publish an /llms.txt guide (brand summary, flagship products, key policies, contact) via a theme template so AI assistants get a curated, machine-readable map of the store.
Open skill - /shopify-admin-agentic-metafields-setup
Define and populate agentic-commerce metafields (material, attributes, key features, specs, sizing) so AI agents can filter and match products to specific shopper requirements.
Open skill - /shopify-admin-agentic-organization-schema
Inject an Organization JSON-LD block (name, logo, sameAs social links, contactPoint) into the theme so AI agents can verify the store is a real, trusted brand and link it to its public identity.
Open skill

