Loading...
Loading...
Skill for handling PR code reviews. Use when triggered by a PR review comment, review request, or when asked to review code changes. Provides workflow for reading review comments, understanding feedback, and iterating on changes.
npx skill4agent add letta-ai/letta-code-action code-reviewpull_request_reviewpull_request_review_comment# List all reviews (approved, changes requested, commented)
gh api repos/$GITHUB_REPOSITORY/pulls/<number>/reviews
# Get a specific review's comments
gh api repos/$GITHUB_REPOSITORY/pulls/<number>/reviews/<review_id>/comments# All line-level review comments on the PR
gh api repos/$GITHUB_REPOSITORY/pulls/<number>/comments
# Filter by specific path
gh api repos/$GITHUB_REPOSITORY/pulls/<number>/comments | jq '.[] | select(.path == "src/example.ts")'pathlineoriginal_linebodydiff_hunkin_reply_to_id# Reply to a specific review comment
gh api repos/$GITHUB_REPOSITORY/pulls/<number>/comments \
-X POST \
-f body="Fixed in the latest commit" \
-f in_reply_to=<comment_id># View the diff
gh pr diff <number> --repo $GITHUB_REPOSITORY
# View changed files list
gh pr view <number> --repo $GITHUB_REPOSITORY --json files
# Compare with base branch (use two dots for shallow clones in GitHub Actions)
git diff origin/$BASE_BRANCH..HEADgh pr reviewgh pr review <number> --approve --body "LGTM! Changes look good."gh pr review <number> --request-changes --body "Please address the following issues..."gh pr review <number> --comment --body "Some observations about the code..."# First, get the latest commit SHA
COMMIT_SHA=$(gh pr view <number> --json headRefOid --jq '.headRefOid')
# Create a review comment on a specific position in the diff
# Note: position is the line number in the diff (not the file), starting from 1
gh api repos/$GITHUB_REPOSITORY/pulls/<number>/comments \
-X POST \
-f body="Consider using a more descriptive variable name here" \
-f commit_id="$COMMIT_SHA" \
-f path="src/example.ts" \
-F position=10commit_idpathpositionbodyposition# Ensure you're on the PR branch
gh pr checkout <number>
# Make changes, then commit
git add <files>
git commit -m "fix: address review feedback"
# Push to update the PR
git push origin HEAD