Taxonomy unification

From XuShuwenn/RedAct · View interactive version

Taxonomy unification is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Build, balance, and validate a unified 5-level taxonomy from multiple heterogeneous category hierarchies.

How to use this skill

Skill file

Unified Taxonomy Construction and Validation

A reusable workflow to merge multiple e-commerce (or similar) category taxonomies into one 5-level hierarchy that is balanced, consistently named, and suitable for cross-source analytics.

When to Use

Use this skill when you need to:

Core Workflow

Follow these phases end-to-end. Do not finalize until verification passes.

Phase 0 — Inputs and Expectations

Phase 1 — Load and Standardize Inputs

Phase 2 — Canonical Tokenization and Signatures

Phase 3 — Candidate Top-Level (Level 1) Design

1) Lightweight TF-IDF + KMeans/MinibatchKMeans over unique full paths or top segments; sweep K in [10, 20], select by silhouette/Calinski-Harabasz and coverage.

2) Embeddings (if available) + hierarchical clustering; cache embeddings for unique strings only; batch to avoid bottlenecks; persist cache for reruns.

Phase 4 — Recursive Clustering (Levels 2–5)

Phase 5 — Category Naming

Phase 6 — Even Source Distribution

Phase 7 — Produce Outputs

Verification

Success criteria (use the provided validator to check):

Run validator:

Common Pitfalls and How to Avoid Them

Optional Script Usage

Use the validator to confirm structural and naming compliance and to diagnose where to refine clustering or naming.

Examples:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.