Install
$ agentstack add skill-pekral-cursor-rules-process-code-review ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Constraint:
- Apply @rules/php/core-standards.mdc
- Apply @rules/git/general.mdc
- Apply @rules/jira/general.mdc
- Apply @rules/reports/general.mdc. CR reply comments and resolved-items updates posted on the GitHub PR stay in canonical English per the rule's Exception — technical CR findings on the GitHub PR (they extend the technical CR thread). The mirrored non-technical summary delegated to
@skills/pr-summary/SKILL.mdon the linked issue / JIRA ticket follows the language of the source assignment. Never mix languages inside the same comment; never use bilingual Kritické (Critical) style parentheses. - If the current project uses Laravel, also apply
@rules/laravel/laravel.mdc,@rules/laravel/architecture.mdc,@rules/laravel/filament.mdc, and@rules/laravel/livewire.mdc - Never mix two natural languages inside a single CR comment. The English exception applies to entire comments — not to inline parenthetical glosses.
- Never push direct changes to the main branch
- If the pull request has merge conflicts with the base branch, stop and report it
- Do not introduce new logic unrelated to review feedback
Steps
- Identify the task from the provided issue code or URL
- Find all open pull requests for the task
- If multiple PRs exist, process each independently
- Before processing a PR, switch to the PR branch and pull latest changes following
@rules/git/general.mdcPull Policy, in order: resolve the default branch (DEFAULT_BRANCH="$(git symbolic-ref --short refs/remotes/origin/HEAD | sed 's@^origin/@@')"— never hardcodeorigin/main),git fetch origin,git pull --rebaseto take the PR branch's own remote first, thengit rebase "origin/$DEFAULT_BRANCH"to bring the default branch in, resolve any conflicts, andgit push --force-with-lease. Do notgit pullagain after the rebase — it would undo the sync. If the rebase changedcomposer.lock, runcomposer installimmediately so dependencies match the new lockfile. If the rebase surfaces conflicts that cannot be resolved cleanly, stop and report it (the existing merge-conflict constraint).
For each PR:
- Load PR context by running
skills/code-review-github/scripts/load-issue.sh— the single deterministic entry point. Never callgh issue view,gh pr view, orgh api /repos/.../issues/...directly. Read review comments, files, commits, status checks, andclosingIssuesoff the resulting JSON document. If the script is unavailable (missing tool, exit code 2/3) fall back to the GitHub MCP server, and always prefer the MCP fallback for review-thread / line-anchored comments that the script does not return. - Load unresolved reviewer threads (mandatory, GitHub).
load-issue.shreturns generalcomments[]andreviews[]but never the line-anchored review threads nor their resolved/unresolved state. Fetch them deterministically with the GraphQLreviewThreadsconnection — this is not one of the forbidden REST endpoints (gh issue view,gh pr view,gh api /repos/.../issues/...):
`` gh api graphql -f query=' query($owner:String!,$repo:String!,$number:Int!,$cursor:String){ repository(owner:$owner,name:$repo){ pullRequest(number:$number){ reviewThreads(first:100, after:$cursor){ pageInfo{ hasNextPage endCursor } nodes{ id isResolved path line comments(first:100){ nodes{ author{login} body url createdAt } } } } } } }' -F owner= -F repo= -F number= ` **Do not accept a truncated list** — the "every unresolved thread" guarantee depends on completeness. When reviewThreads.pageInfo.hasNextPage is true, repeat the query with -F cursor= until it is false; when any thread's comments.nodes reaches the page size, page that thread's comments the same way. If gh api graphql` is unavailable, fall back to the GitHub MCP server for the same thread list plus its resolved state.
- Build the checklist from both sources:
- Structured CR findings published by the review skills (general comments come from
comments[]). - Unresolved reviewer threads from the
reviewThreadsquery — add every thread whereisResolved == false(human reviewer and bot) as a checklist item, and skip every thread whereisResolved == true. Record each thread'sidso it can be marked resolved once its fix lands (see Resolve addressed reviewer threads below).
- Map each finding to a concrete code or test change
Reproducer extraction (per finding)
For every Critical and Moderate finding, extract the reproducer fields published by the CR skills (@skills/code-review/SKILL.md, @skills/code-review-github/SKILL.md, @skills/code-review-jira/SKILL.md, @skills/security-review/SKILL.md):
- Faulty Example — the minimal snippet or input that reproduces the bug
- Expected Behavior — the assertion target the test must verify
- Test Hint — the layer (unit, integration, feature) and entry point
- Suggested Fix — the minimal corrected snippet that resolves the finding (may be
n/a —when the Fix narrative is sufficient)
Read the reproducer fields off comments[] and body / descriptionText returned by the deterministic loader for the originating tracker instead of re-fetching the issue:
- GitHub-originated reviews:
skills/code-review-github/scripts/load-issue.sh. Never callgh issue view,gh pr view, orgh api /repos/.../issues/...directly. - JIRA-originated reviews:
skills/code-review-jira/scripts/load-issue.sh. Never callaclidirectly.
Use these to write a failing test before applying the fix:
- Drop the Faulty Example into a new test case at the layer named in the Test Hint.
- Assert the Expected Behavior — the test must fail on the current code.
- Apply the Suggested Fix snippet (or the Fix narrative when Suggested Fix is
n/a); rerun the test until it passes.
If a CR-skill finding lacks Faulty Example, Expected Behavior, or Test Hint, request a CR rerun rather than guessing — the CR skills are responsible for providing them. Suggested Fix may legitimately be n/a per the CR rules.
Free-form reviewer threads are exempt from the reproducer requirement. Unresolved threads written by human reviewers will not carry the four structured fields. Do not request a CR rerun for them and do not block. Instead, derive the intent from the comment text, apply the minimal best-effort fix that satisfies it, and add or adjust a test at your discretion (a regression test when the comment describes a behavior bug; none when it is a naming / readability / dead-code remark). Keep the change scoped strictly to what the reviewer asked for. The exemption removes only the mandatory reproducer workflow — a behavior-changing best-effort fix still has to satisfy the diff-scoped coverage gate enforced by the Review loop below (@rules/php/core-standards.mdc Testing).
Pre-fix phase — pre-existing issue handling
While reading the affected files in preparation for the CR fixes, you may encounter problems that are unrelated to the reviewer feedback but were already present in those files. The following categories qualify:
- Bugs — incorrect logic, broken edge cases, null-dereference risks, race conditions, or runtime errors that exist before this CR.
- Project-rule violations — code that contradicts any rule listed in this skill's Constraints block (
@rules/php/core-standards.mdc,@rules/git/general.mdc,@rules/laravel/*, …) or any other rule under.claude/rules/. - Security vulnerabilities — anything
@rules/security/backend.md,@rules/security/frontend.md, or@rules/security/mobile.mdwould flag (injection, missing authn/authz, unsafe deserialization, sensitive-data exposure, …).
Rules:
- Do not silently ignore a pre-existing issue you encountered in a file you had to read for the CR fixes — fix it in this PR.
- Do not expand scope by actively scanning unrelated files for additional pre-existing issues. Limit attention to files already touched by the CR fixes.
- Land each pre-existing fix in its own separate commit, ordered before the CR-fix commits:
- Use a Conventional Commits subject per
@rules/git/general.mdc:fix(): pre-existing —for bugs and security,refactor(): pre-existing —for rule violations without behavior change. - The
pre-existing —prefix is mandatory so reviewers can identify these commits at a glance. - Test coverage workflow depends on the commit type:
fix(): pre-existing — …(bug, security) — add the regression test in the same commit as the fix; the test must fail before the fix lands and pass after.refactor(): pre-existing — …(project-rule violation, behavior-preserving) — apply@rules/refactoring/general.mdcTest Coverage Contract: when the target lines are below 100% coverage, author a dedicatedtest(): cover before pre-existing refactorcommit before the refactor commit, and do not modify pre-existing tests inside the refactor commit (mechanical renames forced by the refactor itself stay exempt and must be flagged in the commit body).- Either way, pre-existing fixes follow the same diff-scoped 100% coverage rule as CR fixes.
- In the
cr-statusPR comment posted during PR update, list every pre-existing fix under a## Pre-existing fixesheading with a one-line rationale, so reviewers can review them independently of the CR thread. - If a pre-existing issue is non-trivial (would significantly expand the PR or requires architectural discussion), do not fix it. Surface it in the
cr-statuscomment as a deferred follow-up with the reason — the reviewer can then file a follow-up issue.
Apply fixes
- Apply only requested review changes
- Keep scope strictly limited to review feedback
- Ensure DRY violations are included and resolved
- All production code changes must follow:
- @skills/class-refactoring/SKILL.md
Testing
- If tests are required or missing:
- Run @skills/create-missing-tests-in-pr/SKILL.md
- Ensure current changes have 100% coverage for the changed files only, using the project's available coverage tooling (per the Coverage gate in
@skills/code-review/SKILL.md). Do not gate on the full-suite coverage percentage during a CR / review loop iteration. - Run only relevant tests for changed files
- If migrations were added, run
php artisan migrate
Review loop (mandatory — convergence gate)
This is a blocking loop. Do not advance to Finalization, PR update, or Completion until the loop converges. The final report (technical and non-technical) is published only once, after convergence.
- Initialise
iteration = 1andmaxIterations = 5(safety net to avoid runaway loops). - Run the review inline. Invoke the appropriate CR wrapper directly in this skill's context — do not dispatch as a subagent. Each iteration re-invokes the CR wrapper inline so it reloads the diff after the latest fix commit:
- GitHub:
@skills/code-review-github/SKILL.md - JIRA:
@skills/code-review-jira/SKILL.md
The invocation must include the explicit quiet-mode instruction (see Quiet review runs below). The review run must not publish to the PR or to the issue tracker during loop iterations — capture findings in memory only. Each iteration's CR wrapper runs its Reviewer Comment Fulfillment Gate (canonically defined in @skills/code-review-github/SKILL.md), so the review reloads every reviewer comment / thread and re-verifies that the fixes applied in the previous iteration actually satisfy each reviewer instruction.
- Count
criticalCountandmoderateCountin the latest review, and read thereviewer comments: M/N fulfilledverdict the wrapper records. LetunfulfilledCount = N − M(the reviewer instructions still not satisfied and not rejected-with-reason). Each not-fulfilled instruction is already raised by the gate as a Critical finding, so it is included incriticalCount—unfulfilledCountis tracked separately only to make the convergence condition and the loop report explicit. - If
criticalCount + moderateCount == 0andunfulfilledCount == 0→ converged, exit the loop. The run may not converge while any reviewer comment is still not fulfilled (the change does not yet correspond to what the reviewer asked for) — fulfilling every loaded reviewer instruction is a first-class convergence condition alongside the zero-Critical / zero-Moderate gate. - Otherwise, apply the Suggested Fix snippet from each Critical / Moderate finding (including each not-fulfilled reviewer-instruction finding) using the Reproducer extraction workflow above, run pre-push quality gates on touched files, increment
iteration, and go back to step 2. - If
iteration > maxIterationsand the loop still has not converged, stop and surface the remaining findings to the user — do not push or publish a partial report. The user must triage the residual findings manually before any final report goes out.
Quiet review runs (during the loop)
- During iterations 1…N–1 of the loop, invoke the review skill with the explicit instruction "do not publish; return findings as in-memory markdown for this loop iteration only". Both
code-review-githubandcode-review-jirahonour the suppression: no PR comment, no JIRA comment, no linked-issue summary is posted while the loop is still iterating. - The very last iteration (the one that observes
criticalCount + moderateCount == 0) is the only iteration whose output is published — that publication is performed by the PR update + Completion steps below, not by the review skill itself. - Loop iterations may write quality-gate output (composer scripts, build logs) to the local terminal — that is not "publishing" and is allowed.
Pre-push quality gates
- Discover available fixers and checkers (prefer Phing targets from
build.xml/phing.xml; fall back to Composer scripts incomposer.json) - Run available fixers on all changed files and fix any violations
- Run available checkers/analyzers on all changed files and resolve all reported errors
Finalization (only after Review loop converged)
Precondition: the Review loop above must have exited with criticalCount + moderateCount == 0. If the loop hit maxIterations without converging, do not proceed — return the remaining findings to the user for manual triage instead.
- Do not auto-invoke
@skills/test-like-human/SKILL.md. The user-perspective testing skill runs on demand only — leave it for the user to trigger via/test-like-humanafter the PR is updated. - Commit and push changes
- If PR does not exist, create it according to @rules/git/general.mdc — as a Draft (
gh pr create --draft) per Draft pull requests; the Promote the PR out of Draft step below marks it ready once this converged run is published - Title in English (per
@rules/git/general.mdc) - Body in the assignment language (per
@rules/reports/general.mdc)
PR update (only after Review loop converged)
Precondition: same as Finalization — convergence required.
- Publish the resolved-items report through the publish helper using the dedicated
cr-statusmarker namespace. On GitHub, the marker makes the status comment identifiable as a status post (separate from thecr-commentnamespace); on JIRA the helper ignores the marker argument, socr-statusandcr-commentposts are distinguished by content only (resolved-items body vs.## Pre-existing fixessection vs. CR findings). Concretely: - GitHub PR:
skills/code-review-github/scripts/upsert-comment.sh - cr-status(body on stdin). The helper appends `to the body for traceability and **POSTs a new comment on every run** — it never PATCHes a prior status comment. Action (created`)
…
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: pekral
- Source: pekral/cursor-rules
- License: MIT
- Homepage: https://pekral.cz
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.