Initial commit
This commit is contained in:
12
.claude-plugin/plugin.json
Normal file
12
.claude-plugin/plugin.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# csv-url-parser
|
||||
|
||||
A plugin skill that parses URLs in CSV files and extracts query parameters as new columns
|
||||
45
plugin.lock.json
Normal file
45
plugin.lock.json
Normal file
@@ -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": []
|
||||
}
|
||||
}
|
||||
68
skills/SKILL.md
Normal file
68
skills/SKILL.md
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user