Agent skill

ha-integration-reviewer

Strict Home Assistant integration code review for PR preparation. Covers Quality Scale rules, code style, Config Flow, test coverage, and docs. Invoke immediately when the user says "review my HA integration", "check HA compliance", "HA code review", "HA Quality Scale check", "home assistant PR review", "审查我的 HA 集成", "检查我的代码是否符合 HA 规范", "帮我 review 一下准备提交的代码". Launches parallel check agents across 5 dimensions. Do NOT use for: non-HA code review, configuring HA automations, HACS plugins, or Lovelace card development.

Stars 10
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/niracler/skill/tree/main/skills/workflow/ha-integration-reviewer

Metadata

Additional technical details for this skill

openclaw
{
    "emoji": "\ud83c\udfe0",
    "requires": {
        "bins": [
            "git"
        ],
        "anyMcp": [
            "context7"
        ],
        "anyBins": [
            "gh"
        ]
    }
}

SKILL.md

HA Integration Reviewer

以最严格的 Home Assistant Reviewer 视角审查集成代码。

Prerequisites

Tool Type Required Install
git cli Yes brew install git or git-scm.com
gh cli No brew install gh then gh auth login (for referencing other integrations)
Context7 MCP mcp No npx -y @upstash/context7-mcp — add to Claude Code MCP settings (for HA developer docs)

Do NOT proactively verify these tools on skill load. If a command fails due to a missing tool, directly guide the user through installation and configuration step by step.

审查流程

1. 确定审查范围

bash
# 获取待审查的文件(ha-core 使用 dev 分支)
git diff --name-only HEAD~1  # 最近一次提交
git diff --name-only dev     # 与 dev 分支的差异(ha-core 主分支)

或用户指定的目录/文件。

2. 并行启动检查 Agent

使用 Task 工具并行启动多个专项检查,详见 review-workflow.md。

其他 Agent 环境:以下检查相互独立,可按顺序依次执行。

text
Agent 1: Quality Scale 规则检查
Agent 2: 代码风格检查
Agent 3: Config Flow 检查
Agent 4: 测试覆盖检查
Agent 5: 文档与 Manifest 检查
  1. Quality Scale 验证 - 读取 quality_scale.yaml,验证 done 规则
  2. 代码风格检查 - 对照 copilot-instructions.md
  3. Config Flow 检查 - 验证 unique_id 和测试覆盖
  4. 测试覆盖检查 - 确认 >= 95%
  5. 文档检查 - 验证 strings.json 和 README

所有检查完成后,汇总结果生成统一报告。

3. 动态获取最新规范

不要使用过时的静态文档,每次审查时动态获取:

Quality Scale 规则

text
WebFetch: https://raw.githubusercontent.com/home-assistant/developers.home-assistant/refs/heads/master/docs/core/integration-quality-scale/rules/{rule_name}.md

其他环境:curl -sL <URL> 作为替代。

编码规范

text
WebFetch: https://raw.githubusercontent.com/home-assistant/core/dev/.github/copilot-instructions.md

其他环境:curl -sL <URL> 作为替代。

开发者文档

使用 Context7 获取最新的 Home Assistant 开发者文档。

若未安装 Context7 MCP,从 GitHub 仓库直接获取: curl -sL https://raw.githubusercontent.com/home-assistant/developers.home-assistant/refs/heads/master/docs/...

4. 参考其他集成

查看 ha-core 中类似集成的实现:

bash
gh api repos/home-assistant/core/contents/homeassistant/components/{integration_name}

5. 汇总审查报告

输出结构化报告,包含:

  • 每个检查维度的结果
  • 具体问题及其文件位置
  • 修复建议及优先级

检查清单速查

详见 common-issues.md,包含:

  • 代码风格常见问题
  • 日志规范
  • 异常处理
  • 实体与设备
  • Config Flow
  • 服务注册
  • 文档规范

Quality Scale 验证要点

使用 quality-scale-rule-verifier Agent

ha-core 仓库提供了专门的 Quality Scale 验证 agent:

位置: repos/ha-core/.claude/agents/quality-scale-rule-verifier.md

调用方式:

text
# 验证单个规则
"Check if the {integration} integration follows the {rule_name} rule"

# 验证整个等级
"Verify that this integration reaches the {tier} quality scale"

该 agent 会动态获取规则文档并验证实现,比静态检查更准确。

Done 规则

验证代码是否真正符合规则要求,而非仅仅标记为 done。

Todo 规则

检查是否接近完成,提示用户考虑完成以提升 Quality Scale 等级。

