generic-automation-and-it/smooth-ai-stockanalysis / .agents/skills/ai-review
ai-review
VerifiedAnalyze and execute AI PR review feedback with fix/skip decisions. Use when a user asks to parse an AI review, apply selected fixes, and finalize review processing for GitHub or Azure DevOps pull requests. Detects the review source — for a GitHub Copilot agent review it replies to and resolves each linked review thread; otherwise it appends AI review notes to the PR description.
AI PR Review Analyzer & Executor
Analyze AI PR review feedback and execute fix/skip decisions.
Script location. Every
.agents/skills/ai-review/...path in this document assumes the skill is installed in the repository (copy-install or this repo itself). When this skill runs from the Claude Code plugin (smooth-ai-review), the repository has no.agents/skills/ai-reviewtree — substitute${CLAUDE_PLUGIN_ROOT}/.agents/skills/ai-reviewfor.agents/skills/ai-reviewin every script invocation (e.g."${CLAUDE_PLUGIN_ROOT}/.agents/skills/ai-review/scripts/copilot-review.sh" detect <pr>).
Invocation
The skill is invoked as /ai-review <args>.
Mode selection:
- Explicit keyword as the first argument:
analyseorexecute. - Auto-detect when no keyword is given:
- If any argument matches
\d+=(fix|skip)→ execute mode. - Otherwise → analyse mode.
- If any argument matches
Examples:
/ai-review 48 # auto → analyse
/ai-review analyse 48 # explicit analyse
/ai-review 48 1=fix 2=skip # auto → execute
/ai-review execute 48 1=fix 2=skip # explicit execute
Review source selection (GitHub):
The skill must determine whether the review being processed is a GitHub Copilot agent review or a review from another source (e.g. an OpenCode CLI agent, Gemini, or a generic AI reviewer). The source decides where execute results land — see Execute → Result routing.
- Explicit switch:
--source=copilotor--source=other. - Auto-detect when no switch is given (the default): run the helper and use its verdict —
It scans the PR's reviews and inline review comments for the Copilot reviewer bot (login.agents/skills/ai-review/scripts/copilot-review.sh detect <pr> # prints COPILOT or OTHERCopilot/copilot-pull-request-reviewer[bot]).COPILOT→ Copilot flow;OTHER→ other.
GitHub plumbing lives in
scripts/copilot-review.sh. All deterministic GitHub calls (detect, fetch threads, reply, resolve, post summary) are subcommands of that script. The skill keeps the judgment — parsing the review, fix/skip decisions, and the text of every reply/summary. Reply and summary bodies are piped to the script via STDIN, so multi-line markdown is safe.
Examples:
/ai-review 48 # analyse, auto-detect source
/ai-review analyse 48 --source=copilot # force Copilot-review parsing
/ai-review execute 48 1=fix 2=skip # execute, source auto-detected
/ai-review execute 48 1=fix --source=other # force non-Copilot result routing
Two Modes: analyse and execute
Mode 1: Analyse — Fetch review and recommend fixes/skips
Use when: User provides review URL, review ID, or just PR number
Workflow:
-
Resolve PR number and review ID from arguments
-
Detect review source (Copilot vs other) per Review source selection
-
Fetch review body using
gh apioraz repos prCLI- Copilot flow (GitHub): also pull the inline review comments and their threads so each parsed issue can be tied back to a specific Copilot comment:
Returns JSON nodes of.agents/skills/ai-review/scripts/copilot-review.sh threads <pr>{ id, isResolved, comments:[{ databaseId, path, author, body }] }.
- Copilot flow (GitHub): also pull the inline review comments and their threads so each parsed issue can be tied back to a specific Copilot comment:
-
Parse the review to extract issues and suggested fixes. Copilot flow: record, per issue, the Copilot inline comment
databaseIdand its enclosing review threadid(from thethreadsoutput) so execute can reply and resolve the correct thread. -
Determine recommendation for each issue:
- Known intentional pattern:
skip - AI hallucination:
skip - Genuine bug or logic error:
fix - Real simplification with no trade-offs:
fix - Speculative / "consider" language:
skip - Critical/High without exemption:
fix
- Known intentional pattern:
-
Output analysis table (the detected source is stated above the table):
| # | File | AI PR Review Recommendation | Priority | AI Coder Recommendation | AI Reviewer Reasoning |
|---|
For the Copilot flow, retain the commentId / threadId mapping per row (used by execute) — it need not be printed in the table.
-
Print summary and suggested next command
-
STOP — Do NOT proceed to execute automatically. User decides whether and how to run execute.
Mode 2: Execute — Apply fix/skip decisions
Use when: User provides decisions from analyse output
Argument format: <pr-number> <1=fix|skip> <2=fix|skip> ...
Workflow:
- Load review context — Fetch latest AI review and re-detect review source (Copilot vs other) so execute routes results correctly even when run as a standalone command
- Process each decision — Apply fixes or prepare skip entries
- Commit and push fixes (only if any fixes were applied)
- Route results — post the fix/skip summary table + analysis per Result routing below
- Final empty commit — MANDATORY when any 🔴 Critical or 🟠 High priority issue appears in the review (fix OR skip) — no exceptions. Commit message:
ci: /ai-review — processed review responses. This empty commit re-triggers a full review run to re-verify critical/high findings. Do NOT skip this step, do NOT merge it into a fix commit, do NOT omit it because all high/critical items were skipped. For reviews with only medium/low findings, do NOT make this commit — the fix commits from step 3 suffice. - Report completion
- Review process improvements (only if items were skipped)
Result routing (where execute output lands)
The detected review source decides where the fix/skip summary table and analysis are posted.
Copilot flow (--source=copilot or auto-detected Copilot review):
- Per-thread reply + resolve (option A): for every processed issue — both
fixandskip— reply to the linked Copilot inline review comment with that row's decision and reasoning, then mark its review thread resolved:printf '%s' "**ai-review: FIX** — <what changed / commit ref>" \ | .agents/skills/ai-review/scripts/copilot-review.sh reply <pr> <commentId> # SKIP + reasoning for skipped rows .agents/skills/ai-review/scripts/copilot-review.sh resolve <threadId>- If a row has no mapped
commentId/threadId(e.g. it came from the Copilot summary, not an inline comment), skip the per-thread step for that row and rely on the summary comment below.
- If a row has no mapped
- Summary comment: post the full fix/skip summary table + analysis as one review-level comment on the PR so the overall outcome is visible in one place:
cat summary.md | .agents/skills/ai-review/scripts/copilot-review.sh summary <pr> - Do NOT edit the PR description for the Copilot flow — results live on the review threads and the summary comment.
Non-Copilot flow (--source=other or any non-Copilot review):
- Preserve existing behavior: append the fix/skip summary table + responses block to the PR description's AI Review Notes section. Do not touch review threads.
Guardrails
- Never start execute mode on its own after analyse mode
- MANDATORY: make the final
ci: /ai-review — processed review responsesempty commit whenever the review contains at least one 🔴 Critical or 🟠 High finding — regardless of whether those findings were fixed or skipped. Never omit this commit, never fold it into a fix commit. Only omit for medium/low-only reviews. - Keep fixes scoped to selected items only
- Copilot flow: reply to and resolve only the threads for issues actually processed in this execute run; never resolve unrelated or human-authored threads
- Non-Copilot flow: preserve existing PR AI Review Notes content (append, never overwrite)
- Only suggest review-process improvements, don't apply them
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |