affinage
Skill19 starsChanged 28 days agoMITView on GitHub
Triage a GitHub PR's review comments, CI failures, and merge conflicts through the /age lens. Use when the user says "address the PR feedback", "fix the review comments on PR 123", "fix CI on my PR", "resolve this PR's merge conflicts", or "/affinage". Do not use for a diff without a PR. Use /age instead. Do not use for local Git conflicts without a PR. Use /melt instead.
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- python-authoringSkill
- skill-authoringSkill
- ageSkill
- briesearchSkill
- cheeseSkill
- cookSkill
- cultureSkill
- cureSkill
- easy-cheese-setupSkill
- hard-cheeseSkill
- meltSkill
- moldSkill
- pasteurizeSkill
- plateSkill
- pressSkill
- ultracookSkill
- wheypointSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
68 rules. About 0 are common, 9 are distinctive, and 59 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
59
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Run /age on the PR diff unless the user passes --no-age.
- Distinctive: line 25
Add the new findings to the same report.
- Very specific: line 49
If no reference exists, run gh pr view --json number on the current branch.
- Very specific: line 56
Use the same floor rules as /cure.
- Very specific: line 76
Read ../cheese/references/harness-portability.md for portability rules.
- Very specific: line 78
Use the bundle or repository helper first.
- Very specific: line 79
Do not use the ${CLAUDE_SKILL_DIR} environment variable in an invocation path.
- Very specific: line 85
Read references/flow-details.md for exact commands, exit codes, and grading reasons.
- Very specific: line 87
Resolve PR: Use <pr-ref> or gh pr view --json number.
- Very specific: line 90
Fetch PR status: Run python3 skills/affinage/scripts/affinage.pyz pr-status <pr>.
- Very specific: line 94
Check out the PR: Run gh pr checkout <pr>. The fresh review and /cure read the PR head from the working tree.
- Very specific: line 97
Before a branch switch, stop with status: halt: pr-checkout-dirty-tree on a dirty tree.
- Very specific: line 103
Keep each nonempty body. Remove duplicates by pull_request_review_id.
- Very specific: line 104
Remove duplicates by pull_request_review_id.
- Very specific: line 105
Skip answered threads: Read thread resolution state from GraphQL reviewThreads.
- Very specific: line 108
Run fresh review: Run this step only in standalone mode without --no-age.
- Very specific: line 111
Run /age with the complete subject plan and its evidence.
- Very specific: line 114
Do not increase severity because a reviewer selected CHANGES_REQUESTED.
- Very specific: line 115
Put contained fixes in severity sections.
- Very specific: line 116
Put claims that need outside evidence in ## Needs-investigation.
- Very specific: line 117
Put wrong, unsupported, or large claims in ## Reviewer-rejected.
- Very specific: line 118
Put claims that the current head already fixes in ## Already-addressed.
- Very specific: line 119
Write report: Write .cheese/affinage/pr-<n>.md.
- Very specific: line 120
Start with the four-line handoff slug.
- Very specific: line 121
Add the /age report body and the affinage sections.
- Very specific: line 123
Act or ask: Follow ## Handoff.
- Distinctive: line 125
Do not reply to CI or fresh-review findings.
- Very specific: line 126
Draft cure replies: Run this step only after /cure.
- Very specific: line 127
Read ### Applied and ### Deferred from .cheese/cure/pr-<n>.md.
- Very specific: line 130
Re-review the cure diff: Run this step only after a /cure run without --auto.
- Very specific: line 132
Run the /age <slug> --scope <touched-path> command that .cheese/cure/pr-<n>.md recommends.
- Very specific: line 133
Start each reviewer worker prompt with the line Review mode: severity-report.
- Very specific: line 134
Use the /age findings, not its handoff gate.
- Very specific: line 136
Do not re-review that second /cure.
- Distinctive: line 137
Do not draft replies for these findings.
- Very specific: line 143
Publish: Run this step only after all approved replies post.
- Very specific: line 155
Add each result to its severity section with [from-age:<dimension>].
- Distinctive: line 157
Do not post GitHub replies for these findings.
- Very specific: line 159
Run the fresh review before you grade external claims.
- Very specific: line 161
Use the same agent gate as the grading step.
- Very specific: line 166
When pr-status reports conflicts, send the PR to /melt.
- Distinctive: line 168
Do not resolve conflicts by hand.
- Very specific: line 170
Default and --auto modes run checkout and /melt before /cure.
- Very specific: line 172
If /melt fails, write status: halt: merge-conflicts-need-human and stop.
- Very specific: line 179
Keep dialogue, selection, approval state, and reply posting in the parent context.
- Very specific: line 180
Use a fresh read-only reviewer when any limit below is true:
- Very specific: line 187
Start the reviewer prompt with the line Review mode: severity-report.
- Very specific: line 189
Use a general worker only with degraded: true.
- Very specific: line 197
Use code-intelligence-routing.md for source code operations.
- Distinctive: line 198
Use these affinage tools:
- Very specific: line 208
Write the report to .cheese/affinage/pr-<n>.md.
- Very specific: line 211
Use the severity sections from /age.
- Very specific: line 212
Add the ## Needs-investigation and ## Reviewer-rejected sections from /affinage.
- Very specific: line 222
Use the canonical status: grammar from the handback contract.
- Very specific: line 223
Only next: and the extra keyed lines are phase-specific.
- Very specific: line 225
Use status: ok after grading completes.
- Very specific: line 226
Use status: halt: <reason> when gh or pr-status fails.
- Very specific: line 235
Ask only when the selected fix is large, findings conflict, or --safe is active.
- Very specific: line 243
Use the shared gate in ../cheese/references/handoff-gate.md.
- Very specific: line 246
Only rejected or investigation claims exist: Do not call /cure. Show the reply gate.
- Very specific: line 260
Read references/auto-mode.md when --auto or --plate is active.
- Distinctive: line 273
Prefer a contained fix to push-back.
- Distinctive: line 276
Never apply code fixes in affinage.
- Very specific: line 278
Never post a reply or resolve a thread without approval, unless --auto is active.
- Very specific: line 282
Use GraphQL only to read reviewThreads state and to resolve already-addressed threads.
- Very specific: line 284
Use certain, speculating, or don't know for confidence.
- Distinctive: line 289
Read each affinage reference when its trigger applies:
- Very specific: line 299
Use ../age/references/sub-agent-gate.md for the shared agent gate.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/affinage
Act on existing claims about a PR.
Claims can come from reviewers, CI checks, or merge conflicts.
Grade each claim through the /age lens.
Send accepted claims to /cure.
/affinage always grades claims that exist on the PR.
Its entry path controls whether it also finds new /age findings:
- Standalone — The user starts
/affinage <pr>withouthandoff_context. Run/ageon the PR diff unless the user passes--no-age. Add the new findings to the same report. - Chained —
/cookor/curesupplieshandoff_context. Skip the fresh review because/agealready ran in this chain.
See ## Fresh review for the entry rule.
See ## Merge-conflict resolution for the conflict path.
Phase entry
Run python3 skills/affinage/scripts/affinage.pyz wheypoint-resolve --ref <slug>.
authoritative uses the record; its working_context is the first batched tilth_read.
not-found proceeds cold; legacy shows its source and slug, then proceeds.
gated, ambiguous, and error stop and show the payload.
Show advisory stale-commit and grounded-path-missing findings.
Inputs
/affinage [<pr-ref>] [--auto --stake <floor>] [--plate] [--safe] [--open-pr] [--hard] [--full] [--include-outdated]<pr-ref> accepts a PR number, a PR#<n> reference, or a full GitHub PR URL.
Extract the integer before you call pr-status.
The command accepts only the integer.
If no reference exists, run gh pr view --json number on the current branch.
Flags:
--auto --stake <floor>— Run without selection prompts.<floor>acceptsblocker,high,medium+, orall. Bare--autouses themedium+default floor. Use the same floor rules as/cure. Send/cure --auto --stake <floor>. Post replies without prompts. Seereferences/auto-mode.md.--safe— Add gates before cure selection and conflict resolution. This flag does not remove the default reply gate.--open-pr— Let terminal/plateopen a new PR when no PR exists. Without this flag,/plateonly updates an open PR.--plate— Run--auto --stake medium+ --open-pr. Grade the claims. Cure the selected findings. Post the replies. Then run/plate. An explicit--stake <floor>replacesmedium+.--hard— Pass the metacognitive gate flag to terminal/plate.--full— Show all low findings when at least 10 low findings exist.--include-outdated— Include outdated review threads.--no-age— Skip the fresh review in standalone mode. This flag has no effect in chained mode.
Read ../cheese/references/harness-portability.md for portability rules.
It covers helper resolution, agent dispatch, GitHub operations, and handoff transitions.
Use the bundle or repository helper first.
Do not use the ${CLAUDE_SKILL_DIR} environment variable in an invocation path.
The handoff blocks below define the portable contract.
The rule "slash commands are host renderings, not the control model" applies here.
Flow
Read references/flow-details.md for exact commands, exit codes, and grading reasons.
- Resolve PR. Use
<pr-ref>orgh pr view --json number. Normalize aPR#<n>reference or a PR URL to its integer. Resolve<owner>/<repo>from the Git remote. - Fetch PR status. Run
python3 skills/affinage/scripts/affinage.pyz pr-status <pr>. Alogs_expired: truefield stops withstatus: halt: pr-status-logs-expired. A nonzero exit stops withstatus: halt: pr-status-unavailable. Route a conflicting or dirty merge state to## Merge-conflict resolution. - Check out the PR. Run
gh pr checkout <pr>. The fresh review and/cureread the PR head from the working tree. Skip this step when## Merge-conflict resolutionalready checked out the PR. Before a branch switch, stop withstatus: halt: pr-checkout-dirty-treeon a dirty tree. With--safe, ask before the checkout. A failed checkout stops withstatus: halt: pr-checkout-failed. - Fetch comments. Fetch inline threads from
pulls/<pr>/comments. Skip comments withposition: nullunless the user passes--include-outdated. Fetch review bodies frompulls/<pr>/reviews. Keep each nonempty body. Remove duplicates bypull_request_review_id. - Skip answered threads. Read thread resolution state from GraphQL
reviewThreads. Skip a thread that GitHub marks resolved. Skip a thread when the resolved GitHub handle replied after its root comment. - Run fresh review. Run this step only in standalone mode without
--no-age. Build contextual review input and call the bundledage-routecommand. Include the unresolved thread count from step 5 and the CI failure class. Run/agewith the complete subject plan and its evidence. Tag each new finding with[from-age:<dimension>]. - Grade claims. Classify each claim by the
/agedimension and severity rules. Do not increase severity because a reviewer selectedCHANGES_REQUESTED. Put contained fixes in severity sections. Put claims that need outside evidence in## Needs-investigation. Put wrong, unsupported, or large claims in## Reviewer-rejected. Put claims that the current head already fixes in## Already-addressed. - Write report. Write
.cheese/affinage/pr-<n>.md. Start with the four-line handoff slug. Add the/agereport body and the affinage sections. See## Output. - Act or ask. Follow
## Handoff. - Draft non-cure replies. Draft replies for rejected and investigation claims. Do not reply to CI or fresh-review findings.
- Draft cure replies. Run this step only after
/cure. Read### Appliedand### Deferredfrom.cheese/cure/pr-<n>.md. DraftFixed — <applied summary>.for applied comment findings. DraftAttempted fix reverted — <reason>.for deferred comment findings. - Re-review the cure diff. Run this step only after a
/curerun without--auto./cure --autoruns its own scoped/agechain. Run the/age <slug> --scope <touched-path>command that.cheese/cure/pr-<n>.mdrecommends. Start eachreviewerworker prompt with the lineReview mode: severity-report. Use the/agefindings, not its handoff gate. Send the new findings to one more/cureby the## Handoffrules. Do not re-review that second/cure. Do not draft replies for these findings. Report each finding that remains as a residual. - Post replies. Show one reply gate that lists every drafted reply and every already-addressed thread.
Skip the gate only when
--autois active. Post approved replies withpython3 skills/affinage/scripts/affinage.pyz post-reply. Resolve each approved already-addressed thread without a reply. - Publish. Run this step only after all approved replies post.
Publish when
/cureapplies at least one fix. Also publish when/meltresolved a merge conflict. Send terminal/plate [--open-pr] [--hard] [--safe]. Then run the post-PR learning write-back from../cure/SKILL.md. Skip publication and write-back when the working tree has no change.
Fresh review
Standalone mode calls the router with entry="affinage".
Pass the PR reference and the router values to /age.
This prevents /age from calculating a smaller route with entry="age".
Add each result to its severity section with [from-age:<dimension>].
Send these findings to /cure like other findings.
Do not post GitHub replies for these findings.
Run the fresh review before you grade external claims.
This order lets you remove duplicate findings.
Use the same agent gate as the grading step.
Start each reviewer worker prompt with the line Review mode: severity-report.
Merge-conflict resolution
When pr-status reports conflicts, send the PR to /melt.
/melt uses mergiraf, rerere, and kdiff3.
Do not resolve conflicts by hand.
Default and --auto modes run checkout and /melt before /cure.
--safe requires the handoff gate first.
If /melt fails, write status: halt: merge-conflicts-need-human and stop.
/melt leaves the resolution uncommitted.
Terminal /plate commits and pushes that resolution.
See references/merge-conflict.md.
Sub-agent context gate
Keep dialogue, selection, approval state, and reply posting in the parent context.
Use a fresh read-only reviewer when any limit below is true:
- More than 10 inputs exist.
- The diff exceeds approximately 25 KB.
- Threads cover more than 5 files.
Resolve the reviewer through the shared agent resolver.
Start the reviewer prompt with the line Review mode: severity-report.
Without that line, the reviewer agent returns blocked: missing-contract.
Use a general worker only with degraded: true.
The reviewer returns a compact digest of graded findings.
Each finding includes its dimension, severity, confidence, evidence, and draft push-back.
The parent writes the report, controls selection, calls /cure, and posts replies.
See ../age/references/sub-agent-gate.md for digest limits.
Preferred tools and fallbacks
Use code-intelligence-routing.md for source code operations.
Use these affinage tools:
| Need | Prefer | Fallback |
| PR status | python3 skills/affinage/scripts/affinage.pyz pr-status | gh pr checks and gh pr view |
| GitHub fetch | gh api | none; stop the skill |
| Reply posting | python3 skills/affinage/scripts/affinage.pyz post-reply | none; direct gh api calls omit attribution |
Output
Write the report to .cheese/affinage/pr-<n>.md.
Start with the four-line handoff slug.
Then add the /age report body and the ## PR status section.
Use the severity sections from /age.
Add the ## Needs-investigation and ## Reviewer-rejected sections from /affinage.
See references/report-template.md.
status: <canonical status field>
next: cure | done
artifact: <path-to-prior-cure-or-press-report-if-any>
<one-line orientation: what the PR does and what was graded>Use the canonical status: grammar from the handback contract.
Only next: and the extra keyed lines are phase-specific.
Omit empty sections.
Use status: ok after grading completes.
Use status: halt: <reason> when gh or pr-status fails.
Set next: by the rules in ## Handoff.
Handoff
Pipeline: culture → mold → cook (⇄ press) → age → cure → plate.
/affinage runs parallel to /age and sends findings to /cure.
By default, affinage acts without a prompt.
Ask only when the selected fix is large, findings conflict, or --safe is active.
- Severity findings exist. Calculate the recommended
all-medium, cheapselection. Without an ask reason, announce the selection. Then send/curethe lockedhandoff_context. Then show one reply gate for every drafted reply. That gate covers the applied, deferred, push-back, and investigation replies. With an ask reason, show the cure selection gate instead. Use the shared gate in../cheese/references/handoff-gate.md. Preselect the composite and identify large rows.--autoskips both gates. - Only rejected or investigation claims exist. Do not call
/cure. Show the reply gate. Then wait for a selection.--autoskips this gate.
Then follow Flow steps 10 through 14.
Set status: ok / next: done when no action remains.
Set next: cure when at least one finding meets the medium+ floor.
Set next: done when no severity finding exists.
Also set next: done when the selected findings are empty.
Auto mode
Read references/auto-mode.md when --auto or --plate is active.
It defines the selection, cure chain, reply, and publication steps.
--hard mode
Pass --hard to terminal /plate.
/plate runs /hard-cheese after it verifies the final artifact.
/cure does not call /plate in this chain.
The gate therefore runs once at the publication boundary.
Rules
- Ground each grade in code evidence.
- Prefer a contained fix to push-back.
- Send a valid, contained quality fix to
/cureasLow. - Reserve
## Reviewer-rejectedfor wrong, unsupported, or large claims. - Never apply code fixes in affinage.
- Send code fixes to
/cureand merge conflicts to/melt. - Never post a reply or resolve a thread without approval, unless
--autois active. - Post replies only through
python3 skills/affinage/scripts/affinage.pyz post-reply. - End every reply with
agent on behalf of <handle>. - Resolve
<handle>fromRESPOND_GH_HANDLE,gh api user --jq .login, orgit config user.name. - Use GraphQL only to read
reviewThreadsstate and to resolve already-addressed threads. - Apply the voice rules in
../age/references/voice.md. - Use
certain,speculating, ordon't knowfor confidence. - State that no findings exist when no claim needs grading.
References
Read each affinage reference when its trigger applies:
references/flow-details.md— read when you run Flow steps 2, 3, 5, 6, 7, 10, or 13.references/merge-conflict.md— read whenpr-statusreports a conflicting or dirty merge state.references/report-template.md— read when you write the report at Flow step 8.references/handoff-templates.md— read when you render the cure selection gate or the reply gate.references/auto-mode.md— read when--autoor--plateis active.references/commands.md— read when you need the exact flags of a bundled command. The file is the generated command inventory.
Use ../age/references/sub-agent-gate.md for the shared agent gate.
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 includes the shared agent_resolution block.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

