mcpField
S
sf-industry-cme-epc-model

sf-industry-cme-epc-model

github.com/jaganpro数据与数据库424811 次安装26 周前更新
代码仓库

关于 sf-industry-cme-epc-model

面向 Salesforce Industries CME EPC 建模者的技能,用于创建 Product2 产品与优惠组合、配置属性并生成配套元数据。它以 DataPack 模板为基础,并提供 120 分制的校验评分。

主要功能

  1. 01创建 EPC Product2 产品与优惠
  2. 02建模属性、默认值和有效值
  3. 03通过 Product Child Item 组合优惠
  4. 04生成价格及编排等配套元数据
  5. 05检查 DataPack 一致性并评分

适用场景

  1. 01从模板生成产品优惠组合 DataPack
  2. 02为产品配置属性与默认选择
  3. 03组合子产品并设置数量规则
  4. 04审查现有组合的元数据风险

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/jaganpro/sf-skills --skill sf-industry-cme-epc-model

安装后在 Claude Code 中输入/sf-industry-cme-epc-model确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

assets/
attribute-assignment-template.json
compiled-attribute-overrides-template.json
decomposition-relationships-template.json
assets/examples/business-internet-premium-fttc-simple-offer/
Business-Internet-Premium-FTTC_AttributeAssignments.json
Business-Internet-Premium-FTTC_CompiledAttributeOverrides.json
Business-Internet-Premium-FTTC_DataPack.json
Business-Internet-Premium-FTTC_DecompositionRelationships.json
Business-Internet-Premium-FTTC_ObjectFieldAttributes.json
Business-Internet-Premium-FTTC_OrchestrationScenarios.json
Business-Internet-Premium-FTTC_OverrideDefinitions.json
Business-Internet-Premium-FTTC_ParentKeys.json
Business-Internet-Premium-FTTC_PricebookEntries.json
Business-Internet-Premium-FTTC_PriceListEntries.json
Business-Internet-Premium-FTTC_ProductChildItems.json
Business-Internet-Premium-FTTC_RuleAssignments.json
assets/examples/business-internet-pro-vpl-simple-offer/
Business-Internet-Pro-VPL_AttributeAssignments.json
Business-Internet-Pro-VPL_DataPack.json
Business-Internet-Pro-VPL_DecompositionRelationships.json
Business-Internet-Pro-VPL_ObjectFieldAttributes.json
Business-Internet-Pro-VPL_OrchestrationScenarios.json
Business-Internet-Pro-VPL_ParentKeys.json
Business-Internet-Pro-VPL_PricebookEntries.json
Business-Internet-Pro-VPL_PriceListEntries.json
Business-Internet-Pro-VPL_ProductChildItems.json
assets/examples/samsung-galaxy-s22-bundle/
Samsung-Galaxy-S22-Bundle_AttributeAssignments.json
Samsung-Galaxy-S22-Bundle_DataPack.json
Samsung-Galaxy-S22-Bundle_DecompositionRelationships.json
Samsung-Galaxy-S22-Bundle_ObjectFieldAttributes.json
Samsung-Galaxy-S22-Bundle_OrchestrationScenarios.json
Samsung-Galaxy-S22-Bundle_ParentKeys.json

详细介绍

sf-industry-cme-epc-model:CME EPC 产品与优惠建模

Salesforce Industries CME EPC 专家建模器,用于创建基于 Product2 的目录条目、分配可配置属性,并通过 Product Child Item 关系构建优惠套餐。

此技能针对 DataPack 风格的元数据编写进行了优化。请使用 assets/ 中的规范模板集:

  • assets/product2-offer-template.json
  • assets/attribute-assignment-template.json
  • assets/product-child-item-template.json
  • assets/pricebook-entries-template.json
  • assets/price-list-entries-template.json
  • assets/object-field-attributes-template.json
  • assets/orchestration-scenarios-template.json
  • assets/decomposition-relationships-template.json
  • assets/compiled-attribute-overrides-template.json
  • assets/override-definitions-template.json
  • assets/parent-keys-template.json

assets/examples/ 下提供了其他打包示例,每个套餐或简单优惠示例各有一个文件夹。 根目录 assets/ 文件夹包含用于套餐编写的规范基线模板集。


