From 51ebc9cf3243a961fc916e31b4e5cba4b737c3d4 Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sat, 29 Nov 2025 17:55:04 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 16 ++ README.md | 3 + agents/data-parser.md | 47 ++++ agents/publishing-analyzer.md | 40 ++++ agents/topic-classifier.md | 41 ++++ agents/visualization-generator.md | 48 ++++ commands/audit-content.md | 349 ++++++++++++++++++++++++++++++ plugin.lock.json | 61 ++++++ 8 files changed, 605 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 agents/data-parser.md create mode 100644 agents/publishing-analyzer.md create mode 100644 agents/topic-classifier.md create mode 100644 agents/visualization-generator.md create mode 100644 commands/audit-content.md create mode 100644 plugin.lock.json diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..fb92442 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,16 @@ +{ + "name": "content-library-auditor", + "description": "Analyze WordPress XML, CMS JSON, or CSV exports for content insights. Publishing trends, author breakdowns, topic analysis, and interactive HTML reports with charts.", + "version": "1.0.0", + "author": { + "name": "Tim Metz @ Animalz", + "email": "contact@animalz.co", + "url": "https://animalz.co" + }, + "agents": [ + "./agents" + ], + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..4b03bb6 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# content-library-auditor + +Analyze WordPress XML, CMS JSON, or CSV exports for content insights. Publishing trends, author breakdowns, topic analysis, and interactive HTML reports with charts. diff --git a/agents/data-parser.md b/agents/data-parser.md new file mode 100644 index 0000000..6c1f76a --- /dev/null +++ b/agents/data-parser.md @@ -0,0 +1,47 @@ +--- +name: data-parser +description: Parses WordPress XML, JSON, and CSV content exports into structured data +model: sonnet +--- + +# Data Parser Agent + +Extract structured content data from CMS exports (WordPress XML, JSON, CSV). + +## Supported Formats + +### WordPress XML +Extract from `` elements: +- title, pubDate, dc:creator, category, content:encoded +- Parse dates to standard format +- Calculate word counts from content + +### JSON +Parse flexible schemas, looking for: +- Common field names (title/name, date/published/created_at, author/creator) +- Nested structures (data.posts, items, articles) +- Array or object formats + +### CSV +Parse with headers: +- Required: title, date, author +- Optional: category, tags, word_count, url, status + +## Output Format + +Return array of content objects: +```json +[ + { + "title": "Post Title", + "date": "2024-01-15", + "author": "Author Name", + "categories": ["Category 1"], + "word_count": 1500, + "url": "/post-slug", + "status": "published" + } +] +``` + +Sort by date (newest first). Report parsing stats to user. diff --git a/agents/publishing-analyzer.md b/agents/publishing-analyzer.md new file mode 100644 index 0000000..b7ecb8f --- /dev/null +++ b/agents/publishing-analyzer.md @@ -0,0 +1,40 @@ +--- +name: publishing-analyzer +description: Analyzes publishing trends, cadence, and author contributions +model: sonnet +--- + +# Publishing Analyzer Agent + +Analyze publishing patterns and author contributions from parsed content data. + +## Publishing Trends Analysis + +Calculate: +- Posts per month (group by year-month) +- Publishing frequency (posts/week, posts/month averages) +- Trend direction (increasing/decreasing %) +- Seasonal patterns +- Peak and low periods + +Present as time series with month-by-month breakdown. + +## Author Contribution Analysis + +For each author calculate: +- Total posts +- Percentage of total content +- Average post length +- Publishing frequency (posts/month) +- Active date range +- Recent activity (last 3 months) + +Rank authors by post count. Identify top contributors vs long-tail. + +## Output Format + +Markdown report with: +- Summary stats +- Month-by-month publishing table +- Author contribution rankings +- Key insights and trends diff --git a/agents/topic-classifier.md b/agents/topic-classifier.md new file mode 100644 index 0000000..423faa5 --- /dev/null +++ b/agents/topic-classifier.md @@ -0,0 +1,41 @@ +--- +name: topic-classifier +description: Analyzes content topics, categories, and identifies content gaps +model: sonnet +--- + +# Topic Classifier Agent + +Analyze topic distribution and identify content opportunities. + +## Category Analysis + +From provided content data: +- Count posts per category/tag +- Calculate percentages +- Identify most/least covered topics +- Find orphaned content (no category) + +## Topic Patterns + +Look for: +- Common category combinations +- Topic evolution over time (early vs recent) +- Emerging topics (growth in last 6 months) +- Declining topics (decreased coverage) + +## Content Gap Identification + +Identify opportunities: +- Underserved topics (<5 posts) that could be expanded +- Related topics covered but specific angles missing +- Competitor topics not covered (if competitive data provided) +- Seasonal gaps (topics not covered in certain periods) + +## Output Format + +Markdown with: +- Topic distribution table +- Top 10 categories +- Content gap analysis +- Recommendations for content opportunities diff --git a/agents/visualization-generator.md b/agents/visualization-generator.md new file mode 100644 index 0000000..249d598 --- /dev/null +++ b/agents/visualization-generator.md @@ -0,0 +1,48 @@ +--- +name: visualization-generator +description: Creates interactive HTML reports with Chart.js visualizations +model: sonnet +--- + +# Visualization Generator Agent + +Generate interactive HTML reports with charts for content audit data. + +## Charts to Generate + +### 1. Publishing Trends (Line Chart) +- X-axis: Months +- Y-axis: Post count +- Show 12-24 month trend + +### 2. Author Contributions (Bar Chart) +- X-axis: Author names (top 10) +- Y-axis: Post count +- Sorted by count descending + +### 3. Topic Distribution (Pie Chart) +- Categories/topics +- Show percentages +- Top 8 categories + "Other" + +### 4. Content Length Distribution (Histogram) +- Word count ranges (0-500, 500-1000, 1000-1500, etc.) +- Post count per range + +## HTML Structure + +Create self-contained HTML file with: +- Embedded CSS (clean, professional styling) +- Chart.js from CDN +- Navigation sections +- Print-friendly styles +- Responsive design + +## Data Tables + +Include interactive sortable tables for: +- All posts (title, date, author, category, word count) +- Author stats (name, posts, avg length, period) +- Category stats (name, count, percentage) + +Save to `reports/[name]-audit.html` diff --git a/commands/audit-content.md b/commands/audit-content.md new file mode 100644 index 0000000..1d023d0 --- /dev/null +++ b/commands/audit-content.md @@ -0,0 +1,349 @@ +--- +description: Comprehensive content library analysis from CMS export files +argument-hint: [export-file] [--format] [--output-html] +--- + +# Audit Content Library + +Analyze WordPress XML, CMS JSON, or CSV exports to reveal publishing trends, author contributions, topic distribution, and content opportunities. + +## Step 1: Detect and Parse Export File + +**Read export file ($1):** +- Auto-detect format (XML/JSON/CSV) unless --format specified +- Validate file structure +- Count total items (posts, pages, etc.) + +**Report to user:** +```markdown +## 📁 Content Export Detected + +**File:** $1 +**Format:** [WordPress XML / JSON / CSV] +**Items found:** [number] posts/pages +**Date range:** [earliest] to [latest] +**File size:** [size] + +Would you like to proceed with analysis? +``` + +**Wait for user confirmation.** + +--- + +## Step 2: Parse Content Data + +Use **data-parser** agent to extract: + +**For all formats:** +- Post titles +- Publication dates +- Authors +- Categories/tags +- Post length (word count) +- Status (published/draft) +- URLs/slugs + +**Format-specific:** + +**WordPress XML:** +```xml + + Post Title + Date + Author + Category + Body content + +``` + +**JSON:** +```json +{ + "title": "Post Title", + "date": "2024-01-15", + "author": "Name", + "categories": ["cat1", "cat2"], + "content": "Body..." +} +``` + +**CSV:** +```csv +title,date,author,category,word_count +"Post Title","2024-01-15","Author","Category",1500 +``` + +**Progress report:** +``` +🔄 Parsing content... +- ✅ Posts extracted: [number] +- ✅ Authors identified: [number] +- ✅ Date range: [range] +- ✅ Categories: [number] +``` + +--- + +## Step 3: Analyze Publishing Trends + +Use **publishing-analyzer** agent to calculate: + +**Publishing Cadence:** +- Posts per month (last 6, 12, 24 months) +- Publishing frequency trends (increasing/decreasing) +- Seasonal patterns +- Content velocity + +**Present to user:** +```markdown +## 📊 Publishing Trends + +### Overall Stats +- Total posts: [number] +- Active period: [months/years] +- Average: [X] posts/month +- Trend: [Increasing 15% / Stable / Decreasing 10%] + +### Recent Performance (Last 6 months) +- [Month]: [count] posts +- [Month]: [count] posts +[etc...] + +### Publishing Patterns +- Peak month: [month] ([count] posts) +- Lowest month: [month] ([count] posts) +- Most active day: [day of week] + +Would you like to continue with author and topic analysis? +``` + +**Wait for user approval.** + +--- + +## Step 4: Author Contribution Breakdown + +Use **publishing-analyzer** agent to: + +**Calculate per author:** +- Total posts +- Percentage of total content +- Publishing frequency +- Average post length +- Active period (first to last post) + +**Present breakdown:** +```markdown +## ✍️ Author Contributions + +**Total authors:** [number] + +### Top Contributors + +#### 1. [Author Name] +- **Posts:** [number] ([percentage]% of total) +- **Avg length:** [words] words +- **Active:** [date range] +- **Cadence:** [X] posts/month + +#### 2. [Author Name] +[Same format...] + +--- + +### Long-tail Contributors +- [number] authors with 1-5 posts ([percentage]% of total) + +Continue to topic analysis? +``` + +--- + +## Step 5: Topic & Category Analysis + +Use **topic-classifier** agent to: + +**Analyze categories/tags:** +- Distribution by category +- Most/least covered topics +- Topic combinations +- Content gaps + +**Present analysis:** +```markdown +## 🏷️ Topic Distribution + +### By Category +1. [Category 1]: [count] posts ([percentage]%) +2. [Category 2]: [count] posts ([percentage]%) +[etc...] + +### Topic Insights +- **Most covered:** [topic] ([count] posts) +- **Underserved:** [topics with <5 posts] +- **Emerging:** [topics showing growth] + +### Content Opportunities +- [Gap 1]: Only [X] posts, could expand +- [Gap 2]: [Related topics] covered, but [specific angle] missing + +Proceed to generate report? +``` + +--- + +## Step 6: Generate Reports + +**Ask user for output preference:** +``` +📊 Report Format + +Choose output format: +1. Terminal view (ASCII charts) - Quick review +2. Markdown file - For documentation +3. HTML report - Interactive charts (recommended) +4. All formats + +Which would you like? +``` + +### Terminal View (ASCII Charts) + +``` +Publishing Trends (Last 12 Months) +═══════════════════════════════════ +Jan 2024 ████████░░ 12 posts +Feb 2024 ██████░░░░ 9 posts +Mar 2024 ███████████ 15 posts +[etc...] + +Top Authors +═══════════════════════════════════ +Alice Smith ████████████████ 45 posts (35%) +Bob Johnson ██████████░░░░░░ 28 posts (22%) +[etc...] +``` + +### Markdown Report + +Save to `reports/[filename]-audit.md`: +```markdown +# Content Audit Report + +**Analyzed:** [date] +**Source:** [filename] +**Period:** [date range] + +## Executive Summary +[Key findings] + +## Metrics +[Full breakdowns] +``` + +### HTML Report (with Charts) + +Use **visualization-generator** agent to create: +- Line chart: Publishing trends +- Bar chart: Author contributions +- Pie chart: Topic distribution +- Interactive data tables + +Save to `reports/[filename]-audit.html` + +--- + +## Step 7: Deliver Results + +**Report completion:** +```markdown +## ✅ Content Audit Complete! + +**Analysis period:** [date range] +**Total content:** [number] posts +**Authors:** [number] +**Categories:** [number] + +### Key Findings +- [Finding 1] +- [Finding 2] +- [Finding 3] + +### Reports Generated +- Terminal summary: [displayed above] +- Markdown: reports/[name]-audit.md +- HTML: reports/[name]-audit.html (open in browser) + +### Recommended Actions +1. [Action based on findings] +2. [Action based on findings] +3. [Action based on findings] + +**Next steps:** +- Use `/publishing-trends` for deeper time-series analysis +- Use `/topic-analysis` to explore specific categories +``` + +--- + +## Usage Examples + +```bash +# WordPress export +/audit-content wordpress-export.xml --output-html + +# JSON export from headless CMS +/audit-content content-export.json + +# CSV from analytics +/audit-content content-metrics.csv --format csv + +# With specific output format +/audit-content export.xml --format wordpress --output markdown +``` + +--- + +## Supported Formats + +| Format | Auto-detect | Notes | +|--------|-------------|-------| +| **WordPress XML** | ✅ | Standard WP export | +| **JSON** | ✅ | Any CMS JSON with title/date/author fields | +| **CSV** | ✅ | Must have title,date,author columns minimum | +| **Custom** | Specify with --format | Provide field mapping | + +--- + +## Tips for Best Results + +### Export Best Practices + +**WordPress:** +1. Tools → Export → All content +2. Download XML file +3. Run audit + +**Headless CMS:** +- Export with all metadata (author, dates, categories) +- Include content body for word count analysis +- JSON or CSV format preferred + +**Analytics Export:** +- Include title, publish date, author, URL +- CSV works well for this + +### Data Quality + +✅ **Ensure export includes:** +- Publication dates (for trend analysis) +- Author names (for contribution breakdown) +- Categories/tags (for topic analysis) +- Content/word count (for depth analysis) + +❌ **Watch out for:** +- Drafts mixed with published (can filter) +- Inconsistent date formats +- Missing author attribution +- Incomplete exports (verify date range) diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..e05f4f5 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,61 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:animalzinc/claude-plugins:plugins/content-library-auditor", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "1639f6ff1104f62ad5806e0b41e37389b9436bbc", + "treeHash": "a643e040db0ad7a59e0313da3833a23d2a0088bc293cc5411fcef7420c352e22", + "generatedAt": "2025-11-28T10:13:44.713884Z", + "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": "content-library-auditor", + "description": "Analyze WordPress XML, CMS JSON, or CSV exports for content insights. Publishing trends, author breakdowns, topic analysis, and interactive HTML reports with charts.", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "ab40de72915f51fb86c1abf8fab3edd5b7ffb8df4346e28ca5fcfecbada87293" + }, + { + "path": "agents/topic-classifier.md", + "sha256": "e764a2981b138b75557bbcb05cee694da147a7c49c0fb285a55a572faa813e44" + }, + { + "path": "agents/publishing-analyzer.md", + "sha256": "e91af534d5de343cfde4a51508d412e6e86fcfeecb4aee7daaf9eca65c60e0ff" + }, + { + "path": "agents/visualization-generator.md", + "sha256": "b34165e2be69c9973dd3c55434b1810d90f868d0ef6ea397d66b2ab85cc8bc0c" + }, + { + "path": "agents/data-parser.md", + "sha256": "30d2dc02e91159694c1793f9b2f8d96a9fb940f5a31661c5d0bb7c4c3fbb99f8" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "c08af0761f354fc45ff3829977b73381ab5bd1e400b75c3c1eded235a7bd4a66" + }, + { + "path": "commands/audit-content.md", + "sha256": "b28a273a26dd62a6286df37356b00f97f450dee70bcff78b7b5512ed1f68cf9b" + } + ], + "dirSha256": "a643e040db0ad7a59e0313da3833a23d2a0088bc293cc5411fcef7420c352e22" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file