review-pr
작성자: microsoft
Claude Code 에이전트를 사용하여 구조화된 PR 리뷰 코멘트를 생성하고 GitHub에 게시합니다. API 키가 필요하지 않으며 Claude Code의 기존 인증을 사용합니다.
npx skills add https://github.com/microsoft/agent365-devtools --skill review-prPR Review Skill
Generate and post AI-powered PR review comments to GitHub following engineering best practices.
Usage
/review-pr <pr-number> # Generate review (step 1)
/review-pr <pr-number> --post # Post review to GitHub (step 2)
Examples:
/review-pr 180- Generate review and save to YAML file/review-pr 180 --post- Post the reviewed YAML to GitHub
What this skill does
Step 1: Generate (/review-pr <number>)
- Fetches PR details from GitHub using the gh CLI
- Performs architectural review (NEW!): Questions design decisions, checks for scope creep, validates use cases
- Analyzes changes for security, testing, design patterns, and code quality issues
- Differentiates contexts: CLI code vs GitHub Actions code (different standards)
- Creates actionable feedback: Specific refactoring suggestions based on file names and patterns
- Generates structured review comments in an editable YAML file
- Shows preview of all generated comments
Step 2: Post (/review-pr <number> --post)
- Reads the YAML file you reviewed/edited
- Posts to GitHub: Submits all enabled comments to the PR
- Automatic fallback: If GitHub API posting fails (e.g., Enterprise Managed User restrictions), automatically generates a markdown file with formatted comments for manual copy/paste
Engineering Review Principles
This skill enforces the following principles:
Architectural Review (NEW!)
- Design Decision Validation: Questions "why" before reviewing "how"
- Scope Creep Detection: Flags expansions beyond Agent365 deployment/management
- Use Case Validation: Requires concrete scenarios for new features
- Overlap Detection: Identifies duplication with existing tools (Azure CLI, Portal)
- YAGNI Enforcement: Questions features without documented need
Architecture & Patterns
- .NET architect patterns: Reviews follow .NET best practices
- Azure CLI alignment: Ensures consistency with az cli patterns and conventions
- Cross-platform compatibility: Validates Windows, Linux, and macOS compatibility (for CLI code)
Design Patterns
- KISS (Keep It Simple, Stupid): Prefers simple, straightforward solutions
- DRY (Don't Repeat Yourself): Identifies code duplication
- SOLID principles: Especially Single Responsibility Principle
- YAGNI (You Aren't Gonna Need It): Avoids over-engineering
- One class per file: Enforces clean code organization
Code Quality
- No large files: Flags files over 500 additions
- Function reuse: Encourages reusing functions across commands
- No special characters: Avoids emojis in logs/output (Windows compatibility)
- Self-documenting code: Prefers clear code over excessive comments
- Crisp comments (pr-code-reviewer #30): Flags added comments that run past 1-2 lines, restate the code, or narrate design history — a comment says why in one line; long-form reasoning belongs in the commit/PR.
- Release-note-ready CHANGELOG (pr-code-reviewer #31): Flags
CHANGELOG.mdentries that name internals, explain mechanism, or run multiple sentences — each entry is one crisp consumer-facing sentence (it ships verbatim to nuget.org release notes). - Minimal changes: Makes only necessary changes to solve the problem
Testing Standards
- Framework: xUnit, FluentAssertions, NSubstitute for .NET; pytest/unittest for Python
- Quality over quantity: Focus on critical paths and edge cases
- CLI reliability: CLI code without tests is BLOCKING
- GitHub Actions tests: Strongly recommended (HIGH severity) but not blocking
- Mock external dependencies: Proper mocking patterns
Security
- No hardcoded secrets: Use environment variables or Azure Key Vault
- Credential management: Follow az cli patterns for CLI code; use GitHub Secrets for Actions
Context Awareness
The skill differentiates between:
- CLI code (strict requirements): Cross-platform, reliable, must have tests
- GitHub Actions code (GitHub-specific): Linux-only is acceptable, tests strongly recommended
Review Comments Output
Generated comments are saved to:
C:\Users\<username>\AppData\Local\Temp\pr-reviews\pr-<number>-review.yaml
You can edit this file to:
- Disable comments by setting
enabled: false - Modify comment text
- Adjust severity levels (blocking, high, medium, low, info)
- Add or remove comments
Implementation
The skill uses Claude Code directly for semantic code analysis (inspired by Agent365-dotnet). No separate API key required!
Generate mode (default):
- Claude Code reads
.claude/agents/pr-code-reviewer.mdfor review process guidelines. Read the working-tree (PR) version of this file and of.github/copilot-instructions.mdandCLAUDE.md— not the base-branch copy. When the PR under review adds or changes a review rule (as PR #461 did with rules #30/#31), the new rule must be applied to that same PR in the same run; reading the base copy would skip it. - Claude Code reads
.github/copilot-instructions.mdfor coding standards - Claude Code fetches PR details:
gh pr view <number> --json ... - Claude Code analyzes actual code changes:
gh pr diff <number> - Claude Code performs semantic analysis using its own capabilities
- Claude Code identifies specific issues with line numbers and code references
- Claude Code writes YAML file to
C:\Users\<username>\AppData\Local\Temp\pr-reviews\pr-<number>-review.yaml
Post mode (with --post flag):
- Python script reads the YAML file
- Python script posts comments to GitHub using
gh pr comment - If posting fails (API permissions), automatically generates markdown file for manual copy/paste
Key Advantages:
- ✅ No
ANTHROPIC_API_KEYrequired - uses Claude Code's existing authentication - ✅ Better semantic analysis - Claude Code has full context and conversation history
- ✅ Simpler Python script - only handles posting logic (~240 lines vs ~1500 lines)
- ✅ Easier to maintain and debug
Workflow
-
Generate review:
/review-pr 180- Fetches PR details from GitHub
- Analyzes code and generates review comments
- Saves to YAML file (shows path in output)
-
Review and edit: Open the YAML file
- Review all generated comments
- Edit comment text if needed
- Disable comments by setting
enabled: false - Add your own comments if desired
-
Post to GitHub:
/review-pr 180 --post- Reads the YAML file
- Posts all enabled comments to the PR
- If API posting fails, automatically generates a markdown file for manual copy/paste
Requirements
- GitHub CLI (
gh) installed and authenticated - Python 3.x (only for --post mode)
- PyYAML library:
pip install pyyaml(only for --post mode) - Repository must be a GitHub repository
- GitHub API permissions to post reviews (Enterprise Managed Users may have restrictions)
See Also
- README.md - Detailed documentation
- review-pr.py - Implementation script
microsoft의 다른 스킬
oss-growth
microsoft
OSS 성장 해커 페르소나
official
microsoft-foundry
microsoft
Foundry 에이전트를 엔드투엔드로 배포, 평가 및 관리: Docker 빌드, ACR 푸시, 호스팅/프롬프트 에이전트 생성, 컨테이너 시작, 배치 평가, 지속적 평가, 프롬프트 최적화 워크플로, agent.yaml, 트레이스에서 데이터셋 큐레이션. 용도: Foundry에 에이전트 배포, 호스팅 에이전트, 에이전트 생성, 에이전트 호출, 에이전트 평가, 배치 평가 실행, 지속적 평가, 지속적 모니터링, 지속적 평가 상태, 프롬프트 최적화, 프롬프트 개선, 프롬프트 최적화 도구, 에이전트 지침 최적화, 에이전트 개선...
officialdevelopmentdevops
azure-ai
microsoft
Azure AI: Search, Speech, OpenAI, Document Intelligence에 사용됩니다. 검색, 벡터/하이브리드 검색, 음성-텍스트 변환, 텍스트-음성 변환, 전사, OCR을 지원합니다. 사용 시점: AI Search, 쿼리 검색, 벡터 검색, 하이브리드 검색, 의미 검색, 음성-텍스트 변환, 텍스트-음성 변환, 전사, OCR, 텍스트를 음성으로 변환.
officialdevelopmentapi
azure-deploy
microsoft
이미 준비된 애플리케이션에 대해 기존 .azure/deployment-plan.md 및 인프라 파일이 있는 경우 Azure 배포를 실행합니다. 사용자가 새 애플리케이션 생성을 요청할 때는 이 스킬을 사용하지 말고 azure-prepare를 사용하세요. 이 스킬은 azd up, azd deploy, terraform apply, az deployment 명령을 내장된 오류 복구 기능과 함께 실행합니다. azure-prepare의 .azure/deployment-plan.md와 azure-validate의 검증 상태가 필요합니다. 사용 시점: "run azd up", "run azd deploy", "execute deployment",...
officialdevopsaws
azure-storage
microsoft
Azure Storage Services는 Blob Storage, File Shares, Queue Storage, Table Storage, Data Lake를 포함합니다. 스토리지 액세스 계층(hot, cool, cold, archive), 각 계층 사용 시기 및 계층 비교에 대한 질문에 답변합니다. 객체 스토리지, SMB 파일 공유, 비동기 메시징, NoSQL 키-값, 빅데이터 분석을 제공합니다. 수명 주기 관리를 포함합니다. 사용 용도: blob 스토리지, 파일 공유, 큐 스토리지, 테이블 스토리지, 데이터 레이크, 파일 업로드, blob 다운로드, 스토리지 계정, 액세스 계층,...
officialdevelopmentdatabase
azure-diagnostics
microsoft
Azure에서 AppLens, Azure Monitor, 리소스 상태 및 안전한 트라이지를 사용하여 Azure 프로덕션 문제를 디버그합니다. 사용 시기: 프로덕션 문제 디버그, 앱 서비스 문제 해결, 앱 서비스 높은 CPU, 앱 서비스 배포 실패, 컨테이너 앱 문제 해결, 함수 문제 해결, AKS 문제 해결, kubectl 연결 불가, kube-system/CoreDNS 오류, pod 보류 중, crashloop, 노드 준비 안 됨, 업그레이드 실패, 로그 분석, KQL, 인사이트, 이미지 풀 실패, 콜드 스타트 문제, 상태 프로브 실패,...
officialdevopsdevelopment
azure-prepare
microsoft
Azure 앱을 배포용으로 준비합니다(인프라 Bicep/Terraform, azure.yaml, Dockerfiles). 생성/현대화 또는 생성+배포에 사용하며, 크로스 클라우드 마이그레이션에는 사용하지 않습니다(azure-cloud-migrate 사용). 다음에는 사용하지 마십시오: copilot-sdk 앱(azure-hosted-copilot-sdk 사용). 사용 시점: "앱 생성", "웹 앱 빌드", "API 생성", "서버리스 HTTP API 생성", "프론트엔드 생성", "백엔드 생성", "서비스 빌드", "애플리케이션 현대화", "애플리케이션 업데이트", "인증 추가", "캐싱 추가", "Azure에 호스팅", "생성 및...
officialdevelopmentdevops
azure-validate
microsoft
Azure 배포 전 준비 상태 검증. 구성, 인프라(Bicep 또는 Terraform), RBAC 역할 할당, 관리 ID 권한, 사전 요구 사항에 대한 심층 점검을 실행합니다. 사용 시점: 내 앱 검증, 배포 준비 상태 확인, 사전 점검 실행, 구성 확인, 배포 가능 여부 확인, azure.yaml 검증, Bicep 검증, 배포 전 테스트, 배포 오류 문제 해결, Azure Functions 검증, 함수 앱 검증, 서버리스 검증...
officialdevopstesting