-
Notifications
You must be signed in to change notification settings - Fork 8
Add PR Review Skill for Claude Code #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: sellakumaran <147754920+sellakumaran@users.noreply.github.com>
Co-authored-by: sellakumaran <147754920+sellakumaran@users.noreply.github.com>
Add logic to confirm Website Contributor role assignment for the current user after attempting assignment. If verification fails, log detailed warnings and manual remediation steps. Update tests to cover verification scenarios, including cases where the role already exists or assignment/verification fails, and assert correct logging and command execution.
Update log instructions to specify --endpoint-only for endpoint cleanup/registration in BlueprintSubcommand and BotConfigurator. Refine InfrastructureSubcommandTests mocks: webapp show now simulates post-creation success, signed-in-user returns valid GUID, and role assignment verification returns empty result for realism. Improves user guidance and test reliability.
- Context-aware review: Differentiates CLI vs GitHub Actions code - Actionable refactoring suggestions for large files - Engineering principles: KISS, DRY, SOLID, YAGNI - Test coverage requirements (blocking for CLI, high for actions) - Cross-platform checks (CLI only) - Security: Context-aware credential guidance - Windows encoding fixes for subprocess Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Rename skill.yaml to SKILL.md with YAML frontmatter - Use proper Claude Code skills format (Agent Skills standard) - Add markdown documentation in SKILL.md - Skill should now be discoverable in Claude Code Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…ist all file types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a Claude Code /review-pr skill for generating/editing/posting structured PR review comments, and also enhances the CLI’s Azure infrastructure setup by attempting to assign the current user the Website Contributor role (plus associated tests) and updating endpoint-cleanup guidance to use --endpoint-only.
Changes:
- Add a new Claude skill implementation (
.claude/skills/review-pr/) that generates YAML-based review output and can post viagh. - Update
InfrastructureSubcommand.CreateInfrastructureAsyncto assign/verify “Website Contributor” for the current signed-in user, with new unit tests covering success/failure paths. - Update CLI log guidance to reference
a365 cleanup blueprint --endpoint-only, and ignore locally generated PR review artifacts.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
src/Tests/.../InfrastructureSubcommandTests.cs |
Adds tests for Website Contributor role assignment behavior during infra creation. |
src/.../Services/BotConfigurator.cs |
Updates user guidance strings to use --endpoint-only for endpoint cleanup. |
src/.../Commands/SetupSubcommands/InfrastructureSubcommand.cs |
Adds Azure role assignment + verification for current user on the web app scope. |
src/.../Commands/SetupSubcommands/BlueprintSubcommand.cs |
Updates endpoint registration troubleshooting guidance to use --endpoint-only. |
.gitignore |
Ignores locally generated PR review markdown artifacts. |
.claude/skills/review-pr/review-pr.py |
Adds the PR review generator/poster script (YAML output + gh integration). |
.claude/skills/review-pr/SKILL.md |
Defines the Claude Code skill metadata and usage. |
.claude/skills/review-pr/README.md |
Documents setup/usage for the new /review-pr skill. |
src/Microsoft.Agents.A365.DevTools.Cli/Commands/SetupSubcommands/InfrastructureSubcommand.cs
Show resolved
Hide resolved
src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/Commands/InfrastructureSubcommandTests.cs
Show resolved
Hide resolved
Replaced all hardcoded references to "toolingManifest.json" and "ToolingManifest.json" with McpConstants.ToolingManifestFileName. Updated command classes, helpers, validation, and tests for consistent manifest file handling and improved error/log messages.
This reverts commit d8fdb17.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
src/Microsoft.Agents.A365.DevTools.Cli/Commands/SetupSubcommands/InfrastructureSubcommand.cs
Show resolved
Hide resolved
This update adds deep, context-sensitive code analysis to the PR review tool, leveraging engineering principles and repository guidelines. Key improvements include: - Parsing PR diffs to analyze added/modified code per file. - Loading and applying rules from .github/copilot-instructions.md. - Automated checks for legacy keywords, copyright headers, large functions, resource leaks, code duplication, hardcoded secrets, workflow permissions, and test quality. - Contextual feedback based on PR intent (bug fix, feature, security, etc.). - Improved file categorization and more actionable, principle-driven review comments. - Refactored large file checks to be context-aware and updated the main flow to ensure all analyses have the necessary context. These changes transform the script into a robust, best-practice-enforcing code review assistant.
Resolved conflict in .gitignore by keeping both PR review patterns and Python ignores. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated 14 comments.
Summary
Adds a reusable PR review skill for Claude Code that generates AI-powered, engineering-principles-based review comments.
Features
Usage
/review-pr <pr-number>/review-pr <pr-number> --postEngineering Principles
The skill enforces:
Files Added
.claude/skills/review-pr/SKILL.md- Skill definition with YAML frontmatter.claude/skills/review-pr/review-pr.py- Implementation script.claude/skills/review-pr/README.md- DocumentationWhat Gets Reviewed
Review Comments Include
Output Format
Generated reviews are saved to:
C:\Users\<username>\AppData\Local\Temp\pr-reviews\pr-<number>-review.yamlComments can be:
Test Plan
🤖 Generated with Claude Code