.claude/skills/file-processing/SKILL.md
Data file processing utilities for CSV, JSON, and text files. Provides helpers for reading, transforming, and validating structured data.
npx skillsauth add baidu-baige/loongflow file-processingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides utilities and guidance for building robust file processing applications.
Use this skill when your task involves:
project/
├── main.py # Entry point with CLI
├── file_reader.py # File I/O operations
├── data_processor.py # Core processing logic
├── validator.py # Data validation
├── config.py # Configuration constants
└── utils.py # Helper functions
def read_file_safely(filepath):
"""Read file with proper error handling"""
try:
if not os.path.exists(filepath):
raise FileNotFoundError(f"File not found: {filepath}")
with open(filepath, 'r', encoding='utf-8') as f:
return f.read()
except Exception as e:
print(f"Error reading file: {e}")
return None
import csv
def process_csv(input_file, output_file):
"""Process CSV with header detection"""
with open(input_file, 'r', encoding='utf-8') as f:
reader = csv.DictReader(f)
processed = []
for row in reader:
# Transform each row
processed_row = transform_row(row)
processed.append(processed_row)
# Write results
with open(output_file, 'w', encoding='utf-8') as f:
if processed:
writer = csv.DictWriter(f, fieldnames=processed[0].keys())
writer.writeheader()
writer.writerows(processed)
import json
def process_json(input_file, output_file):
"""Process JSON data"""
with open(input_file, 'r', encoding='utf-8') as f:
data = json.load(f)
# Process data (handle both list and dict)
processed = process_data(data)
with open(output_file, 'w', encoding='utf-8') as f:
json.dump(processed, f, indent=2, ensure_ascii=False)
import argparse
def main():
parser = argparse.ArgumentParser(description='File Processor')
parser.add_argument('input', help='Input file path')
parser.add_argument('output', help='Output file path')
parser.add_argument('--format', choices=['csv', 'json'], default='csv')
args = parser.parse_args()
process_file(args.input, args.output, args.format)
import glob
def process_directory(input_dir, output_dir, pattern='*.csv'):
"""Process all matching files in directory"""
files = glob.glob(os.path.join(input_dir, pattern))
for filepath in files:
filename = os.path.basename(filepath)
output_path = os.path.join(output_dir, f"processed_{filename}")
process_file(filepath, output_path)
def process_with_progress(items):
"""Process items with progress feedback"""
total = len(items)
for i, item in enumerate(items, 1):
process_item(item)
print(f"Progress: {i}/{total} ({i*100//total}%)", end='\r')
print() # New line when complete
When implementing file processing tasks, you have access to:
Read - Read file contentsWrite - Create new filesEdit - Modify existing filesGlob - Find files by patternBash - Run shell commands (e.g., wc -l, head)Always test your file processor with:
Task: "Create a CSV analyzer that calculates statistics"
Suggested Steps:
Recommended Structure:
csv_analyzer.py - Main programstats.py - Statistics calculationsreport_generator.py - Format outputFor more complex tasks, consider:
csv module for CSV handlingjson module for JSON operationspathlib for cross-platform file pathspandas for advanced data processing (if allowed)development
Code review and debugging assistant. Identifies bugs, performance issues, security vulnerabilities, and suggests optimizations.
tools
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------