analyze
The analyze command performs comprehensive data analysis on a specified dataset using the data-explorer subagent, supporting exploratory, statistical, predictive, or complete analysis types. Use this command when you need to understand dataset structure, generate summary statistics, identify patterns and correlations, detect anomalies, perform hypothesis testing, or generate actionable insights with detailed reports and quality assessments.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/liangdabiao/claude-data-analysis/HEAD/.claude/commands/analyze.md -o ~/.claude/commands/analyze.mdanalyze.md
# Data Analysis Command Execute data analysis on dataset `$1` with analysis type `$2` using the data-explorer subagent. ## Context - Dataset location: @data_storage/$1 - Analysis type: $2 (exploratory, statistical, predictive, complete) - Current working directory: !`pwd` - Available visualization libraries: matplotlib, seaborn, plotly - Python data science stack: pandas, numpy, scipy ## Your Task Use the data-explorer subagent to perform comprehensive data analysis: ### 1. Data Assessment - Load and inspect the dataset structure - Check data types, missing values, and duplicates - Generate initial summary statistics - Identify data quality issues ### 2. Statistical Analysis - Perform descriptive statistics analysis - Calculate correlations between variables - Identify outliers and anomalies - Conduct appropriate statistical tests ### 3. Pattern Discovery - Identify trends and patterns in the data - Discover relationships between variables - Detect seasonal patterns or cycles - Find clusters or segments in the data ### 4. Generate Insights - Extract key findings from the analysis - Identify actionable insights - Suggest areas for deeper investigation - Recommend visualization approaches ## Analysis Types ### Exploratory Analysis - Basic data understanding - Summary statistics - Data quality assessment - Initial pattern identification ### Statistical Analysis - Advanced statistical testing - Correlation and regression analysis - Hypothesis testing - Confidence intervals ### Predictive Analysis - Feature importance analysis - Predictive modeling preparation - Variable relationships - Model recommendation ### Complete Analysis - All of the above plus - Comprehensive report generation - Visualization recommendations - Next steps planning ## Expected Output ### Analysis Report Create a comprehensive analysis report with: - **Executive Summary**: Key findings in plain language - **Data Overview**: Dataset characteristics and quality - **Statistical Findings**: Detailed statistical analysis - **Key Insights**: Actionable discoveries - **Recommendations**: Next steps for deeper analysis - **Limitations**: Data and method constraints ### File Outputs - `analysis_reports/analysis_summary_$1.md` - Detailed analysis report - `analysis_reports/statistical_summary_$1.csv` - Statistical summary table - `analysis_reports/data_quality_$1.json` - Data quality assessment ## Quality Assurance - Validate all statistical calculations - Cross-check important findings - Document all assumptions and limitations - Ensure reproducible analysis ## Example Usage ```bash /analyze user_behavior.csv exploratory /analyze sales_data.csv statistical /analyze customer_data.csv predictive /analyze financial_data.csv complete ``` ## Notes - Dataset should be located in the data_storage/ directory - Analysis results will be saved to analysis_reports/ directory - Use Task tool to delegate to data-explorer subagent - Consider following up with /visualize command for charts
Expert code generation specialist for creating high-quality, production-ready analysis code in multiple programming languages. Use proactively for any code generation task requiring clean, efficient, and maintainable code for data analysis, machine learning, and visualization.
Advanced data exploration and analysis specialist for statistical analysis, pattern discovery, machine learning insights, and actionable business intelligence. Use proactively for any data analysis task requiring deep insights and comprehensive understanding.
Research hypothesis generation specialist for creating testable hypotheses, experimental designs, and research methodologies. Use proactively when data analysis suggests deeper investigation or when planning new research initiatives.
Data quality and validation specialist ensuring data integrity, analysis accuracy, and result reliability. Use proactively for any data validation, quality checks, or result verification tasks.
Expert report writer specializing in comprehensive data analysis documentation, executive summaries, and technical documentation. Use proactively to create polished, professional reports.
Expert data visualization specialist for creating interactive, insightful, and publication-quality visualizations with advanced analytics integration and storytelling capabilities. Use proactively when data analysis would benefit from visual representation or when communicating complex insights to stakeholders.
自动化完成整个数据分析工作流程,从数据质量检查到最终报告生成
Generate analysis code in specified language and analysis type