Databrain analysis

From infometa/workbuddyskills · View interactive version

Databrain analysis is an AI agent skill from the GitHub repository infometa/workbuddyskills. Before execute_e2b_code for attribution, drill-down, or statistical tests, read this SKILL.md then drilldown.md and/or statistical/SKILL.md plus needed references. Does not fetch data.

How to use this skill

Skill file

DataBrain Analysis (sandbox)

在 E2B sandbox 里做归因下钻或统计推断。不拉数;先经 databrain-dashboard-service / databrain-intelligence / opinion skills 取数,再分析。

闸门(分析代码前)

用 read_file 读引用文件,再 open_e2b_code_sandbox / upload_to_e2b_code_sandbox / execute_e2b_code。凭记忆写分析代码不算完成。

| 任务类型 | 何时 | 必读 |

|----------|------|------|

| 归因 / 下钻 / 驱动因素 | 贡献度、谁导致变化、多维拆解 | 本文件 + CODE0 |

| 统计检验 / 建模 | A/B、显著性、回归、时序 | 本文件 + CODE0 + 按需 statistical/references/<name>.md |

| 两者都要 | 先归因定位再对子集做检验 | 先 drilldown,再 statistical |

未完成闸门:未读对应 md 已 execute_e2b_code 长段分析脚本。

数据进 sandbox

  1. 优先:取数工具返回的 CSV / 本地路径(run_skill_script 写入 /outputs/... 或工具说明中的路径)→ upload_to_e2b_code_sandbox(local_path=...) → sandbox 内 pd.read_csv(...)。
  2. data_id:若工具结果含 data_id 且附完整 CSV 路径,上传该文件;勿编造文件名。
  3. /large_tool_results/ spill:当工具返回 Tool result too large 且路径为 /large_tool_results/toolu_xxx 时,先按 soul.md §7 尝试 收窄重查;若分析任务需要保留宽表/全量行且收窄会丢维度,则 upload_to_e2b_code_sandbox(local_path=/large_tool_results/...)(或 execute_e2b_code 引用该路径并由宿主自动 staging)后在 sandbox 内解析。不要用 read_file 整文件塞进上下文;不要在无 databrain-analysis 闸门时为简单问答默认走 sandbox。
  4. 包安装:分析前如需 pandas scipy statsmodels,先 execute_e2b_code language=bash:pip install pandas scipy statsmodels(勿用 !pip)。

执行纪律(react)

引用文件

| 文件 | 内容 |

|------|------|

| CODE0 | cumulative_joint、30% 规则、directional/L1、归因结论 |

| CODE0 | 选型表、workflow |

| CODE0 | data_cleaning, stat-t-test, experimental_design, … |

| CODE0 | 终稿如何呈现检验/归因(summarize 阶段) |

无 run_skill_script(分析逻辑在 sandbox 内手写 Python,可参考 references 中的代码模式)。

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.