diff --git a/.claude/skills/github-pr-reviewer/SKILL.md b/.claude/skills/github-pr-reviewer/SKILL.md new file mode 100644 index 00000000000..3d3586eb0f4 --- /dev/null +++ b/.claude/skills/github-pr-reviewer/SKILL.md @@ -0,0 +1,46 @@ +--- +name: github-pr-reviewer +description: Review a GitHub pull request and provide feedback comments. Use when the user says "review the current PR" or asks to review a specific PR. +--- + +# Review GitHub Pull Request + +## Preparation: +- Check if the local commit matches the last one in the PR. If not, checkout the PR locally using 'gh pr checkout'. +- CRITICAL: If 'gh pr checkout' fails for ANY reason, you MUST immediately STOP. + - Do NOT attempt any workarounds. + - Do NOT proceed with the review. + - ALERT about the failure and WAIT for instructions. + - This is a hard requirement - no exceptions. + +## Follow these steps: +1. Use 'gh pr view' to get the PR details and description. +2. Use 'gh pr diff' to see all the changes in the PR. +3. Analyze the code changes for: + - Code quality and style consistency + - Potential bugs or issues + - Performance implications + - Security concerns + - Test coverage + - Documentation updates if needed +4. Ensure any existing review comments have been addressed. +5. Generate constructive review comments in the CONSOLE. DO NOT POST TO GITHUB YOURSELF. + +## IMPORTANT: +- Just review. DO NOT make any changes +- Be constructive and specific in your comments +- Suggest improvements where appropriate +- Only provide review feedback in the CONSOLE. DO NOT ACT ON GITHUB. +- No need to run tests or linters, just review the code changes. +- No need to highlight things that are already good. + +## Output format: +- List specific comments for each file/line that needs attention +- In the end, summarize with an overall assessment (approve, request changes, or comment) and bullet point list of changes suggested, if any. + - Example output: + ``` + Overall assessment: request changes. + - [CRITICAL] Memory leak in homeassistant/components/sensor/my_sensor.py:143 + - [PROBLEM] Inefficient algorithm in homeassistant/helpers/data_processing.py:87 + - [SUGGESTION] Improve variable naming in homeassistant/helpers/config_validation.py:45 + ``` diff --git a/script/gen_copilot_instructions.py b/script/gen_copilot_instructions.py old mode 100644 new mode 100755 index 9db7220e906..895a4ddc035 --- a/script/gen_copilot_instructions.py +++ b/script/gen_copilot_instructions.py @@ -17,6 +17,8 @@ SKILLS_DIR = Path(".claude/skills") AGENTS_FILE = Path("AGENTS.md") OUTPUT_FILE = Path(".github/copilot-instructions.md") +EXCLUDED_SKILLS = {"github-pr-reviewer"} + def gather_skills() -> list[tuple[str, Path]]: """Gather all skills from the skills directory. @@ -32,6 +34,9 @@ def gather_skills() -> list[tuple[str, Path]]: if not skill_dir.is_dir(): continue + if skill_dir.name in EXCLUDED_SKILLS: + continue + skill_file = skill_dir / "SKILL.md" if not skill_file.exists(): continue