본문으로 건너뛰기
cccskills
무료GitHub에 공개

sql-analysis

Answer business questions about counts, trends, comparisons, or rankings using SQL, a language for querying tables. Validate the results, then present a concise answer, a small table, the executed query, and supporting checks.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

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.

설치 방법 보기

이럴 때 유용합니다

  • Counting records for a defined period
  • Checking how a business metric changes over time
  • Comparing groups over the same period
  • Finding the top items by a chosen metric

포함된 파일(1)

  • SKILL.md3.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

SQL Analysis Skill

Repeatable SOP for turning a business question into a verifiable SQL answer.

Steps

  1. 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.

  2. 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-explorer sub-agent with the metric definition as the prompt — its job is to identify the canonical source.
  3. Draft the query. Write the SQL in a fenced sql block. Conventions:

    • Always include the time window in a WHERE clause — never query the full history "just in case".
    • Always SELECT an explicit column list — never SELECT * 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).
  4. 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.
  5. 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.>

Anti-patterns

  • ❌ Reporting a number without the query that produced it.
  • ❌ Using LIMIT N to "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-writer after you have the underlying numbers ready.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Build Java applications with cooperating AI agents using AgentScope Java. Guides asynchronous processing, where waiting tasks do not block execution, plus language model connections, external tools, workflow coordination, error handling, and tests.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Building a Java agent connected to a language model
  • Coordinating agents in sequential or parallel workflows
  • Connecting external tools through MCP
agentscope-ai/agentscope-java6.1천2026년 10월 20일 업데이트

Apply related edits across several files using a unified diff, a file describing code changes. Check the patch with Git before applying it, and rebuild rejected patches using the current file contents.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Applying one related change across three or more files
  • Handling repetitive edits or whitespace-sensitive changes
  • Reusing a patch from a PR or git diff
agentscope-ai/agentscope-java6.1천2026년 10월 20일 업데이트

Turn analysis results into charts suited to the question, such as trends, comparisons, or distributions. Save a chart image and the script that generated it, with a short explanation of the findings and relevant caveats.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Show changes over time
  • Compare values across categories
  • Visualize relationships between two numeric variables
agentscope-ai/agentscope-java6.1천2026년 10월 20일 업데이트

Locate function and class definitions, usages, and relevant files with ripgrep, using text patterns and file filters. Search Git history to see when text appeared or disappeared and investigate who changed specific lines.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Finding function or class definitions
  • Locating usages of a particular function
  • Narrowing searches by file type or path
agentscope-ai/agentscope-java6.1천2026년 10월 20일 업데이트

Calculate the count, sum, minimum, maximum, and average of supplied numbers or datasets, then present the results in a clear, structured format. Analysis results can also be saved to a file when requested.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Check the count and total of supplied numbers
  • Summarize minimum, maximum, and average values
  • Get a basic numerical summary of a dataset
agentscope-ai/agentscope-java6.1천2026년 10월 20일 업데이트

Use a starter template to learn how an agent skill is organized and outline its intended use, required inputs, steps, and output format. Replace the placeholder body with your own working instructions before relying on it.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Learn the basic layout of an agent skill
  • Start drafting a custom skill
  • Describe when an agent should select a skill
agentscope-ai/agentscope-java6.1천2026년 10월 20일 업데이트

agentscope-ai의 스킬 모두 보기

이 스킬의 문제 신고