AI skills collection enhances Claude's capabilities with specialized knowledge, workflows, and tool integrations. Operations teams benefit from domain-specific expertise, streamlining processes and improving efficiency. Integrates with Python and supports Claude agents.
git clone https://github.com/julianromli/ai-skills.gitAI skills collection enhances Claude's capabilities with specialized knowledge, workflows, and tool integrations. Operations teams benefit from domain-specific expertise, streamlining processes and improving efficiency. Integrates with Python and supports Claude agents.
[{"step":"Install dependencies","action":"Run `pip install pandas requests` to install required packages. For CLI usage, ensure Python 3.9+ is installed."},{"step":"Prepare your input","action":"Gather the log file path (e.g., `/var/log/nginx/access.log`) and define your error threshold (minimum occurrences to flag an error)."},{"step":"Run the skill","action":"Execute the Python function or use the CLI command: `python log_parser.py /path/to/logs --threshold 5 --format json`. For Claude agents, integrate via the provided function wrapper."},{"step":"Review output","action":"Check the generated report (CSV/JSON) and recommendations. Use the `report_path` to access detailed error logs."},{"step":"Automate workflows","action":"Schedule the script via cron (Linux) or Task Scheduler (Windows) for regular log analysis. Use the logging output for audit trails."}]
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/julianromli/ai-skillsCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Create an AI skill for [SKILL_NAME] that automates [SPECIFIC_TASK] in [DOMAIN]. The skill should include: 1) A Python function or CLI command to execute the task, 2) Error handling for common edge cases, 3) Logging for audit trails, and 4) Integration instructions for Claude agents. Use [EXAMPLE_INPUT] as a reference for expected behavior.
```python
# AI Skill: Automated Log Parser for Web Server Errors
# Description: Parses Apache/Nginx logs to identify 5xx errors and generates a report with root causes.
# Dependencies: Python 3.9+, pandas, requests
import re
import pandas as pd
from datetime import datetime
import logging
logging.basicConfig(filename='log_parser.log', level=logging.INFO)
def parse_logs(log_file_path, error_threshold=5, output_format='csv'):
"""
Parses server logs to identify 5xx errors and generates a report.
Args:
log_file_path (str): Path to the server log file
error_threshold (int): Minimum occurrences to flag an error (default: 5)
output_format (str): Output format ('csv' or 'json')
Returns:
dict: Report with error details and recommendations
"""
try:
# Read and parse log file
with open(log_file_path, 'r') as f:
logs = f.readlines()
# Extract 5xx errors using regex
error_pattern = re.compile(r'HTTP/1.1" 5\d{2}')
errors = [line for line in logs if error_pattern.search(line)]
if not errors:
return {"status": "success", "message": "No 5xx errors found"}
# Process errors into DataFrame
df = pd.DataFrame(errors, columns=['raw_log'])
df['timestamp'] = df['raw_log'].str.extract(r'\[(.*?)\]')[0]
df['error_code'] = df['raw_log'].str.extract(r'HTTP/1.1" (5\d{2})')[0]
df['url'] = df['raw_log'].str.extract(r'"(.*?)"')[1]
# Group by error code and URL
error_summary = df.groupby(['error_code', 'url']).size().reset_index(name='count')
error_summary = error_summary[error_summary['count'] >= error_threshold]
if error_summary.empty:
return {"status": "success", "message": "No recurring 5xx errors found"}
# Generate recommendations
recommendations = []
for _, row in error_summary.iterrows():
if row['error_code'] == '500':
recommendations.append(f"Investigate internal server errors for {row['url']}")
elif row['error_code'] == '502':
recommendations.append(f"Check backend service health for {row['url']}")
elif row['error_code'] == '503':
recommendations.append(f"Review load balancer configuration for {row['url']}")
# Save output
timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')
if output_format == 'csv':
output_path = f'error_report_{timestamp}.csv'
error_summary.to_csv(output_path, index=False)
else:
output_path = f'error_report_{timestamp}.json'
error_summary.to_json(output_path, orient='records')
logging.info(f"Generated error report: {output_path}")
return {
"status": "success",
"report_path": output_path,
"error_summary": error_summary.to_dict('records'),
"recommendations": recommendations
}
except FileNotFoundError:
logging.error(f"Log file not found: {log_file_path}")
return {"status": "error", "message": "Log file not found"}
except Exception as e:
logging.error(f"Error processing logs: {str(e)}")
return {"status": "error", "message": str(e)}
# Example usage:
# result = parse_logs('/var/log/nginx/access.log', error_threshold=3, output_format='json')
# print(result)
```
**Example Output:**
```json
{
"status": "success",
"report_path": "error_report_20231115_143022.csv",
"error_summary": [
{"error_code": "500", "url": "/api/v1/users", "count": 8},
{"error_code": "502", "url": "/api/v1/products", "count": 12},
{"error_code": "503", "url": "/api/v1/orders", "count": 5}
],
"recommendations": [
"Investigate internal server errors for /api/v1/users",
"Check backend service health for /api/v1/products",
"Review load balancer configuration for /api/v1/orders"
]
}
```AI assistant built for thoughtful, nuanced conversation
IronCalc is a spreadsheet engine and ecosystem
ITIL-aligned IT service management platform
Customer feedback management made simple
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan