npx skills add ...
npx skills add microsoft/semantic-link-labs --skill pr-review-comments
npx skills add microsoft/semantic-link-labs --skill pr-review-comments
Guide for submitting/posting inline PR review comments to GitHub. Use this when you need to post code review comments on specific lines of a Pull Request.
This skill documents how to post inline review comments to GitHub Pull Requests using the GitHub CLI (gh) and GitHub API. Inline comments appear directly on specific lines of code in the PR diff, making it easier for PR authors to identify and address issues.
Use this skill when you need to:
GitHub CLI installed: Check with gh --version
GitHub CLI authenticated: Check with gh auth status
gh auth login -h github.com -p https --webCreate a JSON file with the review comments. Each comment needs:
path: The file path relative to repository rootline: The line number in the new version of the file (right side of diff)body: The comment content (supports Markdown)line field refers to the line number in the new version of the file (right side of the diff)side: "LEFT" and the line number from the old version| Event | Description |
|---|---|
"COMMENT" | Just add comments without approving/requesting changes |
"APPROVE" | Approve the PR with comments |
"REQUEST_CHANGES" | Request changes with comments |
\n for newlines in JSONFor commenting on a range of lines:
| Issue | Solution |
|---|---|
| "Validation Failed" error | Check that the line number exists in the PR diff; verify the file path is correct |
| "Resource not accessible" error | Ensure you have write access to the repository; re-authenticate with gh auth login |
| Comments not appearing on specific lines | The line must be part of the diff (added, modified, or within context lines) |
gh pr review CommandFor simpler reviews without inline comments:
This posts a general review comment but does not support inline comments on specific lines.
microsoft/semantic-link-labssrc/sempy_labs/{module}/_items.pysrc/sempy_labs/{module}/__init__.pySee the examples/ folder for complete working scripts: