SkillsGrove
SkillsGrove/Productivity/sxd007/investigation-ontology/efficiency-diagnosis

efficiency-diagnosis

Installation

$npx skills add https://github.com/sxd007/investigation-ontology --skill efficiency-diagnosis
$git clone --depth 1 https://github.com/sxd007/investigation-ontology.git /tmp/investigation-ontology && mkdir -p ~/.claude/skills && cp -r /tmp/investigation-ontology/plugins/process-efficiency/skills/efficiency-diagnosis ~/.claude/skills/efficiency-diagnosis
Please install this Agent Skill for me: https://github.com/sxd007/investigation-ontology/tree/605fcb0ea0fd7ef29d048e5357305061c354bcc0/plugins/process-efficiency/skills/efficiency-diagnosis — read its SKILL.md and scripts first, and only install it into my skills folder once you have confirmed it is safe.

Summary

Original description · Apache-2.0流程效率诊断 — 评价流程路径结构的冗余与返工(设计层:串行审批/并行机会/返工环/交接链),以及周期时间分解与瓶颈识别(实例层:耗时分布/等待时间/返工率)。当需要回答"流程跑得快不快、卡在哪里、为什么慢"时使用。
The SKILL.md below is reproduced from sxd007/investigation-ontology (commit 605fcb0) under the Apache-2.0 license. The text is unchanged; only the file header metadata is omitted, images are shown as links, and very long files are truncated. Copyright owner or entity authorized by. License: LICENSE. Only the instructions file is shown; see the original repository for any scripts.

流程效率诊断

设计层看结构(制度把路径设计得绕不绕),实例层看运行(实际时间花在哪)。核心产出是瓶颈清单与结构优化建议。

激活条件

  • 评价流程路径结构(串行审批链、可并行环节、返工环、交接链)
  • 分析周期时间分解(处理时间 vs 等待时间)与瓶颈环节
  • 诊断返工率与返工原因分布
  • process-assess-workflow 的 ASSESS 阶段调度本技能(dimensions 含 efficiency)

不适用:数据异常检测(data-analysis——本技能关注全流程时序结构,不针对个案异常);控制设计/执行评价(rcm-analysis / control-testing——效率诊断发现的"等待审批过长"若源于控制设置,须交叉引用控制维度发现而非替代)。

输入

输入 来源 层
flow_edges[](edge_kind 含 main/conditional/reject/return/escalation/emergency) digest.json 设计
process_elements[](L3-L5 层级)+ role_assignments[](RACI) digest.json 设计
rules[](时限规则/阈值——判定"过长"的制度基准) digest.json 设计
实例执行记录(时间戳序列,可重建每笔实例各环节的进入/离开时间) baseline 快照 实例

方法论

设计层 — 路径结构分析(仅 digest)

E1 串行审批链分析:

  • 提取纯串行审批链(连续 A 角色节点、无分支),统计链长;
  • 阈值匹配检查:审批层级与 rules 中的金额/风险阈值是否匹配(小额也走长链)→ approval_overload;
  • 并行机会识别:串行链中前后环节无数据依赖(后环节不消费前环节产出——对照 input_artifact_refs)的,标记为"可并行候选",多处串行无依赖 → serial_redundancy。

E2 返工环检测:

  • 由 reject/return 边构成的"回退到前序环节"路径即为返工环;制度内显式定义的返工环记录其起点/终点/触发条件;
  • 返工环无终止条件(可无限循环)或无责任角色(RACI 未定义谁处理返工件)→ rework_loop(severity 按影响判)。

E3 交接链分析:

  • 按 RACI 统计一笔典型实例的跨部门/跨角色交接次数(每次交接=一次等待+一次丢失风险);
  • 交接链上存在"传递即丢失"的弱交接(前一角色的输出 Artifact 不在后一角色环节的 input_artifact_refs 中)→ handoff_excess(结合实例层等待时间判 severity)。

实例层 — 周期时间分析(+ baseline 快照)

前置(强制):E4 之前按 data-feasibility 完成数据可行性预检并签署测试项可行性矩阵——时间戳粒度(F1)与实例可聚合性(F2)直接决定 E4-E7 可做范围;先声明后分析,不合格按契约降级路径执行。

E4 周期时间分解:对每笔实例计算端到端周期,分解到环节:

环节耗时 = 离开时间戳 - 进入时间戳
等待时间 = 环节内无操作动作的时间(进入后首个动作之前)
处理时间 = 环节内动作的总时长

统计各环节的 P50 / P90 / 最大值。周期分布呈双峰(大量快实例 + 少量极慢实例)提示条件分支未区分对待 → 结合 flow_edges 条件分析。

