Agent Skills › home-assistant/core › ha-review

ha-review

GitHub

用于审查代码变更并提供建设性反馈,确保一致的输出格式。分析质量、Bug、性能及安全,支持子代理并行验证及pre-existing标记。仅审查不修改代码。

.claude/skills/ha-review/SKILL.md home-assistant/core

触发场景

请求代码审查 提供一致的评审反馈

安装

npx skills add home-assistant/core --skill ha-review -g -y
更多选项

非标准路径

npx skills add https://github.com/home-assistant/core/tree/dev/.claude/skills/ha-review -g -y

不安装直接使用

npx skills use home-assistant/core@ha-review

指定 Agent (Claude Code)

npx skills add home-assistant/core --skill ha-review -a claude-code -g -y

安装 repo 全部 skill

npx skills add home-assistant/core --all -g -y

预览 repo 内 skill

npx skills add home-assistant/core --list

SKILL.md

Frontmatter
{
    "name": "ha-review",
    "description": "Reviews Home Assistant code changes and provides constructive feedback. Should be used when a review is requested to provide a consistent review behavior and output format. This skill can be used for code reviews in general, not just for GitHub pull requests."
}

Review Code Changes

Scope:

  • Unless instructed otherwise, review the full changes (the ones from the branch plus uncommitted ones) against the target branch. Resolve the base to an available ref (prefer upstream/<base>, then origin/<base>, then local <base>) and review git diff "$(git merge-base "$BASE_REF" HEAD)"; use dev as the default base.

Analyze the code changes for:

  • Code quality and style consistency
  • Potential bugs or issues
  • Performance implications
  • Security concerns
  • Test coverage
  • Documentation updates if needed
  • Values that reach new code from existing code. Read the producing side, including its fallbacks and defaults, not only the diff.
  • State added to an entity or coordinator. Check where it is reset, for example on reconnect or reload.

Quality scale:

  • If the changes include a quality_scale.yaml file, run a subagent to verify all the added or modified rules, following the ha-quality-scale-verify skill.
  • Include the verification results in the final review comments.

Verification:

  • After the review, run parallel subagents for each finding to double-check it.
  • When a finding suggests a change, also check that the suggested change is valid, for example that it does not violate one of the Home Assistant pylint plugin rules.
  • Spawn up to a maximum of 10 parallel subagents at a time.
  • Gather the results from the subagents and summarize them in the final review comments.

IMPORTANT:

  • Just review. DO NOT make any changes.
  • Be constructive and specific in your comments.
  • Suggest improvements where appropriate.
  • 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.
      1. [CRITICAL] sensor.py:143 - Memory leak
      2. [PROBLEM] data_processing.py:87 - Inefficient algorithm
      3. [SUGGESTION] test_init.py:45 - Improve x variable name
      4. [NIT][PRE-EXISTING] const.py:12 - Unused constant
      
    • Make sure to include the file and line number when possible in the bullet points.
    • Flag findings with [PRE-EXISTING] after the category when the issue already exists on the base branch and the change only touches, moves or sits next to that code. Confirm against the base branch before flagging. Pre-existing findings should not on their own make the overall assessment "request changes".

版本历史

  • 779c7a7 当前 2026-11-03 04:20

    新增对基础分支中已存在问题的[PRE-EXISTING]标记支持,优化评审准确性;补充基于PR反馈的AI技能指令。

  • 8760410 2026-10-19 11:22

    将审查总结改为使用编号列表格式。

  • 702a9cb 2026-07-25 09:23

同 Skill 集合

.claude/skills/bump-dependency/SKILL.md
.claude/skills/custom-integration-sources/SKILL.md
.claude/skills/ha-deprecation-cleanup/SKILL.md
.claude/skills/ha-integration-knowledge/SKILL.md
.claude/skills/ha-merge-queue/SKILL.md
.claude/skills/ha-pr-comment-audit/SKILL.md
.claude/skills/ha-pr-reviewer/SKILL.md
.claude/skills/ha-quality-scale-verify/SKILL.md

元信息

文件数
0
版本
779c7a7
Hash
1670ced9
收录时间
2026-07-25 09:23

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-06 08:34
浙ICP备14020137号-1