- name
SKILL.md
Die Skill-Datei bleibt im Repository des Herausgebers.
Fügen Sie den kopierten Befehl in ein Terminal ein. Er installiert diese SKILL.md in dem jeweiligen Agenten.
npx skills add MiniMax-AI/mcode-stack --skill pr-review-ci -a cursor -yFügen Sie den kopierten Befehl in ein Terminal ein. Er installiert diese SKILL.md in dem jeweiligen Agenten.
npx skills add MiniMax-AI/mcode-stack --skill pr-review-ci -a claude-code -yFügen Sie den kopierten Befehl in ein Terminal ein. Er installiert diese SKILL.md in dem jeweiligen Agenten.
npx skills add MiniMax-AI/mcode-stack --skill pr-review-ci -a codex -yFügen Sie den kopierten Befehl in ein Terminal ein. Er installiert diese SKILL.md in dem jeweiligen Agenten.
npx skills add MiniMax-AI/mcode-stack --skill pr-review-ci -a grok -ySenden Sie die kopierte Nachricht in einem Grok Bot-Chat. Der Bot ruft diese SKILL.md von GitHub ab und fügt sie den Skills hinzu, die alle Ihre Bots gemeinsam nutzen.
Install this skill: https://github.com/MiniMax-AI/mcode-stack/tree/HEAD/stacks/jiachen/skills/pr-review-ciVom Herausgeber
MCode Review runs as a GitHub Actions workflow or as a GitLab CI child pipeline. Both have the same jobs:
Every job runs one subcommand of ci/review.mjs from the plugin at the commit pinned in MCODE_REVIEW_PLUGIN_REF, a 40-character commit of github.com/MiniMax-AI/mcode-stack. Paths below without a repository name are relative to the plugin directory, stacks/jiachen in mcode-stack. On GitLab a PR is a merge request.
.github/workflows/mcode-review.yml on GitHub; .gitlab/mcode-review.gitlab-ci.yml plus the dispatch job in .gitlab-ci.yml on GitLab. Behaviour changes go into the repository's rule pack or into the plugin, never only into the copy.gh or glab only when the user asks you to, never print a secret, and never put one on a command line.Use a full 40-character commit, for example the head of main: git ls-remote https://github.com/MiniMax-AI/mcode-stack refs/heads/main. prepare stops on anything else, so a branch or tag name never moves the version under running PRs. A file of that commit is at https://raw.githubusercontent.com/MiniMax-AI/mcode-stack/<commit>/stacks/jiachen/<path>.
You need GitHub Actions enabled, runners that reach github.com, the npm registry and the model endpoint, and admin access to the repository's settings.
Copy the workflow from the commit: curl -fsSL -o .github/workflows/mcode-review.yml https://raw.githubusercontent.com/MiniMax-AI/mcode-stack/<commit>/stacks/jiachen/ci/github/mcode-review.yml.
In its top-level env, replace <40-character commit of mcode-stack> in MCODE_REVIEW_PLUGIN_REF with the commit. Leave MCODE_REVIEW_TEMPLATE_VERSION, MCODE_REVIEW_PLUGIN_PATH, MCODE_REVIEW_HOST and the jobs as they are. The same block holds MCODE_REVIEW_REPO_PROFILE (a rule pack bundled in ci/config/repos/, default default), MCODE_REVIEW_MCODE_VERSION and MCODE_REVIEW_NPM_REGISTRY; change those only for a reason.
In Settings → Secrets and variables → Actions:
MCODE_REVIEW_API_KEY: the model API key;MCODE_REVIEW_BASE_URL: an Anthropic Messages compatible endpoint, for example https://api.minimax.io/anthropic/v1; docs/pr-review.md lists the endpoint for mainland China;MCODE_REVIEW_LANGUAGE (en or zh), MCODE_REVIEW_PHASE (shadow or enforce), MCODE_REVIEW_HTTPS_PROXY and MCODE_REVIEW_PLUGIN_ARCHIVE_URL;MCODE_REVIEW_GITHUB_TOKEN: the token of a dedicated bot account or GitHub App, to post as that identity instead of github-actions. It needs write access to contents, pull requests and issues of this repository and nothing more; GitHub resolves review threads only for a token that may write contents. With an app token, also set the variable MCODE_REVIEW_BOT_LOGIN to the app's login, such as my-app[bot].With gh: gh variable set MCODE_REVIEW_BASE_URL --body <url>. Let the user run gh secret set MCODE_REVIEW_API_KEY themselves; it prompts for the value, so the key never passes through you.
Commit the workflow on a branch of this repository and open a PR that is not a draft. A PR runs the workflow file of its own branch, so this PR gets the first review. Check it as "Verify" says.
grade starts on comments only after the workflow is on the default branch: GitHub runs comment-triggered workflows from the default branch.
You need runners that run the node:22 image and reach github.com, the npm registry and the model endpoint, and the Maintainer role to set CI/CD variables and create a project access token.
curl -fsSL -o .gitlab/mcode-review.gitlab-ci.yml https://raw.githubusercontent.com/MiniMax-AI/mcode-stack/<commit>/stacks/jiachen/ci/gitlab/review.gitlab-ci.yml. Do not edit the copy.ci/gitlab/dispatch.gitlab-ci.yml at the same commit into the project's .gitlab-ci.yml. Then:
stage to a stage the project already has;<40-character commit of mcode-stack> in MCODE_REVIEW_PLUGIN_REF with the commit;trigger:include:local of .gitlab/mcode-review.gitlab-ci.yml; forward with yaml_variables: true and pipeline_variables: false, which keeps the variables of a manually run pipeline out of the review; and the Draft rule with when: manual and allow_failure: true;&& $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH to both rules.MCODE_REVIEW_API_KEY: the model API key;MCODE_REVIEW_BASE_URL: as on GitHub;MCODE_REVIEW_GITLAB_TOKEN: a bot token that can read the PR, post notes and resolve threads, such as a project access token with the api scope and the Developer role. Set its environment scope to mcode-review;MCODE_REVIEW_LANGUAGE, MCODE_REVIEW_PHASE, MCODE_REVIEW_HTTPS_PROXY, MCODE_REVIEW_NPM_REGISTRY, MCODE_REVIEW_MCODE_VERSION, MCODE_REVIEW_PLUGIN_ARCHIVE_URL and the Feishu variables. A bundled rule pack other than default goes into MCODE_REVIEW_REPO_PROFILE in the dispatch job.ci/github/mcode-review.yml and ci/gitlab/review.gitlab-ci.yml set MCODE_REVIEW_TEMPLATE_VERSION, and the plugin code has the version it expects. When the copy's value differs or is missing, prepare stops with "your copy of is from another plugin version; copy it again from commit ". Copy the template again from the commit the message names, or pin the commit the copy came from. Never edit the version line by hand: a template from one commit with code from another can call a subcommand or need a variable the other does not have.
MCODE_REVIEW_PLUGIN_REF to it and copy the template from the same commit:
env block (the pin, and the profile, CLI version and registry if you changed them).ci/gitlab/dispatch.gitlab-ci.yml at the new commit and apply its changes, and set the new pin in the dispatch job.needs can affect the repository's other CI rules and branch protection.When open PRs pick up the change: GitHub runs a PR's workflow from the test merge of the PR into its target, so open PRs use the new version from their next push (a PR with conflicts gets no run at all). GitLab runs the CI config of the PR's source branch, so an open PR keeps its old dispatch job and template until it rebases or merges the target branch.
Two optional files in the repository root. CI reads both from the merge base; the local pr-review skill reads them from the working tree.
.mcode-review.json: a rule pack with the keys of ci/config/repos/*.json, merged over ci/config/repos/default.json (and over the bundled profile in MCODE_REVIEW_REPO_PROFILE when that is set) key by key: risk_areas (id, name, globs, questions: the questions a person is asked when a PR touches those paths), stacks, ui_globs, generated_globs, tier_thresholds and quiz. A name or questions value is plain text in one language, or an object with one entry per language, { "en": ..., "zh": ... }. quiz overrides only the fields it sets, and its non_product_globs add to the built-in ones. Start from ci/config/repos/example.json, which shows every key..mcode-review.md: the repository's known failure patterns, one numbered list, in the format of skills/pr-review/references/repos/example.md. Every review direction reads it.Notes:
.mcode-review.json that does not parse is reported in the prepare log, and the bundled rule pack is used instead. Check it before committing: node -e 'JSON.parse(require("fs").readFileSync(".mcode-review.json", "utf8"))'.pr-review-tuning skill measures how the rules work on the repository's PRs and proposes changes to these two files.MCODE_REVIEW_LANGUAGE is en (the default) or zh for Simplified Chinese; zh-CN, zh-Hans and chinese also mean zh, and any other value falls back to en with a line in the prepare log. It sets the language of everything the bot posts: summary, threads, rule questions, quiz and Feishu card; the model writes its findings in that language too. Job logs stay in English. A pipeline keeps the language prepare read, and replies in either language are understood.
MiniMax-M3.1-Flash through the Anthropic Messages API at MCODE_REVIEW_BASE_URL.ci/config/models.json holds the provider (provider.headers adds HTTP headers to every call), the models (api: anthropic-messages or openai-responses, context and output token limits, the efforts they support), a model chain per role (lens finds problems, verify checks P0 and P1, quiz writes the quiz), the timeouts in seconds, and optional arms that split PRs between model setups to compare them. Any model the endpoint serves can be added and named in a chain; the code never branches on a model name. A fast failure moves on to the next model of the chain. When a second model is available, putting it first in roles.verify.chain gives a verifier that does not share the finder's blind spots.ci/config/models.json there and commit; set MCODE_REVIEW_PLUGIN_ARCHIVE_URL to a tar.gz of that commit whose one top-level directory holds stacks/jiachen (for a GitHub fork, https://github.com/<owner>/mcode-stack/archive/<commit>.tar.gz); set MCODE_REVIEW_PLUGIN_REF to the fork's commit; and copy the template from that commit. The download sends no token, so the archive must be readable without one.MCODE_REVIEW_PHASE is shadow by default: the summary says the review only comments and does not block. The review never fails the workflow or the pipeline.MCODE_REVIEW_PHASE to enforce so the summary stops saying it only comments.pr-review-tuning report..mcode-review.json with "quiz": { "enabled": true }. PRs that change enough product code (120 lines or 4 files by default; docs, tests and generated files excluded) or a risk path get a short multiple-choice quiz comment: why the change works this way, what it affects, edge cases and failure modes. Answers are public and never block a merge.questions, min_code_lines, min_code_files, skip_source_branches (regular expressions), non_product_globs, regen_min_line_delta, regen_min_file_delta and max_per_mr (quizzes per PR).grade: on GitHub when a person comments on the PR, on GitLab when someone starts the manual mcode-review:grade job.skills/pr-quiz.When MCODE_REVIEW_FEISHU_APP_ID, MCODE_REVIEW_FEISHU_CHAT_ID and MCODE_REVIEW_FEISHU_APP_SECRET are set, publish also sends each author quiz as a card to that Feishu group chat and updates it as the author answers. Without them no card is sent.
MCODE_REVIEW_FEISHU_EMAIL_DOMAINS to the company email domains, comma separated. publish tries, in order, the author's entry in MCODE_REVIEW_FEISHU_EMAIL_ALIASES, commit emails that match the author's username, then the username at each domain, until Feishu accepts one; its log names the email it used, or on a no @ line the emails Feishu rejected. Feishu matches the contact email in its directory, which commits cannot always show: add such authors to MCODE_REVIEW_FEISHU_EMAIL_ALIASES as username=email,username=email, with the contact email, not the enterprise email. Keep the emails in that setting, not in a repository. An author is mentioned only as a member of the chat.MCODE_REVIEW_FEISHU_APP_SECRET and MCODE_REVIEW_FEISHU_EMAIL_ALIASES to mcode-review.MCODE_REVIEW_FEISHU_APP_ID, MCODE_REVIEW_FEISHU_CHAT_ID and MCODE_REVIEW_FEISHU_EMAIL_DOMAINS, and repository secrets MCODE_REVIEW_FEISHU_APP_SECRET and MCODE_REVIEW_FEISHU_EMAIL_ALIASES; the workflow passes them to publish and grade only.GitHub:
permissions: {} at the top and each job asks for its own: prepare reads code, PRs and issues; review and quiz read code only; grade writes PR comments; publish writes PR comments and threads, and contents too, because GitHub resolves and reopens review threads only for a token that may write contents. publish checks out nothing and runs no model.persist-credentials: false. publish and grade hold the token and never call a model.pull_request_target to review them: that runs untrusted code with the repository's secrets. Draft PRs are skipped until they are ready for review. grade ignores comments by bots.GitLab:
mcode-review environment. Only prepare, publish and grade use that environment, and they never call a model.mcode-review:review, mcode-review:quiz) have no environment, but GitLab gives every job the unscoped project and group variables, and a model with a shell can read them. Keep unrelated secrets environment-scoped or protected. The pipeline removes every credential-looking value from what those jobs write, and removes credentials from the git remote before a model starts.mcode-review environment. Such a change shows in the diff and touches the CI risk path of the rule pack.Both hosts:
AGENTS.md, CLAUDE.md, .mcode-review.json, .mcode-review.md and similar) are restored to the merge-base version. PR titles, descriptions and replies in the bot's threads reach the model as untrusted data. On a public repository anyone who can comment on a PR can reply in those threads.GitHub:
gh run list --workflow mcode-review.yml and gh run view <run-id> --log: mcode-review:prepare passes the template version check and logs the tier and the directions; one mcode-review:review (<direction>) job runs per direction; mcode-review:publish succeeds.GitLab:
POST /projects/:id/ci/lint with the project's .gitlab-ci.yml as content, "dry_run": true and "ref" set to the pushed source branch. The answer must have "valid": true and no errors. glab ci lint --dry-run --ref <branch> and the project's pipeline editor run the same check.mcode-review:prepare, one mcode-review:review job per direction, mcode-review:quiz, mcode-review:publish and the manual mcode-review:grade. publish posts a note that starts with "MCode Review".To rehearse without posting, set MCODE_REVIEW_DRY_RUN to '1' on a test branch that you never merge: in the workflow's env on GitHub, in the dispatch job's variables on GitLab. publish then posts nothing and writes the summary to .mcode-review/out/summary.md and a quiz to .mcode-review/out/quiz-note.md. GitLab keeps the summary and the verdict in the publish job's artifacts; the GitHub workflow uploads nothing from publish, so there its log line [dry-run] summary written ... gives the verdict. The review directions still call the model. pr-review-tuning rehearses rounds on past PRs the same way, with every write to GitHub or GitLab blocked.
CI_MERGE_REQUEST_DRAFT. The dispatch job detects a Draft PR from the title, which works on every version.when: manual defaults to allow_failure: false and holds the pipeline until someone starts the job. Write allow_failure: true in that rule.interruptible belongs on the child's jobs, as the template sets it. The review jobs are interruptible: false and queue per PR and direction in a resource_group: a newer push never cancels a running direction, and the next round reuses its result.workflow rule needs CI_MERGE_REQUEST_IID and MCODE_REVIEW_PLUGIN_REF.include cannot see YAML variables. trigger:include sees the trigger job's variables as well as project and group variables.refs/merge-requests/<n>/head with the source branch's own CI config, so it keeps its old dispatch job and the version written in it until it rebases.grade) uses the workflow of the default branch, so during an upgrade PR it still runs the old version.mcode-review environment.ci/review.mjs.stacks/jiachen on Node 22 and on the current Node: node --test ci/test/*.test.mjs.Connects a GitHub or GitLab repository to the MCode Review CI and keeps the setup current. Use when someone adds MCode Review to a repository on GitHub Actions or GitLab CI, upgrades or rolls back the
---name: pr-review-cidescription: Connects a GitHub or GitLab repository to the MCode Review CI and keeps the setup current. Use when someone…---# stacks/jiachen/skills/pr-review-ci/SKILL.mdÜbersicht
Connects a GitHub or GitLab repository to the MCode Review CI and keeps the setup current. Use when someone adds MCode Review to a repository on GitHub Actions or GitLab CI, upgrades or rolls back the pinned plugin commit, changes the repository's rule pack, language, models, shadow or enforce phase, author quiz or Feishu card, checks the security setup, or troubleshoots a review run that failed.
FAQ
Laden Sie stacks/jiachen/skills/pr-review-ci/SKILL.md vom Herausgeber herunter oder kopieren Sie den Pfad und öffnen Sie das Repository. PlugMCP listet den Skill und hostet die Datei nicht.
Der Herausgeber pflegt es unter https://github.com/MiniMax-AI/mcode-stack.
Claude, Cursor, Codex und Grok Build können eine SKILL.md lesen, die Sie aus dem Repository des Herausgebers hinzufügen. Grok Bot installiert sie, wenn Sie den Link zum GitHub-Ordner des Skills in einem Chat senden.
ci/gitlab/dispatch.gitlab-ci.yml| No child pipeline on GitLab | A branch pipeline (the child needs a merge request pipeline), or the included file is not at .gitlab/mcode-review.gitlab-ci.yml | See "GitLab pitfalls" |
| grade never runs on GitHub | The workflow is not on the default branch yet, or the comment came from a bot | Merge the onboarding PR; answer as a person |
| The bot asks again what was answered, or forgets earlier rounds | Its summary comment, which carries the state, was deleted | Leave the summary comment in place; the next round starts over |