Skip to content
Development
Skill

/pipeline-efficiency-benchmark

把 x-dev-pipeline 的 skill 优化做成可重复 benchmark:迁移公开任务包到隔离 workspace,完整打包候选 skills 与 tools 脚本,预检考生输入,执行 baseline/candidate,归一化 Token、耗时、工具调用、评分和金额,生成跨 iteration 横向对比并判断晋级。用户提到 pipeline efficiency、任务包迁移、干净上下文评测、baseline/iteration 对比、Token/费用优化、计费金额、横向报告或

From plugin
x-dev-pipeline
1220 skills
Install
$ npx -y skills add KtKID/x-dev-pipeline --skill pipeline-efficiency-benchmark --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/pipeline-efficiency-benchmark

Context preview

The summary Claude sees to decide when to auto-load this skill.

把 x-dev-pipeline 的 skill 优化做成可重复 benchmark:迁移公开任务包到隔离 workspace,完整打包候选 skills 与 tools 脚本,预检考生输入,执行 baseline/candidate,归一化 Token、耗时、工具调用、评分和金额,生成跨 iteration 横向对比并判断晋级。用户提到 pipeline efficiency、任务包迁移、干净上下文评测、baseline/iteration 对比、Token/费用优化、计费金额、横向报告或

SKILL.md

pipeline-efficiency-benchmark.SKILL.md
name: pipeline-efficiency-benchmark
description: |
  把 x-dev-pipeline 的 skill 优化做成可重复 benchmark:迁移公开任务包到隔离 workspace,完整打包候选 skills 与 tools 脚本,预检考生输入,执行 baseline/candidate,归一化 Token、耗时、工具调用、评分和金额,生成跨 iteration 横向对比并判断晋级。用户提到 pipeline efficiency、任务包迁移、干净上下文评测、baseline/iteration 对比、Token/费用优化、计费金额、横向报告或 evals/x-pipeline-efficiency-workspace 时使用。
metadata:
  compatibility: Requires Python 3.10+ and local readable task, skill, tool, run telemetry, and grader artifacts.

Pipeline Efficiency Benchmark

把一次 pipeline skill 优化拆成可复跑、可审计的七个阶段。执行器只接触公开任务、候选 skill 和运行工具;评分材料始终留在 grader 侧。

适用边界

用于优化和评测 pipeline skill,不用于普通产品开发任务。一个独立模型运行对应一个 run;同一 run 的后续 req、Dev、Verify、QA、Fix 延续原 run 身份。独立重放创建新 run。

固定产物

每个 iteration 至少保存:

iteration-N/
├── benchmark-manifest.json
├── runs/
│   └── <run-id>/
│       ├── workspace/
│       ├── executor-package-manifest.json
│       ├── eval_metadata.json
│       ├── timing.json
│       ├── grading.json
│       ├── pricing.json
│       └── benchmark-run.json
├── comparison.json
├── comparison.md
└── acceptance-report.md

`benchmark-run.json` 是跨版本比较的唯一输入。原始 session、评分和报告继续保留为证据。

所有人类可读报告都保留金额章节。金额证据不足时写 `unknown` 和原因,继续保存报告;禁止静默省略金额。

阶段 1:prepare

两种迁移 profile:

  • `pipeline_candidate`:创建全新 x-dev-pipeline 候选 workspace,复制公开考题、七个阶段 skills、共享 `x-dev-rag-call` 和六个运行 tools。
  • `public_task_only`:向已有的其他框架 workspace 只添加公开考题,保留其现有环境,不注入 x-dev skills/tools。

创建全新 pipeline candidate:

python3 skills/pipeline-efficiency-benchmark/scripts/prepare_workspace.py \
  --workspace <run-dir>/workspace \
  --task-source <public-task-dir> \
  --fixture-source <public-fixture-dir> \
  --prompt-source <public-prompt> \
  --skills-root <candidate-skill-snapshot> \
  --json

向已有 OpenSpec 等候选工程放公开考题包:

python3 skills/pipeline-efficiency-benchmark/scripts/prepare_workspace.py \
  --profile public_task_only \
  --allow-existing \
  --workspace <candidate-workspace> \
  --task-source <public-task-dir> \
  --fixture-source <public-fixture-dir> \
  --prompt-source <public-prompt> \
  --manifest-output <run-dir>/executor-package-manifest.json \
  --json

