affinage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/affinage
/affinage
Act on external claims about a PR — review comments from humans or bots, plus failing CI checks and merge conflicts — grading them through the same lens uses for fresh review, then handing them to for application.
/age/cure/affinage/age- Standalone — the user typed directly, with no upstream
/affinage <pr>. The PR diff has not been reviewed in this session, sohandoff_contextruns/affinageover it and folds the findings into the same report (unless/age).--no-age - Chained — reached from or
/cookwith a/cure.handoff_contextalready ran in that chain, so/ageskips the fresh pass to avoid double-grading and only refines existing claims./affinage
See for the detection rule and for the conflict path.
## Fresh-window review## Merge-conflict resolution针对PR的外部反馈进行处理——包括来自人类或机器人的评审评论、失败的CI检查以及合并冲突——通过与/age用于全新评审相同的视角对这些反馈进行分级,然后将其交给/cure执行修复。
/affinage- 独立触发——用户直接输入,且无上游
/affinage <pr>。本次会话中尚未评审过PR的diff,因此handoff_context会对其运行/age,并将结果整合到同一报告中(除非使用/affinage参数)。--no-age - 链式触发——从/cook或/cure触发,带有。该链式流程中已运行过/age,因此
handoff_context会跳过全新扫描以避免重复分级,仅优化已有的反馈。/affinage
关于检测规则请查看,关于冲突处理流程请查看。
## Fresh-window review## Merge-conflict resolutionInputs
Inputs
text
/affinage [<pr-ref>] [--auto --stake <floor>] [--plate] [--safe] [--open-pr] [--hard] [--full] [--include-outdated]<pr-ref>gh pr view --json numberFlags:
- — autonomous mode;
--auto --stake <floor>(<floor>,blocker,high,medium+) matchesall's semantics. Skips selection, dispatches/cure, posts replies without prompting. Mechanics:/cure --auto --stake <floor>.references/auto-mode.md - — also gates cure-selection and merge-conflict resolution (autonomous by default). Reply posting is gated by default regardless — only
--safeskips it.--auto - — let terminal
--open-propen a new PR when none exists (else it only updates the open one)./plate - — one-shot publish combo =
--plate: triage, cure the recommended floor, post every reply, then plate. An explicit--auto --stake medium+ --open-proverrides--stake <floor>.medium+ - — propagated metacognitive-gate flag; forwarded to terminal
--hard, not fired here./plate - — un-collapses
--fullwhen ≥10 low-severity findings exist (mirrors## Low)./age --full - — include outdated review threads (default: skip).
--include-outdated - — skip the standalone fresh
--no-agepass; no effect when chained./age
Portability reference: . It covers helper resolution, sub-agent dispatch, GitHub operations, and handoff transitions; prefer the bundled or repo-local helper first, and treat as optional host-provided fallback.
The handoff blocks below are the portable contract; slash commands are host renderings, not the control model.
../cheese/references/harness-portability.md${CLAUDE_SKILL_DIR}text
/affinage [<pr-ref>] [--auto --stake <floor>] [--plate] [--safe] [--open-pr] [--hard] [--full] [--include-outdated]<pr-ref>gh pr view --json number参数说明:
- ——自主模式;
--auto --stake <floor>(<floor>、blocker、high、medium+)与/cure的语义一致。跳过选择步骤,直接调度all,无需提示即可发布回复。机制详见:/cure --auto --stake <floor>。references/auto-mode.md - ——同时限制修复选择和合并冲突的解决(默认情况下自主模式会自动处理)。无论如何,回复发布默认受限制——仅
--safe会跳过该限制。--auto - ——当不存在PR时,允许终端
--open-pr创建一个新的PR(否则仅更新已打开的PR)。/plate - ——一键发布组合参数 =
--plate:分类处理、修复推荐级别的问题、发布所有回复,然后执行plate操作。显式指定的--auto --stake medium+ --open-pr会覆盖--stake <floor>。medium+ - ——传播元认知门控参数;转发给终端
--hard,不在此触发。/plate - ——当存在≥10个低严重性问题时,展开
--full部分(与## Low一致)。/age --full - ——包含已过时的评审线程(默认:跳过)。
--include-outdated - ——跳过独立触发时的全新/age扫描;链式触发时无效果。
--no-age
可移植性参考:。该文档涵盖了助手解析、子Agent调度、GitHub操作以及切换过渡;优先使用内置或仓库本地的助手,并将视为可选的宿主提供的回退方案。下方的切换块是可移植契约;斜杠命令是宿主呈现形式,而非控制模型。
../cheese/references/harness-portability.md${CLAUDE_SKILL_DIR}Flow
Flow
Exact CLI invocations, exit-code hints, and grading rationale for steps 2, 3, 6, and 9 below: .
references/flow-details.md- Resolve PR. From or
<pr-ref>; resolvegh pr view --json numberfrom the git remote.<owner>/<repo> - Fetch PR status. . Exit 3 halts
affinage.pyz pr-status <pr>; any other non-zero haltsstatus: halt: pr-status-logs-expired. Conflicting/dirty merge state routes tostatus: halt: pr-status-unavailablebefore grading. Exit-code detail:## Merge-conflict resolution.references/flow-details.md - Fresh-window review. Standalone and not passed: score the PR diff, route it through
--no-agesized with affinage's comment count and CI failure class, runage_route.route(...)with the returned/age/n/lenses, and fold each finding taggedeffort. See[from-age:<dimension>].## Fresh-window review - Fetch comments. Inline threads: (REST; no thread-resolution state, so skip
gh api repos/<owner>/<repo>/pulls/<pr>/commentscomments unlessposition: null). Review bodies:--include-outdated, filtered to non-empty bodies, deduped against inline comments viagh api repos/<owner>/<repo>/pulls/<pr>/reviews.pull_request_review_id - Skip already-replied threads. A thread last-commented by the resolved GitHub handle (§Rules) is already answered — skip it; the footer renders as .
agent on behalf of <handle> - Grade through the age lens. Classify each input (comment, CI failure, or fresh finding) by dimension — code/claim, or check type/failure for CI — per
/age, and by severity (base + location + compounding, same rubric as../age/references/dimensions.md); ignore reviewer-asserted urgency (/ageis metadata, never a severity bump). Bucket into severity sections (contained fixes),CHANGES_REQUESTED(needs out-of-diff evidence), or## Needs-investigation(wrong/ungrounded, or a lot of follow-up work). Full bucketing criteria:## Reviewer-rejected.references/flow-details.md - Write report to : four-line handoff slug, then the age-format body plus two extra sections. See
.cheese/affinage/pr-<n>.md.## Output - Act or ask — per §Handoff.
- Draft non-cure replies, then gate before posting (whenever grading produced these items, with or without ). Never post blind — requires the reply-approval gate (§Handoff), or
/cure. Draft per--auto; post approved ones viareferences/flow-details.md. CI-sourced (affinage.pyz post-reply) and fresh-review (from-check:<job>) findings get no reply.from-age:<dimension> - Post-cure reply posting (only when ran). Once
/curereturns, read/cure's.cheese/cure/pr-<n>.md/### Appliedand post per-finding replies via### Deferred: Applied (affinage.pyz post-reply) →from-comment:<id>; Deferred ("Fixed — <applied summary>.") →from-comment:<id>"Attempted fix reverted — <reason>." - Plate — once every approved reply is posted (steps 9–10) and the cure applied ≥1 fix, dispatch terminal ; publication lands after every reply. After it lands, run the § Post-PR learnings write-back (
/plate [--open-pr] [--hard] [--safe]§ Handoff) — affinage owns the write-back the chained../cure/SKILL.mdsuppressed. Skip plate and write-back when no fix was applied./cure
以下步骤2、3、6、9的精确CLI调用、退出码提示以及分级依据详见:。
references/flow-details.md- 解析PR。从或
<pr-ref>获取;从git远程仓库解析gh pr view --json number。<owner>/<repo> - 获取PR状态。执行。退出码3表示终止,状态为
affinage.pyz pr-status <pr>;其他非零退出码表示终止,状态为status: halt: pr-status-logs-expired。存在冲突/脏合并状态时,会在分级前路由至status: halt: pr-status-unavailable。退出码详情:## Merge-conflict resolution。references/flow-details.md - Fresh-window review。独立触发且未传递:对PR diff进行评分,通过affinage的评论数量和CI失败类别调用
--no-age进行路由,使用返回的age_route.route(...)/n/lenses运行/age,并将每个标记为effort的结果整合到报告中。详见[from-age:<dimension>]。## Fresh-window review - 获取评论。内联线程:调用(REST接口;无线程解析状态,因此除非使用
gh api repos/<owner>/<repo>/pulls/<pr>/comments,否则跳过--include-outdated的评论)。评审主体:调用position: null,筛选非空主体,通过gh api repos/<owner>/<repo>/pulls/<pr>/reviews与内联评论去重。pull_request_review_id - 跳过已回复的线程。由已解析的GitHub账号(§规则)最后评论的线程视为已回复——跳过该线程;页脚会显示为。
agent on behalf of <handle> - 通过age视角分级。按照中的维度,将每个输入(评论、CI失败或全新/age结果)分类为代码/反馈,或针对CI的检查类型/失败类型,并按照严重性(基础+位置+复合,与/age使用相同的评分标准)分级;忽略评审者声明的紧急程度(
../age/references/dimensions.md仅为元数据,不会提升严重性)。将问题归入严重性章节(可修复的问题)、CHANGES_REQUESTED(需要diff外的证据)或## Needs-investigation(错误/无依据,或需要大量后续工作)。完整的归类标准:## Reviewer-rejected。references/flow-details.md - 撰写报告至:四行切换信息,然后是age格式的主体加上两个额外章节。详见
.cheese/affinage/pr-<n>.md。## Output - 执行或询问——根据§Handoff。
- 起草非修复类回复,发布前进行审核(无论是否使用/cure,只要分级产生了此类内容)。切勿盲目发布——需要回复审核门控(§Handoff)或参数。起草规则详见
--auto;通过references/flow-details.md发布已审核的回复。来自CI(affinage.pyz post-reply)和全新评审(from-check:<job>)的结果无需回复。from-age:<dimension> - 修复后回复发布(仅当/cure运行时)。/cure返回后,读取中的
.cheese/cure/pr-<n>.md/### Applied部分,通过### Deferred发布对应结果的回复:Applied(affinage.pyz post-reply)→from-comment:<id>;Deferred("Fixed — <applied summary>.")→from-comment:<id>"Attempted fix reverted — <reason>." - Plate操作——所有已审核的回复发布完成后(步骤9–10),且修复至少应用了一项修改时,调度终端;每次回复发布后都会进行发布操作。发布完成后,执行**§ Post-PR learnings write-back**(
/plate [--open-pr] [--hard] [--safe]§ Handoff)——affinage负责链式/cure所抑制的回写操作。未应用任何修复时,跳过plate和回写操作。../cure/SKILL.md
Fresh-window review
Fresh-window review
Standalone runs (see intro) compute the router call (Flow step 3) and run over the PR diff, passing the router's // so doesn't recompute a smaller sizing from the diff alone. Fold each returned finding into the report's severity sections tagged — they flow to like any other finding but get no GitHub reply (no reviewer to notify, same as items).
entry="affinage"/age <pr-ref>nlenseseffort/ageentry="age"[from-age:<dimension>]/cure[from-check:…]Run the fresh pass before grading external claims so an echoing comment can be deduped, under the same sub-agent gate as grading () to keep the parent context lean.
## Sub-agent context gate独立触发(见简介)会计算的路由调用(流程步骤3),并对PR diff运行,传递路由返回的//,这样/age就不会仅根据diff重新计算的更小范围。将每个返回的结果标记为并整合到报告的严重性章节中——这些结果会像其他结果一样流向/cure,但不会在GitHub上回复(没有评审者需要通知,与项相同)。
entry="affinage"/age <pr-ref>nlenseseffortentry="age"[from-age:<dimension>][from-check:…]在对外部反馈分级前执行全新扫描,这样重复的评论可以被去重,同时与分级使用相同的子Agent门控()以保持父上下文简洁。
## Sub-agent context gateMerge-conflict resolution
Merge-conflict resolution
When reports unresolved conflicts, routes to (mergiraf → rerere → kdiff3) rather than resolving by hand. Default/ run checkout + automatically before ; gates it behind the handoff prompt. If cannot resolve, write and stop. Full steps: .
pr-status/affinage/melt--auto/melt/cure--safe/meltstatus: halt: merge-conflicts-need-humanreferences/merge-conflict.md当报告存在未解决的冲突时,会路由至/melt(mergiraf → rerere → kdiff3),而非手动解决。默认/模式会在/cure前自动执行检出 + /melt;模式会将其置于切换提示的门控之下。如果/melt无法解决冲突,写入并停止。完整步骤:。
pr-status/affinage--auto--safestatus: halt: merge-conflicts-need-humanreferences/merge-conflict.mdSub-agent context gate
Sub-agent context gate
/affinagereviewerdegraded: trueReviewer-rejected/cure../age/references/sub-agent-gate.md/affinagereviewerdegraded: trueReviewer-rejected../age/references/sub-agent-gate.mdPreferred tools and fallbacks
Preferred tools and fallbacks
Call source-code search/read backends per . Affinage-specific tools:
code-intelligence-routing.md| Need | Prefer | Fallback |
|---|---|---|
| PR status (build + merge) | | manual |
| GitHub fetch | | none (skill halts) |
| Reply posting | | none — direct |
| Diff inspection | | |
根据调用源代码搜索/读取后端。Affinage专属工具:
code-intelligence-routing.md| 需求 | 首选工具 | 回退方案 |
|---|---|---|
| PR状态(构建 + 合并) | | 手动执行 |
| GitHub获取 | | 无(工具终止) |
| 回复发布 | | 无——直接调用 |
| Diff检查 | | |
Output
Output
Write to : the four-line handoff slug, then the age-style body plus two extra sections ( and the same severity / / shape uses). Full annotated template: .
.cheese/affinage/pr-<n>.md## PR status## Needs-investigation## Reviewer-rejected/agereferences/report-template.mdmarkdown
status: ok | halt: <one-line reason>
next: cure | done
artifact: <path-to-prior-cure-or-press-report-if-any>
<one-line orientation: what the PR does and what was graded>Empty severity sections are omitted; so are / when empty. when grading completed; when / failed. per § Slug values.
## Needs-investigation## Reviewer-rejectedstatus: okhalt: <reason>ghpr-statusnext:## Handoffnext:写入:四行切换信息,然后是age风格的主体加上两个额外章节(以及与/age相同的严重性 / / 结构)。完整带注释的模板:。
.cheese/affinage/pr-<n>.md## PR status## Needs-investigation## Reviewer-rejectedreferences/report-template.mdmarkdown
status: ok | halt: <one-line reason>
next: cure | done
artifact: <path-to-prior-cure-or-press-report-if-any>
<one-line orientation: what the PR does and what was graded>空的严重性章节会被省略;/为空时也会被省略。分级完成时;/失败时。的值根据 § Slug 的值确定。
## Needs-investigation## Reviewer-rejectedstatus: okghpr-statushalt: <reason>next:## Handoffnext:Handoff
Handoff
Pipeline: culture → mold → cook → press → age → cure → plate · is parallel to and feeds .
/affinage/age/cureDefault: affinage acts without asking, and asks only for a genuine reason (a sprawling/structural fix in the recommended set, conflicting findings) or under (Flow step 8).
--safe- Severity-section findings exist (any severity, including ) — compute the recommended composite (
Low). No reason to ask and noall-medium, cheap: announce the selection, dispatch--safewith the locked/cure(shape:handoff_context§ Cure dispatch context), then render the reply-approval gate before posting (Flow steps 9–10) — never post blind. A reason to ask, orreferences/handoff-templates.md: render the cure-selection gate per--safeinstead, pre-selecting the composite and flagging heavy rows.../cheese/references/handoff-gate.mdskips both gates (--auto).## Auto mode - No severity-section findings, but /
Reviewer-rejecteditems exist — nothing forNeeds-investigationto act on; render the reply-approval gate and post nothing until chosen. Only/cureskips it.--auto
After the selection, post approved replies (Flow step 9–10), then — only when the cure applied ≥1 fix — dispatch terminal (Flow step 11); publication lands after every reply. Exit when there is nothing to act on.
/plate [--open-pr] [--hard] [--safe]status: ok / next: doneSlug values. when ≥1 finding meets the floor; when no severity-section finding exists or all meeting items resolve to an empty selection.
next:curemedium+done流水线: culture → mold → cook → press → age → cure → plate · 与/age并行,并为/cure提供输入。
/affinage默认:affinage无需询问即可执行操作,仅在存在合理原因(推荐集中存在大规模/结构性修复、结果冲突)或使用参数时才会询问(流程步骤8)。
--safe- 存在严重性章节的问题(任何严重性,包括)——计算推荐的组合(
Low)。无询问理由且未使用all-medium, cheap:宣布选择结果,使用锁定的--safe调度/cure(结构详见:handoff_context§ Cure调度上下文),然后在发布前显示回复审核门控(流程步骤9–10)——切勿盲目发布。存在询问理由,或使用references/handoff-templates.md:改为显示修复选择门控(详见--safe),预先选择组合并标记需要大量工作的项。../cheese/references/handoff-gate.md会跳过这两个门控(--auto)。## Auto mode - 无严重性章节的问题,但存在/
Reviewer-rejected项——/cure无需处理任何内容;显示回复审核门控,直到选择后才发布。仅Needs-investigation会跳过该门控。--auto
选择完成后,发布已审核的回复(流程步骤9–10),然后——仅当修复至少应用了一项修改时——调度终端(流程步骤11);每次回复发布后都会进行发布操作。无操作内容时,退出状态为。
/plate [--open-pr] [--hard] [--safe]status: ok / next: doneSlug 的值。当≥1个问题符合级别时,;当无严重性章节的问题,或所有符合条件的项都被选为无需处理时,。
next:medium+next: curenext: doneAuto mode
Auto mode
Skips the selection gate. Resolves merge conflicts via first (halt if unresolved). If standalone, runs the fresh pass. Auto-selects every finding meeting ( enters this mode at ) and dispatches ; once its chain settles, posts replies for the originally graded items only, then dispatches terminal once every reply posts (skipped if no fix applied). If no findings meet the floor: skip , post rejection/investigation replies only, exit . Full mechanics: .
/meltstatus: halt: merge-conflicts-need-human/age<floor>--plate--stake medium+ --open-pr/cure --auto --stake <floor>/plate --open-pr [--hard]/curestatus: ok / next: donereferences/auto-mode.md跳过选择门控。首先通过/melt解决合并冲突(若无法解决则终止,状态为)。如果是独立触发,运行全新的/age扫描。自动选择所有符合的问题(参数会以进入该模式)并调度;链式流程完成后,仅针对最初分级的项发布回复,然后在所有回复发布后调度终端(未应用任何修复时跳过)。若无符合级别的问题:跳过/cure,仅发布拒绝/调查类回复,退出状态为。完整机制:。
status: halt: merge-conflicts-need-human<floor>--plate--stake medium+ --open-pr/cure --auto --stake <floor>/plate --open-pr [--hard]status: ok / next: donereferences/auto-mode.md--hard mode
--hard mode
/affinage--hard/plate/hard-cheese/cure/affinage--hard/plate/hard-cheeseRules
Rules
- Grading is code-grounded, not reviewer-asserted — see Flow step 6.
- Prefer fixing over pushing back. A grounded nit with a contained fix goes to as
/cure; reserveLowfor claims that are wrong, ungrounded, or a lot of work (Flow step 6,## Reviewer-rejected).../age/references/voice.md - Never auto-apply fixes itself — code fixes go through , merge conflicts through
/cure(/melt).## Merge-conflict resolution - Never post a reply without approval — see the reply-approval gate (,
## Handoff).references/handoff-templates.md - Every posted reply ends with the literal attribution via
agent on behalf of <handle>, whereskills/affinage/scripts/affinage.pyz post-replyis resolved from<handle>→RESPOND_GH_HANDLE→gh api user --jq .login. Never callgit config user.namedirectly to post.gh api - Idempotent re-runs rely on the latest-comment-from-self heuristic (Flow step 5) — the REST endpoint exposes no thread resolution state; use GraphQL
/commentsif cross-session resolution state is ever needed.reviewThreads - Apply the shared voice kernel (): name confidence as
../age/references/voice.md; agree when no findings warrant grading.certain | speculating | don't know
- 分级基于代码,而非评审者的声明——见流程步骤6。
- 优先修复而非反驳。有依据的小问题且修复范围有限时,作为级别提交给/cure;仅将错误、无依据或需要大量工作的反馈归入
Low(流程步骤6,## Reviewer-rejected)。../age/references/voice.md - 切勿自动应用修复——代码修复需通过/cure,合并冲突需通过/melt()。
## Merge-conflict resolution - 未经审核切勿发布回复——见回复审核门控(,
## Handoff)。references/handoff-templates.md - 每条发布的回复末尾必须通过添加文字
skills/affinage/scripts/affinage.pyz post-reply署名,其中agent on behalf of <handle>从<handle>→RESPOND_GH_HANDLE→gh api user --jq .login解析而来。切勿直接调用git config user.name发布回复。gh api - 幂等重运行依赖于“自身最新评论”的启发式规则(流程步骤5)——REST 端点不暴露线程解析状态;若需要跨会话解析状态,请使用GraphQL
/comments。reviewThreads - 应用共享语音内核():将置信度标记为
../age/references/voice.md;当无问题需要分级时表示同意。certain | speculating | don't know
References
References
Affinage-local, each also routed inline above: , , , , . is (shared, not affinage-local).
references/flow-details.mdreferences/merge-conflict.mdreferences/report-template.mdreferences/handoff-templates.mdreferences/auto-mode.mdsub-agent-gate.md../age/references/sub-agent-gate.mdScripts: (reply posting), (PR status fetcher).
skills/affinage/scripts/affinage.pyz post-replypr-statusAffinage本地参考资料,也已在上方内联路由:、、、、。位于(共享,非Affinage本地)。
references/flow-details.mdreferences/merge-conflict.mdreferences/report-template.mdreferences/handoff-templates.mdreferences/auto-mode.mdsub-agent-gate.md../age/references/sub-agent-gate.md脚本:(回复发布)、(PR状态获取器)。
skills/affinage/scripts/affinage.pyz post-replypr-statusAgent resolution
Agent resolution
Resolve each dispatch through .
../cheese/references/agent-resolution.md| Work | Preferred types | Permissions/isolation | Minimum power | Effort | Fallback |
|---|---|---|---|---|---|
| Triage review claims and CI evidence | reviewer | read-only, fresh-context | powerful | high | compatible reviewer, then general |
The canonical affinage report carries the shared block.
agent_resolution通过解析每个调度。
../cheese/references/agent-resolution.md| 工作内容 | 首选类型 | 权限/隔离 | 最低能力 | 工作量 | 回退方案 |
|---|---|---|---|---|---|
| 分类处理评审反馈和CI证据 | reviewer | 只读,全新上下文 | 强能力 | 高 | 兼容的reviewer,然后是通用型 |
标准affinage报告包含共享的块。
agent_resolution