homeassistant-yaml-dry-verifier

Detect duplicate trigger, condition, and action structures in Home Assistant YAML configurations.

5.3k|503|Updated Oct 11, 2016
One-click install
npx skills add https://github.com/CCOSTAN/Home-AssistantConfig --skill homeassistant-yaml-dry-verifier
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: homeassistant-yaml-dry-verifier
Source: https://github.com/CCOSTAN/Home-AssistantConfig/tree/main/codex_skills/homeassistant-yaml-dry-verifier
Command: npx skills add https://github.com/CCOSTAN/Home-AssistantConfig --skill homeassistant-yaml-dry-verifier

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the inefficiency and potential for errors caused by duplicated logic within Home Assistant YAML configurations, promoting cleaner, more maintainable code.

Core Features & Use Cases

  • Duplicate Detection: Identifies repeated trigger, condition, action, and sequence blocks across automations and scripts.
  • Redundancy Analysis: Detects duplicate entries within a single block (INTRA) and package-defined scripts called from multiple files (CENTRAL_SCRIPT).
  • Use Case: When refactoring a large Home Assistant configuration, use this Skill to automatically flag any identical automation actions or script sequences that can be consolidated into a single reusable script, improving code quality and reducing maintenance overhead.

Quick Start

Use the homeassistant-yaml-dry-verifier skill to scan the file 'config/packages/bearclaw.yaml' for duplicate YAML structures.

Frequently Asked Questions about homeassistant-yaml-dry-verifier

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find duplicate automations and scripts in Home Assistant YAML?

To find duplicate automations and scripts in Home Assistant YAML, scan configuration files to detect repeated trigger, condition, action, and sequence blocks across automations, scripts, and packages. The analysis flags identical structures so you can consolidate them into a single reusable script.

How do I check my Home Assistant configuration for DRY violations?

Checking Home Assistant configuration for DRY violations involves analyzing YAML files to identify redundant logic within blocks (INTRA) and package-defined scripts called from multiple files (CENTRAL_SCRIPT). It scans for duplicated entries and provides actionable refactoring suggestions to improve maintainability.

What is the best way to refactor redundant Home Assistant YAML logic?

The best way to refactor redundant Home Assistant YAML logic is to detect duplicated trigger, condition, and action structures across automations and consolidate them into a single reusable script. This process reduces code duplication and improves overall configuration maintainability.

Can I scan individual package files like bearclaw.yaml for duplicate YAML structures?

Yes, you can scan individual package files like bearclaw.yaml for duplicate YAML structures. The verifier checks specific configuration package files to identify repeated blocks and package-defined scripts called from multiple files, providing actionable refactoring suggestions.

What types of redundant YAML structures can be detected in Home Assistant automations?

Redundant YAML structures detected in Home Assistant automations include duplicated trigger, condition, action, and sequence blocks. The analysis identifies both duplicate entries within a single block and package-defined scripts called from multiple files across the configuration.

Why should I consolidate duplicate script sequences in Home Assistant?

You should consolidate duplicate script sequences in Home Assistant to eliminate repeated logic across automations and packages. Identifying DRY violations and refactoring duplicated triggers, conditions, and actions into reusable scripts improves code efficiency and reduces maintenance overhead.