sql-analysis
O que ela faz
Esta skill transforma uma pergunta de negócio em uma consulta SQL verificada e uma tabela de resultado pequena. É para analistas e gestores que precisam de números de um banco de dados sem escrever a consulta sozinhos.
Quando usar
- ✓Quando você pergunta quantos, qual é a tendência ou quais são os itens principais em um banco de dados.
- ✓Quando você quer comparar dois grupos ou dois períodos usando os dados.
- ✓Quando você precisa de uma tabela de resultado junto com a consulta que a gerou.
Link da skill
https://github.com/agentscope-ai/agentscope-java/blob/main/agentscope-examples/agents/agentscope-dataagent/src/main/resources/shared/agents/data-agent/skills/sql-analysis/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Quantos clientes novos tivemos a cada mês do ano passado, por região? Mostre a consulta e a tabela.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
A skill reformula a pergunta como uma métrica com agrupamento, janela de tempo e filtro. Ela rascunha o SQL, executa a consulta, verifica se o número de linhas e os resultados fazem sentido e depois apresenta a tabela com a consulta.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do GitHub.
SQL Analysis Skill
Repeatable SOP for turning a business question into a verifiable SQL answer.
Steps
Restate the question as a metric. In one sentence, write: "<metric> by <grouping> over <time window>, filtered by <filter>". If any of those four (metric / grouping / window / filter) is missing or ambiguous, ask one clarifying question and stop. Do not guess.
Locate the source. Decide where the data lives:
- Look in
knowledge/first for any schema notes, data-dictionary entries, or prior query examples uploaded by the user. - If the right table is not obvious, delegate to the
data-explorersub-agent with the metric definition as the prompt — its job is to identify the canonical source.
- Look in
Draft the query. Write the SQL in a fenced
sqlblock. Conventions:- Always include the time window in a
WHEREclause — never query the full history "just in case". - Always
SELECTan explicit column list — neverSELECT *in an answer. - Use CTEs (
WITH x AS (...)) over nested subqueries for anything beyond two levels of nesting. - Comment any non-obvious filter (
-- excludes internal test accounts).
- Always include the time window in a
Validate before reporting. Run the query and check:
- Row count is in the ballpark you expected (1 row, 10 rows, ~30 daily buckets, etc.). A surprising row count is almost always a bug — investigate.
- No
NULLs in the grouping column unless that is the intended cohort. - At least one numeric sanity check: a known total, a known reference value, or a min/max range that matches reality.
- If anything looks off, do not report the number — fix the query first.
Write the report. Use this exact structure:
## Answer <one-sentence direct answer with the headline number(s)> ## Result <small markdown table — at most ~15 rows; for longer results, summarise and offer to render a chart or attach the full CSV> ## Query ```sql <the exact query you ran>Sources & validation
- Table(s):
schema.table_name(row count, freshness if known) - Validation: <which sanity checks you ran and the result>
- Caveats: <known data quality issues, missing dates, etc.>
- Table(s):
Anti-patterns
- ❌ Reporting a number without the query that produced it.
- ❌ Using
LIMIT Nto "make the output fit" without explaining what got cut. - ❌ Reading a single row and reporting it as a trend.
- ❌ Inventing a table or column name. If unsure, delegate to
data-explorer.
When to delegate
- The user's question requires probing several candidate tables / sources
before any query can be written → spawn
data-explorer. - The user wants a polished written deliverable summarising several analyses
(e.g. "weekly health report") → spawn
report-writerafter you have the underlying numbers ready.
Perguntas frequentes
Ela adivinha detalhes que faltam?
Não, se a métrica, o agrupamento, a janela de tempo ou o filtro não estiverem claros, a skill faz uma pergunta de esclarecimento.
Ela mostra a consulta?
Sim, ela apresenta o SQL junto com a tabela de resultado.
Ela confere a resposta?
Sim, ela verifica se o número de linhas e os valores parecem razoáveis antes de informar.
Detalhes
Descrição original do autor
Answer a quantitative business question by writing a SQL query against the data warehouse, validating it, and presenting the result. Use when the user asks "how many...", "what's the trend of...", "compare X vs Y over...", "what's our top N...", or anything that resolves to a query against tabular data. Produces a small result table plus the underlying query.
Popularidade
- Estrelas no GitHub
- 6,2 mil
- Posição no ranking
- #14391
- Licença
- Apache-2.0
- Atualizada em
- 02/11/2026
Comentários
- …
Mais skills deste repositório
agentscope-java
6,2 milAjuda seu agente a escrever código Java não bloqueante para o AgentScope, um framework multiagente construído sobre o Project Reactor.
data-report
6,2 milAjuda seu agente a resumir um conjunto de dados em um relatório com médias, totais, intervalos e tendências, salvo como arquivo Markdown.
data-transform
6,2 milAjuda seu agente a converter um arquivo de dados entre formatos como CSV e JSON, para que os dados possam ser usados em outras ferramentas.
git-changelog
6,2 milAjuda seu agente a escrever um changelog ou notas de versão a partir do histórico do Git, agrupados em funcionalidades, correções e outras mudanças.
Skills parecidas
discrawl
394 milPermite que seu agente pesquise e resuma um arquivo local salvo de mensagens do Discord, verifique quão atualizado ele está e leia mensagens diretas.
clickhouse-io
280 milAjuda seu agente a otimizar consultas e esquemas no ClickHouse com boas práticas de alta performance. Use quando consultas analíticas forem lentas.
scientific-db-pubmed-database
280 milAjuda seu agente a buscar artigos científicos na área biomédica. É útil para pesquisas que precisam de informações médicas específicas.