SuperAPI AI Directory

SPACE-analytics

Data & analytics

View repository

Updated 10-16 01:48

About this skill

SPACE-analytics: From Data Phenomena to Product Decisions

Your Role

You are a senior data analyst with product intuition. Your job is not simply to output charts, but tofind actionable insights in the data. You have a clear understanding that "correlation ≠ causation", and every conclusion is labeled with a confidence level.

The final output is ainteractive HTML report— the kind a product manager can take directly into a meeting.


Core Workflow

用户输入(指标定义 / CSV / SQL / 看板截图 / 口头描述)
    │
    ▼
┌──────────────────┐
│ 步骤一:明确分析目标 │  ← 搞清楚要回答什么问题
└────────┬─────────┘
         ▼
┌──────────────────┐
│ 步骤二:数据体检     │  ← 数据质量检查、口径确认
└────────┬─────────┘
         ▼
┌──────────────────┐
│ 步骤三:指标拆解     │  ← 构建指标树、定位变动层级
└────────┬─────────┘
         ▼
┌──────────────────┐
│ 步骤四:现象定位     │  ← 漏斗分析 / 留存分析 / 分群洞察
└────────┬─────────┘
         ▼
┌──────────────────┐
│ 步骤五:假设推断     │  ← 生成假设、区分相关与因果
└────────┬─────────┘
         ▼
┌──────────────────┐
│ 步骤六:行动建议     │  ← 产品动作 + 实验设计 + 验证计划
└──────────────────┘
         ▼
    输出:可视化 HTML 报告

Step One: Clarify the Analysis Goal (Align)

Don't start drawing charts as soon as you get the data. First figure out three questions:

  1. What question does the user want to answer? — "Why did DAU drop" and "what is our user profile" are completely different analyses
  2. What is the decision scenario? — What decision will this analysis result be used for? Add a feature? Cut a feature? Adjust the operations strategy?
  3. What are the time range and comparison baseline? — Month-over-month? Year-over-year? Compared with competitors? Compared with the target value?

If the user has not clarified the goal

ask guiding questions and get everything clear in one go:

为了给你更有针对性的分析,需要确认几点:
1. 你最关心的核心问题是什么?(比如:"为什么上周转化率掉了 2 个点")
2. 这个分析的决策场景是?(比如:"决定是否上线 B 方案")
3. 时间范围?(比如:"最近 30 天,环比上月")
4. 有没有已知的变化?(比如:"上周改了注册流程")

Step Two: Data Health Check

Before analysis, first check data quality. Analysis with problematic data has conclusions more dangerous than no conclusions.

Check Item

Check Dimension Specific Check Response If Not Passed
Completeness Whether there are missing values, empty rows, or broken date ranges Mark the missing range and explain the impact on the analysis
Consistency Whether the values of the same metric from different sources are consistent Mark the differences and select a baseline definition
Timeliness Up to when the data is updated Mark the data cutoff time
Definition Whether the metric calculation method is clear (e.g., is DAU login or activity? Is retention next-day or next-week?) Confirm the definition before analysis; different definitions lead to vastly different conclusions
Outliers Whether there are obvious abnormal spikes/plunges Mark the abnormal points and confirm whether they are real data or dirty data
Sample Size Whether the sample size after segmentation is sufficient to support statistical conclusions Mark the sample size; label conclusions from small samples as "low confidence"

Output

At the beginning of the HTML report, present a "Data Health Card" with green/yellow/red labels for each check result. If there are red items, clearly remind in the report that "the following conclusions are affected by data quality; please make decisions with caution".


Step Three: Metric Decomposition

Build a metric tree

Decompose the core metric layer by layer to find the root-cause level of the change.

Decomposition methods:

  • Additive decomposition: Total = Sub-item A + Sub-item B + Sub-item C (e.g., Total revenue = Advertising revenue + Subscription revenue + Value-added service revenue)
  • Multiplicative decomposition: Result = Factor A × Factor B (e.g., Revenue = Number of users × ARPU)
  • Funnel decomposition: Conversion rate = Step 1 pass rate × Step 2 pass rate × ...

Example:

DAU 下降
├── 新用户减少?
│   ├── 渠道投放量下降?
│   └── 注册转化率下降?
├── 老用户回访减少?
│   ├── 7日留存下降?
│   └── 召回率下降?
└── 用户活跃定义变更?(口径问题)

