In Part 6, we covered security best practices for Claude Agent Skills. Now we explore real-world use cases with complete, production-ready implementations. This guide provides four comprehensive skill examples across different business domains: financial reporting automation, code review workflows, customer support assistance, and data analysis pipelines. Each example includes complete SKILL.md files, supporting scripts, and integration code in Node.js, Python, and C#.
Use Case 1: Financial Reporting Automation
Financial reporting requires consistency, accuracy, and compliance with accounting standards. This skill automates quarterly financial report generation with proper formatting, calculations, and audit trails.
Business Requirements
- Generate standardized quarterly financial reports
- Apply company-specific formatting and branding
- Calculate key financial metrics automatically
- Include variance analysis and trends
- Ensure compliance with GAAP/IFRS standards
- Maintain audit trail for all calculations
Skill Structure
financial-reporting/
├── SKILL.md
├── scripts/
│ ├── calculate_metrics.py
│ ├── validate_data.py
│ └── generate_audit_log.py
├── references/
│ ├── gaap_standards.md
│ ├── metric_definitions.md
│ └── variance_analysis_guide.md
└── assets/
├── report_template.xlsx
├── logo.png
└── formatting_styles.jsonComplete SKILL.md Implementation
---
name: financial-reporting
description: Generate comprehensive quarterly financial reports with standardized formatting, automated calculations, variance analysis, and GAAP compliance. Use when creating financial statements, quarterly reports, or board presentations.
version: "2.0.0"
license: Proprietary
metadata:
owner: "Finance Operations"
department: "Financial Planning & Analysis"
compliance: "GAAP, SOX"
last_updated: "2026-01-15"
---
# Financial Reporting Skill
## Purpose
Automates the creation of standardized quarterly financial reports including income statements, balance sheets, cash flow statements, and management analysis with proper formatting and compliance checks.
## Report Components
### 1. Executive Summary
- Quarter-over-quarter highlights
- Key performance indicators
- Notable variances and explanations
- Management commentary
### 2. Financial Statements
#### Income Statement
- Revenue breakdown by segment
- Cost of goods sold and gross margin
- Operating expenses by category
- EBITDA and net income
- Earnings per share (basic and diluted)
#### Balance Sheet
- Current and non-current assets
- Liabilities breakdown
- Shareholders equity components
- Working capital analysis
#### Cash Flow Statement
- Operating activities
- Investing activities
- Financing activities
- Free cash flow calculation
### 3. Financial Metrics
Calculate and include these standard metrics:
**Profitability Metrics:**
- Gross Profit Margin = (Revenue - COGS) / Revenue
- Operating Margin = Operating Income / Revenue
- Net Profit Margin = Net Income / Revenue
- Return on Assets (ROA) = Net Income / Total Assets
- Return on Equity (ROE) = Net Income / Shareholders Equity
**Liquidity Metrics:**
- Current Ratio = Current Assets / Current Liabilities
- Quick Ratio = (Current Assets - Inventory) / Current Liabilities
- Cash Ratio = Cash & Equivalents / Current Liabilities
**Efficiency Metrics:**
- Asset Turnover = Revenue / Average Total Assets
- Inventory Turnover = COGS / Average Inventory
- Days Sales Outstanding = (Accounts Receivable / Revenue) * 90
**Leverage Metrics:**
- Debt-to-Equity = Total Debt / Total Equity
- Debt-to-Assets = Total Debt / Total Assets
- Interest Coverage = EBIT / Interest Expense
### 4. Variance Analysis
For each major line item, provide:
- Current quarter actual
- Prior quarter actual
- Year-over-year comparison
- Variance amount and percentage
- Explanation for variances greater than 10%
## Data Validation Requirements
Before generating reports, validate:
1. All required data fields are present
2. Debits equal credits in trial balance
3. Beginning balances plus period activity equals ending balances
4. Cash flow reconciles to balance sheet changes
5. Revenue recognition follows GAAP standards
6. All material transactions are properly classified
Run validation script:
```python
python scripts/validate_data.py --quarter Q1 --year 2026
```
## Calculation Process
### Step 1: Load Financial Data
```python
# Expected data format
financial_data = {
"quarter": "Q1 2026",
"revenue": 125000000,
"cogs": 75000000,
"operating_expenses": 30000000,
"interest_expense": 2000000,
"tax_rate": 0.21,
# ... additional line items
}
```
### Step 2: Calculate Metrics
```python
python scripts/calculate_metrics.py --input data.json --output metrics.json
```
The script will:
- Calculate all standard financial metrics
- Perform variance analysis
- Flag anomalies for review
- Generate audit log
### Step 3: Generate Report
Use the Excel template with calculated values:
- Apply company formatting and branding
- Insert calculated metrics
- Add variance commentary
- Include required disclosures
## Formatting Standards
### Number Formatting
- Revenue/Expenses: $##,###,### (no decimals)
- Percentages: ##.#% (one decimal)
- Ratios: #.## (two decimals)
- Per share: $#.## (two decimals)
### Color Coding
- Positive variances: Green text
- Negative variances: Red text
- Neutral variances (±5%): Black text
- Missing data: Yellow highlight
### Required Disclosures
Include footnotes for:
- Accounting policy changes
- Non-recurring items
- Related party transactions
- Subsequent events
- Going concern considerations
## Compliance Checks
### GAAP Compliance
Verify adherence to:
- Revenue recognition standards (ASC 606)
- Lease accounting (ASC 842)
- Financial instruments (ASC 815)
- Fair value measurements (ASC 820)
### SOX Controls
Document:
- Data sources and transformations
- Calculation methodologies
- Review and approval workflow
- Change tracking and version control
## Audit Trail
Generate comprehensive audit log including:
- Data source files and timestamps
- Calculation formulas and intermediate results
- User who generated the report
- Review and approval chain
- Any manual adjustments with justification
```python
python scripts/generate_audit_log.py --report-id Q1-2026 --output audit_trail.pdf
```
## Quality Assurance Checklist
Before finalizing report:
- [ ] All calculations verified
- [ ] Variances explained
- [ ] Formatting applied consistently
- [ ] Required disclosures included
- [ ] Management review completed
- [ ] Audit trail generated
- [ ] Compliance checks passed
## Output Format
Generate reports in:
- Excel (.xlsx) - detailed with formulas
- PDF (.pdf) - formatted for distribution
- PowerPoint (.pptx) - executive summary for board
## Error Handling
If validation fails:
1. Generate detailed error report
2. Highlight problematic data points
3. Suggest corrective actions
4. Do not proceed with report generation
If data is missing:
1. List missing data requirements
2. Provide example of expected format
3. Indicate minimum data needed to proceed
## Reference Materials
For detailed information, consult:
- [GAAP Standards](references/gaap_standards.md)
- [Metric Definitions](references/metric_definitions.md)
- [Variance Analysis Guide](references/variance_analysis_guide.md)
## Limitations
This skill:
- Assumes clean, validated input data
- Does not perform complex consolidations
- Cannot make accounting judgments
- Requires human review before finalization
- Does not replace professional accountants
## Contact
Questions about financial reporting:
- FP&A Team: fpa@company.com
- Controller: controller@company.comSupporting Script: Calculate Metrics
#!/usr/bin/env python3
"""
Financial metrics calculation script
Calculates standard financial ratios and performs variance analysis
"""
import json
import sys
from decimal import Decimal, ROUND_HALF_UP
from typing import Dict, Any
from datetime import datetime
class FinancialMetricsCalculator:
"""Calculate financial metrics from raw financial data"""
def __init__(self, data: Dict[str, Any]):
self.data = data
self.metrics = {}
self.variances = {}
def calculate_all(self) -> Dict[str, Any]:
"""Calculate all financial metrics"""
self._calculate_profitability()
self._calculate_liquidity()
self._calculate_efficiency()
self._calculate_leverage()
self._calculate_variances()
return {
'metrics': self.metrics,
'variances': self.variances,
'calculated_at': datetime.utcnow().isoformat(),
'data_period': self.data.get('quarter'),
}
def _calculate_profitability(self):
"""Calculate profitability metrics"""
revenue = Decimal(str(self.data['revenue']))
cogs = Decimal(str(self.data['cogs']))
operating_income = Decimal(str(self.data['operating_income']))
net_income = Decimal(str(self.data['net_income']))
total_assets = Decimal(str(self.data['total_assets']))
shareholders_equity = Decimal(str(self.data['shareholders_equity']))
self.metrics['gross_profit_margin'] = self._percentage(
(revenue - cogs) / revenue
)
self.metrics['operating_margin'] = self._percentage(
operating_income / revenue
)
self.metrics['net_profit_margin'] = self._percentage(
net_income / revenue
)
self.metrics['return_on_assets'] = self._percentage(
net_income / total_assets
)
self.metrics['return_on_equity'] = self._percentage(
net_income / shareholders_equity
)
def _calculate_liquidity(self):
"""Calculate liquidity metrics"""
current_assets = Decimal(str(self.data['current_assets']))
current_liabilities = Decimal(str(self.data['current_liabilities']))
inventory = Decimal(str(self.data['inventory']))
cash = Decimal(str(self.data['cash_and_equivalents']))
self.metrics['current_ratio'] = self._ratio(
current_assets / current_liabilities
)
self.metrics['quick_ratio'] = self._ratio(
(current_assets - inventory) / current_liabilities
)
self.metrics['cash_ratio'] = self._ratio(
cash / current_liabilities
)
def _calculate_efficiency(self):
"""Calculate efficiency metrics"""
revenue = Decimal(str(self.data['revenue']))
cogs = Decimal(str(self.data['cogs']))
avg_total_assets = Decimal(str(self.data['avg_total_assets']))
avg_inventory = Decimal(str(self.data['avg_inventory']))
accounts_receivable = Decimal(str(self.data['accounts_receivable']))
self.metrics['asset_turnover'] = self._ratio(
revenue / avg_total_assets
)
self.metrics['inventory_turnover'] = self._ratio(
cogs / avg_inventory
)
self.metrics['days_sales_outstanding'] = int(
(accounts_receivable / revenue) * 90
)
def _calculate_leverage(self):
"""Calculate leverage metrics"""
total_debt = Decimal(str(self.data['total_debt']))
total_equity = Decimal(str(self.data['total_equity']))
total_assets = Decimal(str(self.data['total_assets']))
ebit = Decimal(str(self.data['ebit']))
interest_expense = Decimal(str(self.data['interest_expense']))
self.metrics['debt_to_equity'] = self._ratio(
total_debt / total_equity
)
self.metrics['debt_to_assets'] = self._ratio(
total_debt / total_assets
)
self.metrics['interest_coverage'] = self._ratio(
ebit / interest_expense
)
def _calculate_variances(self):
"""Calculate variances vs prior period"""
if 'prior_period' not in self.data:
return
current = self.data
prior = self.data['prior_period']
for key in ['revenue', 'operating_income', 'net_income']:
if key in current and key in prior:
current_val = Decimal(str(current[key]))
prior_val = Decimal(str(prior[key]))
variance_amount = current_val - prior_val
variance_pct = (variance_amount / prior_val) * 100
self.variances[key] = {
'current': float(current_val),
'prior': float(prior_val),
'variance_amount': float(variance_amount),
'variance_percent': float(variance_pct.quantize(
Decimal('0.1'), rounding=ROUND_HALF_UP
)),
'significant': abs(float(variance_pct)) > 10
}
def _percentage(self, value: Decimal) -> float:
"""Format as percentage with one decimal"""
return float((value * 100).quantize(
Decimal('0.1'), rounding=ROUND_HALF_UP
))
def _ratio(self, value: Decimal) -> float:
"""Format as ratio with two decimals"""
return float(value.quantize(
Decimal('0.01'), rounding=ROUND_HALF_UP
))
def main():
if len(sys.argv) < 3:
print("Usage: python calculate_metrics.py --input data.json --output metrics.json")
sys.exit(1)
# Parse arguments
input_file = sys.argv[sys.argv.index('--input') + 1]
output_file = sys.argv[sys.argv.index('--output') + 1]
# Load data
with open(input_file, 'r') as f:
data = json.load(f)
# Calculate metrics
calculator = FinancialMetricsCalculator(data)
results = calculator.calculate_all()
# Save results
with open(output_file, 'w') as f:
json.dump(results, f, indent=2)
print(f"Metrics calculated successfully. Output: {output_file}")
# Print summary
print("\nKey Metrics:")
for metric, value in results['metrics'].items():
print(f" {metric}: {value}")
if __name__ == '__main__':
main()Integration Code
Python: Financial Report Generator
import os
from anthropic import Anthropic
client = Anthropic(api_key=os.environ.get("ANTHROPIC_API_KEY"))
def generate_financial_report(quarter: str, year: int, data_file: str):
"""Generate financial report using the skill"""
# Read financial data
with open(data_file, 'r') as f:
financial_data = f.read()
response = client.beta.messages.create(
model='claude-sonnet-4-5-20250929',
max_tokens=8192,
betas=['code-execution-2025-08-25', 'skills-2025-10-02'],
container={
'skills': [
{
'type': 'custom',
'skill_id': 'skill_financial_reporting',
'version': 'latest'
}
]
},
messages=[{
'role': 'user',
'content': f'''Generate a comprehensive quarterly financial report for {quarter} {year}.
Financial Data:
{financial_data}
Please include:
1. All financial statements (Income Statement, Balance Sheet, Cash Flow)
2. Calculated metrics with explanations
3. Variance analysis vs prior quarter
4. Executive summary
5. Compliance checklist
Format the report as an Excel file with professional formatting.'''
}],
tools=[{
'type': 'code_execution_20250825',
'name': 'code_execution'
}]
)
# Extract file ID from response
for block in response.content:
if hasattr(block, 'type') and block.type == 'tool_use':
for result in block.content:
if hasattr(result, 'file_id'):
return result.file_id
return None
# Usage
file_id = generate_financial_report('Q1', 2026, 'financial_data_q1_2026.json')
if file_id:
print(f"Report generated successfully. File ID: {file_id}")Use Case 2: Automated Code Review
Code review automation improves consistency and catches common issues before human review, saving developer time while maintaining code quality.
Skill Structure
code-review-automation/
├── SKILL.md
├── scripts/
│ ├── static_analysis.py
│ ├── complexity_checker.py
│ └── security_scanner.py
├── references/
│ ├── coding_standards.md
│ ├── security_checklist.md
│ └── common_patterns.md
└── assets/
└── review_template.mdComplete SKILL.md Implementation
---
name: code-review-automation
description: Perform comprehensive automated code reviews checking for security vulnerabilities, code quality issues, performance problems, and adherence to coding standards. Use when reviewing pull requests, analyzing code changes, or auditing codebase quality.
version: "1.5.0"
license: Apache-2.0
metadata:
owner: "Engineering Operations"
languages: "Python, JavaScript, TypeScript, Java, C#, Go"
---
# Automated Code Review Skill
## Purpose
Performs systematic code reviews checking security, quality, performance, maintainability, and standards compliance before human review.
## Review Categories
### 1. Security Analysis
**Critical Issues (Block merge):**
- SQL injection vulnerabilities
- Cross-site scripting (XSS) risks
- Command injection possibilities
- Path traversal vulnerabilities
- Hardcoded secrets or credentials
- Insecure cryptography usage
- Authentication/authorization bypasses
**High Priority:**
- Missing input validation
- Improper error handling exposing details
- Insufficient access controls
- Deprecated security functions
- Insecure dependencies
### 2. Code Quality
**Readability:**
- Meaningful variable and function names
- Appropriate comment density
- Clear function signatures
- Logical code organization
**Complexity:**
- Cyclomatic complexity under 10
- Function length under 50 lines
- Maximum nesting depth of 4
- No duplicated code blocks
**Maintainability:**
- Single Responsibility Principle
- DRY (Don't Repeat Yourself)
- SOLID principles adherence
- Clear separation of concerns
### 3. Performance
**Common Issues:**
- N+1 database query problems
- Inefficient algorithms (O(n²) or worse)
- Memory leaks
- Unnecessary computations in loops
- Missing caching opportunities
- Excessive API calls
### 4. Testing
**Requirements:**
- Unit tests for new functions
- Edge case coverage
- Error handling tests
- Integration test updates
- Test naming clarity
- Appropriate mocking
### 5. Standards Compliance
**Check against:**
- Team coding standards
- Language-specific best practices
- Framework conventions
- Documentation requirements
- Git commit message format
## Review Process
### Step 1: Initial Analysis
```bash
# Run static analysis
python scripts/static_analysis.py --files changed_files.txt
# Check complexity
python scripts/complexity_checker.py --threshold 10
# Security scan
python scripts/security_scanner.py --severity critical
```
### Step 2: Manual Inspection
Review for:
- Business logic correctness
- API contract changes
- Database schema impact
- Performance implications
- Breaking changes
### Step 3: Generate Review
Structure review as:
**Summary**
- Files changed: X
- Lines added/removed: +X/-Y
- Critical issues: N
- Overall recommendation: Approve/Request Changes/Reject
**Critical Issues** (must fix)
For each issue:
- File: path/to/file.py
- Line: 42
- Severity: Critical
- Issue: SQL injection vulnerability
- Explanation: User input not sanitized
- Recommendation: Use parameterized queries
- Example:
```python
# Bad
query = f"SELECT * FROM users WHERE id = {user_id}"
# Good
query = "SELECT * FROM users WHERE id = ?"
params = (user_id,)
```
**Suggestions** (should fix)
- Similar format but lower priority
- Focus on maintainability and best practices
**Positive Highlights**
- Well-written sections
- Good test coverage
- Clear documentation
- Efficient algorithms
## Language-Specific Checks
### Python
- PEP 8 compliance
- Type hints usage
- Exception handling
- Context managers for resources
- List comprehensions vs loops
### JavaScript/TypeScript
- ESLint rule compliance
- Async/await usage
- Promise error handling
- TypeScript type safety
- React hooks rules
### Java
- Checkstyle compliance
- Exception hierarchy
- Resource management (try-with-resources)
- Stream API usage
- Immutability patterns
### C#
- StyleCop compliance
- LINQ usage
- Async/await patterns
- Using statements
- Nullable reference types
### Go
- Go fmt compliance
- Error handling patterns
- Goroutine usage
- Context propagation
- Interface design
## Security Checklist
Mark each as PASS/FAIL/N/A:
- [ ] No hardcoded credentials
- [ ] Input validation present
- [ ] Output encoding applied
- [ ] SQL parameterized
- [ ] Authentication required
- [ ] Authorization checked
- [ ] HTTPS enforced
- [ ] CSRF tokens used
- [ ] Rate limiting implemented
- [ ] Sensitive data encrypted
- [ ] Security headers set
- [ ] Dependencies up to date
## Performance Checklist
- [ ] No N+1 queries
- [ ] Appropriate indexes
- [ ] Caching considered
- [ ] Pagination for lists
- [ ] Efficient algorithms
- [ ] Resource cleanup
- [ ] Connection pooling
- [ ] Async where appropriate
## Output Format
```markdown
# Code Review: [PR Title]
## Summary
- **Files Changed:** 5
- **Lines:** +230/-45
- **Critical Issues:** 2
- **Suggestions:** 8
- **Recommendation:** Request Changes
## Critical Issues
### 1. SQL Injection Vulnerability
**File:** `api/users.py`
**Line:** 42
**Severity:** Critical
[Details as specified above]
## Suggestions
[List of non-critical improvements]
## Positive Highlights
[Good aspects of the code]
## Next Steps
1. Address critical security issues
2. Consider performance suggestions
3. Update tests for edge cases
4. Update documentation
```
## Automation Limits
This skill cannot:
- Understand full business context
- Make architectural decisions
- Test runtime behavior
- Assess UX/UI changes
- Replace human judgment
## Human Review Required For
- Complex business logic
- Architecture changes
- API design decisions
- Performance tradeoffs
- Security exceptions
## References
- [Coding Standards](references/coding_standards.md)
- [Security Checklist](references/security_checklist.md)
- [Common Patterns](references/common_patterns.md)Node.js Integration
const Anthropic = require('@anthropic-ai/sdk');
const fs = require('fs').promises;
const client = new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY
});
async function reviewPullRequest(prNumber, diffFile) {
// Read diff
const diff = await fs.readFile(diffFile, 'utf-8');
const response = await client.beta.messages.create({
model: 'claude-sonnet-4-5-20250929',
max_tokens: 8192,
betas: ['code-execution-2025-08-25', 'skills-2025-10-02'],
container: {
skills: [{
type: 'custom',
skill_id: 'skill_code_review_automation',
version: 'latest'
}]
},
messages: [{
role: 'user',
content: `Review this pull request (#${prNumber}) and provide comprehensive feedback.
Code Changes:
${diff}
Focus on:
1. Security vulnerabilities
2. Performance issues
3. Code quality and maintainability
4. Testing coverage
5. Standards compliance
Provide actionable recommendations with code examples.`
}],
tools: [{
type: 'code_execution_20250825',
name: 'code_execution'
}]
});
return response.content[0].text;
}
// Usage
reviewPullRequest(1234, './pr_diff.patch')
.then(review => {
console.log(review);
// Post review as PR comment
});Use Case 3: Customer Support Assistant
Automate customer support responses while maintaining brand voice and ensuring accurate information.
Complete SKILL.md Implementation
---
name: customer-support-assistant
description: Provide helpful, accurate customer support responses following company guidelines, knowledge base, and brand voice. Use when responding to customer inquiries, troubleshooting issues, or drafting support communications.
version: "1.3.0"
license: Proprietary
---
# Customer Support Assistant Skill
## Purpose
Helps support agents draft accurate, helpful responses following brand guidelines and knowledge base.
## Response Framework
### 1. Greeting
- Personalize with customer name
- Acknowledge their issue
- Show empathy
Example:
"Hi [Name], thank you for reaching out. I understand you're experiencing [issue], and I'm here to help."
### 2. Problem Understanding
- Restate the issue
- Ask clarifying questions if needed
- Confirm understanding
### 3. Solution
- Provide step-by-step instructions
- Use simple, clear language
- Include screenshots or links when helpful
### 4. Verification
- Confirm issue resolved
- Ask if they need additional help
### 5. Closing
- Thank the customer
- Provide follow-up resources
- Invite future contact
## Brand Voice Guidelines
**Tone:**
- Friendly and professional
- Empathetic but not overly casual
- Clear and confident
- Patient and respectful
**Language:**
- Use "you" and "we"
- Avoid jargon unless customer uses it
- Keep sentences under 20 words
- Use active voice
**Avoid:**
- "Unfortunately"
- "I'm sorry but"
- Negative framing
- Technical acronyms without explanation
## Common Issues and Solutions
### Account Access
**Issue:** Cannot log in
**Steps:**
1. Verify email address
2. Try password reset
3. Check for account lock
4. Clear browser cache
5. Try different browser
### Billing Questions
**Issue:** Unexpected charge
**Steps:**
1. Locate charge in billing history
2. Explain what the charge covers
3. Offer refund if error
4. Update billing preferences if needed
### Product Issues
**Issue:** Feature not working
**Steps:**
1. Verify expected behavior
2. Check service status
3. Try basic troubleshooting
4. Escalate if technical issue
5. Provide workaround if available
## Escalation Criteria
Escalate to supervisor when:
- Customer requests refund over $500
- Legal threat mentioned
- Abusive language used
- Technical issue beyond tier 1
- Account security compromised
## Response Templates
Use as starting points:
**Password Reset:**
```
Hi [Name],
I'd be happy to help you reset your password. Here's what to do:
1. Visit www.example.com/reset
2. Enter your email: [email]
3. Check your inbox for reset link
4. Create a new password
The link expires in 1 hour. If you don't receive it, check your spam folder or let me know!
Best,
[Agent]
```
**Refund Request:**
```
Hi [Name],
I understand you'd like a refund for [item]. I've reviewed your account and processed a full refund of $[amount]. You'll see it in your account within 5-7 business days.
Is there anything else I can help with today?
Best,
[Agent]
```
## Quality Standards
Every response must:
- Answer the customer's question
- Use proper grammar and spelling
- Include next steps
- Offer additional help
- Stay under 200 words (unless complex issue)
## Prohibited Actions
Never:
- Share other customers' information
- Make promises outside policy
- Argue with customers
- Share internal processes
- Rush customers off support
## Metrics
Track:
- First response time
- Resolution time
- Customer satisfaction
- Follow-up rate
- Escalation rateUse Case 4: Data Analysis Pipeline
Automate data analysis workflows with consistent methodology and visualizations.
Complete Implementation
---
name: data-analysis-pipeline
description: Perform comprehensive data analysis including cleaning, exploration, statistical testing, and visualization generation. Use when analyzing datasets, generating insights, or creating data reports.
version: "2.1.0"
license: Apache-2.0
---
# Data Analysis Pipeline Skill
## Purpose
Automates end-to-end data analysis from raw data to insights and visualizations.
## Analysis Workflow
### 1. Data Loading and Validation
- Load data from CSV, Excel, or JSON
- Check data types
- Identify missing values
- Detect duplicates
- Validate ranges
### 2. Data Cleaning
- Handle missing values (imputation or removal)
- Remove duplicates
- Fix data types
- Handle outliers
- Standardize formats
### 3. Exploratory Data Analysis
- Summary statistics
- Distribution analysis
- Correlation analysis
- Pattern identification
- Anomaly detection
### 4. Statistical Testing
- Hypothesis tests
- Confidence intervals
- Significance testing
- Effect size calculations
### 5. Visualization
- Distribution plots
- Time series graphs
- Correlation heatmaps
- Scatter plots with trends
- Box plots for comparisons
### 6. Insights Generation
- Key findings summary
- Trends identification
- Anomaly explanations
- Recommendations
## Standard Visualizations
### Distribution Analysis
```python
import matplotlib.pyplot as plt
import seaborn as sns
def plot_distribution(data, column):
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 4))
# Histogram
ax1.hist(data[column], bins=30, edgecolor='black')
ax1.set_title(f'{column} Distribution')
ax1.set_xlabel(column)
ax1.set_ylabel('Frequency')
# Box plot
ax2.boxplot(data[column])
ax2.set_title(f'{column} Box Plot')
ax2.set_ylabel(column)
plt.tight_layout()
return fig
```
### Correlation Analysis
```python
def plot_correlation(data):
corr = data.corr()
plt.figure(figsize=(10, 8))
sns.heatmap(corr, annot=True, cmap='coolwarm', center=0)
plt.title('Correlation Matrix')
return plt.gcf()
```
## Statistical Tests
### T-Test
Use when comparing means of two groups:
```python
from scipy import stats
def perform_ttest(group1, group2):
t_stat, p_value = stats.ttest_ind(group1, group2)
result = {
't_statistic': t_stat,
'p_value': p_value,
'significant': p_value < 0.05,
'interpretation': 'Significant difference' if p_value < 0.05 else 'No significant difference'
}
return result
```
### Chi-Square Test
Use for categorical data:
```python
def perform_chi_square(contingency_table):
chi2, p_value, dof, expected = stats.chi2_contingency(contingency_table)
return {
'chi_square': chi2,
'p_value': p_value,
'degrees_of_freedom': dof,
'significant': p_value < 0.05
}
```
## Output Report Template
```markdown
# Data Analysis Report
## Executive Summary
[Key findings in 3-5 bullet points]
## Dataset Overview
- **Rows:** N
- **Columns:** M
- **Date Range:** YYYY-MM-DD to YYYY-MM-DD
- **Missing Data:** X%
## Key Findings
### Finding 1: [Title]
**Observation:** [What you found]
**Evidence:** [Statistics, charts]
**Implication:** [What it means]
### Finding 2: [Title]
[Repeat structure]
## Statistical Analysis
[Test results with interpretations]
## Visualizations
[Include generated charts]
## Recommendations
1. [Action based on finding 1]
2. [Action based on finding 2]
## Methodology
[Brief description of analysis approach]
## Limitations
[Note any data quality issues or assumptions]
```
## Quality Checks
Before finalizing analysis:
- [ ] All missing data handled
- [ ] Outliers investigated
- [ ] Visualizations clear and labeled
- [ ] Statistical tests appropriate
- [ ] Findings supported by data
- [ ] Limitations documentedBest Practices for Skill Development
- Start with clear business requirements
- Define success criteria before building
- Include comprehensive examples in SKILL.md
- Provide both automated and manual steps
- Document limitations explicitly
- Include quality assurance checklists
- Maintain audit trails for compliance
- Version control all skill components
- Test with real data before deployment
- Gather user feedback continuously
Coming Up Next
You now have production-ready implementations for four common use cases. In Part 8, the final installment of this series, we will explore troubleshooting and optimization techniques including debugging skills, performance tuning, monitoring strategies, and continuous improvement workflows.
References
- Lee Han Chung - "Claude Agent Skills: A First Principles Deep Dive" (https://leehanchung.github.io/blogs/2025/10/26/claude-skills-deep-dive/)
- Claude Blog - "Introducing Agent Skills" (https://claude.com/blog/skills)
- Anthropic Engineering Blog - "Equipping agents for the real world with Agent Skills" (https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills)
- Claude Code Docs - "Extend Claude with skills" (https://code.claude.com/docs/en/skills)
- Skywork AI - "Claude Skills Explained: Where They Run and How They Work" (https://skywork.ai/blog/ai-agent/claude-skills-explained-where-they-run/)
- Claude Skills - "Agent Skills Cases" (https://www.claudeskills.org/docs/skills-cases)
- GitHub - VoltAgent/awesome-claude-code-subagents (https://github.com/VoltAgent/awesome-claude-code-subagents)
