agentleFS
abipalliabipalli/agent-skills/skills/submit-review/SKILL.md

submit-review

Skill1 starsChanged 18 days agoApache-2.0View on GitHub

Post review findings as one GitHub PR review with inline comments, after the user approves the exact draft. Use for \"submit review\", \"post comments on the PR\".

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

22 rules. About 0 are common, 18 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈18

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the PR number is not already known from context, ask which PR to submit the review on, offering two options: the current branch's PR …

    line 14
  2. Very specific:

    If you just ran /deep-code-review or the user provided findings, use those directly.

    line 26
  3. Distinctive:

    Read full files for context

    line 30
  4. Distinctive:

    Comment quality bar: Only submit comments that are genuinely useful.

    line 33
  5. Distinctive:

    Ask a clarifying question about intent

    line 36
  6. Distinctive:

    Do NOT submit comments that are:

    line 38
  7. Distinctive:

    Use code backticks for identifiers, types, and values

    line 61
  8. Distinctive:

    If suggesting a code change, use a GitHub suggestion block:

    line 62
  9. Distinctive:

    Keep total comment length under 5 lines when possible.

    line 68
  10. Distinctive:

    Verify each file:line actually appears in the diff.

    line 95
  11. Distinctive:

    Prefer the nearest changed line in the same function or block

    line 96
  12. Distinctive:

    If needed, use a changed call site, test, or related line in the diff that makes the off-diff concern actionable

    line 98
  13. Very specific:

    every comment as path:line, followed by its full body.

    line 107
  14. Distinctive:

    Only an explicit Post goes ahead.

    line 116
  15. Very specific:

    Use the gh CLI to submit the approved draft as a single review.

    line 120
  16. Very specific:

    Write the review to a temporary JSON file (for example REVIEW_JSON=$(mktemp)) and submit it via --input to avoid shell escaping issues:

    line 134
  17. Distinctive:

    After the API call succeeds, output:

    line 164
  18. Distinctive:

    If any comments failed to post (e.g., line not in diff), report which ones and why.

    line 169
  19. Distinctive:

    Never submit an empty review unless the user explicitly asked you to approve the PR — if there are no findings, tell the user instead of …

    line 173
  20. Distinctive:

    Never post without the user approving the exact draft (Step 5).

    line 174
  21. Distinctive:

    Prefer fewer, higher-quality comments over many trivial ones

    line 175
  22. Distinctive:

    Use GitHub suggestion blocks whenever a concrete code fix is possible

    line 176

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Submit Review

You are posting a code review on a GitHub PR. Your job is to turn review findings into precise, actionable inline PR comments and submit them as a single review.

Prerequisites: the GitHub CLI (gh), authenticated with permission to review the target PR, and network access to GitHub.

Step 1: Determine the PR

If the PR number is not already known from context, ask which PR to submit the review on, offering two options: the current branch's PR (auto-detect) or a specific PR number. Use a structured question tool (such as Claude Code's AskUserQuestion) when one is available; otherwise ask in plain text.

Auto-detect with:

gh pr view --json number,headRefOid -q '.number'

Step 2: Gather Review Findings

If you just ran /deep-code-review or the user provided findings, use those directly.

Otherwise, generate findings by:

  1. Get the diff: gh pr diff <number>
  2. Read full files for context
  3. Identify issues worth commenting on

Comment quality bar: Only submit comments that are genuinely useful. Each comment must either:

  • Flag a bug, security issue, or correctness problem
  • Suggest a concrete improvement with a clear reason
  • Ask a clarifying question about intent

Do NOT submit comments that are:

  • Style preferences already covered by formatters/linters
  • Restating what the code does without adding insight
  • Generic advice ("consider adding tests") without specifics

Step 3: Draft Comments

For each finding, craft an inline comment that is concise yet precise:

Comment format

Each comment must include:

  • Severity prefix (italic, lowercase): *issue*:, *suggestion*:, or *nit*:
    • *issue*: — bugs, security problems, correctness errors, or design concerns that should be addressed
    • *suggestion*: — concrete improvements worth considering but not blocking
    • *nit*: — minor style, naming, or clarity items; take-or-leave
  • The point: One sentence stating what's wrong or what could be better
  • Why it matters: One sentence on the impact (skip if obvious)
  • Fix (when applicable): A concrete code suggestion or direction — not a vague recommendation

Writing style

  • Lead with the point — no preamble ("Nice work but...", "I noticed that...")
  • Use code backticks for identifiers, types, and values
  • If suggesting a code change, use a GitHub suggestion block:
    ```suggestion
    corrected code here
    ```
  • Keep total comment length under 5 lines when possible. Longer only when the fix requires explanation.
  • One comment per issue. Do not bundle unrelated findings into a single comment.