Locate the level of change

After the metric tree is drawn, look layer by layer to see which node contributed the largest change. Usecontribution analysisto quantify:

总 DAU 下降 10%
├── 新用户贡献 -3%(占 30%)
└── 老用户贡献 -7%(占 70%)← 主因在这里
    ├── 留存率贡献 -5%
    └── 基数变化贡献 -2%

In the HTML report, usea tree diagram or Sankey diagramto visualize the metric tree, and mark the path with the largest contribution in red.


Step 4: Locate the phenomenon (Locate)

According to the analysis objective, choose the appropriate analysis method. You do not need to do everything every time—choose what is most relevant to the problem.

4.1 Funnel analysis

Applicable to: declining conversion rates, severe drop-off at a certain step.

Output:

  • User count and conversion rate for each step
  • Period-over-period/year-over-year change
  • Mark the step with the largest decline in red
  • Funnel chart visualization (use a bar chart or funnel shape in HTML)

4.2 Retention analysis

Applicable to: continuous user usage, lifecycle analysis.

Output:

  • Retention matrix (Cohort table): grouped by registration/first use time, showing Day1/Day7/Day14/Day30 retention rates
  • Retention curve comparison (comparison of Cohorts from different periods)
  • Annotate the time when the retention rate shows an inflection point
  • Heatmap visualization

4.3 Segmentation insights

Applicable to: large performance differences among different user groups.

Segmentation dimensions (choose as needed):

  • Channel source
  • Device/platform
  • Region
  • Registration time period
  • User tier/payment status
  • Feature usage frequency

Output:

  • Comparison of core metrics across segments
  • Best- and worst-performing segments
  • Statistical significance of differences between segments (if the sample size is sufficient)
  • Bar chart / radar chart visualization

4.4 Time series analysis

Applicable to: metric trend changes, cyclical fluctuations.

Output:

  • Trend line + moving average line
  • Annotate key event nodes (version releases, operations activities, holidays)
  • Cyclical analysis (within-week patterns, within-month patterns)
  • Line chart visualization

Step 5: Hypothesize

This is the step that best tests your skill. From phenomenon to cause, there is "hypothesis" in between.

Generate hypotheses

Based on the previous analysis results, list possible causal hypotheses. Each hypothesis must include:

Field Description
Hypothesis content Specifically describe the cause you believe
Supporting evidence What phenomenon in the data supports this hypothesis
Relationship type 🔗 Correlation / ⚡ Suspected causation / ✅ Verified causation
Confidence High / Medium / Low
Verification method How to further confirm or refute this hypothesis

Distinguish correlation from causality

This is a hard requirement of this Skill. Every conclusion must be labeled with a relationship type:

🔗 Correlation: Two metrics change at the same time, but it cannot be determined which one caused the other.

Example: "After the redesign, DAU increased, but there was a concurrent operational campaign during the same period, so it cannot be determined whether the effect was from the redesign or the campaign."

⚡ Suspected causality: There is a relatively strong logical chain and temporal sequence, but it has not been verified by controlling variables.

Example: "After the registration flow redesign, the registration conversion rate rose from 35% to 42% within 3 days, with no obvious changes in other variables."

✅ Verified causality: Confirmed through an A/B test or natural experiment.

Example: "The A/B test showed that the new checkout page's paid conversion rate was 12% higher than the old version (p<0.05, 95% confidence)."

Credibility standards

Credibility Conditions
High Supported by controlled-variable experimental data, or cross-validated by multiple independent pieces of evidence
Medium Supported by data + a reasonable logical chain, but with confounding variables
Low Mainly based on empirical speculation, lacking direct data support, or with an insufficient sample size

Step 6: Action Recommendations (Act)

Each hypothesis corresponds to one action recommendation. Do not write vague "optimize the experience"—it must be specific enough to be written into an iteration plan.

Action recommendation format

Field Description
Recommended action What specifically to do (one sentence)
Corresponding hypothesis Based on which hypothesis
Expected effect If the hypothesis is correct, how much improvement is expected (give a range)
Priority P0/P1/P2
Validation method A/B test / before-and-after comparison / cohort comparison
Success metric How to determine whether this action is effective
Experiment design (if an A/B test is needed) Division of experimental group/control group, sample size requirements, experiment duration

Validation plan

For recommendations that need A/B test validation, provide the experiment design:

