zjuncher/mr-agent/usage-guide
Claude Code and agent skill by zjuncher/mr-agent
- community
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install zjuncher/mr-agent/usage-guideSKILL.md
Project Review Skill
Summary
Project Review Skill lets each GitLab project own declarative review rules for /review and /improve without copying or replacing PR-Agent's global prompts. A project opts in by committing one validated manifest to its target branch; PR-Agent pins that manifest and its referenced Markdown files to the exact target-branch SHA used by the command.
The Skill is project context, not executable code. It cannot add tools, run commands, change output schemas, weaken global safety rules, or grant the model additional repository permissions.
Source of truth
| Item | Path | |
|---|---|---|
| Runtime schema, selection, hashing | pr_agent/suggestions/project_prompt_rules.py | |
| GitLab target-SHA reader | pr_agent/git_providers/gitlab_provider.py | |
/review integration | pr_agent/tools/pr_reviewer.py | |
/improve integration | pr_agent/tools/pr_code_suggestions.py | |
| Usage and feedback storage | pr_agent/feedback/store.py, pr_agent/suggestions/store.py | |
| Cross-project evolution | pr_agent/suggestions/prompt_evolution/project_skill_runner.py | |
| Static evolution guard | pr_agent/suggestions/prompt_evolution/validator.py | |
| SkillOpt batching and score gate | pr_agent/suggestions/prompt_evolution/project_skill_optimizer.py | |
| Pinned-model paired replay | pr_agent/suggestions/prompt_evolution/project_skill_evaluator.py | |
| Optimization and rejected-edit storage | pr_agent/suggestions/prompt_evolution/store.py | |
| Draft MR publisher | pr_agent/suggestions/prompt_evolution/gitlab_publisher.py | |
| Runtime configuration | pr_agent/settings/configuration.toml | |
| Example manifest | pr_agent/settings/project_review_skill.example.toml | |
| Unit tests | tests/unittest/test_project_prompt_rules.py, tests/unittest/test_project_skill_prompt_integration.py |
Responsibility
Project Review Skill is responsible for:
- expressing project-specific review expectations;
- selecting rules by command, language, changed path, and exclusion path;
- loading explicitly referenced project facts under a fixed character budget;
- providing immutable target SHA, Skill hash, selected rule IDs, matched files, and Reference hashes;
- connecting real suggestion outcomes and review feedback to the Skill version that was actually used;
- proposing evidence-backed Skill changes through project-owned Draft MRs.
It is not responsible for:
- replacing global prompts or their output schemas;
- executing repository scripts, tests, tools, or shell commands;
- creating a project's initial Skill;
- changing
references/*.mdautomatically; - approving or merging an evolution MR;
- defining CODEOWNERS or project permissions.
Opt-in layout
The project owner creates this fixed structure in the project's default or reviewed target branch:
Only skill.toml is required. The absence of that file means the project has not opted in; PR-Agent keeps its existing global behavior.
PR-Agent never creates the initial file. This makes repository ownership explicit and prevents feedback from an arbitrary project from granting the bot a new writable policy surface.
Manifest schema
Top-level fields
| Field | Required | Contract | |
|---|---|---|---|
schema_version | yes | Must be integer 1. | |
project | yes | Exact GitLab path_with_namespace, for example example-group/example-project. | |
name | no | Human-readable name, at most 200 characters. | |
description | no | Purpose/ownership summary, at most 2,000 characters. | |
rules | no | Array of at most 50 rule objects. |
Unknown top-level fields are rejected. This prevents a misspelled or future-looking field from silently appearing to work.
Rule fields
| Field | Required | Contract | |
|---|---|---|---|
id | yes | Stable unique identifier using letters, numbers, ., _, or -; at most 128 characters. | |
targets | yes | Non-empty unique list containing only review and/or improve. | |
instruction | yes | Independent review requirement, at most 2,000 characters. | |
languages | no | Unique list containing python and/or cpp; omitted means all languages. | |
paths | no | Include globs; omitted means the whole project. | |
exclude_paths | no | Exclusion globs evaluated after includes. | |
references | no | Markdown paths below references/, relative to the Skill directory. |
Unknown rule fields are rejected. In particular, script, command, validation, tool, and similar executable fields are not part of the schema.
Glob semantics
*matches characters inside one path segment:src/*matchessrc/a.py, but notsrc/pkg/a.py.**crosses directory boundaries:src/**matches bothsrc/a.pyandsrc/pkg/a.py.?matches one non-separator character.- Paths are repository-relative POSIX paths. Absolute paths, empty segments,
.and..are rejected. - A file must match at least one
pathspattern whenpathsis present. - A matching
exclude_pathspattern always wins.
Example: a rule with paths = ["src/realtime/**"] and exclude_paths = ["src/realtime/generated/**"] applies to src/realtime/loop.cc, but not src/realtime/generated/messages.cc.
Reference contract
- A Reference must use
references/<name>.md. - Absolute paths, traversal, non-Markdown files, and files outside the fixed directory are rejected.
- References are loaded only when a rule that cites them is selected.
- Manifest and References are read at the same target SHA.
- At most 10 distinct References are selected.
- Loaded Reference text is clipped to a deterministic total budget of 20,000 characters; provenance records clipping and hashes the original content.
- Reference text is labeled as controlled user context. It cannot override system instructions, schemas, safety rules, or tool permissions.
Runtime call flow
- PR-Agent identifies the GitLab project, MR target branch, current target-branch head SHA, changed files, and language route.
- It reads
.pr_agent/skills/review/skill.tomlat that exact SHA, not from the MR source branch. - It validates TOML, project identity, schema, sizes, paths, references, IDs, targets, and languages.
- It selects rules for
revieworimprove, then filters by language and file path. - It loads only References used by selected rules, at the same SHA.
- It computes an immutable Effective Skill and appends it to the user prompt below an explicit trust-boundary notice.
- It reuses that Skill session through every internal
/improvestage: generation, reflection, scenario validation, inline self-check, de-conflict, and Tier-1 repair. - It records the target SHA, Skill/Manifest hash, selected rules, matched files, Reference hashes, status, and final prompt bundle.
For a mixed Python/C++ MR, PR-Agent still performs its existing language routing. Each model leg receives only the language-compatible subset of the same target-SHA Skill session.
Why source-branch edits cannot affect the current MR
Assume the target branch main points to SHA A, while an MR source branch adds a malicious Skill at SHA B.
PR-Agent resolves main -> A, then calls the repository Files API with ref=A. It never asks for ref=B or the source branch name. The malicious Skill can be reviewed as ordinary Diff content, but it affects reviews only after maintainers merge it and it becomes part of a later target-branch SHA.
Rollout modes
Configure project_review_skill.rollout_mode in PR-Agent:
| Mode | Load and validate | Record provenance | Inject /review | Inject /improve | |
|---|---|---|---|---|---|
disabled | no | disabled status only | no | no | |
shadow | yes | yes | no | no | |
review_only | yes | yes | yes | no | |
review_and_improve | yes | yes | yes | yes |
The repository default is review_and_improve. This remains opt-in per project because a valid target-branch skill.toml is still required.
An unknown rollout value is treated as disabled.
Failure behavior
| Status | Meaning | Runtime behavior | Evolution evidence | |
|---|---|---|---|---|
loaded | Manifest and selected References are valid. | Selected context may be injected according to rollout mode. | Eligible when a rule was selected. | |
missing | Fixed manifest does not exist. | Continue with global prompts. | Not eligible. | |
invalid | Schema, path, size, project identity, or Reference validation failed. | Ignore the entire Skill and continue globally. | Not eligible. | |
unavailable | GitLab/API read failed after the command's normal error handling. | Continue with global prompts and log the failure. | Not eligible. | |
disabled | Rollout mode is disabled. | Do not load or inject. | Not eligible. |
Fail-open here means review availability is preserved by falling back to the trusted global prompt. It does not mean invalid project rules are partially accepted.
Provenance and feedback
Published /improve suggestions persist these fields in published_suggestions:
global_prompt_set_hash, legacy-compatibleproject_rules_hash, and finalprompt_bundle_hash;- explicit
project_skill_hash,project_skill_manifest_hash, andproject_skill_target_sha; - load status, selected rule IDs, matched files, and Reference hashes.
/review stores the same Skill identity in project_skill_usages under the hidden review_id. A later /feedback rating joins to that immutable usage record. Ratings 1-2 become negative project evidence, ratings 4-5 become positive control evidence, and rating 3 remains neutral/pending. Runs with no selected rule or a non-loaded Skill are excluded from Skill evolution.
Evidence from different Skill/Prompt bundles is not mixed. A target Manifest change produces a new hash and supersedes proposals derived from the old version.
Self-evolution lifecycle
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdocs/docs/usage-guide/project_review_skill.md
Popularity
- Repository stars
- 99
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/zjuncher/mr-agent/usage-guide)