Skip to content

Conversation

@sellakumaran
Copy link
Contributor

Summary

Adds a reusable PR review skill for Claude Code that generates AI-powered, engineering-principles-based review comments.

Features

  • Comprehensive file analysis: Reviews ALL files (code, workflows, configs, docs, dependencies)
  • Context-aware reviews: Differentiates between CLI code (strict) and GitHub Actions code (lenient)
  • Engineering principles enforcement: KISS, DRY, SOLID, YAGNI, az cli patterns
  • Specific refactoring suggestions: File-based recommendations for splitting large files
  • Two-step workflow: Generate review → Edit YAML → Post to GitHub
  • Automatic fallback: Generates markdown for manual posting if API access fails
  • Editable output: YAML file format for easy review and modification

Usage

  1. Generate review: /review-pr <pr-number>
  2. Edit the generated YAML file as needed
  3. Post to GitHub: /review-pr <pr-number> --post

Engineering Principles

The skill enforces:

  • .NET architect patterns and best practices
  • Azure CLI alignment and conventions
  • Cross-platform compatibility (for CLI code)
  • Testing requirements (blocking for CLI, high for Actions)
  • Security best practices (no hardcoded secrets)
  • Code quality standards (SOLID, one class per file, max 500 lines)

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 - Documentation

What Gets Reviewed

  • Code files (Python, JS, TS, C#, Java, Go, etc.)
  • Workflow files (.github/workflows/*.yml)
  • Config files (YAML, JSON, TOML, etc.)
  • Dependency files (requirements.txt, package.json, etc.)
  • Documentation files
  • Any other modified files with general review guidance

Review Comments Include

  • Missing tests (blocking for CLI, high for Actions)
  • Large files >500 lines (specific splitting suggestions)
  • Workflow security and best practices
  • Config file validation
  • Dependency security checks
  • Cross-platform compatibility (CLI only)
  • Potential security issues

Output Format

Generated reviews are saved to:
C:\Users\<username>\AppData\Local\Temp\pr-reviews\pr-<number>-review.yaml

Comments can be:

  • Enabled/disabled
  • Modified
  • Severity adjusted (blocking, high, medium, low, info)

Test Plan

  • Skill loads in Claude Code
  • Generate review for PR GitHub Auto-Triage Action with AI-Powered Fix Suggestions #180 (21 files, 7 comments)
  • Reviews all file types (code, workflows, configs)
  • Context-aware analysis (CLI vs Actions)
  • Specific refactoring suggestions generated
  • YAML output is editable
  • Automatic markdown fallback on API failure

🤖 Generated with Claude Code

Copilot AI and others added 11 commits January 23, 2026 16:14
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>
mengyimicro
mengyimicro previously approved these changes Jan 24, 2026
@sellakumaran sellakumaran marked this pull request as ready for review February 11, 2026 00:59
Copilot AI review requested due to automatic review settings February 11, 2026 00:59
@sellakumaran sellakumaran requested review from a team as code owners February 11, 2026 00:59
Copy link
Contributor

Copilot AI left a 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 via gh.
  • Update InfrastructureSubcommand.CreateInfrastructureAsync to 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.

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.
Copilot AI review requested due to automatic review settings February 11, 2026 01:30
Copy link
Contributor

Copilot AI left a 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.

tmlsousa
tmlsousa previously approved these changes Feb 11, 2026
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>
Copilot AI review requested due to automatic review settings February 11, 2026 19:50
@github-actions
Copy link

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link
Contributor

Copilot AI left a 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.

@sellakumaran sellakumaran enabled auto-merge (squash) February 11, 2026 20:39
@sellakumaran sellakumaran merged commit 00bc830 into main Feb 11, 2026
14 checks passed
@sellakumaran sellakumaran deleted the users/sellak/prSkill branch February 11, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants