Agent skill

Bi Causal Attribution

by agentscope-ai in agentscope-ai/QwenPaw-Data

从运营周报、活动文档、对话输入或文档工具 API 中提取业务事件,与指标异常时间窗口对齐,生成有证据支撑的因果归因假设并排序。当已知指标存在异常波动、需要从外部文档证据中解释"为什么"时调用。

Apache-2.0Auto-check passedData & Analytics

Install Bi Causal Attribution

skills CLI
$ npx skills add agentscope-ai/QwenPaw-Data --skill bi-causal-attribution -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install agentscope-ai/QwenPaw-Data bi-causal-attribution --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/agentscope-ai/QwenPaw-Data.git skills-src && mkdir -p .claude/skills && cp -r skills-src/packages/qwenpaw-data-skills/skills/atomic/bi-causal-attribution .claude/skills/bi-causal-attribution && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bi-causal-attribution
GitHub stars
127
Token cost
~1.3k tokens
SKILL.md length
271 words
Files
2 (incl. scripts)
Skills in repo
29
Repo updated
First seen
Licence
Apache-2.0

At a glance

从运营周报、活动文档、对话输入或文档工具 API 中提取业务事件,与指标异常时间窗口对齐,生成有证据支撑的因果归因假设并排序。当已知指标存在异常波动、需要从外部文档证据中解释"为什么"时调用。

  • Works in 4 steps: 异常摘要:一句话描述(指标名、时间窗口、变动方向与幅度、关键维度) → 归因列表(按可信度降序排列):每条包含 → 未解释比例:现有证据无法覆盖的指标变动占比(若上游提供了维度贡献度数据则可计算) → …
  • Data & Analytics work in your project
  • SKILL.md covers 前置条件 and 执行步骤
  • Runs Python scripts from its folder; calls python

What it does

