Use when asked to review a MR/PR on GitHub or GitLab. Checks for XSS vulnerabilities, validates ARIA attributes and WCAG compliance, identifies render-blocking issues and race conditions, enforces semantic HTML. Produces actionable feedback.
74
93%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
Senior-level front-end code review for GitHub and GitLab MRs. Actionable feedback that prevents real problems, teaches patterns, saves debugging time, and improves UX — every finding earns its place. When the project uses a linter, formatter, and CI for style, defer to them; focus human review on semantics, architecture, and risks automation cannot catch.
When asked to review a MR/PR:
get_merge_request, or GitHub equivalent)Every comment must earn its place. Before writing any feedback, ensure it prevents a real problem (bug, security, data loss, production incident), teaches something (pattern, context, pitfall), saves future debugging time (edge case, error handling, integration risk), or improves UX (accessibility, performance). If none of these apply, do not report it as a primary finding.
Feedback levels — Two sources:
[Blocking], [Important], [Suggestion], [Minor]) is the source of truth; use it strictly.Reading protocol (Gatekeeper) — You are an agent with limited memory. You do not have the content of files in the ./references/ folder at startup. You must build the complete inventory of file extensions present in the Diff (e.g. .ts, .twig, .css) before using any file-reading tool. Load only the reference files strictly required as listed in the mapping table (Reference loading).
Top-Down Mental Model: (1) Understand the intent/spec (2) Verify architectural boundaries (3) Evaluate if tests genuinely validate the intent (4) Finally, review implementation details.
Context window amnesia (AI-generated code) — AI often produces local fixes that pass review but break the global architecture (wrong module, duplicated logic, layers that are not respected). When reviewing AI-generated or AI-assisted changes, ask: "Does this fit the existing architecture? Is logic duplicated elsewhere? Are layers/abstractions respected?"
Always the same flow — no mode to detect: (1) Phase 1 (obligatory) — Analyze + report in chat (2) Phase 2 (optional) — Ask the user which findings to post. One thread per finding; the user chooses which get written to the MR/PR. Always ask before posting. (e.g. All Blocking, Blocking + Important, custom selection, None) (3) Phase 3 — Post selected findings on the MR/PR (if the user chose any) with AI disclosure. Use the Ask/question mode to display options before posting.
Supported platforms — GitHub (Pull Requests, github.com or GitHub Enterprise); GitLab (Merge Requests, gitlab.com or self-hosted instance). The agent uses available MCPs (GitLab MCP, GitHub MCP) depending on the project. The MCP is user-configured — the user is responsible for installing and using a legitimate MCP. If no MCP is configured for the target platform, the user must provide the diff or modified files.
MR/PR reference parsing — In this skill, MR/PR denotes the same artifact on both platforms: Merge Request (GitLab) or Pull Request (GitHub). Compatible with GitHub and GitLab — public or private instances. Accepted formats: GitLab: !294, namespace/project!294, full URL; GitHub: #123, owner/repo#123, full URL.
Access check (first) — Before any discovery, verify access to the project and MR/PR:
get_merge_request (GitLab) or equivalent for GitHub — if it fails (404, 403, MCP not configured), stop and inform the user:
Fetch diffs: completeness and inventory — The review must be based on the full diff. Partial diffs lead to false Blocking findings (e.g. claiming a file was not updated when it was, but the change was on another page).
get_merge_request_diffs (and GitHub equivalents) may paginate. Always retrieve all diff entries:
per_page (e.g. 100) when the API allows it, and/orpage until the response has fewer items than per_page (or no more pages).changes_count. Ensure the number of diff entries you use matches or is at least as large as that (e.g. 30 changes ⇒ at least 30 diff entries). If you only see part of them, fetch the next page(s).new_file: true or equivalent)deleted_file: true or equivalent)If the diff exceeds a complexity or size threshold (e.g. +50 files, or very large single-file diffs), alert the user about the risk of context loss and reduced review quality. Propose reviewing in batches: core/logic files first, then UI/CSS, then config or other low-risk changes. Let the user decide how to proceed.
Before reviewing any code, analyze the project to understand its conventions and tooling. See references/discovery.md for the full checklist.
Load references after diffs are fetched, using the paths in the tables below (e.g. ./references/security.md). Apply rules based on changed file types. Deduplicate when multiple file types map to the same reference.
Base (always): ./references/security.md + ./references/code-quality.md + ./references/writing-rules.md
By changed file type:
| File pattern | References to load |
|---|---|
*.js, *.ts, *.mjs, *.cjs | ./references/js-ts.md + ./references/architecture.md + ./references/templates.md |
*.jsx, *.tsx | ./references/js-ts.md + ./references/architecture.md + ./references/templates.md + ./references/accessibility.md (UI components) |
*.css, *.scss, *.less | ./references/css.md |
*.html | ./references/html.md + ./references/accessibility.md |
*.twig | ./references/templates.md + ./references/architecture.md + ./references/html.md + ./references/accessibility.md |
*.vue, *.svelte | ./references/js-ts.md + ./references/architecture.md + ./references/html.md + ./references/css.md + ./references/accessibility.md |
*.png, *.jpg, *.jpeg, *.gif, *.webp, *.avif, *.svg | ./references/assets.md |
By changed content:
| Content | Reference |
|---|---|
package.json, tsconfig.json, config files | ./references/architecture.md |
.gitlab-ci.yml, .github/workflows/* | ./references/ci-cd.md |
By review scope:
| Condition | Reference |
|---|---|
Test files changed (*.test.*, *.spec.*, **/__tests__/*) | ./references/testing.md |
| Application code changed (JS/TS, HTML, Twig, components) without corresponding test changes | ./references/testing.md (to check for missing tests) |
Scope (defined by inclusion only) — What is in scope is defined by the tables above: Frontend files (JS/TS, HTML, CSS, components, assets); server-side templates (e.g. Twig) because they control HTML structure and accessibility — analyze them even in templates/, views/; CI config (.gitlab-ci.yml, .github/workflows/*). Everything not mentioned in these tables is out of scope. Do not load references or comment on out-of-scope files. For mixed MR/PRs, do not read or analyze the diff of out-of-scope files. If the MR/PR contains only out-of-scope files, state that the skill covers frontend and CI only and skip the code review.
Reference index — Purpose of each file:
| File | Purpose |
|---|---|
| js-ts | JS/TS, DOM, events, naming, testability |
| html | Semantics, script loading, W3C syntax |
| css | Convention detection, consistency |
| templates | Twig, server-side includes, defaults |
| accessibility | SVG a11y, focus, ARIA |
| security | XSS, scripts, secrets, runtime risks |
| code-quality | Errors, performance, SOLID |
| testing | Test structure, framework-agnostic |
| architecture | Structure, SOLID, SoC, coupling |
| ci-cd | Pipeline, GitHub Actions, GitLab CI |
| assets | Images, SVG, sprites |
| writing-rules | Formatting, concision, tone |
| discovery | Conventions, linter/formatter, tooling |
Principle: The remote (GitLab/GitHub) is the only source of truth. Do not read from the local workspace for repo content. Feedback must target only code visible in the diff (added/modified lines, marked with +).
Operational rules:
get_merge_request_diffs, get_repository_file / get_file_contents with ref = MR/PR source branch) for diff and file content. Do not use read_file/Read or grep/Grep on repo paths — the workspace may be on another branch or out of sync.Review Progress:
- [ ] 0. Discover project conventions & tooling
- [ ] 1. MR/PR metadata (adapted to project)
- [ ] 2. Pipeline status
- [ ] 3. Code analysis (contextual analysis + duplication detection)
- [ ] 4. Blocking (apply rules from `security.md`, `code-quality.md`)
- [ ] 5. Important (apply rules from loaded references)
- [ ] 6. Attention Required (human review — complex visual, nuanced logic, ambiguous specs)
- [ ] 7. Minor (apply rules from references; group in dedicated section)
- [ ] 8. Highlights & verdictAlways check:
TICKET-ID, feat/TICKET-ID, etc. — just verify the ticket number is present)Only if the project uses them:
Pipeline status is mentioned in the report header only — do not open a discussion thread on pipeline. If pipeline failed, identify the failing job and report it in the header.
The diff alone is not always enough. When a change seems ambiguous or the surrounding code matters (HTML hierarchy, function scope, variable declarations above/below), use get_repository_file to fetch the full file on the source branch and verify the context around the changed lines. Typical cases:
<div> added inside a <ul> is invalid)Do not provide feedback on deleted code, unless the deletion itself causes a problem:
Orphan references after a deletion: combine the full diff inventory with Source of truth: remote only (MCP on the source branch; diff is authoritative when the file is in the MR/PR).
Principle: deleted code will no longer exist after merge. Feedback must focus on what remains or on the impact of the deletion.
See Source of truth for verify-before-asking-remove and false "missing update" rules.
Do not flag issues on unchanged code (context only) unless Blocking (e.g. security vulnerability).
When the MR/PR introduces new logic (utility function, pattern, component), use search (scope: blobs, project scoped) to check if similar code already exists elsewhere in the project. Flag duplication as Important with a suggestion to factor shared logic. Typical duplications:
Every file touched in the MR/PR must be syntactically valid for its type. Invalid files are Blocking:
.yml, .yaml): valid structure, correct indentationpackage.json, tsconfig.json, etc.): valid JSON, no trailing commas## Review: [MR/PR Title]
**Project**: [project path] | **MR/PR**: [link] | **Pipeline**: [status]
**Verdict**: **[APPROVE | REQUEST_CHANGES | COMMENT]**
> [1-2 sentences: summary and overall impression]
### Attention Required (Human Review)
- [Point requiring human verification]. _Human review: [what to check]._
### Findings
#### `[filename]`
- **Blocking** — [Short description. Consequence if not fixed.]
- **Important** — [Short description. Why it matters. Consequence.]
- **Suggestion** — [Short description.] _(personal opinion)_
- **Attention Required** — [Short description.] _Human review: [what to check]._
### Minor
- `[file]`: code hygiene (log, newline, imports — see references)Apply formatting rules (Reference loading). Feedback must target only code in the diff (see Source of truth).
6952aa7
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.