design-taxonomy

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Design Taxonomy Command

分类体系设计命令

Design a taxonomy structure with terms, hierarchy, and classification rules.
设计包含术语、层级和分类规则的分类体系结构。

Usage

使用方法

bash
/cms:design-taxonomy Categories --type hierarchical
/cms:design-taxonomy Tags --type flat
/cms:design-taxonomy ProductFilters --type faceted
bash
/cms:design-taxonomy Categories --type hierarchical
/cms:design-taxonomy Tags --type flat
/cms:design-taxonomy ProductFilters --type faceted

Taxonomy Types

分类体系类型

  • flat: Simple tags with no hierarchy
  • hierarchical: Parent-child tree structure
  • faceted: Multi-dimensional classification
  • flat:无层级的简单标签
  • hierarchical:父子树状结构
  • faceted:多维分类

Workflow

工作流程

Step 1: Parse Arguments

步骤1:解析参数

Extract taxonomy name and type from the command.
从命令中提取分类体系名称和类型。

Step 2: Gather Requirements

步骤2:收集需求

Use AskUserQuestion for structured requirements gathering:
yaml
undefined
使用AskUserQuestion工具结构化收集需求:
yaml
undefined

Question 1: Taxonomy Scope (MCP: CMS taxonomy patterns)

Question 1: Taxonomy Scope (MCP: CMS taxonomy patterns)

question: "What is the primary purpose of this taxonomy?" header: "Purpose" options:
  • label: "Content Organization (Recommended)" description: "Categories for articles, pages, or documents"
  • label: "Product Filtering" description: "Faceted navigation for e-commerce catalogs"
  • label: "Navigation Structure" description: "Menu hierarchy and site sections"
  • label: "Tagging System" description: "Flexible labels for cross-cutting concerns"
question: "What is the primary purpose of this taxonomy?" header: "Purpose" options:
  • label: "Content Organization (Recommended)" description: "Categories for articles, pages, or documents"
  • label: "Product Filtering" description: "Faceted navigation for e-commerce catalogs"
  • label: "Navigation Structure" description: "Menu hierarchy and site sections"
  • label: "Tagging System" description: "Flexible labels for cross-cutting concerns"

Question 2: Hierarchy Depth (MCP: CLI best practices - scope selection)

Question 2: Hierarchy Depth (MCP: CLI best practices - scope selection)

question: "How deep should the taxonomy hierarchy be?" header: "Depth" options:
  • label: "Flat (Recommended)" description: "Single level - simple tags or labels"
  • label: "Shallow (2 levels)" description: "Parent-child structure for basic grouping"
  • label: "Deep (3+ levels)" description: "Full hierarchical tree for complex domains"

Use these responses to tailor taxonomy type and structure.
question: "How deep should the taxonomy hierarchy be?" header: "Depth" options:
  • label: "Flat (Recommended)" description: "Single level - simple tags or labels"
  • label: "Shallow (2 levels)" description: "Parent-child structure for basic grouping"
  • label: "Deep (3+ levels)" description: "Full hierarchical tree for complex domains"

根据收集到的响应调整分类体系的类型和结构。

Step 3: Invoke Skill

步骤3:调用技能

Invoke
taxonomy-architecture
skill with gathered requirements.
调用
taxonomy-architecture
技能并传入收集到的需求。

Step 4: Generate Taxonomy Design

步骤4:生成分类体系设计

Based on type:
Flat Taxonomy:
yaml
taxonomy:
  name: Tags
  type: flat
  settings:
    allow_multiple: true
    allow_new_terms: true
  terms:
    - name: Featured
    - name: Trending
    - name: Popular
Hierarchical Taxonomy:
yaml
taxonomy:
  name: Categories
  type: hierarchical
  max_depth: 3
  settings:
    allow_multiple: true
    required_parent: false
  terms:
    - name: Technology
      children:
        - name: Software
          children:
            - name: Web Development
            - name: Mobile Apps
        - name: Hardware
    - name: Business
      children:
        - name: Marketing
        - name: Finance
Faceted Taxonomy:
yaml
taxonomy:
  name: ProductFilters
  type: faceted
  facets:
    - name: Color
      terms: [Red, Blue, Green, Black, White]
    - name: Size
      terms: [Small, Medium, Large, XL]
    - name: Material
      terms: [Cotton, Polyester, Wool, Leather]
    - name: Price Range
      terms: [$0-25, $25-50, $50-100, $100+]
根据类型生成:
Flat Taxonomy:
yaml
taxonomy:
  name: Tags
  type: flat
  settings:
    allow_multiple: true
    allow_new_terms: true
  terms:
    - name: Featured
    - name: Trending
    - name: Popular
Hierarchical Taxonomy:
yaml
taxonomy:
  name: Categories
  type: hierarchical
  max_depth: 3
  settings:
    allow_multiple: true
    required_parent: false
  terms:
    - name: Technology
      children:
        - name: Software
          children:
            - name: Web Development
            - name: Mobile Apps
        - name: Hardware
    - name: Business
      children:
        - name: Marketing
        - name: Finance
Faceted Taxonomy:
yaml
taxonomy:
  name: ProductFilters
  type: faceted
  facets:
    - name: Color
      terms: [Red, Blue, Green, Black, White]
    - name: Size
      terms: [Small, Medium, Large, XL]
    - name: Material
      terms: [Cotton, Polyester, Wool, Leather]
    - name: Price Range
      terms: [$0-25, $25-50, $50-100, $100+]

Step 5: Generate Implementation

步骤5:生成实现代码

Provide EF Core model for the taxonomy:
csharp
public class Taxonomy
{
    public Guid Id { get; set; }
    public string Name { get; set; }
    public TaxonomyType Type { get; set; }
    public List<Term> Terms { get; set; }
}

public class Term
{
    public Guid Id { get; set; }
    public string Name { get; set; }
    public string Slug { get; set; }
    public Guid? ParentId { get; set; }
    public int SortOrder { get; set; }
}
提供用于分类体系的EF Core模型:
csharp
public class Taxonomy
{
    public Guid Id { get; set; }
    public string Name { get; set; }
    public TaxonomyType Type { get; set; }
    public List<Term> Terms { get; set; }
}

public class Term
{
    public Guid Id { get; set; }
    public string Name { get; set; }
    public string Slug { get; set; }
    public Guid? ParentId { get; set; }
    public int SortOrder { get; set; }
}

Related Skills

相关技能

  • taxonomy-architecture
    - Taxonomy patterns
  • content-type-modeling
    - Taxonomy fields
  • taxonomy-architecture
    - 分类体系模式
  • content-type-modeling
    - 分类体系字段