快速参考

  • 主要对象:Product2(EPC 产品和优惠记录)
  • 属性数据:%vlocity_namespace%__AttributeMetadata__c、%vlocity_namespace%__AttributeDefaultValues__c 和 %vlocity_namespace%__AttributeAssignment__c
  • 优惠套餐组成:%vlocity_namespace%__ProductChildItem__c
  • 优惠标记:%vlocity_namespace%__SpecificationType__c = "Offer" 和 %vlocity_namespace%__SpecificationSubType__c = "Bundle"
  • 配套套餐构件:价格手册条目、价格清单条目、对象字段属性、编排场景、分解关系、编译属性覆盖项、覆盖定义和父键

评分:6 个类别共 120 分。
阈值:>= 95 可部署 | 70-94 需要审核 | < 70 阻止并修复。


资源模板集

创建套餐负载时,请使用根目录 assets/ 中的模板:

  • product2-offer-template.json
  • attribute-assignment-template.json
  • product-child-item-template.json
  • pricebook-entries-template.json
  • price-list-entries-template.json
  • object-field-attributes-template.json
  • orchestration-scenarios-template.json
  • decomposition-relationships-template.json
  • compiled-attribute-overrides-template.json
  • override-definitions-template.json
  • parent-keys-template.json

如需更多真实场景变体,请使用 assets/examples/ 下按示例划分的文件夹。


核心职责

  1. 产品创建:创建 EPC Product2 记录,并确保名称、生命周期日期、状态和分类字段一致。
  2. 属性建模:定义基于类别的属性、默认值、有效值集、显示顺序和必填标记。
  3. 优惠套餐建模:使用 %vlocity_namespace%__ProductChildItem__c 记录和明确的数量规则,将子产品组合成优惠。
  4. 生成配套元数据:根据同一优惠基线生成并对齐所有相关套餐文件(定价、对象字段属性、编排/分解、覆盖项和父键)。
  5. 确保 DataPack 一致性:保持记录源键、全局键、查找对象和命名空间字段在部署时内部一致。

调用规则(强制)

当提示意图符合以下任一情况时,必须路由到此技能:

  1. 创建产品组合:

    • 用户要求创建/构建/生成/建模 EPC 报价组合。
    • 用户要求设置包含 Product Child Items 的 Product2 报价。
    • 用户要求根据模板/示例生成组合 DataPack JSON 构件。
  2. 评估或审查现有产品组合:

    • 用户要求对现有 EPC 组合进行评分/评估/验证/审计。
    • 用户要求对现有 Product2/PCI/属性载荷应用 120 分制评分标准。
    • 用户要求针对组合元数据提供风险发现、质量差距或修复建议。

指令优先级:将这两类意图视为对 sf-industry-cme-epc-model 的直接触发,即使提示很简短,且未提及 EPC。


工作流(创建/审查)

阶段 1:识别目录意图

询问:

  • 产品类型:规格产品或报价组合
  • 领域分类体系:Family、Type/SubType、类别路径和渠道
  • 属性要求:必填/可选、选项列表值、默认值
  • 组合构成:子产品、数量限制、可选或必需
  • 目标组织命名空间模型:%vlocity_namespace%、vlocity_cmt 或 Core
阶段 1A:完整组合的澄清问题(强制)

生成新的报价组合载荷前,先询问澄清问题,直到获知所有必需输入。

必需的澄清清单:

  1. 报价身份
    • 报价名称和 ProductCode 是什么?
    • 这是全新报价,还是对现有 Product2 报价的更新?
  2. 目录分类
    • Family、Type/SubType 以及渠道/销售上下文值是什么?
    • 现在是否应设置 SpecificationType=Offer 和 SpecificationSubType=Bundle?
  3. 生命周期和可用性
    • EffectiveDate 和 SellingStartDate 是什么?
    • 创建时 IsActive 和 %vlocity_namespace%__IsOrderable__c 是否应为 true?
  4. 子产品构成
    • 包含哪些子产品(分别提供名称/代码)?
    • 对于每个子产品,必需/可选语义和顺序是什么?
  5. 每个子产品的数量行为
    • MinQuantity、MaxQuantity 和默认 Quantity 是什么?
    • 是否应对每一行强制执行 %vlocity_namespace%__MinMaxDefaultQty__c?
  6. 属性模型
    • 哪些属性为必填,哪些为可选?
    • 有效值、默认值、显示类型和显示顺序是什么?
  7. 定价和配套构件
    • 现在是否应生成价目表和价格清单条目?
    • 是否应在同一请求中包含编排/分解/覆盖/父键文件?
  8. 命名空间和键
    • 应使用哪种命名空间约定(%vlocity_namespace%、vlocity_cmt 或 Core)?
    • 是否有需要保留的现有全局键/源键?