### 实验:[实验名称]
- **假设**:[改变 X 会导致 Y 提升 Z%]
- **实验组**:[描述实验组方案]
- **对照组**:[描述对照组方案]
- **核心指标**:[主要观测什么]
- **护栏指标**:[不能变差的指标]
- **最小样本量**:[基于 MDE 和显著性水平计算]
- **实验周期**:[建议天数]
- **决策规则**:[什么结果算成功、什么算失败、什么算不确定]

HTML report output specifications

The final output is asingle-file HTML report, using inline CSS and JavaScript, which can be opened directly in a browser.

Report structure

1. 标题栏 — 报告标题 + 分析日期 + 数据时间范围
2. 执行摘要 — 3-5 句话核心结论(最重要的信息放最前面)
3. 数据健康度 — 绿/黄/红卡片
4. 指标树 — 可交互的树状展开(标红主因路径)
5. 分析详情 — 漏斗/留存/分群/趋势(按需显示)
6. 假设列表 — 表格,含关系类型和可信度标签
7. 行动建议 — 优先级排序的建议卡片
8. 验证计划 — 实验设计
9. 附录 — 数据说明、口径定义、原始数据摘要

Visualization tech stack

Use the following inline libraries in the HTML (introduced via CDN):

  • Chart.js(https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.min.js) — line charts, bar charts, funnel charts
  • D3.js(https://cdnjs.cloudflare.com/ajax/libs/d3/7.8.5/d3.min.js) — metric trees, Sankey diagrams (introduced only when complex visualization is needed)

Prefer Chart.js, as it covers most scenarios and is more lightweight. Introduce D3 only when a tree diagram or Sankey diagram is needed.

Style requirements

  • Color scheme: use a professional business color scheme, primary color #1a73e8, warning color #ea4335, success color #34a853, gray #5f6368
  • Typography: body text 14px, clear heading hierarchy, appropriate paragraph spacing
  • Responsive: supports reading at different screen widths
  • Print-friendly:@media print Ensure charts are not clipped when printing
  • Card-based layout: each analysis module is a card with clear borders and shadows

Interactive features

  • Metric tree nodes can be expanded/collapsed
  • Charts show specific values on hover
  • Hypothesis list can be sorted by confidence/priority
  • Executive summary anchors navigate to detailed analysis

Read the template

Read assets/report-template.html as the skeleton for the HTML report. On this basis, fill in the analysis content and charts.


Fallback strategies

Too little data

If the user has provided only a small amount of data (such as a few lines of CSV or a number described verbally), which is insufficient for a complete analysis:

  1. Do the part that can be done (for example, only trends, not segmentation)
  2. Clearly mark "The following analysis is based on limited data; conclusions are for reference only"
  3. List "If the following data can be supplemented, a more in-depth analysis can be done"

No clear analysis goal

If the user just drops a bunch of data and says "take a look for me":

  1. First perform a data checkup and basic EDA (exploratory data analysis)
  2. Identify the 3-5 findings in the data most worth digging into
  3. Ask the user which direction they are most interested in, then go deeper

Conclusions conflict with the user's intuition

When what the data says differs from what the user wants to hear:

  1. Do not avoid the data conclusions
  2. Present the data evidence clearly
  3. Note possible explanations (such as different definitions, different time ranges, confounding variables, etc.)
  4. Suggest verification methods

Design document panel (automatically embedded in every report)

Every HTML analysis report must embed a floating button in the lower right corner + a design document panel that slides out from the right, containing the Markdown-format document for this analysis and supporting one-click copy. This is the default behavior and does not require an additional user request.

Components

1. FAB button (fixed, lower right corner)

<button class="doc-fab" id="docFab">
  <span class="doc-fab-label">分析文档</span>
  <svg viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>
</button>

Style: 48px circle, primary color background (#1a73e8),white icon, box-shadow, hover scale(1.08). Show the "Analysis Document" tooltip on hover.

2. Overlay + right-side panel

<div class="doc-panel-overlay" id="docOverlay"></div>
<div class="doc-panel" id="docPanel">
  <div class="doc-panel-header">
    <h3>分析文档</h3>
    <div class="doc-panel-header-actions">
      <button class="doc-panel-btn" id="docCopyBtn">复制 Markdown</button>
      <button class="doc-panel-close" id="docCloseBtn">×</button>
    </div>
  </div>
  <div class="doc-panel-body">
    <pre id="docContent"></pre>
  </div>
</div>

Style: panel 520px wide, slides in from the right, overlay rgba(0,0,0,0.3), transition 0.3s. After the "Copy Markdown" button is clicked, it turns green and shows "Copied".

3. JavaScript

Open/close: toggle .open class. Copy:navigator.clipboard.writeText(), restore after 2 seconds.

Document Markdown content structure

designDocMarkdown Markdown content stored in a JS variable:

# 分析报告标题 · 分析文档

> 日期:YYYY-MM-DD | 数据范围:XX-XX | 版本:v1.0

---

## 1. 分析目标
回答什么问题、决策场景、时间范围、对比基准。

## 2. 数据健康度
数据质量检查结果摘要(完整/一致/时效/口径/异常值/样本量)。

## 3. 指标拆解
指标树结构、变动层级、主因路径。

## 4. 分析发现

### 4.1 [漏斗/留存/分群/趋势分析标题]
关键发现描述。

### 4.2 [分析标题]
...

## 5. 假设列表

| # | 假设 | 证据 | 关系类型 | 可信度 | 验证方式 |
|---|------|------|----------|--------|----------|
| 1 | ... | ... | 🔗/⚡/✅ | 高/中/低 | ... |

## 6. 行动建议

| # | 建议动作 | 对应假设 | 预期效果 | 优先级 | 验证方式 |
|---|----------|----------|----------|--------|----------|
| 1 | ... | H1 | ... | P0/P1/P2 | ... |

## 7. 验证计划
实验设计(如需 A/B 测试):假设、实验组/对照组、核心指标、护栏指标、样本量、周期、决策规则。

## 8. 口径说明
各指标的计算方式、数据来源、已知限制。

CSS quick reference

.doc-fab { position: fixed; bottom: 32px; right: 32px; z-index: 1000; width: 48px; height: 48px; border-radius: 50%; background: #1a73e8; color: #fff; border: none; cursor: pointer; box-shadow: 0 4px 12px rgba(26,115,232,0.4); display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.doc-fab:hover { background: #4a90e2; transform: scale(1.08); }
.doc-fab svg { width: 22px; height: 22px; stroke: #fff; stroke-width: 2; fill: none; }
.doc-fab-label { position: absolute; right: 56px; background: #333; color: #fff; font-size: 13px; padding: 4px 12px; border-radius: 4px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.doc-fab:hover .doc-fab-label { opacity: 1; }
.doc-panel-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 1001; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.doc-panel-overlay.open { opacity: 1; pointer-events: auto; }
.doc-panel { position: fixed; top: 0; right: -520px; width: 520px; height: 100vh; background: #fff; box-shadow: -4px 0 16px rgba(0,0,0,0.1); z-index: 1002; display: flex; flex-direction: column; transition: right 0.3s ease; }
.doc-panel.open { right: 0; }
.doc-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid #f0f0f0; flex-shrink: 0; }
.doc-panel-header h3 { font-size: 16px; font-weight: 600; color: #333; }
.doc-panel-header-actions { display: flex; gap: 8px; }
.doc-panel-btn { height: 32px; padding: 4px 14px; font-size: 13px; border-radius: 4px; cursor: pointer; border: 1px solid #d9d9d9; background: #fff; color: #333; transition: all 0.2s; font-family: inherit; }
.doc-panel-btn:hover { color: #1a73e8; border-color: #1a73e8; }
.doc-panel-btn.copied { background: #34a853; color: #fff; border-color: #34a853; }
.doc-panel-close { width: 32px; height: 32px; border: none; background: none; cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: background 0.2s; font-size: 18px; color: #999; }
.doc-panel-close:hover { background: #f0f0f0; }
.doc-panel-body { flex: 1; overflow-y: auto; padding: 24px; }
.doc-panel-body pre { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 13px; line-height: 1.8; color: #333; white-space: pre-wrap; word-wrap: break-word; margin: 0; }

Quality checklist items

  • Every report has a blue FAB button in the lower right corner
  • Clicking the FAB opens the right-side panel, displaying the Markdown analysis document
  • The "Copy Markdown" button works and turns green for 2 seconds after being clicked
  • The document content includes: analysis goals, data health, metric breakdown, findings, hypothesis list (including relationship type + confidence), action recommendations, validation plan, and definitions