`--allow-existing` 只允许保留已有文件;`task/`、`fixture/`、`PROMPT.md` 或 manifest 目标发生冲突时拒绝覆盖。

`--skills-root` 目录必须包含:

  • `x-spec`
  • `x-adversarial-risk`
  • `x-req`
  • `x-dev`
  • `x-verify`
  • `x-qa-gate`
  • `x-fix`

共享 skill:

  • `x-dev-rag-call`

skill 包的 `assets/executor-tools/` 包含七个工具。prepare 向考生 workspace 复制六个运行工具:

  • `xdev.py`
  • `validator.py`
  • `flag.py`
  • `req.py`
  • `spec.py`
  • `verify.py`

`metrics.py` 保留在本 skill 包内,只供 collect 阶段读取 session,不进入考生 workspace。迁移成功以目标 workspace 中的文件和 run 目录侧车 manifest 的 SHA 校验为准。源路径、benchmark 身份、skill 的 `evals/`/`tests/` 和 grader 元数据留在 workspace 外。

阶段 2:preflight

在启动模型前运行:

python3 skills/pipeline-efficiency-benchmark/scripts/validate_workspace.py \
  <run-dir>/workspace \
  --manifest <run-dir>/executor-package-manifest.json \
  --json

preflight 检查:

1. 公开 task 和 workspace 外的 package manifest 均存在。 2. `pipeline_candidate` 额外要求完整七阶段 skill、共享 `x-dev-rag-call` 和六个运行 tools;`public_task_only` 保持原框架环境。 3. pipeline candidate 的 tools 与 skill 内 bundled 版本 SHA 一致。 4. `xdev.py` 的本地导入依赖齐全且 CLI 可启动。 5. package manifest 中的所有文件保持原 hash。 6. workspace 不含 `oracle`、`rubric`、`grader`、`answers` 等 grader-only 路径。

exit 0 才能启动执行器。exit 1 保持阻断并修复打包问题。

阶段 3:execute

执行器使用干净上下文:

  • 新 thread 或 session,继承轮次为 0。
  • cwd 固定为本 run 的 `workspace/`。
  • 可读范围只含 workspace。
  • 提示词描述真实任务和可用 skills;执行器提示词不出现 hidden answer、rubric 或 oracle 信息。
  • baseline 使用相同模型、reasoning、公开输入和运行工具;baseline 只移除待测 skill 影响。
  • candidate 按 workspace `skills/README.md` 的链路执行。

运行链:

x-spec
  → 按风险预算调用 x-adversarial-risk
  → x-req
  → x-dev
  → x-verify
  → x-qa-gate
  → x-fix 与增量复验

阶段切片必须写入 `scope`,例如 `spec_risk_only` 或 `full_pipeline`。不同 scope 的总 Token 不进入同一降幅计算。

阶段 4:collect

先保留原始遥测,再归一化:

1. 查询执行日期的官方模型价格页,将价格、来源 URL、查询日期和账单/套餐口径写入 `<run-dir>/pricing.json`。不要把价格长期硬编码在 skill 中。 2. 使用 `assets/report-templates/pricing.json` 建立价格快照;完整字段说明见 `references/pricing-schema.md`。 3. 运行归一化:

python3 skills/pipeline-efficiency-benchmark/scripts/normalize_run.py \
  --run-id iter6-terra-run1 \
  --label "Iteration 6 Terra" \
  --scope full_pipeline \
  --metrics <run-dir>/full-pipeline-metrics.json \
  --timing <run-dir>/timing.json \
  --full-grading <run-dir>/full-pipeline-grading.json \
  --spec-risk-grading <run-dir>/grading.json \
  --metadata <run-dir>/eval_metadata.json \
  --pricing <run-dir>/pricing.json \
  --output <run-dir>/benchmark-run.json

优先保存:

  • Input、Cached input、Uncached input、Output、Reasoning output、Total。
  • 主任务活跃时间、嵌套 reviewer 时间、执行器时间和。
  • 工具调用、LLM 调用、失败命令。
  • phase Token 分布。
  • 原生评分和统一 rubric 重评分。
  • 官方价格来源、查询日期和每 1M Tokens 单价。
  • API 等价成本、cache-write 上界、无缓存成本和缓存节省。
  • 实际现金增量、套餐额度倍数和套餐额度等价金额。

