技能圖譜SKILLSGROVE
技能圖譜/辦公文件/sxd007/investigation-ontology/order-execution-variance-analysis

order-execution-variance-analysis

安裝

$npx skills add https://github.com/sxd007/investigation-ontology --skill order-execution-variance-analysis
$git clone --depth 1 https://github.com/sxd007/investigation-ontology.git /tmp/investigation-ontology && mkdir -p ~/.claude/skills && cp -r /tmp/investigation-ontology/plugins/investigation-ontology/skills/order-execution-variance-analysis ~/.claude/skills/order-execution-variance-analysis
請幫我安裝這個 Agent Skill:https://github.com/sxd007/investigation-ontology/tree/605fcb0ea0fd7ef29d048e5357305061c354bcc0/plugins/investigation-ontology/skills/order-execution-variance-analysis ,先閱讀它的 SKILL.md 和指令碼,確認安全後再安裝到我的技能目錄。

簡介

原文描述 · Apache-2.0项目执行差异分析 — 多维度对比合同流、货物流、资金流的申报记录与实际执行记录,输出链路对比可视化HTML与结构化差异报告。适用于渠道舞弊、采购舞弊、虚构交易等多类场景。
以下 SKILL.md 內容轉載自 sxd007/investigation-ontology(提交 605fcb0),依據 Apache-2.0 許可證轉載正文(文字未改動;僅省略檔案頭後設資料、將圖片顯示為連結,超長內容會截斷);版權歸 owner or entity authorized by 所有。許可證:LICENSE。僅展示說明檔案,附帶指令碼請在原倉庫檢視。

订单执行差异分析

将企业系统内的申报记录与调查获取的实际执行记录进行结构化对比,识别差异并输出可视化分析报告。本技能不绑定任何具体舞弊场景,是跨领域的通用分析工具。

配置前置检查

在执行本技能的业务操作前,按以下流程检查用户配置:

检查 {配置路径}/team-profile.md
├── 不存在 / 含 [PLACEHOLDER] / 含 PAUSED 标记
│   └── 自动进入 /efio:cold-start 配置向导,完成后继续当前操作
└── 配置就绪 → 继续

详细规则参见 config-templates/config-loader.md。

此技能当前无需读取特定配置项,仅检查配置就绪状态。

When to Activate

同时满足以下条件时激活:

  1. 可获取申报记录:能从企业系统(ERP、订单系统、售后系统等)获取项目在申报阶段的完整链路信息,或由调查员完整提供
  2. 可获取实际执行记录:调查已取得各级下游链路的真实执行凭证——包括各级合同、发票、签收单、付款记录等,或调查员整理提供
  3. 需要系统化对比:申报链路与实际链路之间的差异不是单点的,涉及多环节、多维度

典型场景:渠道链路核查、采购订单 vs 实际交付核对、虚构交易识别、资金流向追踪。


分析框架

核心概念

申报链路(系统记录)                    实际链路(调查获取)
┌──────────────────┐               ┌──────────────────┐
│ ERP 订单信息       │   对比         │ 合同/发票/签收单   │
│ 售后激活记录       │ ──────────→   │ 付款/物流凭证     │
│ 申报渠道层级       │               │ 访谈/现场核查结果  │
│ 申报成本结构       │               │ 第三方工商信息     │
└──────────────────┘               └──────────────────┘
                                            │
                     ┌──────────────────────┤
                     ▼                      ▼
             差异识别                 结构化输出
         ┌─────────────┐         ┌──────────────────┐
         │ 链路差异      │         │ 可视化 HTML 报告  │
         │ 配置差异      │         │ 证据登记表条目    │
         │ 资金差异      │         │ 后续调查建议      │
         └─────────────┘         └──────────────────┘

分析维度

对比围绕 三条流 展开,每条流对比"申报值"与"实际值":

① 合同流(Contract Flow)

对比项 申报值(系统内) 实际值(调查获取)
交易主体 申报的终端客户/各级代理 合同签署方、实际参与方
链路层级 申报渠道层级结构 实际合同链各层主体
合同产品/价格(optional) 订单配置和价格 各级合同实际配置和价格

② 货物流(Goods Flow)

对比项 申报值(系统内) 实际值(调查获取)
发货去向 申报发货地址/终端地址 签收单实际地址/售后激活地址
交付路径 申报的物流链路 实际运输/仓储/交付记录/签收信息
设备激活 关联的客户名称 实际激活公司/地址

③ 资金流(Capital Flow)

对比项 申报值(系统内) 实际值(调查获取)
交易金额 申报价格、折扣 各级合同实际金额、支付记录
渠道利润 申报利润率 实际利润分配(差额去向)
第三方费用 申报的 OtherCost 实际服务交付和支付凭证

数据采集

采集内容

数据类别 内容 来源
系统申报数据 ERP 订单、售后激活记录、BOM 配置、申报渠道链路 企业系统(MCP 或调查员导出)
实际执行数据 各级合同(含与终端客户的)、发票、签收单、付款记录、物流单 调查获取(合同/发票电子件)

采集方式

