From 5e3fa00dc5a2fe2388de766a2e92414f562c49f5 Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sat, 29 Nov 2025 18:26:47 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 12 +++++++ README.md | 3 ++ plugin.lock.json | 45 +++++++++++++++++++++++++ skills/SKILL.md | 68 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 128 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 plugin.lock.json create mode 100644 skills/SKILL.md diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..772667b --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "csv-url-parser", + "description": "A plugin skill that parses URLs in CSV files and extracts query parameters as new columns", + "version": "1.0.0", + "author": { + "name": "Steven Wu", + "email": "steven@feedmob.com" + }, + "skills": [ + "./skills/SKILL.md" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..84627e8 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# csv-url-parser + +A plugin skill that parses URLs in CSV files and extracts query parameters as new columns diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..c430fa8 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,45 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:feed-mob/claude-code-marketplace:plugins/csv-url-parser", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "f37beab351c608fe239d2a8ed0298d3d07503c95", + "treeHash": "f3ee500f892875be6d1da76a8928d6d76fca48519d75b44065ad5141a557148c", + "generatedAt": "2025-11-28T10:16:52.168146Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "csv-url-parser", + "description": "A plugin skill that parses URLs in CSV files and extracts query parameters as new columns", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "48d977f9efb235dd44a3a677924af2bdf60b81a785b6c138034d2a2c6acf302a" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "c2659d3528c99a6da95c8756b83dc85bec85f6b0bd30b94fd7cbab2ff9ac7605" + }, + { + "path": "skills/SKILL.md", + "sha256": "e2e3976f9ec3b2f4807c714f15314edaac85ccfdc4fa8ef70aad6d9be5935f9e" + } + ], + "dirSha256": "f3ee500f892875be6d1da76a8928d6d76fca48519d75b44065ad5141a557148c" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skills/SKILL.md b/skills/SKILL.md new file mode 100644 index 0000000..327389f --- /dev/null +++ b/skills/SKILL.md @@ -0,0 +1,68 @@ +--- +name: csv-url-parser +description: Parse URLs in CSV files and extract query parameters as new columns. Use when working with CSV files containing URLs that need parameter extraction and analysis. +allowed-tools: Read, Write, Bash, Glob +--- + +# CSV URL Parser + +This skill extracts query parameters from URLs in CSV files and adds them as new columns. + +## Instructions + +1. **Identify CSV files**: Look for CSV files in the current directory or specified path +2. **Analyze URL column**: Find the column containing URLs (looks for 'url' or 'URL' headers) +3. **Extract parameters**: Parse all query parameters from URLs +4. **Create new columns**: Add parameter names as new column headers +5. **Process data**: Fill new columns with parameter values (multiple values joined with '|') +6. **Save results**: Update the CSV file with new columns + +## Implementation + +The skill uses Ruby to process CSV files. Run the processing script: + +```bash +ruby scripts/process_csv.rb [file1.csv file2.csv ...] +``` + +If no files are specified, it processes all CSV files in the current directory. + +The script will: + +- Read CSV files with headers +- Extract query parameters from URLs using URI parsing +- Handle multiple values for the same parameter (joined with '|') +- Preserve original data while adding new parameter columns +- Handle malformed URLs gracefully + +For detailed examples, see [EXAMPLES.md](EXAMPLES.md). + +## Usage Examples + +**Process all CSV files in current directory:** +``` +Parse URLs in my CSV files +``` + +**Process specific CSV file:** +``` +Extract URL parameters from data.csv +``` + +**Analyze URL parameters:** +``` +Show me what parameters are in the URLs from this CSV +``` + +## Requirements + +- Ruby with standard libraries (CSV, URI, CGI) +- CSV files must have headers +- URL column should be named 'url' or 'URL' + +## Output + +- Original CSV file updated with new parameter columns +- Multiple parameter values separated by '|' +- Preserves all original data +- Handles empty/missing parameters gracefully