data-analyst
Use when the user asks to query a database, analyze data, create charts/visualizations, explore data patterns, or asks business questions about data. Replicates Devin cloud's Data Analyst Agent (DANA) for the CLI — SQL-first exploration, schema-aware querying, and seaborn-style visualizations via MCP data sources.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- data-analyst
- triggers
- [ "user", "model" ]
- description
- Use when the user asks to query a database, analyze data, create charts/visualizations, explore data patterns, or asks business questions about data. Replicates Devin cloud's Data Analyst Agent (DANA) for the CLI — SQL-first exploration, schema-aware querying, and seaborn-style visualizations via MCP data sources.
03 SKILL.md 正文
Data Analyst (CLI replica of DANA — Data ANAlyst Agent)
What this replicates
Cloud Devin has a Data Analyst Agent (DANA) — a specialized agent optimized for querying databases, analyzing data, and creating visualizations. It maintains a "Database Knowledge" note with schema docs, auto-references it before queries, and outputs formatted tables, charts, and plain-English interpretations.
The CLI has no "Data" agent mode. This skill fills that gap by
providing the DANA workflow as an invocable procedure using MCP data
sources already configured in mcp_config.json.
Sources:
- docs.devin.ai/work-with-devin/data-analyst (DANA overview)
- docs.devin.ai/use-cases/gallery/dana-slack-data-analyst (Slack usage)
- docs.devin.ai/release-notes/2025 (DANA release)
- devin.ai/ai-data-analyst-1/ (build-your-own guide)
When to Use
- "Query the database for X"
- "How many users signed up last week?"
- "Show me a chart of daily revenue"
- "Analyze patterns in the orders table"
- "What's the churn rate by cohort?"
- Any SQL/data analysis task against an MCP-connected data source
When NOT to Use
- No MCP data source is configured — DANA requires a connected database
- The question is about code, not data — use
researchorgrep - The task needs code changes, not analysis — use Normal mode
- Quick file inspection (CSV/JSON on disk) — use
read+execdirectly
Prerequisites
- At least one MCP data source configured in
mcp_config.json(PostgreSQL, Redshift, Snowflake, BigQuery, SQLite, etc.) - Verify connectivity:
mcp_list_toolsfor the data source server - If no data source is configured, say so and stop — do not guess schema or fabricate data
Procedure
Step 1 — Schema discovery (Database Knowledge)
DANA maintains a "Database Knowledge" note. In the CLI, build it on-the-fly:
mcp_call_toolto list tables (SELECT table_name FROM information_schema.tablesor the MCP's schema tool)- For relevant tables, describe columns (
DESCRIBE <table>orSELECT column_name, data_type FROM information_schema.columns WHERE table_name = '<table>') - Cache findings in a file:
writeto.devin/db-schema.md - On subsequent queries,
read.devin/db-schema.mdfirst — only re-discover if the schema may have changed
Output: schema doc with table names, columns, types, and relationships.
Step 1b: Business glossary (term -> definition)
Schema says what exists, not what it means. A correct-looking query
still returns the wrong number when "revenue" should exclude
cancelled orders. Maintain .devin/db-glossary.md:
| term | definition (SQL-ready) | certified_by | source |
|------|----------------------|--------------|--------|
| revenue | sum(orders.total) WHERE status != 'cancelled' | @user | ticket #123 |
read.devin/db-glossary.mdbefore formulating queries; if a business term in the question has no row, ask the user once and record the answer.- Definitions are SQL-ready fragments, not prose: they must map to filters/joins you can paste into the query.
- New terms only enter the glossary after user confirmation
(
certified_by); never invent definitions. - When the user corrects a number ("that's not our churn"), fix the glossary row first, then re-run; the correction persists.
- Always return the generating query with the answer, and when the data cannot answer the question, say so instead of approximating (an analyst who abstains beats one who fabricates).
Step 2 — Query formulation
- Translate the user's natural-language question into SQL
- Start with a
SELECT ... LIMIT 10to validate the query and preview results - Check for:
- Correct table joins (use schema doc from Step 1)
- Date/time handling (timezone awareness — DANA learns from feedback; here, ask the user if timezone is ambiguous)
- NULL handling (use
COALESCEor filter explicitly) - Performance (add
LIMITfor exploratory queries)
Output: validated SQL query + preview results.
Step 3 — Full query execution
- Run the full query via
mcp_call_tool - If the result is large (> 100 rows), write to a file
(
query-results-<timestamp>.csv) and summarize in chat - Format output as a Markdown table for small results (< 20 rows)
Output: result set (table or file reference) + row count.
Step 4 — Analysis & interpretation
- Summarize key findings in plain English
- Identify patterns, anomalies, or trends
- If the user asked for metrics, compute them explicitly:
- Counts, sums, averages, medians, percentiles
- Rates (conversion, churn, growth) with clear denominators
- Cohort breakdowns if relevant
- Compare to expectations: "This is X% higher/lower than typical"
Output: numbered findings with the supporting query/row cited.
Step 5 — Visualization (if requested)
DANA uses seaborn for charts. In the CLI:
- Write a Python script to generate the chart:
import matplotlib matplotlib.use('Agg') # headless import matplotlib.pyplot as plt import pandas as pd # ... load data, plot, save plt.savefig('chart-<name>.png', dpi=150, bbox_inches='tight') execthe scriptreadthe PNG to display it inline- Report the file path for later reference
Output: chart file path + inline display + 1-sentence caption.
Output format
## Data Analysis: <question>
### Schema used
- `<table>`: <columns relevant to this query>
### Query
```sql
<SQL>
Results
<Markdown table or file reference>
Findings
- <finding with data citation>
- ...
Chart
<if requested: file path + inline image>
## Up-to-date docs
If the user asks about a specific pandas, seaborn, matplotlib, SQLAlchemy, or plotting API, invoke `context7` before writing code. This is especially useful for seaborn-style visualizations where API signatures change between versions.
## CLI-specific notes
- No persistent Database Knowledge: cloud DANA persists schema docs
across sessions. The CLI caches to `.devin/db-schema.md` — check
if it exists, re-discover if stale.
- No Slack integration: cloud DANA responds in Slack threads. The
CLI outputs to the terminal; use `write` for large results.
- MCP-dependent: this skill only works if a data MCP server is
configured. Check `mcp_config.json` and `mcp_list_servers` first.
- Auto-feedback learning via glossary: cloud DANA learns from user
corrections ("remember that 'active user' means logged in within 7
days"). The CLI persists them in `.devin/db-glossary.md` (Step 1b):
corrections become certified, SQL-ready definitions that survive
across sessions.
- Schema safety: never run `DROP`, `DELETE`, `UPDATE`, `INSERT`, or
any mutating SQL unless the user explicitly asks. DANA is
read-only by design; this skill follows the same constraint.
## Cross-skills
- `architecture-diagrams` / mermaid — when the analysis output needs a diagram artifact (ER, flow, topology) for reports.
any mutating SQL unless the user explicitly asks. DANA is
read-only by design; this skill follows the same constraint.
04 同仓库更多 Skills
montador-de-ideias
Use when assembling, expanding, or elevating a raw project idea or initial prompt into an ultra-detailed, first-principles dossier and compiled master prompt with journalistic OSINT market research, Tech Lead and Staff Architect justifications, atomic and modular hardening/optimization, and high-impact contact surfaces.
git-github-adaptive-engineering
Use when any task touches git history, GitHub issues/PRs/releases/CI, repo governance, or branch and merge decisions. Runs the Fase Zero situational-awareness battery, picks one of five delivery flows via the adaptive decision engine, and enforces commit/PR information-density standards. Orchestrates the gh, git-workflows, github-actions, pr, and debug/finish skills.
adaptive-agenda-calendar-routine-engine
Use when planning or executing work across hours, days, weeks, or sprints. Turns the calendar into a strict time-blocked agenda (HH:MM-HH:MM blocks carrying a routine profile, expected inputs, and a handoff output artifact), runs the 5-stage cognitive flow (Radar and Hunt -> Triage plus Steve Jobs conception -> workbench manifest -> >=32-cycle loop -> Close plus Open-Minded Scrum), and unfolds macro calendar milestones into micro agenda blocks through extensions/gcal/wrapper.py.
demo
Use when demonstrating a skill in a fixture project.
duplicate-skill
Use when testing duplicate skill name detection.
duplicate-skill
Use when testing duplicate skill name detection.