E5 瓶颈识别:

  • 等待时间占比最高的环节(P90 等待 > 全流程等待的 40%)→ bottleneck_wait(severity:high=瘫痪级积压 / medium=常态性延迟 / low=偶发);
  • 制度时限对照:环节 P50 超出 rules 时限 → 独立标注"制度违约率"(与 control-testing 的 control_deviation 交叉引用,避免重复计数——时限超期同时是控制偏离时,由 control-testing 主责,本技能交叉引用其 finding_id);
  • 单点负载:某角色同时是多个串行环节的 R → 个人负载分析(该角色的队列深度)。

E6 返工率分析:

  • 实际走了 reject/return 路径的实例占比 = 返工率;
  • 返工原因分布(哪个环节的返工件最多、流向哪里);
  • 返工率高(>10% 建议)且集中于单点 → 该单点是质量或规则问题,交叉引用对应维度(规则阈值不合理 → goal/risk 维度;提交质量差 → handoff 分析);
  • rework_loop(设计层)与实际返工率(实例层)对照:设计无环但实际高频回退 → 路径外循环,记 control_bypassed 交叉引用(control-testing 主责)。

E7 离群诊断:cycle_time_outlier——P90 与 P50 比值异常大的环节(等待/处理比失控),单独列为待深挖项(可能指向瓶颈的下游成因)。

评价产出结构

01_assessments/efficiency/
├── structure_review.md         # E1-E3 设计层结构诊断
├── cycle_time_decomposition.md # E4 周期分解(环节×P50/P90/等待占比)
├── bottleneck_analysis.md      # E5+E7 瓶颈清单
├── rework_analysis.md          # E6 返工率与原因分布
└── findings.yaml               # 按 finding-contract 聚合

起步脚手架

直接复制本技能 templates/ 下的产出骨架到目标维度目录(或由工作流 scaffold-dimension.mjs 统一生成):

node skills/process-assess-workflow/scripts/scaffold-dimension.mjs {output_root}/01_assessments/<dim> --skill <dim> [--assessment-id PA-2026-001] [--date 2026-09-29]

骨架含本技能文档化的全部 .md 产出与 findings.yaml 占位;占位符 {assessment_id}/{date} 自动替换。findings 结构遵循 finding-contract,聚合到 findings.yaml。

填充真实数据后运行 node skills/process-assess-workflow/scripts/validate-findings.mjs 01_assessments/efficiency/findings.yaml 做契约校验,0 错误方可进入 REPORT(可加 --strict 把警告也计为错误)。

质量纪律

  1. 消费纪律:只消费 digest-schema 兼容的流程知识包(默认生产者 policy-digest)与 baseline 快照;不读原文;不引入快照外数据;
  2. 锚点纪律:设计层 finding 带 anchor.digest(flow_edge/process_element/rule ID + source),实例层带 anchor.baseline(版本+快照+记录);
  3. 交叉引用纪律:与其他维度重叠的发现(时限超期=控制偏离;高频返工=规则问题)只交叉引用主责技能的 finding_id,不重复输出;
  4. 改进建议可行性:serial_redundancy 类结构建议须注明数据依赖依据("无依赖"的判定来自 input_artifact_refs 对照),避免拍脑袋建议;
  5. finding 结构遵循 finding-contract(ED-NNN 前缀);
  6. 阈值纪律:本技能全部数值阈值(40% 等待占比 / 10% 返工率 / P90:P50>3 等)的出处与校准状态见 threshold-baseline;标注"经验值"者不得包装为行业标准,企业有内部基准时优先替代并注明。

上游缺陷识别(DDR)

实例数据是流程结构的独立先知,时序分析天然暴露模板(flow_edges/artifact 依赖)的完整性。观察到以下信号时按 DDR 机制报告:

观察 嫌疑 DDR 类型
实例高频返工环在 flow_edges 无对应 reject/return 边 流转边遗漏 omission
serial_redundancy 判定所依赖的 input_artifact_refs 疑似错挂(后环节实际等待前环节产出) 依赖关系归类错误——不排除则并行化建议是伪优化 misclassification
环节超期但 rules 无时限条款,且条款锚点 excerpt 含时限数字 时限参数未提取 omission

纪律:serial_redundancy 的并行化建议在依赖关系 DDR 闭环前不得进入 REPORT 的正式建议清单(伪优化比不优化更有害)。

Template-free 降级:无流程知识包时 E4–E7(周期分解/瓶颈/返工/离群)完整可用,E1–E3 结构诊断跳过;报告标注"无模板基准——结论限于实证发现",见 finding-contract §7。

Related

View full license text (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.