name: model-content description: 设计内容类型schema,包括字段、验证和关系。用于内容建模工作坊或快速schema设计。 argument-hint: <content-type-name> [–mode full|quick|guided] [–format yaml|json|csharp] allowed-tools: Read, Glob, Grep, Task, Skill, AskUserQuestion
Model Content 命令
设计一个内容类型schema,包括部分、字段和验证规则。
用法
/cms:model-content Article --mode guided
/cms:model-content Product --mode quick --format csharp
/cms:model-content Event --mode full
模式
- full: 完整工作坊,包含利益相关者问题
- quick: 快速schema生成,使用合理默认值
- guided: 交互式逐步字段定义
工作流程
步骤 1: 解析参数
从命令中提取内容类型名称和选项。
步骤 2: 基于模式执行
完整模式:
- 调用
cms-facilitator content-modeling代理进行工作坊 - 通过利益相关者问题收集需求
- 生成带有理由的综合schema
快速模式:
- 调用
content-type-modeling技能 - 为内容类型生成具有常见模式的schema
- 使用行业标准字段
引导模式:
- 使用 AskUserQuestion 进行字段逐一定义
- 询问每个字段的类型、验证和用途
- 增量构建schema
步骤 3: 生成输出
以请求格式生成内容类型定义:
- yaml: 人类可读规范
- json: API兼容schema
- csharp: EF Core 实体模型
步骤 4: 验证schema
- 验证必填字段是否存在
- 检查字段类型一致性
- 验证关系引用
- 确保遵循命名约定
输出示例
content_type:
name: Article
display_name: Article
description: 博客文章和新闻帖子
stereotype: Document
parts:
- name: TitlePart
built_in: true
- name: AutoroutePart
built_in: true
- name: ArticlePart
custom: true
fields:
- name: Body
type: HtmlField
required: true
editor: wysiwyg
- name: Excerpt
type: TextField
required: false
hint: 列表中的简短摘要
- name: FeaturedImage
type: MediaField
required: false
allowed_types: [image/*]
- name: Categories
type: TaxonomyField
taxonomy: categories
required: true
min: 1
- name: Tags
type: TaxonomyField
taxonomy: tags
required: false
- name: Author
type: ContentPickerField
content_types: [Author]
required: true
settings:
creatable: true
listable: true
draftable: true
versionable: true
相关技能
content-type-modeling- 内容类型模式dynamic-schema-design- EF Core JSON 列content-relationships- 字段关系