组件元数据 / LLM v0

每个公开组件具备结构化元数据(名称、layer、props、scenes、antipatterns 等),供后续 LLM 文件与 Agent 选型。

读取

包内导出:

import { componentMetaList } from '@kotodama/lego-react';
// 或
import { componentMetaList } from '@kotodama/lego-react/meta';

构建产物(机器可读):

  • @kotodama/lego-react/meta/components.json — 简要清单
  • @kotodama/lego-react/meta/llm/components.json — 完整 ComponentMeta[]
  • @kotodama/lego-react/meta/llm/components.yaml — 同内容 YAML

文档站静态副本(构建后):/ui/meta/llm/components.json(若已拷贝到 doc_build)。

Schema 字段

字段 说明
name 组件名
layer infra | primitive | pattern | block
description 一句话能力
props 公开 props 名列表
scenes admin / marketing / brand / mobile
antipatterns 反模式(可选)
i18nKeys 文案 key(可选)
configurable 可被 ConfigProvider 覆盖的 props(可选)

覆盖率门禁:MVP 组件元数据 ≥ 80%(pnpm check:meta-coverage)。