Install
openclaw skills install sfe-data-viewerSFE数据查询与分析工具,用于查询医药销售效能数据
openclaw skills install sfe-data-viewer本文件提供能力宪章 + 能力树 + 按需加载规则。详细参数与流程见各模块 openapi/ 与 examples/。
当前版本: v0.1
接口版本: 所有业务接口统一使用 /erp-open-api/* 前缀,通过 appKey 鉴权。
能力概览(2 块能力):
sfe-user:用户维度数据查询(区划、产品、客户、项目、任务、填报数据等13个接口)sfe-zone:区划维度数据查询(待办任务、计划、实际、采集数据等4个接口)统一规范:
cms-auth-skills/SKILL.mdcms-auth-skills/SKILL.md授权依赖:
appKey 时,先尝试读取 cms-auth-skills/SKILL.mdcms-auth-skills/SKILL.md 中的鉴权规则准备 appKeynpx clawhub@latest install cms-auth-skills --forcenpx clawhub@latest install https://github.com/spzwin/cms-auth-skills.git --force输入完整性规则(强制):
projectId(通过 project-summary 接口)zoneId 和 periodStart/periodEndtenantId 参数。如未传入,API 会返回可选择的租户列表,需让用户选择后再重新调用建议工作流(简版):
SKILL.md 与 cms-auth-skills/SKILL.md,明确能力范围、鉴权与安全约束。openapi/<module>/api-index.md。openapi/<module>/<endpoint>.md 获取入参/出参/Schema。examples/<module>/README.md 组织话术与流程。scripts/<module>/<endpoint>.py 执行接口调用,获取 TOON 编码后的结果。所有接口调用必须通过脚本执行,不允许跳过脚本直接调用 API。脚本使用规则(强制):
openapi/<module>/<endpoint>.md 都必须有对应的 scripts/<module>/<endpoint>.py,不允许"暂无脚本"。scripts/common/toon_encoder.py 编码后再输出,不允许直接输出原始 JSON。scripts/ 下的脚本均可脱离 AI Agent 直接在命令行运行。openapi/<module>/api-index.md。openapi/ 文档为准,脚本仅负责编排调用流程。cms-auth-skills/SKILL.md。--tenantId 可选参数,用于多租户场景。用户存在多个租户身份时须传入。意图路由与加载规则(强制):
api-index.md。宪章(必须遵守):
SKILL.md 只描述"能做什么"和"去哪里读",不写具体接口参数。SKILL.md + cms-auth-skills/SKILL.md,只有触发某模块时才加载该模块的 openapi、examples 与 scripts。api-index.md 仅做索引。模块路由与能力索引(合并版):
| 用户意图(示例) | 模块 | 能力摘要 | 接口文档 | 示例模板 | 脚本 |
|---|---|---|---|---|---|
| "查询我有权限的区划" | sfe-user | 查询用户授权的区划 | ./openapi/sfe-user/api-index.md | ./examples/sfe-user/README.md | ./scripts/sfe-user/zone.py |
| "查询我有权限的产品" | sfe-user | 查询用户授权的产品 | ./openapi/sfe-user/api-index.md | ./examples/sfe-user/README.md | ./scripts/sfe-user/product.py |
| "查询我有权限的客户" | sfe-user | 查询用户授权的客户 | ./openapi/sfe-user/api-index.md | ./examples/sfe-user/README.md | ./scripts/sfe-user/customer.py |
| "查询客户画像信息" | sfe-user | 查询客户画像标签 | ./openapi/sfe-user/api-index.md | ./examples/sfe-user/README.md | ./scripts/sfe-user/customer-profile.py |
| "查询覆盖分管关系" | sfe-user | 查询区划客户关联 | ./openapi/sfe-user/api-index.md | ./examples/sfe-user/README.md | ./scripts/sfe-user/coverage.py |
| "查询我的数据采集项目" | sfe-user | 查询项目摘要 | ./openapi/sfe-user/api-index.md | ./examples/sfe-user/README.md | ./scripts/sfe-user/project-summary.py |
| "查询项目的周期列表" | sfe-user | 查询项目周期 | ./openapi/sfe-user/api-index.md | ./examples/sfe-user/README.md | ./scripts/sfe-user/project-period.py |
| "查询项目的填报模板" | sfe-user | 查询项目模板 | ./openapi/sfe-user/api-index.md | ./examples/sfe-user/README.md | ./scripts/sfe-user/project-schema.py |
| "查询项目的角色权限" | sfe-user | 查询角色权限 | ./openapi/sfe-user/api-index.md | ./examples/sfe-user/README.md | ./scripts/sfe-user/project-role.py |
| "查询我的待办任务" | sfe-user | 查询待办任务状态 | ./openapi/sfe-user/api-index.md | ./examples/sfe-user/README.md | ./scripts/sfe-user/project-task.py |
| "查询我的计划编制数据" | sfe-user | 查询计划数据 | ./openapi/sfe-user/api-index.md | ./examples/sfe-user/README.md | ./scripts/sfe-user/project-plan.py |
| "查询我的实际结果数据" | sfe-user | 查询实际数据 | ./openapi/sfe-user/api-index.md | ./examples/sfe-user/README.md | ./scripts/sfe-user/project-actual.py |
| "查询我的采集填报数据" | sfe-user | 查询采集数据 | ./openapi/sfe-user/api-index.md | ./examples/sfe-user/README.md | ./scripts/sfe-user/project-general.py |
| "查询某个区划的待办任务" | sfe-zone | 按区划查任务 | ./openapi/sfe-zone/api-index.md | ./examples/sfe-zone/README.md | ./scripts/sfe-zone/project-task.py |
| "查询某个区划的计划数据" | sfe-zone | 按区划查计划 | ./openapi/sfe-zone/api-index.md | ./examples/sfe-zone/README.md | ./scripts/sfe-zone/project-plan.py |
| "查询某个区划的实际数据" | sfe-zone | 按区划查实际 | ./openapi/sfe-zone/api-index.md | ./examples/sfe-zone/README.md | ./scripts/sfe-zone/project-actual.py |
| "查询某个区划的采集数据" | sfe-zone | 按区划查采集 | ./openapi/sfe-zone/api-index.md | ./examples/sfe-zone/README.md | ./scripts/sfe-zone/project-general.py |
能力树(实际目录结构):
sfe-data-viewer/
├── SKILL.md
├── openapi/
│ ├── sfe-user/
│ │ ├── api-index.md
│ │ ├── zone.md
│ │ ├── product.md
│ │ ├── customer.md
│ │ ├── customer-profile.md
│ │ ├── coverage.md
│ │ ├── project-summary.md
│ │ ├── project-period.md
│ │ ├── project-schema.md
│ │ ├── project-role.md
│ │ ├── project-task.md
│ │ ├── project-plan.md
│ │ ├── project-actual.md
│ │ └── project-general.md
│ └── sfe-zone/
│ ├── api-index.md
│ ├── project-task.md
│ ├── project-plan.md
│ ├── project-actual.md
│ └── project-general.md
├── examples/
│ ├── sfe-user/README.md
│ └── sfe-zone/README.md
└── scripts/
├── common/toon_encoder.py
├── sfe-user/
│ ├── README.md
│ ├── zone.py
│ ├── product.py
│ ├── customer.py
│ ├── customer-profile.py
│ ├── coverage.py
│ ├── project-summary.py
│ ├── project-period.py
│ ├── project-schema.py
│ ├── project-role.py
│ ├── project-task.py
│ ├── project-plan.py
│ ├── project-actual.py
│ └── project-general.py
└── sfe-zone/
├── README.md
├── project-task.py
├── project-plan.py
├── project-actual.py
└── project-general.py