`--timing` 用于 Token 文件与耗时文件分离的 run;耗时已包含在 `--metrics` 时可以省略。

Token 公式:

total_tokens = input_tokens + output_tokens
uncached_input_tokens = input_tokens - cached_input_tokens
effective_tokens = uncached_input_tokens + output_tokens

Cached input 是 Input 子集,Reasoning output 是 Output 子集。跨 provider 口径不同的 run 标记为不可直接比较。

金额公式:

api_equivalent
= regular_uncached_input × uncached_input_rate
+ cache_write_input × cache_write_input_rate
+ cached_input × cached_input_rate
+ output × output_rate

no_cache_api_equivalent
= all_input × uncached_input_rate
+ output × output_rate

cache_savings
= no_cache_api_equivalent - api_equivalent

quota_equivalent
= api_equivalent × quota_multiplier

provider 未单列 cache-write Tokens 时,基础金额把全部 uncached input 按普通输入单价计算;金额上界把全部 uncached input 按 cache-write 单价计算。API 等价成本、实际现金增量和套餐额度等价金额是三个独立指标。

阶段 5:grade

grader 在执行结束后读取隐藏评分器。每次保存:

  • grader/rubric 版本。
  • 逐项通过、失败和证据。
  • 原生分。
  • 同一当前 rubric 下的历史重评分。
  • critical gate。

同一根因触发多条 assertion 时保留每条扣分,另在根因字段标注关联。

阶段 6:compare

只把 `benchmark-run.json` 交给比较脚本:

python3 skills/pipeline-efficiency-benchmark/scripts/compare_runs.py \
  --run <baseline>/benchmark-run.json \
  --run <iteration-5>/be
Read more
Ships withx-dev-pipeline

An auditable development workflow for AI coding agents: requirement contracts, implementation evidence, deterministic checks, and risk-matched review.

Get the whole plugin
Stats
12
Stars
0
Forks
Active
Maintenance
Python
Language
MIT
License
9d ago
Last commit
5mo ago
Created

Repo: KtKID/x-dev-pipeline

Other skills on x-dev-pipeline.

x-cr
Skill

x-cr

软件正确性调查 skill。用于用户说“XX 不太对”“这个功能有 bug”“结果和预期不一致”“帮我查原因”,也用于 review 模块、文件、diff 或 PR 的正确性。遇到已知异常、模块不变量、信任边界、授权范围扩张、服务端校验、租户/会话隔离或持久化一致性问题时优先使用本 skill。 本 skill…

x-dev
Skill

x-dev

开发任务执行 skill。读取单个 task 的 dev-checklist.md,按行序以"先测试后实现"的方式逐行执行,dev-report 只记验证结论(全绿或 N 个 🔴),全部行验证通过后交付。触发:`x-dev {task-dir}`、用户要求执行/开发某个 task。

x-fix
Skill

x-fix

Bug 修复执行 skill。分三种入口: 1. 用户直接报告 Bug → 定位根因 → 修复 → 产出 fix-report-*.md 或 fix-note-*.md(无需 CR 报告) 2. 有 x-cr 的 CR 报告 → 按稳定 Bn/INV-ID 逐条修复 → 回写同一份 task 内或仓库级…

x-qa-gate
Skill

x-qa-gate

verify 通过后的质量审查。Q2/Q3 各由一个 reviewer 在单轮内按 q1-intent、q2-correctness、q3-evidence 三个独立 lens 穷尽检查;Q3 使用完整高风险输入和逐 lens 回执。发现 P0/P1 后登记 issue 并交 x-fix 批量修复,主 agent…

x-req3
Skill

x-req3

x-spec3 的任务拆解 skill。读取 `docs/spec/{spec-name}/spec.md` 的目标、边界与不变量、判断依据、验收清单和直接 GWT Scenarios,生成 `docs/spec/{spec-name}/tasks/{task-name}/dev-checklist.md`,并以…

x-spec3
Skill

x-spec3

在开发方案已经讨论清楚、需要固化保存时使用。也适用于用户明确要求保存方案、编写规格文档,或希望在开发前明确目标、边界、约束和验收标准的场景。将已确认的方案整理成可供后续任务拆解、开发和验证共同使用的规格文档。