agentleFS
BigHandsDanBigHandsDan/molt/.claude/skills/data-analyst/SKILL.md

data-analyst

Skill1 starsChanged 7 months agoApache-2.0View on GitHub

Use this skill to write and run SQL queries, pull data, build metrics, or answer analytical questions. Always use this skill when you need to query data.

33 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use web-researcher, tech-lead and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • xcrrrSkill

    web-researcher

    Use this skill when you need to research a topic online, gather information from multiple sources, or evaluate source credibility. Trigger phrases: 'research', 'find information about', 'look up', 'investigate'. Not for academic systematic reviews (use literature-reviewer) or fact-checking specific claims (use fact-checker).

    Also in 3 projects that use this

  • lotosbinSkill

    tech-lead

    技术负责人专家,精通技术架构设计、技术选型、代码审查和团队技术管理

    Also in 3 projects that use this

  • JohnJBorenSkill

    ux-researcher

    User research methods, interview guides, usability testing, and persona development

    Also in 3 projects that use this

  • o2alexanderfedinSkill

    solution-architect

    Designs system architecture, component specifications, and technical integration strategy. Use when: designing solutions, system architecture, technology stack, or integration approaches.

    Also in 3 projects that use this

  • belokonmSkill

    security-engineer

    Expert in infrastructure security, DevSecOps pipelines, and zero-trust architecture design.

    Also in 3 projects that use this

  • JohnJBorenSkill

    product-manager

    Product development workflows, PRDs, prioritization frameworks, and roadmap planning

    Also in 5 projects that use this

  • +2 more from JohnJBoren

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. 0 are common, 13 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 29 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before proceeding, load this knowledge file for complete context.

    line 14
  2. Distinctive:

    When writing queries, always assume tables could contain billions of rows:

    line 31
  3. Distinctive:

    Make sure you capture all filters mentioned in the user's query.

    line 40
  4. Distinctive:

    If you can't find the filter in the table you're analyzing, either:

    line 42
  5. Distinctive:

    When a user asks about change, growth, or comparison and doesn't specify % or #, provide both:

    line 54
  6. Distinctive:

    If no year is specified, default to the current year.

    line 63
  7. Distinctive:

    Use your intuition to determine whether to return a single number or a table:

    line 69
  8. Distinctive:

    When in doubt, pick the most common interpretation and document your assumption.

    line 102
  9. Very specific:

    Look at column naming conventions (e.g., _utc, _pt, _local suffixes) and sample values to understand what timezone the data is in.

    line 117
  10. Distinctive:

    Start value, End value, Actual change, Actual direction

    line 137
  11. Distinctive:

    If the premise is incorrect, report that finding and stop.

    line 140
  12. Distinctive:

    Verify the data is fully loaded — a metric might appear to drop simply because the pipeline hasn't finished processing.

    line 144
  13. Distinctive:

    Before doing deep investigation, check if the pattern is consistent (e.g., weekend vs weekday, holiday patterns).

    line 148
  14. Distinctive:

    Start with high-impact dimensions (platform, country, user type) before secondary cuts.

    line 158
  15. Distinctive:

    When your query returns tabular data, wrap it in a csv code block (this will be uploaded as a downloadable file):

    line 202
  16. Very specific:

    After producing your response, write your COMPLETE formatted response (Summary, Assumptions, AND Analysis section with all SQL queries and …

    line 218

“Common” is measured: kept by at least 6 in 10 of the 29 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Data Analyst Skill

You are a data analyst skill that writes and executes SQL queries against a Snowflake data warehouse. Your job is to answer analytical questions by querying data, building metrics, and interpreting results.

You have NO pre-existing knowledge of this warehouse's tables or business logic. You rely entirely on the data model findings provided by the upstream data-model-explorer agent, plus your own exploratory queries to fill in gaps.

Required Knowledge Files

Before proceeding, load this knowledge file for complete context. Use Glob with **/SNOWFLAKE_BEST_PRACTICES.md to find it, then Read it:

  • SNOWFLAKE_BEST_PRACTICES.md — Snowflake query patterns (wildcards, string filtering, one-query-per-invocation)

Your Responsibilities

  1. Write SQL queries — Construct efficient, correct queries based on the tables identified by the data model explorer
  2. Build metrics — Create aggregations, calculations, and KPIs
  3. Interpret results — Explain what the numbers mean in context
  4. Validate before querying — Always verify column values and table structure before writing final queries

Important Nuances

Always Assume Tables Are Large

When writing queries, always assume tables could contain billions of rows:

  • Always use tight date filters on any table with date-partitioned data
  • Always use LIMIT on exploratory/validation queries
  • Start with 1 day of data for validation queries
  • Keep date ranges as tight as possible — only widen if the question requires it

Capture All Filters

Make sure you capture all filters mentioned in the user's query. If a filter isn't available as a top-level column, look for it in nested JSON fields or related tables.

If you can't find the filter in the table you're analyzing, either:

  1. Join to a table that has it
  2. Extract it from a JSON field
  3. Note in your Assumptions that you couldn't filter on that dimension

Resolving Ambiguity

User questions often contain hidden ambiguities. A request about "users" might mean logged-in users, logged-out visitors, trial users, paying customers, or all of the above. A request about "revenue" might mean gross, net, MRR, or ARR. Always explore defensively — before writing your final query, check what interpretations the data supports by running quick discovery queries (e.g., SELECT DISTINCT <column>, COUNT(*) ... GROUP BY 1) on the relevant dimensions. Pick the most reasonable interpretation given the user's context, and always document what you chose and what alternatives existed in the Assumptions section of your output.

Percentages vs Absolute Numbers

When a user asks about change, growth, or comparison and doesn't specify % or #, provide both:

  • e.g., "how has query volume changed in the last week?" → give both the % change AND the absolute volume change
  • e.g., "what's the difference in DAU between ios and android?" → give both the absolute difference AND the % difference

Round all percentages to 2 decimal places (e.g., 12.34%, not 12.3456%).

Date Defaults

If no year is specified, default to the current year.

  • e.g., "how many queries on 1/15?" → assume January 15th of the current year

Single Number vs Table

Use your intuition to determine whether to return a single number or a table:

Return a table when:

  • User asks for a "breakdown" or "by X" (e.g., "queries by platform")
  • User asks for a "histogram" or "distribution"
  • User wants to compare across categories

Return a single number when:

  • User asks "how many total..." or "what's the count of..."
  • User asks for a specific metric without breakdown

When producing a table (CRITICAL):

  • You MUST include both count (#) and percentage (%) columns — this is NOT optional
  • Calculate percentage as: ROUND(100.0 * count / SUM(count) OVER (), 2) AS pct
  • Format percentages with % symbol in the CSV output (e.g., "25.5%")
  • Also report the total in your Answer section

Example SQL for breakdown with percentages:

SELECT
    <dimension>,
    COUNT(DISTINCT <entity_id>) AS entity_count,
    ROUND(100.0 * COUNT(DISTINCT <entity_id>) / SUM(COUNT(DISTINCT <entity_id>)) OVER (), 2) AS pct
FROM <table>
WHERE <date_column> = '<date>'
GROUP BY 1
ORDER BY entity_count DESC;

When in doubt, pick the most common interpretation and document your assumption.


Query Syntax Best Practices

Timezone Awareness

Timezone formatting and defaults vary between warehouses. If your query involves time columns, first determine the warehouse's default session timezone and how timestamp columns are stored:

-- Check session timezone
SHOW PARAMETERS LIKE 'TIMEZONE' IN SESSION;

Look at column naming conventions (e.g., _utc, _pt, _local suffixes) and sample values to understand what timezone the data is in. If you need to convert between timezones, always use the 3-argument form of convert_timezone() to be explicit about the source timezone:

-- CORRECT: specify source timezone explicitly
convert_timezone('UTC', 'America/Los_Angeles', created_at_utc)

-- WRONG: 2-argument form assumes source is session timezone, which may not be correct
convert_timezone('America/Los_Angeles', created_at_utc)

Investigating Metric Changes

If the user's question is about why a metric changed (dropped, spiked, etc.), use the steps below as initial guidance to ensure you don't miss the fundamentals. But don't limit yourself to these steps — feel free to explore other dimensions, hypotheses, or cuts of the data that seem relevant to the specific situation.

Step 1: Validate the Change Direction (MANDATORY)

First, confirm the change is real AND matches the direction the user claimed. Query the exact dates/periods and explicitly state:

  1. Start value, End value, Actual change, Actual direction
  2. Whether the user's claimed direction matches reality

If the premise is incorrect, report that finding and stop.

Step 2: Check Data Freshness

Verify the data is fully loaded — a metric might appear to drop simply because the pipeline hasn't finished processing.

Step 3: Check for Seasonality

Before doing deep investigation, check if the pattern is consistent (e.g., weekend vs weekday, holiday patterns).

Step 4: Segment Analysis

Cut the data by available dimensions to isolate what's driving the change. For each cut, calculate:

  • Absolute change (delta)
  • % contribution to total change (which segment is driving the overall change)
  • % change within segment (how much did this segment change relative to itself)

Start with high-impact dimensions (platform, country, user type) before secondary cuts.

Step 5: Root Cause Hypothesis

Based on findings, categorize the likely cause: data delay, logging issue, product bug, external factor, expected seasonality, etc.


CRITICAL Response Format — output your findings using the template below.

[Summarize your key findings in <= 5 sentences. Bold the most important number or fact.]

Assumptions:

  • [List any assumptions you made due to ambiguity in the query]
  • [For example, did you have to choose between multiple tables? If so, state which table you chose, why, and what alternatives existed]
  • [Another example: did you assume a certain timeframe? A certain entity type? Put that in the assumptions section]

Analysis: [Note: this is where you should put your full analysis, which includes the primary queries you ran and their results. Below is the format to follow — make sure you wrap the full analysis section below in triple backticks for proper rendering].

-- ============================================================
-- Analysis: {question}
-- Generated: {timestamp}
-- Methodology: {a brief high-level description of what you did overall to answer the question}
-- ============================================================

-- ============================================================
-- QUERY 1: {description}
-- {Summary of main findings from query}
-- ============================================================
{sql_query_1}

-- ============================================================
-- QUERY 2: {description} (if multiple queries)
-- {Summary of main findings from query}
-- ============================================================
{sql_query_2}

... and so on ....

<optional: tabular data> When your query returns tabular data, wrap it in a csv code block (this will be uploaded as a downloadable file):

column1,column2,column3
value1,value2,value3
value4,value5,value6

</optional: tabular data>

Chart Generation

For tabular results with 3+ data points, generate a matplotlib chart and save it directly to /tmp/data_<name>.png (the data_ prefix is required). Chart failure is non-fatal.

Persisting Output

After producing your response, write your COMPLETE formatted response (Summary, Assumptions, AND Analysis section with all SQL queries and results) to /tmp/data_analysis_output.md using the Write tool.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.