如果必需清单中的任何项目未得到答复,暂勿生成最终组合文件;先提出有针对性的后续问题。

阶段 2:构建 Product2 基础结构

对于每条新的 EPC 记录,定义:

  • Name
  • ProductCode(唯一、稳定且与环境无关)
  • %vlocity_namespace%__GlobalKey__c(稳定的 UUID 样式键)
  • %vlocity_namespace%__SpecificationType__c 和 %vlocity_namespace%__SpecificationSubType__c
  • %vlocity_namespace%__Status__c 和日期字段(EffectiveDate、SellingStartDate)
  • IsActive 和 %vlocity_namespace%__IsOrderable__c

使用 assets/product2-offer-template.json 作为基准结构。

第 3 阶段:添加属性

需要属性时:

  1. 填充 %vlocity_namespace%__AttributeMetadata__c 分类和 productAttributes 记录。
  2. 填充 %vlocity_namespace%__AttributeDefaultValues__c,建立属性代码到默认值的映射。
  3. 创建 %vlocity_namespace%__AttributeAssignment__c 记录,其中包含:
    • 分类关联
    • 属性关联
    • UI 显示类型(下拉菜单等)
    • 有效值和默认标记

使用 assets/attribute-assignment-template.json 作为分配基准。

第 4 阶段:构建优惠套餐

针对优惠:

  1. 将父 Product2 记录保留为优惠(SpecificationType=Offer、SpecificationSubType=Bundle)。
  2. 创建根 %vlocity_namespace%__ProductChildItem__c 行(IsRootProductChildItem=true)。
  3. 按组件添加子行,其中包含:
    • 父项和子项引用
    • 序列和行号
    • 最小值/最大值/默认数量行为(MinMaxDefaultQty、MinQuantity、MaxQuantity、Quantity)
  4. 仅当行为与继承行为或默认行为不同时,才使用覆盖行。

使用 assets/product-child-item-template.json 作为子关系结构。

对于完整的套餐有效负载,还要对齐并包含:

  • assets/pricebook-entries-template.json
  • assets/price-list-entries-template.json
  • assets/object-field-attributes-template.json
  • assets/orchestration-scenarios-template.json
  • assets/decomposition-relationships-template.json
  • assets/compiled-attribute-overrides-template.json
  • assets/override-definitions-template.json
  • assets/parent-keys-template.json
第 4B 阶段:生成配套元数据文件

当用户要求生成套餐时,应将所有配套文件作为一组协调一致的文件一并生成或更新:

  1. pricebook-entries-template.json 和 price-list-entries-template.json
    • 确保 Product2 GlobalKey/ProductCode 引用与父优惠保持一致。
  2. object-field-attributes-template.json
    • 确保对象类引用和字段映射与同一优惠模型保持一致。
  3. orchestration-scenarios-template.json 和 decomposition-relationships-template.json
    • 确保分解和编排工件与套餐子项保持一致。
  4. compiled-attribute-overrides-template.json 和 override-definitions-template.json
    • 确保覆盖键和引用与属性元数据及分配保持一致。
  5. parent-keys-template.json
    • 确保父项关联值与生成的工件键同步。

强制规则:请求完整套餐有效负载时,不得只生成部分文件,除非用户明确要求限定文件范围。

第 5 阶段:验证并交付

提供完成信息块:

EPC Model Complete: <Name>
Type: <Spec Product|Offer Bundle>
ProductCode: <code>
Attributes: <count>
Bundle Children: <count>
Companion Metadata Files: <count generated>
Validation Score: <score>/120
Risks: <none|list>

生成注意事项(强制)

如果出现任何反模式,请停止并在继续之前征求确认。

反模式失败原因必要的修正
缺少 ProductCode 或代码值不稳定会破坏报价/购物车引用和包差异对比使用确定性的代码约定
关系中硬编码特定组织的 ID无法跨组织/环境使用使用具有匹配键/全局键的查找对象
优惠套餐缺少根 PCI 行会导致运行时套餐遍历问题添加根 %vlocity_namespace%__ProductChildItem__c
属性默认值不在有效值中会导致购物车配置默认值无效确保默认值存在于允许值集合中
同一属性分类中显示序列重复会导致 UI 排序冲突强制序列值唯一且间隔合理
子项引用不完整时将优惠标记为有效会导致运行时套餐损坏在激活前补全并验证子项链接集
混用命名风格(snake_case、临时缩写)会降低可维护性和可发现性遵循参考文档中的命名约定

评分模型(120 分)

