automattic/taxonomist
Analyze and optimize a WordPress site's category taxonomy. Exports all posts, uses AI to suggest an improved category structure — merging duplicates, retiring dead categories, creating missing ones, writing descriptions, and re-categorizing posts. Run this when the user wants to clean up or improve their categories.
npx skills add https://github.com/Automattic/studio --skill taxonomist
AI-powered WordPress category taxonomy optimizer. Analyzes every post on a WordPress site and suggests an improved category structure — merging duplicates, retiring dead categories, creating missing ones, and re-categorizing posts.
Based on Taxonomist by Matt Mullenweg.
When the user invokes this skill, introduce yourself:
> Welcome to Taxonomist! I'll analyze your WordPress categories and suggest improvements — merging duplicates, retiring dead categories, creating missing ones, and re-categorizing your posts using AI.
>
> Everything is safe: I'll preview all changes before doing anything, and log every modification so it can be reversed. Nothing touches your site until you approve it.
Then identify the target site. If there's only one local Studio site, use it automatically. If there are multiple, ask which one to analyze.
Before anything else, call the install_taxonomy_scripts tool with the target site to set up the PHP scripts.
This skill operates through an interactive, step-by-step process on a local Studio site:
Steps 1-6 require NO write access to the site. The site is only modified after explicit user approval.
All data files go in a taxonomist-data/ directory inside the site root:
{site_path}/taxonomist-data/
├── export/
│ ├── posts.json # Exported posts with full content
│ └── categories.json # Current category list
├── batches/
│ ├── batch-000.json # Posts split into analysis batches
│ ├── batch-001.json
│ └── ...
├── results/
│ ├── batch-000-results.json
│ └── ...
├── backups/
│ └── pre-analysis-{timestamp}.json
└── logs/
└── changes-{timestamp}.tsv
site_list to find available sitessite_info to verify the site is runningsite_startwp_cli with eval 'echo "OK";'Create the working directory structure, then export posts and categories.
Use wp_cli:
term list category --format=json --fields=term_id,name,slug,description,count,parent
Save the output to taxonomist-data/export/categories.json.
Use wp_cli:
eval-file tmp/taxonomist/export-posts.php
With the environment variable:
TAXONOMIST_OUTPUT={site_path}/taxonomist-data/export/posts.json
Report to the user:
Create a full taxonomy snapshot before any analysis.
Use wp_cli:
eval-file tmp/taxonomist/backup.php
With the environment variable:
TAXONOMIST_OUTPUT={site_path}/taxonomist-data/backups/pre-analysis-{timestamp}.json
Split exported posts into batches and analyze each batch with a sub-agent.
Read taxonomist-data/export/posts.json and split into batch files of ~20-50 posts each (adjust based on average post length — aim for batches that fit within a single agent context). Write each batch to taxonomist-data/batches/batch-NNN.json.
For each batch, spawn a sub-agent (use the Agent tool with model "haiku" for efficiency) with this prompt:
> Analyze these blog posts and suggest optimal category assignments.
>
> Existing categories: {list from categories.json with slugs}
>
> Instructions:
> - Read the FULL content of each post, not just the title
> - Suggest 1-3 categories per post using category slugs (not display names)
> - Prefer existing categories over creating new ones
> - Only propose a new category if the topic is genuinely unserved AND would apply to multiple posts
> - Avoid generic catch-alls like "Uncategorized" or "General"
> - For each post, provide a confidence level: "high", "medium", or "low"
>
> Output format (JSON array):
> `json
> [
> {
> "post_id": 123,
> "cats": ["wordpress", "ai"],
> "new_cats": [],
> "confidence": "high"
> }
> ]
> `
>
> If proposing a new category, add it to new_cats with a suggested slug and name:
> `json
> "new_cats": [{"slug": "machine-learning", "name": "Machine Learning"}]
> `
>
> Batch data:
> {batch JSON content}
Save each sub-agent's output to taxonomist-data/results/batch-NNN-results.json.
After all batches complete:
taxonomist-data/results/aggregated.jsonPresent a single comprehensive table showing the recommended action for every category:
| Category | Posts | Action | Description |
|----------|-------|--------|-------------|
| WordPress | 142 | Keep | Articles about WordPress development, plugins, and the WordPress ecosystem |
| Tech | 89 | Keep | Technology industry news, trends, and analysis |
| Asides | 34 | Retire → merge into "Notes" | Short-form posts and quick thoughts |
| Uncategorised | 23 | Retire → re-categorize | Posts to be assigned proper categories |
| Machine Learning | — | Create | Posts about ML, neural networks, and AI model training |
Include:
Then show the full dry run — a table of every post that would change, showing old categories → new categories.
CRITICAL: You MUST use the AskUserQuestion tool here to get explicit approval before proceeding. Do NOT continue to Step 7 without the user's explicit "yes" or approval.
Present the plan, then use AskUserQuestion with options like:
If the user wants adjustments, iterate on the plan and use AskUserQuestion again for each revision until they approve.
After approval, first create any new categories and update descriptions using wp_cli:
# Create new categories
term create category "Category Name" --slug=category-slug --description="Description here"
# Update existing category descriptions
term update category {term_id} --description="Updated description"
Prepare the suggestions JSON file from the approved plan, then run the apply script.
First, do a preview (dry run) using wp_cli:
eval-file tmp/taxonomist/apply-changes.php
With environment variables:
TAXONOMIST_SUGGESTIONS={site_path}/taxonomist-data/results/suggestions.json
TAXONOMIST_LOG={site_path}/taxonomist-data/logs/changes-{timestamp}.tsv
TAXONOMIST_MODE=preview
Show the user the preview results. Use AskUserQuestion to confirm before applying. After they confirm, run again with:
TAXONOMIST_SUGGESTIONS={site_path}/taxonomist-data/results/suggestions.json
TAXONOMIST_LOG={site_path}/taxonomist-data/logs/changes-{timestamp}.tsv
TAXONOMIST_MODE=apply
TAXONOMIST_REMOVE_CATS=uncategorized
After applying changes:
wp_cli: term list category --format=table --fields=term_id,name,slug,counteval 'echo count(get_posts(["posts_per_page" => -1, "category__in" => [get_option("default_category")]]));'If the user wants to undo all changes, use wp_cli:
eval-file tmp/taxonomist/restore.php
With environment variable:
TAXONOMIST_BACKUP={site_path}/taxonomist-data/backups/pre-analysis-{timestamp}.json
site_list, site_info, site_start, wp_cli, etc.) — not shell commandswp_cli: option update default_category {new_id} if neededtaxonomist-data/ directoryTake automattic/taxonomist from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.