analyze
回答資料問題,從快速查詢到正式報告都能做
中文翻譯
--- name: analyze description: 回答資料相關的問題,從快速查詢到完整分析都行。適用於查單一指標、調查趨勢或下滑的原因、比較不同區隔隨時間的變化,或為利害關係人準備正式的資料報告。 argument-hint: "<question>" --- # /analyze - 回答資料問題 > 如果看到不熟悉的佔位符,或需要確認目前連了哪些工具,請見 [CONNECTORS.md](../../CONNECTORS.md)。 回答資料問題,從快速查詢、完整分析到正式報告都行。 ## 用法 ``` /analyze <natural language question> ``` ## 工作流程 ### 1. 理解問題 解析使用者的問題,並判斷: - **複雜度**: - **快速回答**:單一指標、簡單篩選、事實查詢(例如 "How many users signed up last week?") - **完整分析**:多維度探索、趨勢分析、比較(例如 "What's driving the drop in conversion rate?") - **正式報告**:附方法論、注意事項和建議的完整調查(例如 "Prepare a quarterly business review of our subscription metrics") - **資料需求**:需要哪些資料表、指標、維度和時間範圍 - **輸出格式**:數字、表格、圖表、敘述,或組合 ### 2. 蒐集資料 **如果有連接資料倉儲 MCP server:** 1. 探索 schema,找出相關的資料表和欄位 2. 撰寫 SQL 查詢來取出需要的資料 3. 執行查詢並取得結果 4. 如果查詢失敗,除錯後重試(檢查欄位名稱、資料表參照,以及特定 SQL 方言的語法) 5. 如果結果看起來不對勁,繼續之前先跑 sanity check **如果沒有連接資料倉儲:** 1. 請使用者用下列其中一種方式提供資料: - 直接貼上查詢結果 - 上傳 CSV 或 Excel 檔 - 描述 schema,讓你寫查詢給他們去跑 2. 如果寫的查詢是要讓人手動執行,使用 `sql-queries` skill 取得各 SQL 方言的最佳實務 3. 拿到資料後,繼續做分析 ### 3. 分析 - 計算相關指標、彙總和比較 - 找出模式、趨勢、離群值和異常 - 跨維度比較(時間區間、區隔、類別) - 複雜的分析要把問題拆成子問題,逐一處理 ### 4. 呈現前先驗證 分享結果之前,先跑過驗證檢查: - **筆數合理性**:紀錄筆數合理嗎? - **Null 檢查**:有沒有可能讓結果失真的意外 null? - **量級檢查**:數字落在合理範圍嗎? - **趨勢連續性**:時間序列有沒有意外的缺口? - **彙總邏輯**:小計加起來等於總計嗎? 只要任何一項檢查讓你起疑,就去調查並註明注意事項。 ### 5. 呈現發現 **快速回答:** - 直接講答案並附上相關背景 - 附上使用的查詢(收合或放在 code block),方便重現 **完整分析:** - 先講關鍵發現或洞察 - 用資料表和/或視覺化來支撐 - 註明方法論和任何注意事項 - 建議後續的問題 **正式報告:** - 附關鍵結論的執行摘要 - 說明做法和資料來源的方法論章節 - 附佐證的詳細發現 - 注意事項、限制和資料品質備註 - 建議和後續步驟 ### 6. 適合的時候做視覺化 當圖表比表格更能有效傳達結果時: - 使用 `data-visualization` skill 選擇正確的圖表類型 - 產生 Python 視覺化,或把它做進 HTML 儀表板 - 遵循視覺化的最佳實務,確保清楚和正確 ## 範例 **快速回答:** ``` /analyze How many new users signed up in December? ``` **完整分析:** ``` /analyze What's causing the increase in support ticket volume over the past 3 months? Break down by category and priority. ``` **正式報告:** ``` /analyze Prepare a data quality assessment of our customer table -- completeness, consistency, and any issues we should address. ``` ## 小技巧 - 盡量明確說明時間範圍、區隔或指標 - 如果你知道資料表名稱,就說出來,可以加快流程 - 對於複雜的問題,Claude 可能會拆成多個查詢 - 結果在呈現之前一定會經過驗證,如果有哪裡看起來怪怪的,Claude 會標出來
英文原文
--- name: analyze description: Answer data questions -- from quick lookups to full analyses. Use when looking up a single metric, investigating what's driving a trend or drop, comparing segments over time, or preparing a formal data report for stakeholders. argument-hint: "<question>" --- # /analyze - Answer Data Questions > If you see unfamiliar placeholders or need to check which tools are connected, see [CONNECTORS.md](../../CONNECTORS.md). Answer a data question, from a quick lookup to a full analysis to a formal report. ## Usage ``` /analyze <natural language question> ``` ## Workflow ### 1. Understand the Question Parse the user's question and determine: - **Complexity level**: - **Quick answer**: Single metric, simple filter, factual lookup (e.g., "How many users signed up last week?") - **Full analysis**: Multi-dimensional exploration, trend analysis, comparison (e.g., "What's driving the drop in conversion rate?") - **Formal report**: Comprehensive investigation with methodology, caveats, and recommendations (e.g., "Prepare a quarterly business review of our subscription metrics") - **Data requirements**: Which tables, metrics, dimensions, and time ranges are needed - **Output format**: Number, table, chart, narrative, or combination ### 2. Gather Data **If a data warehouse MCP server is connected:** 1. Explore the schema to find relevant tables and columns 2. Write SQL query(ies) to extract the needed data 3. Execute the query and retrieve results 4. If the query fails, debug and retry (check column names, table references, syntax for the specific dialect) 5. If results look unexpected, run sanity checks before proceeding **If no data warehouse is connected:** 1. Ask the user to provide data in one of these ways: - Paste query results directly - Upload a CSV or Excel file - Describe the schema so you can write queries for them to run 2. If writing queries for manual execution, use the `sql-queries` skill for dialect-specific best practices 3. Once data is provided, proceed with analysis ### 3. Analyze - Calculate relevant metrics, aggregations, and comparisons - Identify patterns, trends, outliers, and anomalies - Compare across dimensions (time periods, segments, categories) - For complex analyses, break the problem into sub-questions and address each ### 4. Validate Before Presenting Before sharing results, run through validation checks: - **Row count sanity**: Does the number of records make sense? - **Null check**: Are there unexpected nulls that could skew results? - **Magnitude check**: Are the numbers in a reasonable range? - **Trend continuity**: Do time series have unexpected gaps? - **Aggregation logic**: Do subtotals sum to totals correctly? If any check raises concerns, investigate and note caveats. ### 5. Present Findings **For quick answers:** - State the answer directly with relevant context - Include the query used (collapsed or in a code block) for reproducibility **For full analyses:** - Lead with the key finding or insight - Support with data tables and/or visualizations - Note methodology and any caveats - Suggest follow-up questions **For formal reports:** - Executive summary with key takeaways - Methodology section explaining approach and data sources - Detailed findings with supporting evidence - Caveats, limitations, and data quality notes - Recommendations and suggested next steps ### 6. Visualize Where Helpful When a chart would communicate results more effectively than a table: - Use the `data-visualization` skill to select the right chart type - Generate a Python visualization or build it into an HTML dashboard - Follow visualization best practices for clarity and accuracy ## Examples **Quick answer:** ``` /analyze How many new users signed up in December? ``` **Full analysis:** ``` /analyze What's causing the increase in support ticket volume over the past 3 months? Break down by category and priority. ``` **Formal report:** ``` /analyze Prepare a data quality assessment of our customer table -- completeness, consistency, and any issues we should address. ``` ## Tips - Be specific about time ranges, segments, or metrics when possible - If you know the table names, mention them to speed up the process - For complex questions, Claude may break them into multiple queries - Results are always validated before presentation -- if something looks off, Claude will flag it