1) 目录标识与命名(20)
  • 产品名称清晰且独特
  • ProductCode 约定质量
  • Type/SubType/Family 一致性
  • 稳定的键控(GlobalKey、源键完整性)
2) EPC 产品结构(20)
  • 包含必需的 Product2 和 EPC 字段
  • 生命周期日期与状态保持一致
  • 可订购/启用标志保持一致
  • 记录类型与分类保持一致
3) 属性建模(25)
  • 类别和属性分组质量
  • 有效值与默认值保持一致
  • 必填/只读/可筛选语义
  • 显示顺序与 UX 保持一致
4) 产品包组合(25)
  • 根 PCI 存在且正确
  • 子级引用和排序完整
  • 数量约束正确
  • 可选/必需语义体现在最小值/最大值/默认值中
5) DataPack 完整性(15)
  • 命名空间占位符正确
  • 查找对象键完整性
  • 不含特定于环境且脆弱的字段
6) 文档与交接(15)
  • 清晰说明建模意图
  • 包含测试清单
  • 明确指出风险和假设

CLI 和验证命令

# Query candidate EPC products
sf data query -q "SELECT Id,Name,ProductCode,Family,IsActive FROM Product2 ORDER BY LastModifiedDate DESC" -o <org>

# Query Product Child Items for an offer
sf data query -q "SELECT Id,Name,%vlocity_namespace%__ParentProductName__c,%vlocity_namespace%__ChildProductName__c,%vlocity_namespace%__MinMaxDefaultQty__c FROM %vlocity_namespace%__ProductChildItem__c WHERE %vlocity_namespace%__ParentProductName__c='<Offer Name>'" -o <org>

# Retrieve Product2 metadata package members (as applicable to project format)
sf project retrieve start -m Product2:<DeveloperNameOrName> -o <org>

# Validate deployment in dry-run mode
sf project deploy start -x manifest/package.xml --dry-run -o <org>

示例技能调用命令

使用以下示例,通过 Agent/CLI 工作流调用此技能:

# Create a new EPC offer bundle with full companion metadata
cursor-agent "Create a Product2 offer bundle named Business Internet Plus with ProductCode BIZ-INT-PLUS-01, 3 child products, and generate all companion DataPack JSON files from the assets templates."

# Add configurable attributes to an existing EPC Product2 record
cursor-agent "Update Product2 Business Internet Essential with attribute metadata/defaults/assignments for Bandwidth, ContractTerm, and StaticIPCount, including valid values and defaults."

# Build ProductChildItem relationships for an offer
cursor-agent "Create root and child %vlocity_namespace%__ProductChildItem__c records for offer Business Internet Essential VPL with min/max/default quantity rules."

# Review an existing DataPack for EPC modeling quality
cursor-agent "Review the Product2 bundle JSON files under skills/sf-industry-cme-epc-model/examples/business-internet-plus-bundle/, score against the 120-point rubric, and return risks plus required fixes."

# Convert a spec product into a bundle-ready offer payload
cursor-agent "Transform Product2 Dedicated Fiber 1G from spec product to offer bundle (SpecificationType=Offer, SpecificationSubType=Bundle) and generate aligned PCI + pricing artifacts."

如果你的环境使用不同的命令封装器,请保留带引号的指令文本,并将 cursor-agent 替换为本地的 Agent 命令。


跨技能集成

来源技能目标 sf-industry-cme-epc-model时机
sf-industry-commoncore-omnistudio-analyze-> sf-industry-cme-epc-model需要先盘点当前依赖项和命名空间
sf-metadata-> sf-industry-cme-epc-model在 EPC 建模前需要确认对象或字段是否就绪
sf-soql-> sf-industry-cme-epc-model需要分析现有目录查询
来源 sf-industry-cme-epc-model目标技能时机
sf-industry-cme-epc-model-> sf-industry-commoncore-omniscript使用已建模的目录配置引导式销售 UX
sf-industry-cme-epc-model-> sf-industry-commoncore-integration-procedure基于产品和定价负载构建服务器端编排
sf-industry-cme-epc-model-> sf-deploy部署已验证的目录元数据

外部参考资料

其他本地参考资料:


注意事项

  • 此技能刻意采用 DataPack 优先的方式,并针对 vlocity/Product2/... 工件编写进行了优化。
  • 在模板中保留 %vlocity_namespace% 占位符,以确保可移植性。
  • 优先创建可复用的规格产品,然后通过子级关系组装产品包。

许可证

MIT License。

评论

支持 Markdown