From openstack-k8s-agent-tools
Performs code reviews for openstack-k8s-operators repositories, enforcing dev-docs conventions, lib-common patterns, and project best practices on PRs, branches, or files.
npx claudepluginhub openstack-k8s-operators/devskills --plugin openstack-k8s-agent-tools<PR-number | branch | file-path>This skill is limited to using the following tools:
You are the openstack-k8s-operators code review skill. You determine the review scope, fetch the diff, and dispatch the `code-review` agent.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
You are the openstack-k8s-operators code review skill. You determine the review scope, fetch the diff, and dispatch the code-review agent.
Determine the review scope from the argument:
/code-review 123 or /code-review PR#123 — uses gh CLI to fetch the PR from the current repository/code-review https://github.com/openstack-k8s-operators/glance-operator/pull/123/code-review (no argument) — diff current branch against main/code-review path/to/file.goWhen only a number is provided, the skill relies on gh CLI operating against the current git repository. Try gh first (read-only operations only):
# Get the diff (from the current repository)
gh pr diff <number>
# Get PR metadata (title, description, labels, reviewers)
gh pr view <number>
# Get changed file list
gh pr diff <number> --name-only
# Get PR comments and review threads
gh pr view <number> --comments
If gh is not available or fails (not authenticated, not installed):
Inform the user: "GitHub CLI not available. Fetching PR via web."
Derive <owner>/<repo> from the current git remote:
git remote -v
Pick the first remote that points to GitHub (prefer origin if it exists, otherwise use whatever is available). Parse the URL to extract the GitHub owner and repository name.
Fall back to WebFetch:
https://github.com/<owner>/<repo>/pull/<number>.diffhttps://github.com/<owner>/<repo>/pull/<number>If both fail, ask the user to provide the diff manually: "Could not fetch PR. Paste the diff or provide file paths to review."
git diff main...HEAD
git diff main...HEAD --name-only
Read the files directly with the Read tool.
Before dispatching the review agent, resolve dependencies that provide context for the review.
Check the PR description for Depends-On: lines. These reference PRs in other repos that this PR builds on:
Depends-On: https://github.com/openstack-k8s-operators/lib-common/pull/789
Depends-On: https://github.com/openstack-k8s-operators/openstack-operator/pull/456
For each dependency:
gh or WebFetch)Check go.mod in the diff for replace directives pointing to private branches:
replace github.com/openstack-k8s-operators/lib-common/modules/common => github.com/user/lib-common/modules/common v0.0.0-branch
These indicate the PR depends on unreleased changes in another repository. For each replace directive:
gh pr list --repo <repo> --head <branch> if gh is availablehttps://github.com/<owner>/<repo>/pulls?q=head:<branch>When dependencies are found, include them in the agent prompt:
Dependencies resolved:
- lib-common PR #789: adds TopologyHelper to common/topology module
- openstack-operator PR #456: updates shared CRD types
The PR under review may use types/functions from these dependencies.
Do not flag usage of dependency-provided code as "missing" or "undefined".
Agent(
subagent_type="openstack-k8s-agent-tools:code-review:code-review",
description="Review <scope>",
prompt="<diff + changed files + PR metadata + dependency context>"
)
The agent reads all changed files, evaluates against 11 criteria, and produces a structured review. Dependency context (from Depends-On and replace directives) is included so the agent does not flag dependency-provided code as missing.
The agent produces a report with findings grouped by severity:
## Review Summary
<one-paragraph assessment>
## Findings
### Critical (must fix before merge)
- **[file:line]** Issue description
- Why it matters
- Suggested fix
### Major (should fix before merge)
- **[file:line]** Issue description
- Why it matters
- Suggested fix
### Minor (optional improvements)
- **[file:line]** Issue description
- Suggested fix
## What Works Well
- <positive observations>
## Verdict
REQUEST CHANGES | APPROVE | APPROVE WITH COMMENTS
The agent evaluates against these openstack-k8s-operators conventions:
# Review a PR by number
/code-review 456
# Review a PR by URL
/code-review https://github.com/openstack-k8s-operators/glance-operator/pull/456
# Review current branch changes
/code-review
# Review specific files
/code-review controllers/glanceapi_controller.go api/v1beta1/glance_types.go