shopify-admin-cogs-completeness-audit

Read-only: identify products and variants missing inventoryItem.unitCost to ensure accuracy of profit and inventory valuation reports.

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-cogs-completeness-audit" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-3669c863240eb150f036d3052a68198c79bb6ebb45a72e6ee44315b5410e53a5. 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: identify products and variants missing inventoryItem.unitCost to ensure accuracy of profit and inventory valuation reports.

0 Downloads

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

SkillPi interpretation

Tasks
Read-only: identifies products and variants that are missing inventoryItem.unitCost so margin and inventory valuation reports stay accurate.
Inputs and outputs
CSV file `cogs_audit_<YYYY-MM-DD>.csv` with columns: `variant_id`, `inventory_item_id`, `sku`, `product_title`, `vendor`, `product_status`, `price`, `unit_cost`, `inventory_quantity`, `value_at_price`, `currency`
Software, accounts and paid services
Authenticated Shopify CLI session: `shopify store auth --store <domain> --scopes read_products,read_inventory` API scopes: `read_products`, `read_inventory`
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: shopify-admin-cogs-completeness-audit
role: merchandising
description: "Read-only: identifies products and variants that are missing inventoryItem.unitCost so margin and inventory valuation reports stay accurate."
toolkit: shopify-admin, shopify-admin-execution
api_version: "2025-01"
graphql_operations:
  - productVariants:query
  - inventoryItems:query
status: stable
compatibility: Claude Code, Cursor, Codex, Gemini CLI

Purpose

Scans every variant in the catalog and surfaces those whose inventoryItem.unitCost is missing or zero. Cost of goods sold (COGS) is the foundation for margin reporting, profit-based pricing decisions, and inventory valuation — a single missing cost silently corrupts every downstream calculation. Read-only — no mutations.

Prerequisites

  • Authenticated Shopify CLI session: shopify store auth --store <domain> --scopes read_products,read_inventory
  • API scopes: read_products, read_inventory

Parameters

Parameter Type Required Default Description
store string yes — Store domain (e.g., mystore.myshopify.com)
status_filter string no ACTIVE Variant product status to audit: ACTIVE, DRAFT, ARCHIVED, or ALL
vendor_filter string no — Optional vendor to scope the audit
include_zero_cost bool no true Treat unitCost = 0 as missing (recommended; zero cost is rarely intentional)
only_stocked bool no true Limit to variants with inventoryQuantity > 0
format string no human Output format: human or json

Safety

ℹ️ Read-only skill — no mutations are executed. Safe to run at any time. The skill flags missing data; remediation should happen through a follow-up workflow that you control.

Workflow Steps

  1. OPERATION: productVariants — query Inputs: first: 250, query: <built from status_filter and vendor_filter>, select sku, price, inventoryQuantity, inventoryItem { id }, product { title, vendor, status, productType }, pagination cursor Expected output: All matching variants; paginate until hasNextPage: false

  2. OPERATION: inventoryItems — query Inputs: Batched inventoryItemIds (≤100 per request) Expected output: unitCost { amount, currencyCode }, tracked

  3. Filter to variants where unitCost == null or unitCost.amount == 0 (when include_zero_cost: true). Compute potential margin gap as price - 0 = price for the missing-cost variants — this is the fictional margin downstream reports will show.

  4. Summarize: count missing, % of catalog, total stock-value impact (sum of inventoryQuantity * price across missing rows since you cannot value them on cost).

GraphQL Operations

# productVariants:query — validated against api_version 2025-01
query VariantsForCogsAudit($query: String, $after: String) {
  productVariants(first: 250, after: $after, query: $query) {
    edges {
      node {
        id
        sku
        title
        price
        inventoryQuantity
        product {
          id
          title
          vendor
          status
          productType
        }
        inventoryItem {
          id
        }
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
# inventoryItems:query — validated against api_version 2025-01
query InventoryItemCosts($ids: [ID!]!) {
  nodes(ids: $ids) {
    ... on InventoryItem {
      id
      tracked
      sku
      unitCost {
        amount
        currencyCode
      }
    }
  }
}

Session Tracking

Claude MUST emit the following output at each stage. This is mandatory.

On start, emit:

╔══════════════════════════════════════════════╗
║  SKILL: COGS Completeness Audit              ║
║  Store: <store domain>                       ║
║  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):

══════════════════════════════════════════════
COGS COMPLETENESS AUDIT
  Variants audited:        <n>
  Missing unit cost:       <n>  (<pct>%)
  Stocked + missing cost:  <n>
  Catalog value at risk:   $<amount> (priced, not costed)

  Top vendors by missing variants:
    <vendor>  Missing: <n>  Stocked: <n>
  Output: cogs_audit_<date>.csv
══════════════════════════════════════════════

For format: json, emit:

{
  "skill": "cogs-completeness-audit",
  "store": "<domain>",
  "variants_audited": 0,
  "missing_cost": 0,
  "missing_cost_pct": 0,
  "stocked_missing": 0,
  "value_at_risk": 0,
  "currency": "USD",
  "output_file": "cogs_audit_<date>.csv"
}

Output Format

CSV file cogs_audit_<YYYY-MM-DD>.csv with columns: variant_id, inventory_item_id, sku, product_title, vendor, product_status, price, unit_cost, inventory_quantity, value_at_price, currency

Error Handling

Error Cause Recovery
THROTTLED API rate limit exceeded Wait 2 seconds, retry up to 3 times
inventoryItem is null Variant has no inventory item (rare) Skip, note in error count
unitCost.currencyCode differs from store currency Multi-currency cost capture Treat as present; do not flag, surface currency mismatch separately
All variants have costs Healthy catalog Exit with summary: 0 missing, 100% complete

Best Practices

  • Run monthly; whenever new vendors or product lines are onboarded, run on day one of activation to catch missing costs before margin reports are trusted.
  • Filter by vendor_filter to assign remediation work to the buyer responsible for that vendor's data.
  • Pair with inventory-valuation-report — that report will silently treat missing-cost SKUs as worthless inventory unless this audit is clean.
  • Treat unitCost = 0 as missing by default. Genuine zero-cost SKUs (free samples, GWP) are rare; tag those with a zero-cost-intentional product tag and exclude them from the audit via vendor_filter or downstream filtering.
  • Use the CSV as a worklist: hand it to the merchandising team for cost capture, then re-run weekly until the missing count is zero.

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 Value95/100

Highlights

  • 针对 Shopify 商家利润与库存估值准确性的核心痛点,解决缺失 unitCost 导致的报表失真问题
  • 具备高实用价值,适用于电商运营、财务、买手等多个角色,属于高频刚需场景
Trigger Precision95/100

Highlights

  • description 清晰界定功能边界(只读审计、识别缺失 unitCost),无歧义
  • frontmatter 中 description 完整且位置正确,覆盖多种使用场景
Structure and Standards95/100

Highlights

  • Workflow Steps 分步清晰,包含操作类型、输入输出和分页逻辑
  • 提供完整的 GraphQL 操作示例和 Session Tracking 输出模板,便于执行和验证
Execution Reliability90/100

Highlights

  • API 版本明确(v2025-01),参数设计合理(分页250、批处理≤100)
  • 覆盖主要异常场景(限流、inventoryItem null、货币不匹配),只读操作安全可靠
Evidence Verifiability (mean of the first four)94/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_products,read_inventory` API scopes: `read_products`, `read_inventory`

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