skills/code-review-jira/SKILL.md
Use when run code review for JIRA issues and publish results to GitHub PR and JIRA
npx skillsauth add pekral/cursor-rules code-review-jiraInstall 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.
Perform code review for JIRA issues by analyzing related pull requests and publishing results to:
@skills/pr-summary/SKILL.md and the mirrored linked-GitHub-issue summary follow the language of the source JIRA 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 and to JIRA ticket comments via acli.skills/code-review-jira/scripts/load-issue.sh <KEY|URL> — the single deterministic entry point. Never call acli directly. Read issue header, description, comments, attachments, subtasks, issue links, custom fields, devSummary, and pullRequests off the resulting JSON document.ECOMAIL-1234), a /browse/<KEY> URL, or any URL containing ?selectedIssue=<KEY>.expand=changelog), available next transitions, and friendly custom-field names (expand=names).pullRequests arrayBefore reviewing code, load and analyze the full JIRA issue:
For each PR:
## Assignment Compliance markdown block (the wrapper converts it to JIRA Wiki Markup before passing it to pr-summary for the JIRA target, and keeps GitHub Markdown for the linked-GitHub-issue mirror). When no linked tracker exists, the skill returns the status no linked issue — assignment compliance skipped. The CR wrapper passes the returned block as an embedded block to @skills/pr-summary/SKILL.md so each tracker (JIRA ticket, linked GitHub issue) receives one consolidated comment per CR run (per issue #498). Do not embed the block into the GitHub PR comment — surface only the consolidated-comment status in the PR comment summary line.MODE=cr — read-only refactoring lens scoped to the PR diff. Surface DRY duplication and tech-debt-reducing changes only on lines actually touched by the PR. MODE=cr guarantees no code changes, commits, fixers, or review chaining.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 GitHub PR comment. The JIRA non-technical comment never carries these technical sections.@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 on the GitHub PR comment under the dedicated ## Database Analysis section (see Output Rules) — never silently fold them into the Critical / Moderate / Minor buckets. The JIRA non-technical comment does not carry this section (it stays plain-language via pr-summary).@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 all publishing below — no GitHub PR comment, no JIRA comment, no linked-GitHub-issue mirror. Return the assembled review markdown to the caller and stop. Only the final (publishing) call fromprocess-code-reviewafter convergence runs Publish 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. History across runs is preserved by GitHub's edit history; never re-create a Previous CR Status section in the body.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.file:line reference in the body of each finding instead.@skills/pr-summary/SKILL.md. This CR skill must not author its own JIRA summary — the goal is a uniform "Authors / Available behind / Summary of changes / How to test" output that non-technical project managers understand and can act on, identical to what pr-summary produces for any other audience.pr-summary exactly once for the JIRA ticket and pass it the ## Assignment Compliance markdown block returned by @skills/assignment-compliance-check/SKILL.md — first convert that block to JIRA Wiki Markup per @rules/jira/general.mdc (## → h2. , **bold** → *bold*, etc.) — as an embedded block. pr-summary appends the block verbatim after How to test and upserts the JIRA comment via skills/code-review-jira/scripts/upsert-comment.sh (JIRA MCP server fallback when acli lacks comment-edit support or exits with code 4). The upsert keeps exactly one JIRA comment per (ticket, acli actor) — keyed by the invisible anchor {anchor:cr-comment-actor-<slug>} (auto-prepended by the upsert helper) — so follow-up runs edit it in place instead of stacking new comments. Never post a separate JIRA 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 JIRA comment credits the real change author(s) (JIRA display name when the JIRA loader can match a committer; otherwise the GitHub handle; otherwise the git Name <email>). Never the agent / CR identity. Confirm the Authors 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 comment carries the Available behind line and folds the toggle-enabling step into How to test step 1.@skills/pr-summary/SKILL.md with the JIRA tracker target so it renders @skills/pr-summary/templates/pr-summary-jira.md in JIRA Wiki Markup and upserts the comment on the originating JIRA ticket through the helper above (no direct acli jira workitem comment add calls that bypass the marker).pr-summary already enforces this constraint by design, and the embedded Assignment Compliance block obeys the same rule. Technical content stays exclusively on the GitHub PR comment.closingIssues[] of the GitHub PR JSON is non-empty), delegate the linked-GitHub-issue comment to @skills/pr-summary/SKILL.md (GitHub tracker target). The skill renders @skills/pr-summary/templates/pr-summary-github.md in GitHub Markdown and upserts it via skills/code-review-github/scripts/upsert-comment.sh on each entry in closingIssues[] (one comment per linked issue, per actor — keyed by <!-- cr-comment:actor=<gh-login> -->). Pass the same author + test-parameter-gating context as the JIRA invocation above — the mirrored comment must carry the same Authors and Available behind lines.## Assignment Compliance markdown block returned by @skills/assignment-compliance-check/SKILL.md as an embedded block so the linked-GitHub-issue audience also sees one consolidated comment per CR run instead of two separate posts.pr-summary, so they are guaranteed to match.closingIssues[] is empty, skip this block and note "no linked GitHub issue — mirror skipped" in the PR comment summary line.## Coverage section, and the final Summary line are always rendered in the GitHub PR comment. Every other section — Findings (including each severity sub-heading), Refactoring (DRY / tech debt), 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.@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 GitHub 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. The JIRA non-technical comment (produced by pr-summary) never includes this section.## 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.templates/github-output.md@skills/pr-summary/SKILL.md, not by this skill. Invoke pr-summary with the JIRA tracker target; do not author or embed a custom template here.pr-summary enforces the no-file-paths / no-line-numbers / no-code-snippets / no-severity-jargon contract by design — plain language understandable by non-developers, in two sections: Summary of changes and How to test.h2. / h3. headings, *bold*, _italic_, {{inline}}, {code:php} ... {code}, * / # bullets, [label|url], {quote}) is handled by @skills/pr-summary/templates/pr-summary-jira.md per @rules/jira/general.mdc. Do not "translate" the output back to GitHub Markdown when posting via acli / JIRA MCP server.@skills/test-like-human/SKILL.md. The user-perspective testing skill runs on demand only (via /test-like-human or an explicit follow-up); CR-track skills must never chain into it.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.