data-investigation

Workflows for conducting rigorous, reproducible data investigations and ad hoc analyses. Applicable for investigating business questions, explaining metric anomalies, validating hypotheses, performing root-cause analysis, or preparing one-off investigative dashboards or memos.

Last repository push
GitHub Stars
212
Forks
664
Issues / PRs
21

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "data-investigation" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-78fcddc8c2d6bc0cce07733bcf8b321a9868d733b89a86669f39b7cad5d55a7d. Verify the upstream source and version against https://github.com/Kilo-Org/kilo-marketplace before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Workflows for conducting rigorous, reproducible data investigations and ad hoc analyses. Applicable for investigating business questions, explaining metric anomalies, validating hypotheses, performing root-cause analysis, or preparing one-off investigative dashboards or memos.

0 Downloads

Introduction source: third_party · Kilo-Org · 0.0.1 Reference

SkillPi interpretation

Inputs and outputs
Bad: Better:
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: data-investigation
description: >-
  A workflow for conducting rigorous, reproducible data investigations and
  ad-hoc analyses. This skill should be used when investigating a business
  question, explaining a metric anomaly, validating a hypothesis, performing
  root cause analysis, or preparing a one-off investigation dashboard or memo.
metadata:
  category: data
  author: Pedro / Kilo Code
  source:
    repository: 'https://github.com/Kilo-Org/skills'
    path: skills/data-investigation
    license_path: LICENSE
    commit: a30ff33da809171784aca50d1b5978cebc2185f1

Data Investigation

Use this skill to produce investigations that are fast, correct, reproducible, and communicate a clear conclusion rather than a pile of charts.

Purpose

Every investigation should be answerable in one sentence before the first SQL query is written.

Phase 1: Frame Before Querying

1. Write the one-sentence answer first

Before writing any SQL, write the sentence the conclusion is expected to be.

Example: The cohort size gap is a definition problem rather than a product behavior problem.

If the sentence cannot be written, the question is not yet understood.

2. Classify the investigation type

Type Trigger Approach
Gap analysis Why do A and B not match? Establish the gap, localize it, explain it
Root cause Why did this metric change? Confirm real, isolate segment, align timing, validate mechanism
Hypothesis test Is X causing Y? Define what must be true, test sub-claims, confirm or reject
Feasibility check Is this number trustworthy? Check grain, joins, nulls, definition overlap

3. State 2-3 competing hypotheses before querying

Never investigate with a single hypothesis. That creates confirmation bias.

Order hypotheses by plausibility and note which one is currently expected to be correct and why.

Phase 2: Build Queries In Escalating Specificity

1. Establish first, explain second

Step 1 always confirms the anomaly is real and measures its magnitude. Do not jump to cause until the effect is confirmed.

select
    <time_bucket>,
    <source_a_count> as metric_a,
    <source_b_count> as metric_b,
    <source_a_count> - <source_b_count> as gap,
    round(100.0 * (<source_a_count> - <source_b_count>) / nullif(<source_a_count>, 0), 1) as pct_gap
from ...
order by 1

2. Localize by breaking one dimension at a time

After confirming the gap, break it down along one dimension per step:

  • By time: when did it appear?
  • By segment: who is affected?
  • By signal/source: which path is missing?

3. Align timing with upstream changes

Once the anomaly start date is known, check:

  • git commits to relevant models, ETL jobs, or application code
  • schema migrations or source changes
  • metric definition changes
  • external events such as launches, campaigns, or pricing changes

A credible root cause must explain why the metric changed when it did.

4. Validate the mechanism

After identifying a candidate cause, confirm it mechanically:

  • Does the affected population match the predicted population?
  • What does the counterfactual look like?
  • Does a second independent signal support the explanation?

Do not stop at correlation.

5. Quantify each hypothesis before concluding

For every candidate explanation, produce a number.

Examples:

  • H1 accounts for 1,240 users
  • H2 accounts for 1,050 users

If a hypothesis cannot be quantified, it is not yet validated.

Phase 3: SQL Hygiene Rules

Use stable time bounds for investigations

Investigation SQL should be reproducible. Favor fixed bounds over rolling windows unless the analysis is intentionally operational and evergreen.

-- Prefer fixed investigation scope
where created_at >= '2026-02-16'
  and created_at < '2026-04-04'

Add explicit grain comments in important CTEs

-- grain: one row per user
with users as (
    ...
)

Prefer named comparison outputs over raw aggregates

Bad:

select count(*) from ...

Better:

select
    count(*) as users_in_scope,
    count(distinct org_id) as orgs_in_scope
from ...

Keep diagnostic queries small and discardable

Diagnostic SQL exists to answer one question. Do not build giant reusable queries too early.

Phase 4: Communication Rules

Lead with the answer

The first sentence of the written output should state the conclusion.

Bad:

I looked at several possible explanations for the discrepancy.

Good:

The discrepancy is caused by internal users being excluded from the dashboard query but included in the warehouse baseline.

Separate evidence from interpretation

Use a structure like:

  1. Conclusion
  2. Evidence
  3. Why alternative hypotheses were rejected
  4. Recommended next action

Include the limiting assumption

Every investigation should state the biggest assumption that could change the answer.

Example:

This conclusion assumes backend event timestamps are complete for the affected week; if ingestion was delayed, the gap may be overstated.

Phase 5: Output Standard

Every completed investigation should leave behind:

  1. One-sentence answer
  2. Final supporting SQL or notebook
  3. A note on rejected hypotheses
  4. Any follow-up question or unresolved ambiguity

Common Failure Modes

  • Treating a metric definition dispute as a product issue
  • Comparing sources with different grain or freshness
  • Accepting the first plausible explanation without quantification
  • Writing one giant query too early
  • Ending with charts instead of an answer

Related Skills

Version history

  1. skills-20261103210927-6c1b454 GitHub ↗
    Original release notes

    Automated skills release from commit 6c1b4543cac1d45a80bf5904e4b69ac315117323

  2. skills-20260928190452-ff51758 GitHub ↗
    Original release notes

    Automated skills release from commit ff51758b06b8249007116184096765d47bdb7505

  3. skills-20260924105536-d31110d GitHub ↗
    Original release notes

    Automated skills release from commit d31110d62dc0bd00c22f1d6f6a630d1e702a0049

  4. skills-20260923085113-cea285e GitHub ↗
    Original release notes

    Automated skills release from commit cea285ef0e4d6ec47cd2fd9fdbca03813a3363c7

  5. skills-20260922193956-97d7333 GitHub ↗
    Original release notes

    Automated skills release from commit 97d7333d8200e5ac556c659c8669f3a83ba10866

Only the five most recent versions are shown. View full version history at the source ↗

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 提供结构化数据调查方法论,解决业务问题调查、指标异常解释等高频刚需场景
  • 强调可复现性与结论导向,显著提升分析效率与可信度
Trigger Precision95/100

Highlights

  • 触发描述精准完整,覆盖多种变体(业务问题/指标异常/假设验证/根因分析/仪表板准备)
  • 边界清晰,无歧义或重叠风险
Structure and Standards93/100

Highlights

  • 5个Phase结构清晰,步骤明确,有出口条件
  • 包含端到端SQL示例与具体规则,frontmatter完整
Execution Reliability91/100

Highlights

  • 基于SQL与数据分析最佳实践,工具来源明确
  • 覆盖主要异常场景,强调机制验证与量化分析
Evidence Verifiability (mean of the first four)93/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • github.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.