| name | code-review |
| description | Use to review code changes with a two-stage process - first checking spec/requirements compliance, then code quality. Works on staged changes, branches, or PRs. |
| user-invocable | true |
| argument-hint | [branch name, PR number, or file paths] |
Code Review for OpenMetadata
Two-stage review process: requirements compliance first, then code quality.
When to Use
- Before creating a PR
- Reviewing someone else's PR
- Self-checking your own changes before requesting review
Usage
/code-review # Review uncommitted changes
/code-review feature-branch # Review branch diff against main
/code-review #1234 # Review GitHub PR
/code-review path/to/file.java # Review specific files
Stage 1: Spec Compliance Review
Verify the changes do what they're supposed to do — no more, no less.
Steps
- Understand the goal. Read the PR description, issue, or ask the user what the change is supposed to accomplish.
- Read all changed files. Use
git diff to see the full scope:
git diff main...HEAD
git diff --staged
gh pr diff <number>
- Check completeness against requirements:
- Does every stated requirement have a corresponding code change?
- Are there missing pieces? (e.g., backend change without migration, API change without UI update)
- Check for scope creep:
- Are there changes unrelated to the stated goal?
- Was code "improved" that didn't need to change?
- Check the cross-layer contract:
- Schema change (
openmetadata-spec/) + model regeneration (make generate)
- Backend API change + frontend API client update
- New entity field + database migration (
bootstrap/sql/)
- New connection config +
yarn parse-schema for UI forms
Report Format (Stage 1)
## Spec Compliance: [PASS / FAIL / PARTIAL]
### Requirements Met
- [x] Requirement A — implemented in file.java:42
- [ ] Requirement B — MISSING: no migration for new field
### Scope Issues
- file.java:100-120 — unrelated refactor, consider separate PR
### Cross-Layer Gaps
- Schema updated but `make generate` not run (models out of sync)
If Stage 1 fails, stop here. Fix compliance issues before reviewing quality.
Stage 2: Code Quality Review
Now review the implementation quality.
Checklist
Architecture:
Java:
Python:
TypeScript/React:
Testing (use /test-enforcement for full analysis):
Security:
Report Format (Stage 2)
## Code Quality: [GOOD / NEEDS WORK / SIGNIFICANT ISSUES]
### Issues (must fix)
- file.java:42 — wildcard import, use specific imports
- Component.tsx:15 — `any` type, use `EntityReference` from generated types
### Suggestions (nice to have)
- connector.py:80 — could use `yield from` instead of loop
### Positive Notes
- Good test coverage for the new endpoint
- Follows existing pagination pattern correctly
Reviewing GitHub PRs
When reviewing a GitHub PR by number:
gh pr view <number>
gh pr diff <number>
gh api repos/{owner}/{repo}/pulls/<number>/comments
gh pr checks <number>
After review, optionally post findings:
gh pr review <number> --comment --body "Review findings..."