sql-root-cause-analysis SKILL.md skillA

sql-root-cause-analysis from zj-unicom-ai/uniemployee is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add zj-unicom-ai/uniemployee/sql-root-cause-analysis@git:20260916.fc5c664

Pins git:20260916.fc5c664 in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
zj-unicom-ai/uniemployee
Path
backend/skills/sql-root-cause-analysis/SKILL.md
Versions recorded
1
Latest version
git:20260916.fc5c664, committed Sep 16, 2026
Size
4,053 bytes
Repository stars
797
License
MIT

SQL 版归因分析技能。当用户问为什么、指标异常、趋势下滑/增长、KPI 未达标、营收/订单/转化/成本波动时使用。.

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# SQL 版归因分析

你是数据分析师。遇到“为什么”“下降原因”“增长来自哪里”“异常波动”“KPI 未达标”等问题时,必须按本规程做归因分析。只使用小数可用的 SQL / 表格 / 知识库 / 连接器工具,禁止使用 `run_python`、文件系统和本地脚本。

## 适用范围

- 营收、订单量、利润、转化率、复购率、客单价等指标明显变化
- 某地区、产品、渠道、客户分群表现显著偏离整体
- 用户明确问“为什么”“原因”“归因”“拖累项”“拉动项”
- 用户要求复盘、诊断、波动分析、KPI 未达标分析

## 执行步骤

### 步骤 1:确认问题口径

先从用户问题中识别:
- 目标指标:例如销售额、订单数、客单价、转化率
- 目标周期:例如本月、上月、最近 7 天、某季度
- 对比基准:环比、同比、目标值、整体平均、其他分组
- 可下钻维度:时间、地区、产品、渠道、客户、销售等

口径不清但可合理假设时,先说明假设后继续;缺少关键字段时,先检索 schema 再判断。

### 步骤 2:获取并验证数据

1. 调用 `sql_db_smart_search(user_query="用户原始问题")` 获取相关表结构。
2. 涉及多表时调用 `sql_db_table_relationship(table_names="...")`。
3. 对核心表调用 `sql_db_profile(table_names="...")`,确认行数、字段非空率、时间范围和数值范围。
4. 核心分析 SQL 执行后调用 `sql_db_quality_check(query="核心 SQL")`。如果样本量小、缺失多或结果为空,后续结论必须降级。

### 步骤 3:确认异常事实

先跑总览 SQL,确认异常是否真实存在:
- 当前周期指标值
- 对比周期指标值
- 变化量 = 当前值 - 对比值
- 变化率 = 变化量 / 对比值

如果异常不存在,直接说明“当前数据不支持异常判断”,不要继续编造原因。

### 步骤 4:维度贡献拆解

对每个可用维度分别计算:
- 当前周期值
- 对比周期值
- 变化量
- 变化率
- 对总体变化的贡献度

优先下钻这些维度:
1. 时间:找到变化发生在哪一天/周/月
2. 地区:定位主要拖累或拉动区域
3. 产品:定位主要拖累或拉动品类/SKU
4. 渠道:定位渠道结构变化
5. 客户:定位头部客户、客户分群或新老客变化

贡献度公式:

`维度项变化量 / 总体变化量`

总体变化量为 0 时,不计算贡献度,改用当前值占比和变化率解释。

### 步骤 5:量价/结构拆解

当指标是收入、销售额、GMV 等金额类指标时,尽量拆成:
- 量:订单数、销量、客户数
- 价:客单价、件均价、折扣率
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add zj-unicom-ai/uniemployee/sql-root-cause-analysis@sha256:a1d9a1c5d7431ffa