Exempt 规则

评估豁免理由是否合理,是否真的不适用于该集成。

关键审查标准

异步编程

  • 所有外部 I/O 必须 async
  • 禁止在事件循环中阻塞
  • 使用 gather 替代循环中的 await

异常处理

  • 缩小 try 块范围
  • 使用 ServiceValidationError 处理输入错误
  • 使用 HomeAssistantError 处理通信故障

Config Flow

  • unique_id 正确设置
  • 100% 测试覆盖
  • UI 文本规范(避免 "Click",加粗按钮标签)

测试

  • 位于 tests/components/{domain}/
  • 使用 fixture 和 snapshot testing
  • 覆盖率 >= 95%

Expand your agent's capabilities with these related and highly-rated skills.

niracler/skill

pinboard-manager

Use this skill for ALL Pinboard bookmark management tasks — this is the go-to skill whenever Pinboard (pinboard.in) is involved. Invoke immediately when the user wants to: audit or reorganize messy tags, check for broken/dead links, identify stale or outdated bookmarks, clean up their bookmark collection, or manage their Pinboard account in any way. Also use when the user says 整理书签, 检查死链, 整理 tag, 书签管理, pinboard cleanup, bookmark audit, tag consistency, timeliness check, pinboard 过时检测. Do NOT trigger for: browser bookmark management, Raindrop.io, or general URL checking without Pinboard context.

10 0
Explore
niracler/skill

yunxiao

Use this skill for all Alibaba Cloud 云效 (Yunxiao) DevOps operations on codeup.aliyun.com. Invoke IMMEDIATELY when the user wants to: create or manage Merge Requests (MR) on codeup, update work items/tasks in 云效, query MR lists or task status, create version tags via 云效 API, or push code to a codeup remote. Key triggers: 创建 MR, 提交评审, 云效, yunxiao, codeup, 更新任务, 查看任务, 发布版本, 打 tag. Handles both MCP tool mode and aliyun CLI fallback. Do NOT use for GitHub PRs (use git-workflow), Jira, GitLab, or non-Alibaba platforms.

10 0
Explore
niracler/skill

weekly-report

Use this skill whenever the user wants to write or generate a structured weekly work report (软件研发周报) — the formal 3-section corporate format with 本周工作总结, 下周工作计划, and 其他事项. This skill automatically collects data from git logs, Obsidian diary Work Log entries, schedule YAML files, GitHub PRs, and 云效 MRs/tasks to draft the report. Invoke when the user says 周报, 软件研发周报, 本周工作总结, 写周报, weekly report, end-of-week summary, or asks to prepare a work summary for their manager/team. Do NOT use for personal diary entries, monthly reviews, OKR summaries, meeting notes, or quarterly retrospectives.

10 0
Explore
niracler/skill

code-sync

Use this skill to batch-sync all git repos across machines — pushing uncommitted changes at end of day or pulling latest at start of day. Invoke when the user wants to sync all repos (not just one), mentions 「下班同步」「上班更新」 「code-sync」, or describes end-of-day push / morning pull across ~/code. Triggers on: "sync all my repos", "end of day sync", "morning update", "push all dirty repos", "pull all projects", 「同步代码」「下班同步」「上班更新」. Do NOT trigger for: single-repo git operations, committing specific files (use git-workflow), general git push/pull questions, or workspace template updates.

10 0
Explore
niracler/skill

schedule-manager

(macOS only) Use this skill for ALL Apple Calendar and Reminders management tasks using osascript and reminders-cli, following GTD methodology. Invoke immediately when the user wants to: schedule a meeting or event, add a todo or reminder, check today's agenda, plan the week ahead, do a weekly review, or capture any task they don't want to forget. Also use when the user says 安排会议, 创建提醒, 查看日程, 规划下周, 添加待办, 记一下, 别忘了, 今天要做什么, 周回顾. This is the right skill any time the user wants to interact with macOS Calendar or Reminders apps.

10 0
Explore
niracler/skill

skill-reviewer

Use this skill to audit, review, or validate Claude Code skills (.md files in .claude/commands/). Invoke when user wants to check skill quality, cross-platform compatibility, cross-agent compatibility, prerequisite declarations, or description triggering accuracy. Triggers on: 审查 skill, review skill, 检查 skill 质量, skill 兼容性检查, validate skill, audit skill. This skill delegates structure validation to validate.sh, content quality to skill-creator, and handles compatibility auditing itself. Do NOT use for general code review, reviewing PRs, or reviewing CLAUDE.md.

10 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results