shopify-admin-gift-card-liability-report

Read-only: Break down total unused gift card balances as a financial liability by issuance batch and remaining-balance ranges.

Last repository push
GitHub Stars
205
Forks
23
Issues / PRs
2

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "shopify-admin-gift-card-liability-report" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-08ee1750a4eefea1045bfb388ddac00502dc6aa7772b0cd752b26a056cfb469f. Verify the upstream source and version against https://github.com/40RTY-ai/shopify-admin-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Read-only: Break down total unused gift card balances as a financial liability by issuance batch and remaining-balance ranges.

0 Downloads

Introduction source: third_party · 40RTY-ai · 0.0.1 Reference

SkillPi interpretation

Tasks
Read-only: calculates total outstanding gift card balance as a financial liability, broken down by issue cohort and remaining balance band.
Inputs and outputs
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`
Software, accounts and paid services
Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes read_gift_cards` API scopes: `read_gift_cards`
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
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
THROTTLED API rate limit exceeded Wait 2 seconds, retry up to 3 times
No gift cards with positive balance Store hasn't issued any, or all redeemed Exit with $0 liability
Multi-currency cards Cards issued in different presentment currencies Group totals by currency code; do not sum across currencies
Card with null expiresOn No expiry policy Treat as non-expiring; do not include in expiry-based breakage

Best Practices

  • Run on the last day of every accounting period so the figure aligns with your balance-sheet close.
  • The total outstanding amount is the deferred-revenue liability — book it in your accounting system, do not treat issued gift cards as revenue.
  • Breakage policy varies by jurisdiction; consult your accountant before recognizing breakage candidates as revenue. The stale_days and expiresOn flags here are inputs to that policy, not a substitute for it.
  • Track the redemption-rate trend month over month — declining redemption can indicate a customer-experience issue (recipients can't find / remember their cards).
  • Pair with gift-card-issuance to monitor flow: liability should increase by issuance and decrease by redemption + breakage.

Version history

  1. v1.1.0 GitHub ↗
    Original release notes

    ## 🤖 New category: Agentic Commerce Readiness The fix-it side of the [**agentiq.report**](https://agentiq.report) audit. The audit tells operators *where* AI shopping agents (ChatGPT, Gemini, Perplexity, agentic checkout) can't find, read, or recommend their store. This release adds **10 skills that remediate those findings** via the native Shopify Admin GraphQL toolkit — closing the loop: **audit finds the gap → run the matching skill → re-audit confirms.** Every skill declares the audit **signals** it fixes (`audit_signals` frontmatter), so a finding in the report maps directly to the skill that resolves it. ### Skills - **`agentic-readiness-audit`** — flagship, read-only store-side scorecard that routes each gap to its fix skill - **`agentic-product-jsonld-backfill`** — barcode/GTIN, vendor, product type for complete Product JSON-LD - **`agentic-image-alt-text`** — descriptive alt text on product media - **`agentic-description-enrichment`** — fact-rich descriptions for AI quoting - **`agentic-metafields-setup`** — define + populate agentic metafields for filtering - **`agentic-product-taxonomy`** — Shopify Standard Product Taxonomy categories - **`agentic-crawler-access`** — allow GPTBot/ClaudeBot/PerplexityBot… in `robots.txt.liquid` - **`agentic-llms-txt`** — publish a curated `/llms.txt` for AI assistants - **`agentic-organization-schema`** — Organization JSON-LD (sameAs, contactPoint) into the theme - **`agentic-policy-readability`** — machine-readable shipping/returns policies Plus a weekly **`agentic-readiness-monitor`** routine that re-audits and alerts on regressions. ### Stats **116 skills across 11 categories** (was 106/10), **21 routines** (was 20). All GraphQL validated against the live Admin 2025-01 schema; `pnpm validate:index` passes (116 skills, 64 operations). ### Notes Theme-editing and policy skills default to `dry_run`/`audit` mode, write inside managed `# BEGIN/END` blocks, and recommend duplicating the theme first.

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 针对企业财务人员的高频刚需场景,提供精确的礼品卡负债细分报告
  • 支持 ASC 606 / IFRS 15 会计准则下的 breakage 识别,具备实际会计应用价值
Trigger Precision95/100

Highlights

  • 触发描述精准完整,明确限定为只读负债计算,边界清晰
  • 参数定义详尽,涵盖多种过滤和输出选项
Structure and Standards85/100

Areas to improve

  • 文档长度接近上限 Reported severity: Minor

    SKILL.md 内容约480行,接近500行限制

    Recommendation: 考虑将部分详细说明移至附录或外部链接以保持主文档简洁

Highlights

  • Workflow Steps 划分清晰,包含完整的输入输出说明
  • Session Tracking 强制输出规范确保执行过程可追踪
Execution Reliability90/100

Highlights

  • GraphQL 查询已验证 API 版本兼容性(2025-01)
  • 完善的错误处理机制覆盖节流、空数据、多币种等关键场景
Evidence Verifiability (mean of the first four)91/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes read_gift_cards` API scopes: `read_gift_cards`

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.