score-prompt

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

1. 输入解析

1. Input Parsing

1.1 必填参数

1.1 Required Parameters

target_file
(位置 1)— 待评分文件绝对路径。支持的扩展名:
.md
/
.yaml
/
.yml
/
.json
/
.toml
/
.txt
不支持二进制 / 编程语言源码(不是该 skill 的评估对象)。
target_file
(Position 1) — Absolute path of the file to be scored. Supported extensions:
.md
/
.yaml
/
.yml
/
.json
/
.toml
/
.txt
. Binary files / programming language source codes are not supported (not the evaluation target of this skill).

1.2 可选参数

1.2 Optional Parameters

  • target_score=N
    (默认 90)— 退出循环所需的最低 Overall 分数(百分制,0-100)。低于此分则继续迭代。
  • max_rounds=N
    (默认 10)— 最大迭代轮次上限。达到上限未达标则停止(不抛错,输收口报告说明未达)。
  • review_focus="..."
    (默认空)— 评审侧重说明。例
    review_focus="schema instruction"
    review_focus="OpenCode skill body"
    。传空则 oracle 用通用 baseline。
  • target_score=N
    (default 90) — Minimum Overall score required to exit the loop (percentage, 0-100). If the score is lower than this value, the iteration continues.
  • max_rounds=N
    (default 10) — Upper limit of maximum iteration rounds. If the target is not reached when the limit is hit, stop (no error thrown, output a closing report indicating the target is not met).
  • review_focus="..."
    (default empty) — Focus of the review. Examples:
    review_focus="schema instruction"
    or
    review_focus="OpenCode skill body"
    . If left empty, the oracle uses a general baseline.

2. 全局规则

2. Global Rules

2.1 Fast Fail Rule

2.1 Fast Fail Rule

任何
task()
/
tool()
/
skill()
调用失败(超时、agent 不可用、返回错误等):
  1. 立即停止当前 round
  2. 报告「🔴 [round 名] 中断:[调用名] 调用失败。[错误信息]」
  3. 等待用户介入
禁止降级、禁止重试、禁止跳过、禁止自行替代执行。
If any
task()
/
tool()
/
skill()
call fails (timeout, agent unavailable, error returned, etc.):
  1. Immediately stop the current round
  2. Report "🔴 [Round Name] Interrupted: [Call Name] call failed. [Error Message]"
  3. Wait for user intervention
Downgrading, retrying, skipping, or executing alternative actions on your own is prohibited.

2.2 评分体系(百分制)

2.2 Scoring System (Percentage)

每个维度 1-5 分,乘以 20 得百分制分数。Overall = 5 维度平均分 × 20
维度含义
Clarity意图对 LLM 是否无歧义?动词具体 vs 模糊?条件显式 vs 隐式?
Conciseness是否有可移除的重复?有没有增加 token 但不增加约束的措辞?
ActionabilityLLM 能否端到端执行而无需问"等等,我该做什么"?失败模式是否处理?
Consistency内部术语、PHASE/Step 编号、格式约定是否一致?
Minimal-slop有没有 AI 生成的冗余 / 营销框架 / 魔数 token / 重述?
Each dimension is scored 1-5 points, multiplied by 20 to get the percentage score. Overall = Average score of 5 dimensions × 20.
DimensionMeaning
ClarityIs the intent unambiguous to the LLM? Are verbs specific vs vague? Are conditions explicit vs implicit?
ConcisenessAre there removable repetitions? Is there wording that adds tokens but no constraints?
ActionabilityCan the LLM execute end-to-end without asking "Wait, what do I do?" Are failure modes addressed?
ConsistencyAre internal terminology, PHASE/Step numbering, and format conventions consistent?
Minimal-slopIs there AI-generated redundancy, marketing frameworks, magic number tokens, or restatements?

2.3 target_score 模式

2.3 target_score Mode

默认值与取值范围见 §1.2(未传时默认 90,合法区间 0-100)。
  • target_score >= 95
    视为"严格模式"(每次修复都需更高 ROI)
  • target_score < 80
    视为"宽松模式"(oracle 会更关注阻塞性问题)
  • target_score < 0
    > 100
    视为非法,停止并提示用户
Default value and range are specified in §1.2 (default 90 if not passed, valid range 0-100).
  • target_score >= 95
    is considered "Strict Mode" (each refinement requires higher ROI)
  • target_score < 80
    is considered "Lenient Mode" (oracle will focus more on blocking issues)
  • target_score < 0
    or
    > 100
    is considered invalid, stop and prompt the user

3. R0:baseline 摸底

3. R0: Baseline Assessment

