A comprehensive Claude Code skill for reviewing OpenStack Gerrit changes with automated checks and best practices.
- Automated Fetch: Fetches reviews from OpenStack Gerrit automatically
- Previous Comment Analysis: Fetches and analyzes comments from other reviewers on previous patchsets
- Feedback Verification: Checks if issues raised in previous patchsets have been addressed
- Code Quality Analysis: Checks for HACKING.rst compliance and OpenStack coding standards
- Security Review: Identifies common security issues (SQL injection, command injection, etc.)
- Test Coverage: Validates test structure and coverage requirements
- Database Changes: Reviews migrations, repository pattern usage, and model changes
- API Compatibility: Checks for breaking changes and versioning issues
- Performance Analysis: Identifies N+1 queries and other performance issues
- Comprehensive Reporting: Generates detailed markdown review reports with feedback tracking
This skill works with any OpenStack project that uses Gerrit for code review.
The skill is already available in this repository at .claude/skills/openstack-review/.
To use this skill across all OpenStack projects, copy it to your global skills directory:
cp -r .claude/skills/openstack-review ~/.claude/skills//openstack-review 970404This will:
- Fetch review 970404 from Gerrit
- Fetch and analyze previous review comments from other reviewers
- Check if previous feedback has been addressed
- Analyze all code changes
- Run code quality checks
- Generate a comprehensive review report including feedback tracking
You can also use the helper script directly:
# Set SKILL_DIR based on where the skill is installed
SKILL_DIR="${SKILL_DIR:-$HOME/.claude/skills/openstack-review}"
# Fetch the review
${SKILL_DIR}/fetch_review.sh 970404Or use the direct path for your installation:
# Global install (default):
~/.claude/skills/openstack-review/fetch_review.sh 970404
# Project-specific install:
./.claude/skills/openstack-review/fetch_review.sh 970404- Fetches all comments from previous patchsets
- Identifies issues marked by other reviewers (-1 votes, requests, questions)
- Verifies that requested changes have been made
- Checks if reviewers' questions have been answered
- Flags unaddressed feedback
- Import order (stdlib, third-party, project)
- Logging patterns (LOG.warning vs LOG.warn, no translation)
- JSON module usage (jsonutils vs json)
- Line continuation (parentheses vs backslashes)
- Mutable default arguments
- TaskFlow revert signatures
- Test structure mirrors code structure
- Coverage ≥92%
- Bug fixes have regression tests
- New features have unit tests
- Migrations for schema changes
- Repository pattern usage
- Model compatibility
- Versioning
- Type validation
- Backward compatibility
- Documentation updates
- SQL injection prevention
- Command injection prevention
- Path traversal prevention
- Secrets in code
- TLS/SSL validation
- N+1 query detection
- Eager loading usage
- Pagination for large datasets
The skill generates a markdown report (REVIEW_<number>.md) containing:
- Summary: What the change does
- Files Changed: List of modified files with statistics
- Code Quality Issues: HACKING.rst violations and style issues
- Testing Analysis: Test coverage and adequacy
- Security Assessment: Potential security concerns
- Performance Impact: Performance considerations
- Compatibility: Breaking changes analysis
- Documentation: Documentation updates needed
- Recommendation: Approve/Needs Work/Reject with reasoning
- Fetch the review from Gerrit
- Analyze code changes automatically
- Run automated checks (pep8, tests, coverage)
- Generate comprehensive review report
- Post feedback on Gerrit or share with team
# Invoke the skill
/openstack-review 970404
# Claude will:
# 1. Fetch the review from Gerrit
# 2. Download review history and comments
# 3. Analyze previous reviewer feedback
# 4. Show commit details
# 5. Verify if previous issues were addressed
# 6. Analyze current code changes
# 7. Run tox environments
# 8. Check for common issues
# 9. Generate REVIEW_970404.md with feedback tracking
# Review the generated report
cat REVIEW_970404.md
# The report will include:
# - Previous patchset comments
# - Which issues were addressed
# - Which issues remain open
# - Your new review findings
# Use the report to post feedback on Gerrit- SKILL.md: Main skill instructions and workflow
- reference.md: Detailed reference for common issues and examples
- fetch_review.sh: Helper script to fetch Gerrit reviews
- analyze_comments.py: Python script to analyze review comments and track feedback
- README.md: This file
- CHANGELOG.md: Version history and updates
- Git repository with an OpenStack project
.gitreviewfile in the repository root- Access to the Gerrit host (typically review.opendev.org)
- Python 3 with tox installed
- curl for API access
This skill works with any OpenStack project that has:
- A
.gitreviewfile - Gerrit-based code review workflow
- Standard OpenStack project structure (tox, tests, etc.)
Examples: Nova, Neutron, Octavia, Cinder, Keystone, Glance, Heat, etc.
For large changes (like performance optimizations), focus on:
- High-level architecture changes
- Critical paths (hot code paths)
- Test coverage for new logic
- Performance benchmark results
- Backward compatibility
For bug fixes, verify:
- Root cause analysis in commit message
- Test that reproduces the bug
- Test passes with the fix
- No unintended side effects
- Appropriate bug reference (Closes-Bug: #XXXXXX)
For API changes, check:
- Versioning strategy
- Input validation
- Error handling
- Documentation updates
- API reference updates
- Backward compatibility
- OpenStack Contributor Guide
- Code Review Guidelines
- Commit Message Guidelines
- Project Documentation - Find your project's docs
- HACKING.rst - Check your project's root directory for coding standards
If git fetch fails:
- Verify
.gitreviewfile exists in repository root - Check network connectivity to the Gerrit host
- Verify the review number is correct
- Try accessing the review in browser:
https://<gerrit-host>/c/<project>/+/<review-number> - Check that the project name in
.gitreviewis correct
If tox commands fail:
- Ensure tox is installed:
pip install tox - Check Python version compatibility
- Verify all dependencies are installed
If permission denied on scripts:
- Make scripts executable:
chmod +x .claude/skills/openstack-review/*.sh
To improve this skill:
- Edit SKILL.md for workflow changes
- Update reference.md for new examples
- Enhance fetch_review.sh for better automation
- Add new checks and patterns as needed
This skill follows the same license as the Octavia project (Apache License 2.0).