create-pr-review-from-comments | Skill Performance & Reviews | TopRankSkills

TopRank Skills

Home / Skills / tools / create-pr-review-from-comments

create-pr-review-from-comments

maintained by dimfeld

star 6 account_tree 0 verified_user MIT License
bolt View GitHub

name: create-pr-review-from-comments description: Converts "AI" comments in local files into Github PR review comments allowed-tools: Write(/tmp), Bash(bun * pr-review-from-comments/scripts/:*) disable-model-invocation: true

Find the current jj branch name using: jj log -r 'latest(heads(ancestors(@) & remote_bookmarks()), 1)' --limit 1 --no-graph -T bookmarks | tr -d '*' | sed 's/@origin$//'

Then use gh pr list --head <branch-name> to get the number of the PR.

IMPORTANT NOTE: ALL SCRIPTS ARE RELATIVE TO THE SKILL.md file path but you must run them from the repository directory.

Run the extract_comments.ts script to find all AI comments in modified files:

bun scripts/extract_comments.ts

This script will output each comment with:

  • File path
  • Comment type (single, block_start, block_end)
  • The comment line number in the edited file
  • The comment text
  • The adjacent original line number and content (the line the comment refers to)

Use the "Adjacent Original Line" number as the line field in the Comment structure. For block comments (AI_COMMENT_START/AI_COMMENT_END pairs), use the block_start's adjacent line as startLine and the block_end's adjacent line as line.

interface Comment {
  file: string;
  startLine?: number;
  line: number
  text: string;
}

interface Input {
  pr: number;
  status?: 'comment' | 'requestChanges' | 'approve';
  body: string;
  comments: Comment[];
}

Once you have that, read the files and relevant surrounding lines to ensure you have the full context of each comment.

After extracting comments, display them and ask if the user wants to:

  • set a particular status value
  • modify the comments

Finally, separately ask for a review body (main message) to be included with the review.

Generate an object of type Input, save it as JSON to a temporary file, and pass it to scripts/create_review.ts.

GITHUB_TOKEN=$(gh auth token) bun scripts/create_review.ts <tempfile>

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!

Skill Details

GitHub Stars 6
GitHub Forks 0
Created Mar 2026
Last Updated 3个月前
tools tools automation tools

Related Skills

specs-gen
chevron_right
glm-coding-agent
chevron_right
creating-pr
chevron_right
writing-skills
chevron_right
reviewing-pr
chevron_right

Build your own?

Join 12,000+ developers contributing to the Claude ecosystem.