- name
SKILL.md
Le fichier du skill reste dans le dépôt de l'éditeur.
Collez la commande copiée dans un terminal. Elle installe ce SKILL.md dans cet agent.
npx skills add MiniMax-AI/mcode-stack --skill pr-review-tuning -a cursor -yCollez la commande copiée dans un terminal. Elle installe ce SKILL.md dans cet agent.
npx skills add MiniMax-AI/mcode-stack --skill pr-review-tuning -a claude-code -yCollez la commande copiée dans un terminal. Elle installe ce SKILL.md dans cet agent.
npx skills add MiniMax-AI/mcode-stack --skill pr-review-tuning -a codex -yCollez la commande copiée dans un terminal. Elle installe ce SKILL.md dans cet agent.
npx skills add MiniMax-AI/mcode-stack --skill pr-review-tuning -a grok -yEnvoyez le message copié dans un chat Grok Bot. Le Bot récupère ce SKILL.md sur GitHub et l'ajoute aux skills que partagent tous vos Bots.
Install this skill: https://github.com/MiniMax-AI/mcode-stack/tree/HEAD/stacks/jiachen/skills/pr-review-tuningDe l'éditeur
The loop a team runs on its own review bot once a week: measure it on recent PRs, find noise and misses, propose at most three rule changes, backtest them on past PRs whose outcome is known, have an independent check recompute the numbers, report, and change rules only after a person approves. On GitLab a PR is a merge request.
The rules serve four goals together:
A change that improves one goal must not clearly worsen another. When it trades one for another, the proposal says so and by how much.
The working directory is .mcode-review-tuning/ in the repository the user runs this from, or a path the user names. It holds PR titles, replies and usernames: ask the user to add it to .gitignore or .git/info/exclude before the first run.
.mcode-review-tuning/
decisions.md decisions in force, dated, newest first
<week>/ the measured ISO week, for example 2026-W02
state.json where this week's run stands (references/scheduling.md)
data/ prs.jsonl and raw/ from collect.mjs; metrics.json and metrics.md
from metrics.mjs; judgments.json with your judgments
proposals/ P1.md to P3.md; candidate rule files in P<n>/; cases.jsonl
and backtest/<arm>/ from backtest.mjs
report.md the weekly report
verify.md the independent check
decisions.md records what people decided and when: the scope (host, project, target branches, time zone), the standing token budget for backtests, who approves, what stays unchanged for now, and the decision on every past proposal. Read it before anything else; it overrides the defaults in this skill. Add an entry only when a person states a decision, with its date. Never infer one.
Node 22 or later, no dependencies. Run them from this skill's directory, or with full paths.
node scripts/collect.mjs --host github|gitlab --project <owner/name or group/name> --since <iso> --until <iso> --out <dir> [--api-url <url>]
node scripts/metrics.mjs --in <dir>/prs.jsonl [--previous <old-dir>/metrics.json] --out <dir>
node scripts/backtest.mjs --host github|gitlab --project <...> --repo <local clone> --cases <cases.jsonl> --plugin <stack dir> [--profile <candidate .mcode-review.json>] [--notes <candidate .mcode-review.md>] [--lang en|zh] --budget <tokens> --out <dir>
collect.mjs reads the PRs of the window, the bot's summary state and its threads, with GET requests and GraphQL queries only, and writes <dir>/prs.jsonl (one record per PR) and the raw answers in <dir>/raw/. The token comes from GITHUB_TOKEN or GH_TOKEN on GitHub and GITLAB_TOKEN on GitLab, else from gh auth token or glab auth token. --api-url points at GitHub Enterprise or a self-managed GitLab.metrics.mjs computes the numbers that references/metrics.md defines and writes metrics.json and metrics.md. It also takes --since <iso> --until <iso>, which keep the measurement inside the week, and --sync-branches <regex> for the source branches that stay out of the time to merge.backtest.mjs replays the CI review (prepare, lens, publish as a dry run) on past PRs in isolated clones, with every write to GitHub or GitLab blocked, and stops starting new cases at the token budget. See references/backtest.md.Every run, scheduled or by hand, resumes where <week>/state.json says the week stands (references/scheduling.md).
decisions.md. Without a scope, ask the user for the host, the project, the target branches, the time zone and a standing backtest budget (or none), and record their answers. On a scheduled run, stop and report what is missing instead.references/scheduling.md has the command that prints <week> <since> <until>. Create or read <week>/state.json and follow its re-entry rules.node scripts/collect.mjs --host <host> --project <project> --since <since> --until <until> --out <week>/data.node scripts/metrics.mjs --in <week>/data/prs.jsonl --previous <last-week>/data/metrics.json --out <week>/data --since <since> --until <until>. Leave out --previous when last week has no metrics.json. Read metrics.md.data/raw/, not only the numbers, and name the pattern behind each problem: a question nobody can act on, a checklist item that misfires, risk-area globs that match too much. Judge at least 30 replied threads yourself and report how often the keyword outcome agrees with you. If you change the patterns, measure them again on a fresh sample; the sample you tuned them on cannot measure them.data/judgments.json with a confidence and one line of evidence.decisions.md says to measure only. At most three proposals, ranked, each in proposals/P<n>.md with the measured problem, the change, the expected effect on each of the four goals, the risk, how next week's data will show whether it worked, and how other review tools handle the same problem, with sources read this week. references/proposals.md has the template and says where each kind of change goes.Measure only: steps 1 to 6, the independent check and the report, with the baseline numbers and up to three candidate problems ranked for next week. No proposals and no backtest. The baseline is what makes next week's changes readable.
decisions.md..mcode-review.json or .mcode-review.md, with a description written with pr-description. A change to the plugin itself (lens checklists, prompts, limits in code) goes upstream to mcode-stack, or to the team's fork: hand the person the patch, and open the issue or PR only when they ask.decisions.md, and the PR in state.json.Run it as a MiniMax Code scheduled task, a Claude Code scheduled run or plain cron. Every trigger is safe to repeat: it reads state.json, does the next step that is due, and stops. references/scheduling.md has the state file, the re-entry rules (at most two restarts per worker per week, a wait of 20 to 30 minutes after a model gateway error) and the setup for each runner.
collect.mjs only reads, and backtest.mjs blocks every write.references/metrics.md: every number metrics.mjs computes, how, and its caveats.references/proposals.md: what can change where, the proposal template, estimating effects, other tools.references/backtest.md: cases, the token budget, running and judging.references/report-template.md: the weekly report.references/scheduling.md: the week, state.json, re-entry rules, MiniMax Code, Claude Code and cron.The weekly self-tuning loop for the MCode Review bot on GitHub or GitLab. Measures the bot on a repository's recent PRs (threads per PR, which kinds people answer or dismiss, what was unanswered at me
---name: pr-review-tuningdescription: The weekly self-tuning loop for the MCode Review bot on GitHub or GitLab. Measures the bot on a repository's…---# stacks/jiachen/skills/pr-review-tuning/SKILL.mdVue d'ensemble
The weekly self-tuning loop for the MCode Review bot on GitHub or GitLab. Measures the bot on a repository's recent PRs (threads per PR, which kinds people answer or dismiss, what was unanswered at merge, cost per round, time to merge, follow-up fixes), finds noise and misses, proposes at most three rule changes with their expected effect on each goal, backtests them on past PRs with known outcomes within an agreed token budget, has an independent check recompute the numbers, and changes rules only after a person approves. The first run only measures. Use for requests to run pr-review-tuning or to measure or tune the review bot, for the weekly scheduled run, and for settling a proposal (approve or reject P1).
FAQ
Téléchargez stacks/jiachen/skills/pr-review-tuning/SKILL.md auprès de l'éditeur, ou copiez le chemin et ouvrez le dépôt. PlugMCP répertorie le skill et n'héberge pas le fichier.
L'éditeur le maintient sur https://github.com/MiniMax-AI/mcode-stack.
Claude, Cursor, Codex et Grok Build peuvent lire un SKILL.md que vous ajoutez depuis le dépôt de l'éditeur. Grok Bot l'installe lorsque vous envoyez dans un chat le lien du dossier GitHub du skill.
decisions.mdreferences/backtest.mdreferences/metrics.md, recomputes at least five headline numbers with a short script of its own (at least two straight from the GitHub or GitLab API, the rest from prs.jsonl; never with collect.mjs or metrics.mjs), re-judges at least ten of your judgments, and writes verify.md with PASS or FAIL per item and every difference. Fix what fails, or take it out of the report and say so.report.md from references/report-template.md in the user's language: conclusion first, verified, inferred and unverified claims kept apart. Reply with the one-line conclusion, the proposals waiting for a decision and the path of the report.