Install
$ agentstack add skill-abhatt-rh-redhat-docs-agent-tools-git-pr-reader ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ● Environment & secrets Used
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Git PR Reader Skill
Unified interface for GitHub Pull Requests and GitLab Merge Requests — read, review, and post comments.
Capabilities
- Auto-detect Git platform: Automatically identifies GitHub vs GitLab from URL
- Read PR/MR data: Fetch title, description, and file-level diffs with smart filtering
- List changed files: Get file paths, statuses, and line counts with optional glob filtering
- Review comments: Fetch existing review comments/discussions, filter bots, include/exclude resolved
- Post review comments: Post inline comments on specific diff lines with duplicate detection and fallback to PR-level comments
- Extract line numbers: Parse diffs to get added/modified line numbers for accurate comment placement
- Validate comments: Check comment line numbers against actual diff content
- Auto-detect PR/MR: Find the open PR/MR for the current git branch (GitHub via
ghCLI, GitLab via API) - Smart file filtering: Exclude irrelevant files using configurable YAML patterns:
- Test files (test/, _test.go, .spec.ts, etc.)
- Lock files (package-lock.json, *.lock, Pipfile.lock, etc.)
- CI/CD configs (.gitlab-ci.yml, .github/workflows/, Dockerfile, etc.)
- Build artifacts (dist/, build/, target/, *.class, etc.)
- Generated code (.pb.go, .gen.go, etc.)
- Vendor directories (node_modules/, vendor/, etc.)
- Images and binaries (.png, .jpg, *.svg, etc.)
Usage
Subcommands
read — Read PR/MR data with diffs and file filtering
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py read --url "https://github.com/owner/repo/pull/123"
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py read --url "https://gitlab.com/group/project/-/merge_requests/456" --format markdown
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py read --url "https://github.com/owner/repo/pull/123" --no-filter
info — Get PR/MR information
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py info https://github.com/owner/repo/pull/123 --json
files — List changed files
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py files https://github.com/owner/repo/pull/123
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py files https://github.com/owner/repo/pull/123 --filter "*.adoc" --json
comments — List review comments
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py comments https://github.com/owner/repo/pull/123
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py comments https://github.com/owner/repo/pull/123 --include-resolved --json
diff — Get unified diff
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py diff https://github.com/owner/repo/pull/123
post — Post review comments
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py post https://github.com/owner/repo/pull/123 comments.json
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py post https://github.com/owner/repo/pull/123 comments.json --review-type technical
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py post https://github.com/owner/repo/pull/123 comments.json --review-type style --dry-run
extract — Extract line numbers from diff
# Find line number for a pattern
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py extract https://github.com/owner/repo/pull/123 path/to/file.adoc "pattern"
# Dump all added/modified lines
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py extract --dump https://github.com/owner/repo/pull/123 path/to/file.adoc
# Validate a comments JSON file against the diff
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py extract --validate https://github.com/owner/repo/pull/123 comments.json
detect — Auto-detect PR/MR for current branch
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py detect
python3 ${CLAUDE_SKILL_DIR}/scripts/git_pr_reader.py detect --json
Authentication
Set in ~/.env (global) or .env in the project root (local override). See docs-tools README for setup:
GITHUB_TOKEN=your-github-pat # required scope: "repo" for private, "public_repo" for public
GITLAB_TOKEN=your-gitlab-pat # required scope: "api"
The script loads .env files automatically — do not prepend source ~/.env to bash commands.
Python Library Usage
from git_pr_reader import GitReviewAPI
api = GitReviewAPI.from_url("https://github.com/owner/repo/pull/123")
# Read PR data with filtering
data = api.get_pr_data()
# Get PR info
info = api.get_pr_info()
# Get changed files
files = api.get_changed_files()
# Get review comments
comments = api.get_review_comments()
# Post comments
api.post_comments([
{"file": "path/to/file.adoc", "line": 42, "message": "Issue description"}
])
# Extract line numbers from diff
lines = api.extract_line_numbers("path/to/file.adoc")
# Validate comments against diff
results = api.validate_comments(comments_list)
Comments JSON Format
[
{"file": "path/to/file.adoc", "line": 42, "message": "Issue: missing title", "severity": "suggestion"},
{"file": "path/to/other.adoc", "line": 10, "message": "Typo in description", "severity": "suggestion"}
]
Configuration
File filtering patterns are defined in config/git_filters.yaml. You can customize these patterns for your specific needs.
Dependencies
Install required Python packages:
python3 -m pip install PyGithub python-gitlab pyyaml pip-system-certs
Integration with Other Skills
This skill works well with:
- jira-reader: Combine JIRA issue context with Git code changes
- jira-writer: Generate release notes from JIRA + Git data, then push back to JIRA
- docs-review-style: Post style review findings as inline PR/MR comments
- docs-review-technical: Post technical review findings as inline PR/MR comments
Limitations
- GitHub API rate limits: 60 requests/hour (unauthenticated), 5000/hour (authenticated)
- GitLab API rate limits: 10 requests/second
- Only fetches file-level diffs, not commit-level history
- Requires public PRs/MRs unless authentication tokens are provided
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: abhatt-rh
- Source: abhatt-rh/redhat-docs-agent-tools
- License: Apache-2.0
- Homepage: https://redhat-documentation.github.io/redhat-docs-agent-tools/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.