helpers/skills/code-review/SKILL.md
Perform AI code review on a GitLab MR or local branch. Reviews all commits since the base branch, produces structured JSON feedback with inline comments, and posts results to GitLab (CI) or displays them locally. Use when asked to review code changes, do a code review, or run ai-review.
npx skillsauth add opendatahub-io/ai-helpers code-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Perform a structured code review of the current branch's changes and post results to GitLab (in CI) or display them locally.
Review ALL commits in the branch since the base branch. The git workspace is
already checked out with the branch to review. Use git commands to inspect the
changes — do NOT access remote APIs (e.g., glab commands).
git log --oneline origin/main..HEAD
git diff origin/main..HEAD
Adjust the base branch name if different from main (e.g., master, develop).
In CI, $CI_MERGE_REQUEST_DIFF_BASE_SHA identifies the exact base commit.
Only review the committed diff between branches. Do NOT run git status,
do NOT report on untracked files, and do NOT include uncommitted working-tree
changes in your review.
$ARGUMENTS
If no additional instructions were provided above, follow these defaults:
Provide constructive feedback that helps maintain code quality and follows project best practices. Be selective and focused: only comment on issues that genuinely matter. Do not comment for the sake of commenting. If the code is well-written and follows best practices, it is perfectly acceptable to return zero inline comments. Prioritize critical and major issues over minor stylistic preferences. Avoid repeating the same type of feedback across multiple locations — one representative comment is sufficient.
When referencing coding standards, security norms, best practices, or component-specific behavior, search for and cite the authoritative source (official documentation, RFCs, upstream references) to back up the claim.
Write your review output as a JSON file at /tmp/ai-review-output.json.
The JSON must be a valid object matching this schema exactly:
{
"summary": "Brief overall assessment of the changes (2-4 sentences, markdown allowed inside this string)",
"positive_aspects": ["List of good practices and well-implemented features"],
"inline_comments": [
{
"file": "path/to/file (relative to repo root)",
"line": 42,
"severity": "critical|major|minor|suggestion",
"comment": "Description of the issue and suggested fix (markdown allowed inside this string)"
}
],
"fix_prompt": "Optional: a copy-paste prompt to fix all issues found. Omit this field if there are no actionable fixes."
}
file must be the path relative to the repository root
(e.g., src/main.py, not /workspace/src/main.py).[].[].Run the review.py script from this skill's scripts/ directory.
Execute it directly (not via python) to invoke uv via the shebang:
./scripts/review.py post /tmp/ai-review-output.json
The script auto-detects the platform (GitLab CI, GitHub, or local) and handles:
$CHILL_MODE env var)If the script reports a JSON parse error, fix the JSON in
/tmp/ai-review-output.json and re-run the command.
After the script completes successfully:
inline_comments must reference the NEW file version, not the old one; using old-side line numbers causes comments to land on the wrong line in GitLab.git status or reviewing uncommitted changes will produce false findings that are not part of the MR diff.The Python script reads these from the environment. In GitLab CI, most are set automatically — no manual configuration needed.
| Variable | Required for | Default | Description |
|----------|-------------|---------|-------------|
| GITLAB_API_TOKEN | CI/MR | — | GitLab Personal Access Token |
| CI_SERVER_URL | — | https://gitlab.com | GitLab server URL |
| CI_PROJECT_ID | CI/MR | — | GitLab project ID |
| CI_MERGE_REQUEST_IID | CI/MR | — | Merge request IID |
| CI_MERGE_REQUEST_DIFF_BASE_SHA | CI/MR | — | Base SHA for diff positioning |
| CI_COMMIT_SHA | CI/MR | — | Head commit SHA |
| CI_JOB_NAME | — | ai-review | Job name for summary footer |
| CI_JOB_URL | — | # | Job URL for summary footer |
| Variable | Required for | Default | Description |
|----------|-------------|---------|-------------|
| CHILL_MODE | — | true | Filter out suggestion-level comments |
| VERBOSE | — | false | Show detailed API error responses |
tools
Use this skill to filter a pre-fetched set of Hacker News stories down to those that report supply-chain security threats relevant to software developers — including malicious packages on npm or PyPI, compromised developer tooling, and attacks targeting source code repositories or CI/CD infrastructure. Reads stories from stories.json in the workspace, performs semantic analysis (fetching HN threads when the title alone is ambiguous), and writes the stories worth alerting on to findings.json.
development
Run hexora static analysis on a Python package repository to detect suspicious code patterns, then triage findings with deterministic rules and AI reasoning to produce a structured risk report section.
development
Inspect recent git history of a Python package repository for suspicious commits touching supply-chain-sensitive files, then triage findings with AI reasoning to produce a structured risk report section.
development
Scan a Python package repository for compiled/binary files using Fromager-style detection and malcontent YARA analysis, then triage findings with deterministic rules and AI reasoning to produce a structured risk report section.