The line at the top of this page pins the label git:20260916.fc5c664, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_doxdh2sp4s7qbdok.svg)](https://markdownregistry.com/a/art_doxdh2sp4s7qbdok)

4 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 1 version of this file, committed on Sep 16, 2026.

versioncommittedcommitsizeaudit
git:20260916.fc5c664 latest2026-09-16 fc5c664 4,053 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (4053 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

zj-unicom-ai/uniemployee · 797 stars · license MIT · pushed 2026-10-29 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_doxdh2sp4s7qbdok
GET https://markdownregistry.com/api/v1/resolve?ref=zj-unicom-ai/uniemployee/sql-root-cause-analysis
GET https://markdownregistry.com/api/v1/blob/a1d9a1c5d7431ffa91dac13145939673a1cfa6b0187ed2de84f0079db60dd676

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.

More from zj-unicom-ai/uniemployee

business-overview SKILL.md skill
zj-unicom-ai/uniemployee · backend/skills/business-overview/SKILL.md · 经营全景分析技能。当用户需要了解整体经营状况、核心KPI、趋势对比、同比环比、利润分析时使用。
git:20260815.4388611 · audit A · 797 stars
china-unicom-ppt SKILL.md skill
zj-unicom-ai/uniemployee · backend/skills/china-unicom-ppt/SKILL.md · Create China Unicom branded presentations. Use when the user asks to write, create, revise, or outline a China Unicom…
git:20261029.f880d7d · audit A · 797 stars
competitor-deep-dive SKILL.md skill
zj-unicom-ai/uniemployee · backend/skills/competitor-deep-dive/SKILL.md · 竞品深度对标分析技能。当用户需要竞品分析/竞品对标/新品解读/价格战应对/竞品档案查询时使用。产出含 ECharts 对比图表的 HTML 在线看板。
git:20261026.c33cc14 · audit B · 797 stars
content-video-pipeline SKILL.md skill
zj-unicom-ai/uniemployee · backend/skills/content-video-pipeline/SKILL.md · 将不同领域的主题、资料或脚本制作成有旁白、画面、字幕、动效和成片检查的视频;适用于希望建立或复用个人视频生产流程的创作者。
git:20260929.8dd385c · audit A · 797 stars
customer-360 SKILL.md skill
zj-unicom-ai/uniemployee · backend/skills/customer-360/SKILL.md · 客户 360 画像技能。当用户询问某个客户的综合情况、合作状态、历史消费、已购产品、联系人、在途商机、合同状态,或要求做客户盘点、拜访前背景调查时使用本技能。
git:20261008.6c49597 · audit A · 797 stars
data-analysis SKILL.md skill
zj-unicom-ai/uniemployee · backend/skills/data-analysis/SKILL.md · 数据分析师工作规程。当用户给出销售/业务数据问题、要求统计、对比、趋势、归因、结论或建议时使用。
git:20260916.fc5c664 · audit A · 797 stars
decision-analysis SKILL.md skill
zj-unicom-ai/uniemployee · backend/skills/decision-analysis/SKILL.md · 决策分析与方案推荐技能。当用户要求做经营决策、方案比选、定价调整、资源投入、产品线取舍时使用。
git:20260815.4388611 · audit A · 797 stars
enterprise-sales SKILL.md skill
zj-unicom-ai/uniemployee · backend/skills/enterprise-sales/SKILL.md · 自研产品客户拜访技能。当客户经理需要拜访政企客户、准备解决方案、生成方案文档、或整理拜访纪要时使用本技能。
git:20260912.5351272 · audit A · 797 stars
fault-impact-analysis SKILL.md skill
zj-unicom-ai/uniemployee · backend/skills/fault-impact-analysis/SKILL.md · 故障影响分析技能。当用户报告基站故障、网络中断、退服、大面积断网,或需要评估故障影响范围、安排装维人员时使用。
git:20261008.6c49597 · audit A · 797 stars
frontend-design SKILL.md skill
zj-unicom-ai/uniemployee · backend/skills/frontend-design/SKILL.md · Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with…
git:20260815.4388611 · audit A · 797 stars
hr-assistant SKILL.md skill
zj-unicom-ai/uniemployee · backend/skills/hr-assistant/SKILL.md · HR 综合人力技能。当用户咨询人事制度、招聘流程、员工关系、薪酬福利、考勤休假、培训发展等人力资源相关问题时使用本技能。
git:20260815.4388611 · audit A · 797 stars
industry-deep-research SKILL.md skill
zj-unicom-ai/uniemployee · backend/skills/industry-deep-research/SKILL.md · 行业深度研究规程。用户要研究某个行业、产业链、市场结构、技术路线、政策环境、中长期趋势、机会或风险时使用。
git:20261026.c33cc14 · audit A · 797 stars

Every file in zj-unicom-ai/uniemployee

Browse by kind, by grade A, or by owner.