skills/code-review-github/SKILL.md
Use when perform code review for GitHub pull requests and post findings as PR comments plus a non-technical summary to every linked issue
npx skillsauth add pekral/cursor-rules code-review-githubInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run a full code review for GitHub pull requests and publish findings directly to the PR.
@skills/pr-summary/SKILL.md for every closingIssues[] linked GitHub issue follows the language of the source assignment. Never mix languages inside the same comment; never use bilingual Kritické (Critical) style parentheses.git add, git commit, git push, git reset, git checkout -- …, etc.). Switching to the relevant branch and git pull to read the latest diff are allowed; mutating the working tree or pushing to the remote is not. Publishing is limited to PR / linked-issue comments via gh.skills/code-review-github/scripts/load-issue.sh <NUMBER|URL> — the single deterministic entry point. Never call gh issue view, gh pr view, or gh api /repos/.../issues/... directly. Read PR header, description, comments, commits, files, reviews, status checks, and closingIssues off the resulting JSON document.closingIssues[]) the same way — pass its number or URL to the same script.Before reviewing code, load and analyze the full linked issue:
skills/code-review-github/scripts/load-issue.sh <NUMBER|URL> — description, all comments, and any referenced attachments or links come off the resulting JSON document.Always run:
## Assignment Compliance markdown block (or the status no linked issue — assignment compliance skipped when closingIssues[] is empty). The CR wrapper passes the returned block as an embedded block to @skills/pr-summary/SKILL.md so the linked-issue audience reads one consolidated comment per CR run (per issue #498). Do not embed the block into the PR comment — keep the PR comment focused on technical findings and surface the consolidated-comment status in the summary line.MODE=cr — read-only refactoring lens scoped to the PR diff. Surface DRY duplication and tech-debt-reducing changes that apply to lines actually touched by the PR. MODE=cr guarantees no code changes, commits, fixers, or review chaining. Do not propose changes outside the diff.Run conditionally:
@rules/refactoring/general.mdc) → run the full refactoring skill set read-only. When the PR restructures existing code without adding a feature or changing observable behavior, additionally invoke @skills/refactor-entry-point-to-action/SKILL.md with MODE=cr to surface the entry-point → Action proposals. Both refactoring skills run read-only — no code changes, no commits, no fixers, no review chaining — MODE=cr enforces this. Fold their output into the Refactoring (DRY / Tech Debt Reduction) section (in-scope) and Refactoring Proposals section (out-of-scope) of the PR comment.@skills/mysql-problem-solver/SKILL.md is mandatory. Trigger pattern list is owned by @skills/code-review/SKILL.md Specialized Reviews (raw SQL, Eloquent / query-builder calls, eager loads, model scopes, ModelManager / Repository methods, migrations, seeders, DynamoDB / NoSQL access). Capture its findings and surface them in the published PR comment under the dedicated ## Database Analysis section (see Output Rules) — never silently fold them into the Critical / Moderate / Minor buckets.@skills/code-review/SKILL.md is executed for the diff@skills/class-refactoring/SKILL.md (run with MODE=cr — read-only) and look for:
@rules/code-review/general.mdc Reuse Existing Logic section@skills/refactor-entry-point-to-action/SKILL.md run with MODE=crQuiet mode (loop iterations from
@skills/process-code-review/SKILL.md): when the caller explicitly requests "do not publish; return findings as in-memory markdown for this loop iteration only", skip the entire Post Results step — do not post the PR comment, do not post the linked-issue summary. Return the assembled review markdown to the caller and stop. Only the very last (publishing) call fromprocess-code-reviewafter convergence runs Post Results in full.
<!-- cr-comment:actor=<gh-login> --> (auto-appended by the upsert helper) so follow-up runs edit the existing comment in place instead of stacking new comments — no quoting, no "Replying to …" threads, no detached follow-up posts.skills/code-review-github/scripts/upsert-comment.sh <PR-NUMBER|URL> - (body on stdin). The helper detects the current actor (gh api user --jq .login), searches the PR comments for the marker, and either PATCHes the existing comment or POSTs a fresh one. The published URL is emitted on stdout; the action (created|updated) on stderr — log it in the PR comment summary line.updateIssueComment (or addIssueComment when absent). Never bypass the marker convention by posting through raw gh issue comment / gh pr comment — that path stacks duplicates and is forbidden.Critical → Moderate → Minor → Refactoring (DRY / Tech Debt Reduction)
Include file + line in the finding body
Include actionable fix
Post all findings inside the single PR comment — never as line-anchored review comments.
If no findings:
## Coverage section, and the final Summary line only. Omit every other section entirely. Do not append a "No findings identified" line — the Counts line Critical 0 · Moderate 0 · Minor 0 · Refactoring 0 already signals the clean state and the omitted sections confirm there is nothing to fix.closingIssues[] of the JSON loaded in step 1 to @skills/pr-summary/SKILL.md. This CR skill must not author its own non-technical template — the goal is a uniform "Authors / Available behind / Summary of changes / How to test" output across both trackers that non-technical project managers understand and can act on.pr-summary exactly once per linked issue and pass it the ## Assignment Compliance markdown block returned by @skills/assignment-compliance-check/SKILL.md as an embedded block. pr-summary appends the block verbatim after How to test and publishes one consolidated comment containing both the change summary and the assignment-compliance verdict. The CR run posts exactly one comment per linked issue — never a separate gh issue comment for assignment compliance on top of it.pr-summary, pass through the PR author.login + commits[].author.login set and the git %an <%ae> log so the published summary credits the real change author(s), never the agent or the identity running this CR. pr-summary resolves and prints those identities in its Authors line — confirm the line is present in the published comment.pr-summary, also pass through any test-parameter gating detected in the diff (feature flag, ENV switch, query-string parameter, request header, admin toggle, allow-list) so the published summary carries the Available behind line and folds the toggle-enabling step into How to test step 1. When the diff contains no such gate, confirm with pr-summary that the line is omitted intentionally rather than forgotten.@skills/pr-summary/SKILL.md with the GitHub tracker target so it renders @skills/pr-summary/templates/pr-summary-github.md in GitHub Markdown and upserts the comment via skills/code-review-github/scripts/upsert-comment.sh on every entry in closingIssues[] (one comment per linked issue, per actor — keyed by the marker <!-- cr-comment:actor=<gh-login> -->). pr-summary mirrors the same format that @skills/code-review-jira/SKILL.md posts to JIRA, so reviewers reading either tracker see the same consolidated comment.pr-summary enforces the no-file-paths / no-line-numbers / no-code-snippets / no-severity-jargon contract by design; technical content stays exclusively on the PR comment. The embedded Assignment Compliance block follows the same constraint — it carries plain-language gap descriptions only.closingIssues[] is empty, skip this step and note "no linked issue — issue summary skipped" in the PR comment summary line. assignment-compliance-check returns the same status in that case so the wrapper does not even build an embedded block.## Coverage section, and the final Summary line are always rendered in the PR comment. Every other section — Findings (including each severity sub-heading), Refactoring (DRY / Tech Debt Reduction), Refactoring Proposals, and Database Analysis — appears only when it has at least one item. Never emit None. / Not applicable. / n/a placeholders for empty sections; drop the whole heading and body instead. The Counts line is the single source of "zero" signal so a clean review stays scannable. History across CR runs is preserved by GitHub's edit history on the upserted comment — never re-create a Previous CR Status section in the body.file:line and a concrete refactoring step.@rules/php/core-standards.mdc and, for Laravel projects, @rules/laravel/architecture.mdc. Use n/a — <reason> only when a snippet adds no value over the one-line Fix description (e.g. naming-only changes, dead-code removal, pointers to an existing helper whose name already says enough).@skills/process-code-review/SKILL.md can convert each finding into a reproducer test and apply the fix directly from the PR comment.@skills/code-review/SKILL.md Specialized Reviews), the posted PR comment must include a dedicated ## Database Analysis section before ## Coverage. The section reports only the mysql-problem-solver findings (with severity mirroring Critical / Moderate / Minor) and the proposed query rewrite / index reuse / batching fix per @rules/sql/optimalize.mdc. Do not include the queries / migrations inspected list or any EXPLAIN / static-analysis summary — those stay inside the internal investigation. When no DB operations are present, omit the section entirely.## Coverage section before the summary line. The section reports the coverage command run (per the Coverage gate in @skills/code-review/SKILL.md — the project's available coverage tooling, scoped to the changed files), the exact command run, and the coverage result for the changed files (or "coverage tooling unavailable" with reason). Never post a CR comment without this section.posted summary to issue #N (or comma-separated list when multiple), no linked issue — issue summary skipped, or failed to post on issue #N: <reason> when a permission / network error occurs. Never post a CR comment without it.Use the template defined in templates/pr-comment-output.md.
development
Use when autonomously resolving the oldest open GitHub issue end-to-end. Picks the oldest open issue (optionally filtered by label, default `Resolve_by_AI`), delegates resolution to `resolve-issue`, then runs `code-review-github`, `process-code-review`, and `merge-github-pr` on the resulting pull request. Stops and reports any blocker (merge conflict, failing CI, unresolved Critical/Moderate findings) instead of force-merging.
testing
Use when analyzing a specific security threat from a referenced source (CVE, GHSA, security advisory, blog post, or write-up). Produces a human-readable remediation report with step-by-step instructions an AI agent can follow to eliminate the threat in the current project.
development
Use when preparing data and context before /resolve-issue, TDD, or CR runs. Loads the assignment, extracts every concrete user scenario from the task description and acceptance criteria, maps each scenario to the codebase, seeds the development database with the records needed to reproduce the bug or feature end-to-end, and reports any gap that would force the implementing agent to hallucinate.
development
Use when preparing a concise QA report for an internal tester from a JIRA task and its linked pull requests — focused on what the tester should report back to the dev team — and posting it as a JIRA comment.