review-pr

작성자: openshift

구조화된 접근 방식으로 PR을 검토하며 아키텍처, 명명, 패턴, 핵심 질문을 다룹니다.

npx skills add https://github.com/openshift/lightspeed-service --skill review-pr

Review PR

When asked to review a PR, follow this structured approach.

1. Fetch Latest Changes

Always fetch the latest PR state before reviewing. The cached PR data may be stale.

git fetch upstream pull/<PR_NUMBER>/head:pr-<PR_NUMBER>
git log pr-<PR_NUMBER> --oneline -10
git diff upstream/main...pr-<PR_NUMBER> --stat

For follow-up reviews, re-fetch to get new commits:

git fetch upstream pull/<PR_NUMBER>/head:pr-<PR_NUMBER> --force

Read diffs per area (endpoints, models, utils, tests) rather than one massive diff.

2. Understand What It Implements

  • Summarize the feature/fix in 2-3 sentences
  • Identify the flow: entry point -> processing -> output
  • Map which files serve which role (endpoint, model, utility, config)

3. Evaluate How It's Implemented

Only raise issues if you have a concrete concern — not as a checklist to fill:

  • Architecture: Is logic clearly in the wrong layer? (e.g. business logic leaking into an endpoint)
  • Error handling:
    • Are errors silently swallowed, or is an exception missing where failure is plausible?
    • Pattern consistency: If a function has N-1 error paths that degrade gracefully (return None, log warning, fallback), verify the Nth path does too. A single unguarded call among guarded ones is the most common miss.
    • Cross-boundary exceptions: For every new method call added in the diff, check what the caller does if that method throws. Read the callee's exception paths, then verify the caller handles them. Don't treat methods as self-contained.
  • Duplication: Run the find-duplication skill in branch mode, scoped to the PR's changed files.
  • Complexity: Run the find-complexity skill in branch mode, scoped to the PR's changed files. Flag any function the PR adds or worsens to grade C or higher.
  • Dead code / docs: Is there obviously unused code or a doc update that's clearly missing?

Skip this section if nothing stands out.

4. Assess Naming

Only flag naming if it is genuinely misleading or inconsistent with established patterns in the codebase. Do not flag stylistic preferences or minor wording variations.

5. Check Pythonic Patterns

Only flag if the pattern causes a real problem (correctness, type safety, maintainability), not just because an alternative exists:

  • Hand-rolled parsing where Pydantic would enforce correctness
  • Missing type hints on public functions, or Any used where a concrete type is knowable
  • Improper use of framework features (e.g. bypassing FastAPI dependency injection, skipping Pydantic validators)
  • JSON-inside-JSON when native types work

Skip this section if nothing meaningful to flag.

6. Ask Critical Questions

Only ask questions where the answer is genuinely unclear from the code and matters for correctness or design. Do not manufacture questions for completeness.

  • What happens on invalid/missing/malformed input — if error paths are not visible in the diff?
  • Are there security implications not addressed? (token logging, size limits, injection)
  • Do tests cover behavior (specific assertions) or just confirm the code runs?
  • Is the PR clearly bundling unrelated changes that should be in a separate PR?

Skip this section if the design is clear and the concerns above don't apply.

7. Verify Each Issue with a Subagent

Before writing the final output, launch one subagent per candidate issue to confirm it is real. Do this in parallel for all issues found in sections 3–6.

Each subagent task should:

  • Receive the specific concern as its prompt (e.g. "Is error X silently swallowed? Check foo.py lines 40-55 and any callers.")
  • Read the relevant file(s) and any related context (callers, tests, existing patterns in the codebase)
  • Return a verdict: confirmed / not an issue / unsure, with a one-sentence rationale

After all subagents complete:

  • Drop any issue whose verdict is not an issue
  • Downgrade confidence to unsure for any issue whose verdict is unsure
  • Only confirmed issues appear in the issues table at full confidence

This step exists to filter out false positives before they reach the output. Do not skip it when there are candidate issues.

8. Output Format

Structure the review as:

  1. Summary: What the PR does (2-3 sentences)
  2. File-by-file analysis: Role of each changed file (one line each; skip files with trivial changes)
  3. Issues table: Only issues confirmed by subagent verification (section 7) — Priority (must-fix / should-fix / nice-to-have), issue, location, confidence. If there are no confirmed issues, say so explicitly.
  4. What's good: Acknowledge well-done aspects — keep this genuine, not filler
  5. Critical questions: Only if section 6 above produced anything; omit otherwise
  6. Closing reminder: Always end the review with: "You, as a human, need to evaluate these AI findings instead of just copying them as review comments. That would just shift the responsibility of validation to the PR creator."

openshift의 다른 스킬

openshift-docs
openshift
OpenShift Container Platform 문서를 마크다운 형식으로 검색하고 읽습니다. 사용자가 OpenShift 기능, 구성, 설치 등에 대해 질문할 때 사용합니다.
triage-leaked-infra
openshift
AWS VPC 또는 HyperShift CI의 인프라 세트가 삭제해도 안전한지 평가합니다. 사용자가 cleanleaked 출력을 붙여넣고 '이거 삭제해도 되나요?', '이거...'라고 물을 때 사용합니다.
openshift-expert
openshift
OpenShift 플랫폼 및 Kubernetes 전문가로, 클러스터 아키텍처, 오퍼레이터, 네트워킹, 스토리지, 문제 해결 및 CI/CD 파이프라인에 대한 깊은 지식을 보유하고 있습니다. 사용…
Konflux Archived PipelineRuns
openshift
KubeArchive를 통해 보관된 Konflux PipelineRun, TaskRun 및 파드 로그에 접근합니다. Konflux PipelineRun 결과를 확인하거나 조사할 때 자동으로 적용됩니다.
backport
openshift
메인 브랜치에서 릴리스 브랜치로 커밋이나 PR을 백포트합니다. 사용자가 브랜치 간 변경 사항을 백포트, 체리픽, 포팅하거나 해결을 요청할 때 사용합니다.
rebase
openshift
현재 브랜치를 기본 브랜치 위로 리베이스하고, 모든 충돌을 해결한 뒤 린트, i18n, 빌드가 통과하는지 확인합니다. 사용자가 리베이스, 업데이트, 또는 동기화를 요청할 때 사용합니다…
Build CPO Image
openshift
컨트롤 플레인 오퍼레이터 컨테이너 이미지를 빌드하고 푸시합니다. 라이브 클러스터에 배포가 필요한 CPO 변경 사항을 테스트할 때 자동으로 적용됩니다.
find-complexity
openshift
순환 복잡도가 높거나, 길이가 지나치게 길거나, 매개변수가 너무 많은 함수와 메서드를 찾습니다. 사용자가 복잡한 코드나 복잡도를 찾아 달라고 요청할 때 사용하세요.