目的:拿到首份 oracle 报告,建立修复 backlog。
调用(单 oracle agent,run_in_background=false):

task(subagent_type="oracle", prompt="
你是 Oracle 评审 agent,负责对 <target_file> 跑 5 维度质量评分(baseline 摸底)。

**任务**:

1. 阅读本 skill body(§2.2 5 维度定义 + §5 输出格式 + §2.3 target_score 模式 — 全部以 skill body 为权威源)
2. 阅读 <target_file>(待评审文件)
3. 按 §5 输出格式输出 5 维度分数 + 3 类 findings + Quick wins

**目标分数**(百分制):<target_score>,< 80 表示宽松 / ≥95 表示严格 / 默认 90。
   ")
解析输出:提取 Overall 分数(如 "Overall: 4.5/5" → 90/100),记为 R0 baseline。
Purpose: Obtain the first oracle report and establish a refinement backlog.
Call (single oracle agent, run_in_background=false):

task(subagent_type="oracle", prompt="
You are the Oracle Review Agent, responsible for running a 5-dimensional quality assessment (baseline assessment) on <target_file>.

**Task**:

1. Read this skill body (§2.2 5-dimensional definitions + §5 Output Format + §2.3 target_score mode — all are authoritative sources from the skill body)
2. Read <target_file> (the file to be reviewed)
3. Output 5-dimensional scores + 3 types of findings + Quick wins according to §5 Output Format

**Target Score** (percentage): <target_score>, < 80 means lenient / ≥95 means strict / default 90.
   ")
Parse Output: Extract the Overall score (e.g., "Overall: 4.5/5" → 90/100), record it as R0 baseline.

4. R1+:修复-重审循环

4. R1+: Refinement-Review Loop

4.1 循环入口

4.1 Loop Entry

读取上一轮 oracle 输出,列出所有 🔴 / 🟡 / ⚪ findings。对每个 finding 决定"本轮修"或"延后"。
修复优先级
  • 🔴 必修(本轮)
  • 🟡 视 ROI 修(本轮,如改动 ≤ 3 行)
  • ⚪ 选最优 ROI 的 1-2 个修(本轮)
Read the oracle output from the previous round, list all 🔴 / 🟡 / ⚪ findings. Decide "fix in this round" or "postpone" for each finding.
Refinement Priority:
  • 🔴 Must fix (this round)
  • 🟡 Fix based on ROI (this round, e.g., changes ≤ 3 lines)
  • ⚪ Select 1-2 items with the highest ROI to fix (this round)

4.2 应用修复

4.2 Apply Refinements

用 Read/Edit 工具直接改
target_file
原文件):
  1. 改动前先 Read 确认当前行号
  2. 用 Edit 替换(精确匹配,不模糊替换)
  3. 改完用
    bash
    bun test
    /
    openspec schema validate
    等验证(如目标文件关联项目有这些测试)。若无任何可用测试套件(如审 README/独立 .md),跳过本步骤,仅依赖 oracle 重审作为质量门禁。
严禁:批量改 3 处以上未经验证,一次改一处立即确认。
Use the Read/Edit tool to directly modify
target_file
(original file):
  1. Read to confirm the current line numbers before modification
  2. Use Edit to replace (exact match, no fuzzy replacement)
  3. After modification, run verification such as
    bun test
    /
    openspec schema validate
    via
    bash
    (if the target file is associated with a project that has these tests). If no test suite is available (e.g., reviewing README/standalone .md), skip this step and only rely on oracle re-review as the quality gate.
Strictly Prohibited: Modify more than 3 places in batches without verification; modify one place at a time and confirm immediately.

4.3 重抽 + 重审

4.3 Re-extract + Re-review

每次改完后:
  1. (无需重新读取 target_file —— oracle 每轮自动重读;如有改动,直接进入下一轮审查)
  2. 重跑 oracle(同 §3 的 task() 调用,复用 session_id 保持跨轮上下文)。具体机制:从 R0 的
    task()
    返回值中提取
    session_id
    字段(OpenCode 标准),后续
    task(subagent_type="oracle", session_id=<提取值>, prompt=...)
    调用中作为参数传入。不要省略 session_id——省略会导致 oracle 每次重审时丢失跨轮已知 findings,导致 R(N) 评分震荡。
  3. 解析新分数,记为 R(N)
After each modification:
  1. (No need to re-read target_file — the oracle automatically re-reads it every round; if there are changes, directly proceed to the next round of review)
  2. Re-run the oracle (same task() call as §3, reuse session_id to maintain cross-round context). Specific mechanism: Extract the
    session_id
    field (OpenCode standard) from the return value of R0's
    task()
    , and pass it as a parameter in subsequent
    task(subagent_type="oracle", session_id=<extracted value>, prompt=...)
    calls. Do not omit session_id — omitting it will cause the oracle to lose known cross-round findings during each re-review, leading to R(N) score fluctuations.
  3. Parse the new score, record it as R(N)

4.4 循环退出条件(每轮修复前先检查)

4.4 Loop Exit Conditions (Check before each round of refinement)

读取最新 R(N) oracle 报告:
  • Overall × 20 ≥ target_score → 退出循环,进入 §5 收口
  • rounds 计数 ≥ max_rounds → 强制停止,进入 §5 收口(说明未达标 + 残留 findings)
  • 否则 → 进入 §4.1 下一轮
Read the latest R(N) oracle report:
  • Overall × 20 ≥ target_score → Exit the loop, proceed to §5 Closing
  • Round count ≥ max_rounds → Force stop, proceed to §5 Closing (indicate target not met + remaining findings)
  • Otherwise → Proceed to §4.1 for the next round

5. 收口报告

5. Closing Report

findings 等级符号定义:🔴 = 严重问题,必须修复;🟡 = 建议改进,视 ROI 修复;⚪ = 可选优化,择高 ROI 项处理。
无论循环是因达标退出还是 max_rounds 强制停止,都输出最终收口报告:
undefined
Definition of Finding Level Symbols: 🔴 = Critical issue, must be fixed; 🟡 = Recommended improvement, fix based on ROI; ⚪ = Optional optimization, handle items with high ROI.
Whether the loop exits due to reaching the target or being forced to stop by max_rounds, output the final closing report:
undefined

score-prompt 收口报告

score-prompt Closing Report

目标文件: <target_file> 目标分数: <target_score> 实际分数: <R(N) Overall × 20>/100 迭代轮数: R0 → R(N) 耗时: <估算分钟数>
Target File: <target_file> Target Score: <target_score> Actual Score: <R(N) Overall × 20>/100 Iteration Rounds: R0 → R(N) Time Spent: <estimated minutes>

分数演进

Score Evolution

RoundOverallΔ修复内容摘要
R080/100baseline 摸底
R188/100+8修 3 🟡 + 2 ⚪
R292/100+4修 1 🟡 残留
...
RoundOverallΔRefinement Summary
R080/100Baseline assessment
R188/100+8Fixed 3 🟡 + 2 ⚪
R292/100+4Fixed remaining 1 🟡
...

达标状态

Target Status

✅ 已达 target_score(≥ 90)/ ❌ 未达(残留 N 个 findings)
✅ Target score reached (≥ 90) / ❌ Target not reached (N remaining findings)

残留 findings(如有)

Remaining Findings (if any)

  • 🟡 L45: ...
  • ⚪ L78: ...
  • 🟡 L45: ...
  • ⚪ L78: ...

建议后续

Follow-up Recommendations

  • 如需更高分数,可传 target_score=95 重新跑此 skill
  • 残留 findings 中标 [低 ROI] 的可在未来 review 时一并处理

收口报告输出后,**skill 任务完成**,返回控制权给用户。
  • To achieve a higher score, re-run this skill with target_score=95
  • Items marked [Low ROI] in remaining findings can be handled in future reviews

After the closing report is output, **the skill task is completed**, and control is returned to the user.

6. 错误处理

6. Error Handling

  • 目标文件不存在 → 立即报告「🔴 target_file 不存在:<path>」,停止
  • 目标文件不是支持类型 → 报告「🔴 不支持的文件类型:<ext>,本 skill 支持 .md/.yaml/.yml/.json/.toml/.txt」,停止
  • oracle agent 不可用 → 报告「🔴 oracle agent 不可用,本 skill 强依赖 oracle 做质量评审」,停止
  • max_rounds 内未达标 → 不抛错,输出收口报告(标 ❌ 未达),返回控制权
  • target_score 非法 → 报告「🔴 target_score 必须在 0-100 之间」,停止
  • Target file does not exist → Immediately report "🔴 target_file does not exist: <path>" and stop
  • Unsupported file type → Report "🔴 Unsupported file type: <ext>, this skill supports .md/.yaml/.yml/.json/.toml/.txt" and stop
  • Oracle agent unavailable → Report "🔴 Oracle agent is unavailable, this skill relies heavily on oracle for quality review" and stop
  • Target not reached within max_rounds → No error thrown, output closing report (mark ❌ target not met), return control
  • Invalid target_score → Report "🔴 target_score must be between 0 and 100" and stop ",