系统申报数据 → 首选 MCP 调取系统记录(如数据库查询类 MCP)
              └── fallback:调查员从系统手动导出,提供截图或文件

实际执行数据 → 调查员收集合同、发票等电子件
              ├── 可通过文档分析类 MCP 解析为结构化数据
              └── fallback:调查员整理后手工录入

数据采集完成后,填写 templates/intake-form.md 作为对比分析的结构化输入。


差异识别

对比申报链路与实际链路后,识别以下差异类型(不限于此,可根据场景扩展):

差异类型 含义 常见场景
链路差异 实际链路层级多于或少于申报层级 隐瞒渠道链路、虚构中间层
地址差异 实际交货/激活地址与申报地址不符 窜货、虚报终端客户
配置差异 实际交付产品配置与订单配置不一致 拼单绑单、替换设备
价格/利润差异 实际交易价格/利润分配与申报不符 成本造假、隐瞒渠道利润
发票差异 实际发票路径与申报路径不一致 隐瞒中间层、虚构交易
主体差异 实际参与方与申报参与方不一致 虚构终端客户、未披露关联方
关系维度差异 实际关系类型与申报不符(合同流/资金流/货物流/控制关系维度的错位) 隐瞒真实交易结构、合同流与资金流路径不一致

每项差异记录至少包含:差异类型、涉及环节(合同流/货物流/资金流)、申报值、实际值、差异描述。


可视化输出

模板架构

当前提供 链路对比图模板(templates/chain-comparison-template.html),支持以下能力:

  1. 动态链路结构:自动检测链路层级深度,适配任意层数(不再限制为 4 层),深度超过视口时自动横向滚动
  2. 异构深度对比:申报和实际链路深度不一致时,自动补全缺失层级并标注"未申报"/"未涉及"
  3. 多维度语义对比:合同流(蓝)、资金流(绿)、货物流(紫)、控制关系(玫红)四类维度,通过不同颜色和线型区分
  4. 确定性标注:每条连接线按确认状态(已确认→实线、可疑→长虚线、待核实→短虚线)自动选择线型
  5. 差异标注:在链路图上标记差异节点和差异边
  6. 风险汇总:按链路/项目维度汇总所有差异点

多模板扩展

模板分为两层——数据结构层 和 渲染层:

templates/
├── chain-comparison-template.html    ← 当前可用:链路对比模板
└── [new]-template.html               ← 将来扩展:新增分析维度的可视化模板

新增模板的约束:

  • 必须与 intake-form.md 的数据结构兼容
  • 自行实现渲染逻辑,不依赖其他模板
  • 在文件头部声明所需的数据字段清单

结果整合

与证据注册表的对接

差异分析的输出可以(但不必须)写入 evidence_registry.json,构建事实认定。写入路径:

差异分析输出                        evidence_registry.json
─────────────────                  ──────────────────────
项目维度数据      ──→   entities[](entity_type: project)
各链路节点        ──→   entities[](entity_type: organization)
发现的差异        ──→   evidence_items[](type: system_data 或 documentary)
基于差异的判断    ──→   findings[](每条差异判断对应一条 finding)

每条 finding 的 confidence 取决于证据质量:

  • 系统数据 + 书面证据双重确认 → confirmed
  • 仅其中之一 → probable
  • 只有间接线索 → suspected(触发补充取证)

单项目与多项目

单项目分析:按上述流程,一个项目输出一份差异报告。报告中的 META 标识项目 ID,BLOCKS/DIFFS 仅包含本项目数据。

多项目整合分析:当需要横向对比多个项目(如同一代理商涉及的多个项目)时:

  1. 逐个项目完成单项目差异分析
  2. 对所有项目的差异输出进行横向归集,按差异类型/涉案主体/金额等维度汇总
  3. 输出整合报告,包含:
    • 各项目差异汇总表(统一维度,便于横向对比)
    • 按涉案主体归集的差异总览(该主体在哪些项目、哪些环节有差异)
    • 异常模式识别(多个项目中出现相似的差异类型,提示系统性风险)

整合分析的结果同样可以写入 evidence_registry.json,以 entities[] 和 findings[] 的形式关联多个项目。


分析辅助工具

以下工具类型可辅助加速数据采集和对比分析。它们不是必须的——未配置时,由模型按上述方法直接完成。

数据库查询类 MCP(如配置)

  • 能力: 执行 SQL 查询,导出系统数据
  • 辅助场景: 从 ERP/售后系统调取申报记录,直接转入 intake-form 作为申报值
  • 不可用时: 调查员从系统手动导出后提供

文档分析类 MCP(如配置)

  • 能力: 提取 PDF/图片中的文本,解析表格
  • 辅助场景: 将合同、发票等扫描件解析为结构化数据,填充实际执行值
  • 不可用时: 调查员人工阅读后整理录入

推理验证类 MCP(如配置)

  • 能力: 多路径一致性比对
  • 辅助场景: 跨项目和跨维度的系统性差异归集和异常模式检测
  • 不可用时: 模型直接完成比对分析

Related

檢視許可證全文(Apache-2.0)
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by
      reason of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright 2026 Alpha Shen

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.