retail-kpi-knowledge
Retail KPI / metric-contract reasoning layer for BI agents in the Seshat BI project. Use when an agent must reason about the BUSINESS MEANING of a retail KPI before any implementation — defining a KPI in business terms, classifying additivity (fully/semi/non-additive), identifying grain, listing required source fields, resolving ambiguity (gross vs net, VAT, returns, cost method, same-store), choosing an MVP KPI pack, reviewing a metric contract for completeness, or preparing a clean handoff to an implementation layer. Also use it to classify KPI sufficiency or prepare an owner policy decision packet. This is a meaning/definition + review layer, not an executor: it does not write DAX/SQL/Python, grant readiness, approve policy, or design dashboards. See INDEX.md for live/planned routes; registry.yaml is the authoritative machine-readable inventory.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-11
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- retail-kpi-knowledge
- description
- Retail KPI / metric-contract reasoning layer for BI agents in the Seshat BI project. Use when an agent must reason about the BUSINESS MEANING of a retail KPI before any implementation — defining a KPI in business terms, classifying additivity (fully/semi/non-additive), identifying grain, listing required source fields, resolving ambiguity (gross vs net, VAT, returns, cost method, same-store), choosing an MVP KPI pack, reviewing a metric contract for completeness, or preparing a clean handoff to an implementation layer. Also use it to classify KPI sufficiency or prepare an owner policy decision packet. This is a meaning/definition + review layer, not an executor: it does not write DAX/SQL/Python, grant readiness, approve policy, or design dashboards. See INDEX.md for live/planned routes; registry.yaml is the authoritative machine-readable inventory.
02 资源文件 61
- 参考文档checklists/kpi-extension-checklist.md1.5 KB
- 参考文档checklists/kpi-pack-review-checklist.md1.2 KB
- 参考文档checklists/kpi-policy-decision-checklist.md1.2 KB
- 参考文档checklists/metric-ambiguity-checklist.md1.4 KB
- 参考文档checklists/metric-contract-review-checklist.md1.9 KB
- 参考文档contracts/average-basket-size-units.md1.8 KB
- 参考文档contracts/average-transaction-value.md2.6 KB
- 参考文档contracts/discount-amount.md2.4 KB
- 参考文档contracts/discount-rate.md1.9 KB
- 参考文档contracts/discounted-transaction-rate.md2.0 KB
- 参考文档contracts/gross-margin-percent.md1.9 KB
- 参考文档contracts/gross-margin.md2.1 KB
- 参考文档contracts/gross-sales.md2.7 KB
- 参考文档contracts/net-sales-growth.md4.4 KB
- 参考文档contracts/net-sales.md2.9 KB
- 参考文档contracts/quantity-sold.md2.3 KB
- 参考文档contracts/returns-rate-value.md2.8 KB
- 参考文档contracts/same-store-sales-growth.md3.9 KB
- 参考文档contracts/transactions-count.md2.2 KB
- 参考文档contracts/ytd.md4.7 KB
- 参考文档domains/basket-and-transactions.md3.4 KB
- 参考文档domains/branch-store-performance.md4.3 KB
- 参考文档domains/customer.md5.9 KB
- 参考文档domains/data-quality-control.md3.8 KB
- 参考文档domains/discounts-and-promotions.md3.8 KB
- 参考文档domains/inventory.md3.9 KB
- 参考文档domains/margin-profitability.md3.5 KB
- 参考文档domains/product-category-performance.md3.7 KB
- 参考文档domains/returns.md3.7 KB
- 参考文档domains/sales-and-revenue.md3.9 KB
- 参考文档domains/targets-and-budgets.md3.2 KB
- 参考文档domains/time-intelligence.md2.2 KB
- 参考文档INDEX.md9.1 KB
- 参考文档knowledge/kpi-additivity-and-grain.md3.2 KB
- 参考文档knowledge/kpi-ambiguities.md3.8 KB
- 参考文档knowledge/kpi-core-concepts.md3.2 KB
- 参考文档knowledge/kpi-sufficiency-and-policy-decisions.md3.1 KB
- 参考文档knowledge/metric-contracts.md3.7 KB
- 参考文档knowledge/retail-kpi-domains.md2.4 KB
- 参考文档packs/branch-performance-pack.md1.7 KB
- 参考文档packs/data-quality-control-room-pack.md1.5 KB
- 参考文档packs/inventory-control-pack.md1.4 KB
- 参考文档packs/mvp-retail-kpi-pack.md3.0 KB
- 参考文档packs/product-performance-pack.md1.6 KB
- 参考文档packs/returns-exceptions-pack.md1.3 KB
- 参考文档packs/sales-performance-pack.md1.7 KB
- 参考文档patterns/metric-anti-patterns.json3.6 KB
- 参考文档patterns/metric-contract-candidates.json2.5 KB
- 参考文档patterns/metric-patterns.json2.2 KB
- 参考文档README.md5.0 KB
- 参考文档references/enterprise-kpi-knowledge-layer.md71.4 KB
- 参考文档references/id-conventions.md2.2 KB
- 参考文档references/implementation-handoff-template.md1.3 KB
- 参考文档references/kpi-coverage-scorecard-template.md4.9 KB
- 参考文档references/kpi-derivation-lineage.md6.0 KB
- 参考文档references/metric-contract-template.md2.6 KB
- 参考文档references/planned-kpi-backlog.md987 B
- 参考文档references/research-notes.md2.2 KB
- 参考文档references/source-field-requirements.md2.7 KB
- 参考文档references/source-map.md1.3 KB
- 参考文档registry.yaml13.5 KB
03 SKILL.md 正文
Retail KPI Knowledge Skill
A Retail KPI and metric-contract reasoning layer for BI agents. It helps an agent define, classify, review, and validate retail KPIs before any DAX measure, SQL transformation, or dashboard page is built.
Purpose
This layer owns the business meaning of retail KPIs and the metric contract that must exist before implementation. It produces definitions, additivity and grain calls, required-field lists, ambiguity flags, validation checks, and a clean handoff to the DAX / semantic-model layer.
It does not produce runtime artifacts. It governs meaning; other layers govern code.
Use when
The agent needs to:
- define a retail KPI in business terms
- review a metric contract for completeness
- classify a KPI's additivity (fully / semi / non-additive)
- identify a KPI's grain
- identify the required source fields for a KPI
- decide whether a KPI is safe for dashboard use
- choose an MVP KPI pack for a first dashboard
- detect ambiguous or dangerous KPI meaning (gross vs net, VAT, returns, cost method)
- prepare a handoff to an implementation layer (SQL for fields/grain/transform, DAX for the measure, Python for single-node source-prep, Big-data for distributed/at-scale aggregation & reconciliation)
- classify a candidate as answerable, source-blocked, policy-blocked, or not applicable
- prepare a neutral decision packet for a named policy authority
Do not use when
- writing DAX measures (→ DAX knowledge layer)
- building or transforming SQL tables (→ SQL knowledge layer)
- executing Python / dataframe prep (→ Python knowledge layer)
- approving readiness or granting pass/block (→ Readiness layer)
- designing dashboard visuals or page layout (→ Dashboard design layer)
- publishing Power BI
Mandatory workflow
Always route, never scan. Open the fewest files needed.
SKILL.md -> INDEX.md -> relevant knowledge / contract / pack file(s) -> metric contract / checklist / verdict
- Start here (
SKILL.md) to confirm scope and boundaries. - Go to
INDEX.mdand pick the matching task / symptom / domain / pack route. - Open only the file(s) that route names.
- End on a deliverable: a completed metric contract, a checklist result, a verdict, an owner decision packet, or an implementation handoff note. Never end inside raw knowledge.
Boundaries
- Readiness owns gates and pass/block status.
- SQL knowledge owns SQL transformation and reconciliation logic.
- DAX knowledge owns measures, filter context, and semantic-model implementation.
- Python knowledge owns dataframe / source-prep reasoning.
- Dashboard design owns visual and page design.
- Retail KPI knowledge (this layer) owns business KPI meaning and metric contracts.
Stop rules
Stop and hand off (do not continue) when any of these is true:
- The task asks for DAX, SQL, or Python code → hand off to that layer; provide only a business-terms formula and a handoff note.
- The task asks whether a dataset/model is ready to ship → hand off to Readiness.
- The task asks for a dashboard page or visual design → hand off to Dashboard design.
- A KPI's policy is undefined (VAT, returns, cost method, same-store, snapshot date) →
mark
blocked_by_policy, prepare the decision packet, and stop; do not invent the policy. - A required source field cannot be confirmed to exist → mark it as an assumption or dependency; do not pretend the field exists.
04 同仓库更多 Skills
fake-skill
A fixture skill with declaring frontmatter, used as positive shipped evidence.
fake-skill
A fixture skill with declaring frontmatter, used as positive shipped evidence.
bare-skill-no-frontmatter
暂无简介
fake-skill
A fixture skill with declaring frontmatter, used as positive shipped evidence.
bi-sql-knowledge
SQL reasoning, validation, reconciliation, transformation, diagnostics, and anti-pattern knowledge layer for Seshat BI agents. Use when a task involves reasoning about source SQL: source profiling, table grain, keys & uniqueness, joins & fan-out amplification, aggregation correctness, COUNT/NULL semantics, deduplication, validation queries, reconciliation queries, silver/gold transformation logic, window/date-time analytics, SQL anti-patterns, or basic SQL performance reasoning, or interpretation of a supplied sanitized PostgreSQL JSON execution plan. The SQL counterpart to bi-dax-knowledge. It is a thinking & validation layer, not a database executor, runtime validator, dbt/Dagster project, or automatic tuning service.
bi-python-knowledge
Python/pandas reasoning and review layer for BI and data agents in the Seshat BI project. Use when an agent must reason about dataframe work — profiling a source, judging dtypes/schema, cleaning and standardizing, merging without fan-out, aggregating at a declared grain, parsing dates, validating/reconciling against SQL and readiness, diagnosing performance/memory, or reviewing a Python pipeline. This is a reasoning layer, not an executor and not a Python tutorial. It does not run pipelines, define metrics, or own gating. See INDEX.md for the live routes.