Merge git_review_api.py into git-pr-reader skill#39
Merged
Conversation
441db99 to
3250376
Compare
Unify the read-only git_pr_reader.py skill and the full-featured git_review_api.py command script into a single unified script at skills/git-pr-reader/scripts/git_pr_reader.py. The merged script uses PyGithub and python-gitlab libraries and provides all capabilities from both sources via CLI subcommands: read, info, files, comments, diff, post, extract, and detect. - Remove commands/scripts/git_review_api.py - Update docs-review command to reference new script path - Update requirements-analyst and docs-planner agents to use idiomatic Skill invocation pattern (docs-tools:git-pr-reader) - Update docs-technical-review and docs-workflow references - Update SKILL.md with complete documentation of all subcommands Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
…Skill invocations Replace Skill: docs-tools:git-pr-reader invocations with direct python3 script calls in agent and command files, and fix python -> python3 in docs-review.md per project convention. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
Document that commands and agents should call backing scripts directly
via ${CLAUDE_PLUGIN_ROOT} rather than using Skill: invocations. Reserve
Skill: pseudocode for pure knowledge/checklist skills with no script.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
Add decision table clarifying when to use direct script calls
(${CLAUDE_PLUGIN_ROOT}/...) vs Skill: invocations for loading full
skill knowledge.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
Replace jira-reader with rh-ssg-formatting and ibm-sg-punctuation as examples of pure knowledge skills with no backing script. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
Convert jira-reader, redhat-docs-toc, and article-extractor from
Skill: pseudocode to python3 ${CLAUDE_PLUGIN_ROOT}/... direct calls,
since all three have backing scripts. Also fix python -> python3 for
jira_ticket_graph.py.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Aidan Reilly <aireilly@redhat.com>
rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
3250376 to
863fb69
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Unifies the two separate Git API scripts into a single unified
git_pr_reader.pyin thegit-pr-readerskill:commands/scripts/git_review_api.py(deleted) — full-featured API usingurllib.requestwith review posting, line extraction, branch detection, and CLI subcommandsskills/git-pr-reader/scripts/git_pr_reader.py(was read-only) — now the unified script with all capabilitiesChanges
Unified script (
skills/git-pr-reader/scripts/git_pr_reader.py)The merged script uses PyGithub and python-gitlab libraries (not raw urllib.request) and provides all capabilities via CLI subcommands:
readinfofilescommentsdiffpostextractdetectArchitecture:
GitReviewAPIwithGitHubReviewAPIandGitLabReviewAPIimplementationsReviewComment,DiffLine,PostResultconfig/git_filters.yamlload_env_file()(noenv_utilsdependency)get_diff()usesurllib.requestwithAccept: application/vnd.github.diff(PyGithub doesn't expose raw unified diffs)detectsubcommand usesghCLI for GitHub andurllib.requestfor GitLab API discoveryReference updates
docs-review.md— Updated all script paths fromcommands/scripts/git_review_api.pytoskills/git-pr-reader/scripts/git_pr_reader.pyrequirements-analyst.md— Switched from direct script calls to idiomaticSkill: docs-tools:git-pr-reader, args: "..."patterndocs-planner.md— Same Skill pattern updatedocs-technical-review.md— Updated referencedocs-workflow.md— Updated prerequisite referenceDeleted
commands/scripts/git_review_api.py— All functionality merged into the skillTesting
All subcommands tested against real GitHub PR and GitLab MR:
read(json + markdown)info --jsonfiles(plain +--filter+--json)commentsdiffextract --dumpdetectTest URLs:
https://github.com/openshift/openshift-docs/pull/108356https://gitlab.cee.redhat.com/.../merge_requests/389Test plan
docs-review --prworkflow still works end-to-enddocs-tools:git-pr-readerskill invocation from agentspost --dry-runagainst a test PR/MR🤖 Generated with Claude Code