Bi Causal Attribution is an agent skill from agentscope-ai/QwenPaw-Data. 从运营周报、活动文档、对话输入或文档工具 API 中提取业务事件,与指标异常时间窗口对齐,生成有证据支撑的因果归因假设并排序。当已知指标存在异常波动、需要从外部文档证据中解释"为什么"时调用。

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/event_evidence_scorer.py`).

It sits in Data & Analytics. The repository describes itself as: Agentic enterprise data analytics: governed facts (DataBridge), reusable methodology (Skill-Hub), and controllable execution (Host). The licence is Apache-2.0.

When your agent uses it

  • Data & Analytics work in your project

Example prompts

  • “/bi-causal-attribution”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. 异常摘要:一句话描述(指标名、时间窗口、变动方向与幅度、关键维度)
  2. 归因列表(按可信度降序排列):每条包含
  3. 未解释比例:现有证据无法覆盖的指标变动占比(若上游提供了维度贡献度数据则可计算)
  4. 后续建议:对低可信度归因的验证方式,或需要补充的证据类型

What it can do on your machine

Read from SKILL.md and the folder at commit e0bae36. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bi Causal Attribution loads about 1.3k tokens when it runs. Until then it costs about 30 tokens; SKILL.md has 271 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~30
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from agentscope-ai/QwenPaw-Data at commit e0bae36, republished under its Apache-2.0 licence (© agentscope-ai). 271 words, ~1,342 tokens.

Download SKILL.mdSave it as .claude/skills/bi-causal-attribution/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
bi-causal-attribution
description
从运营周报、活动文档、对话输入或文档工具 API 中提取业务事件,与指标异常时间窗口对齐,生成有证据支撑的因果归因假设并排序。当已知指标存在异常波动、需要从外部文档证据中解释"为什么"时调用。

bi-causal-attribution

从外部证据源(运营周报、活动记录、产品发布文档、对话输入等)中发现业务事件,与指标异常时间窗口对齐,生成有证据支撑的因果归因假设并按可信度排序。

与相邻归因技能的关系:

技能回答的问题输入
bi-attribution-analysis哪个维度对指标变动贡献了多少(量化)结构化 CSV
bi-causal-attribution(本技能)为什么发生这种变动(因果)外部文档证据
bi-time-impact-attribution已知具体事件后,量化其影响度结构化事件列表

典型场景:

  • "人均GAAP这周为什么下降了" → 已有异常检测结论,需从周报/活动记录中找原因
  • "企业用户 Token 消耗为什么上月明显增长" → 结合产品发布记录和运营文档解释驱动因素

前置条件

开始前确认以下信息已就绪:

  • 指标异常信息:异常指标名称、时间窗口(起止日期)、变动方向(上升/下降)、变动幅度,来自 bi-anomaly-detection 输出或用户描述
  • 受影响维度(可选):已定位的关键维度(组)值,来自 bi-attribution-analysis 或 bi-dimension-drilldown;若无则留空,维度吻合度评分将降级为中性值
  • 证据源:至少一种可用的证据来源(见步骤 2)

若异常信息不完整,需先调用 bi-anomaly-detection 获取。


执行步骤

1:构建异常锚点

整理指标异常的关键信息,作为后续事件匹配的基准,落盘至 data/processed/anomaly_anchor.csv:

字段说明示例
指标名发生异常的指标国内人均GAAP
异常开始日期异常时间窗口起始2026-06-08
异常结束日期异常时间窗口结束2026-06-14
变动方向上升 / 下降 / 波动下降
变动幅度环比/同比变化值或百分比-12%
关键维度已定位的受影响维度值(选填)企业用户

2:证据源接入

支持以下两类证据源,可同时使用:

2a. 对话输入 / 文件上传

证据直接出现在对话上下文或用户上传的文件中,包括:

  • 运营周报(文字粘贴或文档上传)
  • 营销活动计划表
  • 产品发布记录
  • 用户直接描述的业务事件(如"这周 618 活动在做折扣")

处理方式:从对话上下文或文件内容中直接提取,无需额外接口调用,进入步骤 3。

2b. 文档工具 API

通过工具调用从外部系统检索业务事件信息(如活动日历接口、产品发布记录接口)。

查询时,以异常时间窗口为中心,向前扩展 7 天构建检索范围,覆盖事件通常在指标变动前已发生的情况:

检索范围 = [异常窗口开始日期 - 7天, 异常窗口结束日期]

按以下优先级取值,命中即停:

优先级来源示例
1用户显式指定的接口/工具用户要求"查一下活动日历接口"
2域知识包(若存在)域知识包指定活动记录接口名称
3语义层接口(若可用)通过语义层查询业务事件配置

若两类来源均可用,合并结果并去重(按事件名称+时间去重);若均不可用,终止执行并提示用户提供证据源。


3:事件提取与标准化

对每份证据内容,提取其中描述的业务事件,按以下字段标准化,落盘至 data/processed/extracted_events.csv:

字段说明示例
事件名称简洁描述事件618活动折扣
开始日期事件生效起始(不确定则留空,推断值需加 [推测])2026-05-22
结束日期事件生效结束(持续中则填异常窗口末尾,留空规则同上)2026-06-22
预期方向事件对目标指标的预期效果:正向 / 负向 / 双向 / 不确定双向
影响维度事件主要影响的用户群或业务维度(不确定则留空)企业用户
来源类型结构化文档 / 周报 / 对话输入周报
原文摘要支撑提取结论的原文片段(100字以内)"【来源原文节选,100字以内,直接引用,不改写】"

提取规则:

  • 时间不明确:尽量从上下文推断(如"本周上线"→ 结合文档日期推算);推断结果在日期字段加 [推测] 标注;完全无法推断则留空
  • 方向不确定:同一事件预期方向存在歧义(如折扣活动既拉低人均 GAAP 又拉高付费人数),标注 双向,不武断判断单一方向
  • 重复事件:同一事件出现在多个来源,合并为一条;来源类型 取可信度最高的那个
  • 不相关内容:与指标或业务无关的信息(如纯流程记录、人事通知)不提取

4:事件评分与排序

按以下优先级选择计算方式,命中即停:

方式一:使用脚本

路径:scripts/event_evidence_scorer.py

参数:

参数说明
--anomaly-file异常锚点文件路径(必填,来自步骤 1)
--events-file标准化事件列表文件路径(必填,来自步骤 3)
--output-file评分结果输出路径(可选)

调用示例:

bash
python scripts/event_evidence_scorer.py \
    --anomaly-file data/processed/anomaly_anchor.csv \
    --events-file data/processed/extracted_events.csv \
    --output-file data/processed/causal_attribution_result.csv

评分维度:

维度权重计算方式
时间覆盖度25%事件时间窗口与异常时间窗口的重叠天数 / 异常窗口总天数;事件无日期信息则为 0
方向一致性25%负向(异常为下降)或正向(异常为上升)= 1.0;双向/不确定 = 0.5;方向相反 = 0
维度吻合度25%与关键异常维度完全匹配 = 1.0;部分匹配或事件维度未知 = 0.5;不匹配 = 0;关键维度未指定时一律 = 0.5
证据明确度25%事件在证据中有明确记录且与异常直接对应 = 1.0;事件存在但描述模糊或为推测性关联 = 0.5;仅用户口头提及、无任何证据佐证 = 0

综合评分 → 可信度分级:

综合评分可信度
≥ 0.7高
0.4 ~ 0.7中
< 0.4低

输出格式:

异常窗口: {开始日期} ~ {结束日期} | 方向: {上升/下降} | 关键维度: {维度值或"未指定"}

事件名称              可信度  综合评分  时间覆盖  方向一致  维度吻合  证据明确  原文摘要
{事件A}(高覆盖)       高     0.7+    0.x      0.x     0.x      0.x    "原文节选..."
{事件B}(部分匹配)     中     0.4~0.7  0.x      0.x     0.x      0.x    "原文节选..."
{事件C}(证据薄弱)     低     <0.4    0.x      0.x     0.x      0.0    "用户口头提及"
方式二:LLM 自行推理评分

触发条件(满足任一即走本方式):

场景说明
脚本不存在scripts/event_evidence_scorer.py 文件不在项目目录中
环境无法执行脚本无 Python 环境、脚本报错、无文件系统写权限
数据未落盘步骤 1/3 未生成 CSV(如用户直接在对话中提供异常描述和事件,跳过了文件落盘)
事件数量极少提取事件 ≤ 3 条,逐条推理比调用脚本更高效

执行方式:

对步骤 3 提取的每个事件,按以下维度逐一推理打分,最终加权汇总:

① 时间覆盖度(25%)

事件时间窗口与异常时间窗口的重叠程度。重叠越多、越居中,得分越高;事件无日期信息或完全不重叠得分最低;完整覆盖整个异常窗口得分最高。在 0-1 之间打分。

② 方向一致性(25%)

事件预期对目标指标的影响方向与异常变动方向的吻合程度。方向明确一致得分最高;方向模糊(双向/不确定)居中;方向明确相反得分最低。在 0-1 之间打分。

③ 维度吻合度(25%)

事件影响的用户群或业务维度与已定位的异常关键维度的匹配程度。完全匹配得分最高;部分匹配或维度不明得分居中;明确不匹配得分最低;若步骤 1 未指定关键维度,则一律取中性分。在 0-1 之间打分。

④ 证据明确度(25%)

事件被找到、记录并与本次异常关联的清晰程度。在证据中有明确记录且可直接对应本次异常得分最高;有记录但描述模糊或关联为推测性的得分居中;仅为用户口头提及、无任何文档佐证得分最低。在 0-1 之间打分。

综合评分计算:

综合评分 = 时间覆盖度 × 0.25 + 方向一致性 × 0.25 + 维度吻合度 × 0.25 + 证据明确度 × 0.25

按综合评分从高到低排序,划分可信度等级后,输出与方式一相同的表格格式,进入步骤 5。


5:归因结论输出

基于步骤 4 的评分结果,生成结构化归因结论,按以下格式输出:

  1. 异常摘要:一句话描述(指标名、时间窗口、变动方向与幅度、关键维度)
  2. 归因列表(按可信度降序排列):每条包含:
    • 可信度标注:[高] / [中] / [低]
    • 事件名称与时间范围
    • 因果机制说明:1-2 句解释该事件如何导致指标变动
    • 证据原文:直接引用原始摘要,注明来源
    • 待验证疑点(若有)
  3. 未解释比例:现有证据无法覆盖的指标变动占比(若上游提供了维度贡献度数据则可计算)
  4. 后续建议:对低可信度归因的验证方式,或需要补充的证据类型

输出格式:

异常摘要:{指标名} {时间窗口} 环比{变动方向} {变动幅度},{关键维度(若有)贡献约 X% 的变动}。

归因结论:

[高] {事件名称}({起止日期})
     机制:{1-2句说明该事件如何通过具体路径导致指标变动}
     证据:"{原文节选}" —— {来源描述,如"X月X日运营周报"}

[中] {事件名称}({日期})
     机制:{机制说明}
     证据:{来源描述}
     疑点:{待验证的不确定因素,及建议的验证方式}

[低] {事件名称}({时间不确定时注明})
     机制:{机制说明}
     证据:{来源描述,如"用户对话输入,无明确时间"}
     疑点:{需要补充的信息,及获取方式}

未解释比例:现有证据覆盖指标变动约 {X}%,剩余 {Y}% 尚无对应证据。

后续建议:
- [{可信度}] {事件名称}:{具体的验证动作或所需补充数据}

© agentscope-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in packages/qwenpaw-data-skills/skills/atomic/bi-causal-attribution of agentscope-ai/QwenPaw-Data.

  • SKILL.md
  • scripts/event_evidence_scorer.py

Open the folder on GitHubat commit e0bae36

Compare with similar skills

Bi Causal Attribution next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bi Causal Attribution compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bi Causal Attribution this skillagentscope-ai/QwenPaw-Data127—~1.3kAutomated safety check: PassApache-2.0
MatplotlibzLanqing/codex-claude-academic-skills4.7k17 repos~2.9kAutomated safety check: PassMIT
Exploratory Data Analysisspacering-net/codeg3.9k14 repos~3.6kAutomated safety check: PassMIT
Scikit LearnzLanqing/codex-claude-academic-skills4.7k16 repos~3.9kAutomated safety check: PassBSD-3-Clause
Chart Visualizationbytedance/deer-flow84k1 repos~840Automated safety check: PassMIT
TimesFM Forecastinggoogle-research/timesfm34k—~4.7kAutomated safety check: PassApache-2.0

Similar skills

  • Matplotlib

    zLanqing/codex-claude-academic-skills

    Low-level plotting library for full customization. An agent skill from zLanqing/codex-claude-academic-skills.

    4.7k GitHub starsUsed in 17 repos~2.9k tokens
    Data & AnalyticsAuto-check passed
  • Exploratory Data Analysis

    spacering-net/codeg

    Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats.

    3.9k GitHub starsUsed in 14 repos~3.6k tokens
    Data & AnalyticsAuto-check passed
  • Scikit Learn

    zLanqing/codex-claude-academic-skills

    Machine learning in Python with scikit-learn. An agent skill from zLanqing/codex-claude-academic-skills.

    4.7k GitHub starsUsed in 16 repos~3.9k tokens
    Data & AnalyticsAuto-check passed
  • Chart Visualization

    bytedance/deer-flow

    Picks a suitable chart type from 26 options for your data, maps the data to that chart's parameters and generates a chart image through a JavaScript script.

    84k GitHub starsUsed in 1 repo~840 tokens
    Data & AnalyticsAuto-check passed
  • TimesFM Forecasting

    google-research/timesfm

    Forecasts any univariate time series zero-shot with Google's TimesFM model, returning point forecasts and calibrated prediction intervals without training.

    34k GitHub stars~4.7k tokensUpdated 11 days ago
    Data & AnalyticsAuto-check passed
  • Sandbox Bench

    vercel/next.js

    Official

    Benchmark React or Next.js changes on Vercel Sandbox VMs with paired A/B statistics: react PR/commit vs base, or Next.js PR/commit vs base, measured end-to-end through the bench/render-pipeline app…

    143k GitHub stars~4.1k tokensUpdated today
    Data & AnalyticsAuto-check passed

More from agentscope-ai/QwenPaw-Data

All 29 skills in this repo
  • Bi Report Generation

    agentscope-ai/QwenPaw-Data

    将 BI 数据分析结果组织成可视化 HTML 报告。当分析完成、需要生成报告时调用. An agent skill from agentscope-ai/QwenPaw-Data.

    127 GitHub stars~1.2k tokensUpdated 5 days ago
    Auto-check passed
  • Fetch Data

    agentscope-ai/QwenPaw-Data

    取数 / 查数据 / 拉数据 / 跑 SQL。把自然语言取数需求转为 SQL,经数据湖仓执行后返回查询结果供下游分析。任何需要业务数据的任务在工作区缺少对应文件时都必须先调用此技能——覆盖 BI 业务分析、留存 / 转化 / 同期群分析、数据探索 EDA、统计建模、定量计算、元数据查询、数据查询。命中任一即触发:(1) 直接索要指标或记录,如「DAU 多少」「上月销售额」「3…

    127 GitHub stars~2.5k tokensUpdated 5 days ago
    Auto-check passed
  • Bi Adaptive Threshold

    agentscope-ai/QwenPaw-Data

    通过量化历史数据的自然波动幅度,自适应计算判定阈值。当需要从数据本身确定阈值(如波动阈值、影响度阈值等)、而非使用固定值时调用。仅适用于日/周粒度阈值确定。

    127 GitHub stars~726 tokensUpdated 5 days ago
    Auto-check passed
  • Bi Anomaly Detection

    agentscope-ai/QwenPaw-Data

    基于阈值检测时间序列中的显著异常波动点。当需要找出指标异常波动日期、识别数据异动时调用. An agent skill from agentscope-ai/QwenPaw-Data.

    127 GitHub stars~637 tokensUpdated 5 days ago
    Auto-check passed
  • Bi Attribution Analysis

    agentscope-ai/QwenPaw-Data

    计算各维度(组)值对指标变动的贡献度,支持可加型量值指标和加权平均型/率值指标。当需要计算贡献度、解释指标"为什么涨/跌"时调用。

    127 GitHub stars~1.2k tokensUpdated 5 days ago
    Auto-check passed
  • Bi Clustering

    agentscope-ai/QwenPaw-Data

    对用户、产品等业务对象做分群:用波士顿矩阵法做象限分群,或用分层聚类、K-means、DBSCAN 等聚类技术分群。当需要做客群/产品分群、象限策略、画像或密度型子结构发现时调用。触发条件:当对话中出现“分群”、“分类”、“聚类”、“不同类型”、“不同场景”等体现分群分析词语时触发。

    127 GitHub stars~1.6k tokensUpdated 5 days ago
    Auto-check passed

Questions about Bi Causal Attribution

What does Bi Causal Attribution do?

从运营周报、活动文档、对话输入或文档工具 API 中提取业务事件,与指标异常时间窗口对齐,生成有证据支撑的因果归因假设并排序。当已知指标存在异常波动、需要从外部文档证据中解释"为什么"时调用。. Bi Causal Attribution is an agent skill from agentscope-ai/QwenPaw-Data.

When should I use Bi Causal Attribution?

Bi Causal Attribution fits situations like: data & Analytics work in your project.

How do I install Bi Causal Attribution in Claude Code?

Run `npx skills add agentscope-ai/QwenPaw-Data --skill bi-causal-attribution -a claude-code`. Or copy the skill folder (packages/qwenpaw-data-skills/skills/atomic/bi-causal-attribution in agentscope-ai/QwenPaw-Data) into .claude/skills/bi-causal-attribution in your project. Claude Code loads it when a task matches its description.

How do I install Bi Causal Attribution in Codex?

Run `npx skills add agentscope-ai/QwenPaw-Data --skill bi-causal-attribution -a codex`. Or copy the skill folder (packages/qwenpaw-data-skills/skills/atomic/bi-causal-attribution in agentscope-ai/QwenPaw-Data) into .agents/skills/bi-causal-attribution in your project. Codex loads it when a task matches its description.

Can I use Bi Causal Attribution in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add agentscope-ai/QwenPaw-Data --skill bi-causal-attribution -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bi-causal-attribution, .gemini/skills/bi-causal-attribution, .github/skills/bi-causal-attribution and .opencode/skills/bi-causal-attribution in your project.

What does Bi Causal Attribution need to run?

Going by SKILL.md and its folder, Bi Causal Attribution needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Bi Causal Attribution access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Bi Causal Attribution safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Bi Causal Attribution use?

Bi Causal Attribution is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bi Causal Attribution use?

About 1.3k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bi Causal Attribution?

Skills that share tags, products or a category with Bi Causal Attribution: Matplotlib (zLanqing/codex-claude-academic-skills, 4.7k stars), Exploratory Data Analysis (spacering-net/codeg, 3.9k stars), Scikit Learn (zLanqing/codex-claude-academic-skills, 4.7k stars) and Chart Visualization (bytedance/deer-flow, 84k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bi Causal Attribution?

agentscope-ai (a GitHub organization) maintains it in agentscope-ai/QwenPaw-Data, which has 127 GitHub stars. The repository holds 29 skills in this directory. The repository was last updated on October 5, 2026.

Source: agentscope-ai/QwenPaw-Data on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.