Examples

Good:

issue: This unwrap() will panic if the upstream RPC returns an unexpected response. Propagate the error with ? instead.

let result = client.call().await?;

Good:

suggestion: Is the + 1 intentional here? With limit = 0 this fetches 1 item, which differs from the previous behavior of returning empty.

Good:

nit: MAX_EVICTED_STREAMS could be pub(crate) for consistency with the other constants in this file.

Bad:

I think it might be worth considering whether this could potentially cause issues in some edge cases. Maybe we should think about adding some error handling here?

Step 4: Map Comments to Diff Positions

For each comment, determine:

  1. File path — the file in the diff
  2. Line number — the line in the NEW version of the file (right side of the diff)
  3. Side — always RIGHT unless commenting on deleted code

Verify each file:line actually appears in the diff. GitHub only accepts inline review comments on diff positions, so if a finding refers to code outside the changed lines, find the next best inline anchor instead of moving it into the top-level review body:

  • Prefer the nearest changed line in the same function or block
  • Then prefer the nearest changed line in the same file
  • If needed, use a changed call site, test, or related line in the diff that makes the off-diff concern actionable

When anchoring to a nearby diff line, write the comment so the target is clear (for example, "This new call still relies on foo returning non-null..."). If there is no honest inline anchor in the diff, skip that comment and report it after submission rather than posting a top-level review note.

Step 5: Get Approval

A posted review is public and notifies the PR author, so nothing is posted without the user's explicit go-ahead. First decide the review action (see the table in Step 6), then show the user the exact draft:

  • the PR (number and title) and the action, APPROVE or COMMENT;
  • every comment as path:line, followed by its full body;
  • any finding you skipped because it had no honest inline anchor, with the reason.

Then ask with a structured question tool (such as Claude Code's AskUserQuestion) when one is available, or in plain text otherwise. Offer these options:

  • Post: submit exactly as shown.
  • Edit: the user names changes. Apply them, show the revised draft, and ask again.
  • Cancel: post nothing.

Only an explicit Post goes ahead. Silence, an ambiguous reply, or a running pipeline does not count. If the user asked to approve the PR, that is still a request to draft the review, not approval to post it.

Step 6: Submit the Review

Use the gh CLI to submit the approved draft as a single review. Determine the appropriate review action from the review verdict, not just whether comments exist:

VerdictAction
Overall approval, optionally with inline non-blocking commentsAPPROVE
Feedback should be posted but the PR should not be approved yetCOMMENT
No inline comments and no explicit approval requestDo not submit an empty review; tell the user there were no findings

Never use REQUEST_CHANGES — always use COMMENT or APPROVE. REQUEST_CHANGES blocks the PR and should only be done manually by the reviewer in the GitHub UI.

APPROVE reviews may include inline comments when the review verdict is approval and the comments are non-blocking. Do not attach an additional top-level approval comment such as "LGTM" or a summary paragraph; approval is conveyed by the review event itself.

Build the review command

Write the review to a temporary JSON file (for example REVIEW_JSON=$(mktemp)) and submit it via --input to avoid shell escaping issues:

{
  "commit_id": "<HEAD SHA of the PR>",
  "event": "<APPROVE or COMMENT>",
  "body": "",
  "comments": [
    {
      "path": "path/to/file.rs",
      "line": 42,
      "side": "RIGHT",
      "body": "*issue*: Comment body here"
    }
  ]
}
gh api repos/{owner}/{repo}/pulls/{number}/reviews \
  --method POST \
  --input "$REVIEW_JSON"

The event field must be either APPROVE or COMMENT. Never use REQUEST_CHANGES.

The body field must be an empty string "" — do not include a top-level review summary or an extra approval message. All feedback goes in inline comments only.

Step 7: Confirm Submission

After the API call succeeds, output:

  • Link to the PR
  • Count of comments posted
  • The review action taken

If any comments failed to post (e.g., line not in diff), report which ones and why.

Important Guidelines

  • Never submit an empty review unless the user explicitly asked you to approve the PR — if there are no findings, tell the user instead of posting
  • Never post without the user approving the exact draft (Step 5); post what they approved, unchanged
  • Prefer fewer, higher-quality comments over many trivial ones
  • Use GitHub suggestion blocks whenever a concrete code fix is possible
  • Comments on deleted lines use side=LEFT and the old file's line number
  • Multi-line comments: use start_line and line together with start_side and side

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.