t3chn

vi-code-review

1
0
# Install this skill:
npx skills add t3chn/codex-skills --skill "vi-code-review"

Install specific skill from multi-skill repository

# Description

Automate GitHub pull request code reviews using `gh`: check eligibility (not closed/draft/trivial/already-reviewed), collect relevant `AGENTS.md` guidance, review changes from multiple perspectives, confidence-score issues, and post a concise PR comment with full-SHA code links.

# SKILL.md


name: vi-code-review
description: "Automate GitHub pull request code reviews using gh: check eligibility (not closed/draft/trivial/already-reviewed), collect relevant AGENTS.md guidance, review changes from multiple perspectives, confidence-score issues, and post a concise PR comment with full-SHA code links."


GitHub PR Code Review (gh)

Provide a structured code review for a GitHub pull request using the GitHub CLI (gh).

Prerequisites

  • gh installed and authenticated (gh auth status)
  • Run inside a git repo with the PR remote configured

Workflow

  1. Create an update_plan checklist for the steps below.

  2. Identify the PR:

  3. If the user provides a PR URL/number, use that.
  4. Otherwise, infer the current PR (gh pr view) or ask which PR to review.

  5. Eligibility check (skip if not eligible):

  6. PR is closed/merged
  7. PR is a draft
  8. PR is trivial/automated (e.g. dependency-bump bot PRs, mechanical version bumps) and obviously OK
  9. PR already has a code review from you (check existing comments)

  10. Gather review context:

  11. Fetch PR summary + files changed (gh pr view)
  12. Fetch diff (gh pr diff)
  13. Collect relevant guidance files:

    • Root AGENTS.md (if present)
    • Any AGENTS.md in directories containing modified files
    • If none exist, proceed without them
  14. Review from multiple perspectives (do separate passes; avoid nitpicks):

  15. Guidance compliance: Does the change violate relevant AGENTS.md instructions?
  16. Shallow bug scan: Obvious correctness issues visible in the diff (focus on big bugs).
  17. Historical context: Use git blame / history on modified files for relevant pitfalls/regressions.
  18. Related PR context: Look for prior PRs touching the same files and reuse relevant lessons (optional; only if easy via gh).
  19. Comment intent: Ensure changes comply with important code comments in modified files.

  20. For each potential issue, assign a confidence score (0โ€“100):

  21. 0: False positive or clearly pre-existing
  22. 25: Might be real but canโ€™t verify; stylistic and not explicitly required by guidance
  23. 50: Real but minor/nitpick or unlikely to matter
  24. 75: Very likely real and important; or explicitly mentioned by guidance
  25. 100: Definitely real; strong evidence it will occur frequently or break functionality

Filter out issues with score < 80.

  1. Re-check eligibility (PR can change while you review): still open, not draft, still needs review.

  2. Comment on the PR with the result using gh pr comment.

  3. Keep it brief; avoid emojis.
  4. Cite each issue with a link to the exact code location using full SHA and a line range:
    https://github.com/<owner>/<repo>/blob/<full-sha>/<path>#L<start>-L<end>

Comment Format

If issues exist (score โ‰ฅ 80):

### Code review

Found N issues:

1. <brief description> (<guidance or evidence>)

<full-sha link>

If no issues meet the threshold:

### Code review

No issues found. Checked for bugs and guidance compliance.

Review Boundaries

  • Do not run builds/typechecks/linters just for review; assume CI will handle it.
  • Ignore pre-existing problems not introduced by the PR.
  • Avoid pedantic formatting/style nits unless explicitly required by a relevant guidance file.

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.