hass-eink-dashboard: Skill for Claude Code

.agents/skills/implement-widget-tests/SKILL.md

implement-widget-tests is a skill for Claude Code from cryptomilk/hass-eink-dashboard. It costs 46 tokens per session (4,319 once invoked), scanned A, original, Apache-2.0.

A skill for writing tests for a dashboard widget before its SVG renderer is implemented. TDD, or test-driven development, means writing failing tests first and then implementing code to make them pass.

In plain words
What is it for?
Use it to create the initial test suite for a widget's rendered appearance and sizing in the e-ink dashboard.
Why use it?
It gives new widgets checks for layout details such as borders, dividers, icon alignment, and proportional sizing. It also points the agent to the project's existing helpers and test patterns.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: installed under .agents/ (shared by several agents); $skill-name invocation.

This is cryptomilk/hass-eink-dashboard's own configuration. It tells Claude Code how to work on hass-eink-dashboard itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything hass-eink-dashboard configures →

Reuse

Borrowing it

Nothing to install: this file belongs to cryptomilk/hass-eink-dashboard. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/cryptomilk/hass-eink-dashboard/main/.agents/skills/implement-widget-tests/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/cryptomilk/hass-eink-dashboard

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for implement-widget-tests

README.md
[![agentmods](https://agentmods.dev/badge/skills/cryptomilk/hass-eink-dashboard/implement-widget-tests/github.svg)](https://agentmods.dev/skills/cryptomilk/hass-eink-dashboard/implement-widget-tests)
Your own site
<a href="https://agentmods.dev/skills/cryptomilk/hass-eink-dashboard/implement-widget-tests"><img src="https://agentmods.dev/badge/skills/cryptomilk/hass-eink-dashboard/implement-widget-tests/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for implement-widget-tests

Your own site · 80×15
<a href="https://agentmods.dev/skills/cryptomilk/hass-eink-dashboard/implement-widget-tests"><img src="https://agentmods.dev/badge/skills/cryptomilk/hass-eink-dashboard/implement-widget-tests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,319 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00046 $0.04319
Opus 5.5 $0.00018 $0.01728
Sonnet 5.5 $0.00009 $0.00864
Haiku 4.5 $0.00005 $0.00432

Measured 3d ago against content hash 7b607d509d6f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

implement-widget-tests scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/implement-widget-tests/SKILL.md · 464 lines

How it starts

The opening of the file, as written. The whole thing — 464 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Write Widget Tests: $widget-type

Write comprehensive tests for the $widget-type widget. This is the TDD red phase — tests must FAIL until the SVG renderer is implemented.

Before you start

  1. Read the task description / spec doc for the new widget.
  2. Read tests/helpers.py for available test helpers.
  3. Read existing per-widget test files in tests/test_render_*.py for patterns. The SEPARATOR tests (TestRenderSeparator) in tests/test_render_separator.py are the reference for structural/pixel assertions. The weather tests (TestRenderWeather) in tests/test_render_weather.py show the _DEFAULTS + _config() pattern.
  4. Read custom_components/eink_dashboard/templates/_macros.svg.j2 for macro signatures (card_container, card_row, chip) so you know the card container insets to use in pixel region calculations.
  5. Read const.py for COLOR_BLACK=0, COLOR_WHITE=255, COLOR_GRAY=120, PADDING=24.

Existing test classes

!grep -rn "^class Test" tests/test_render_*.py

Current test helper signatures

!grep -n "^def " tests/helpers.py

Current WidgetMetrics sizing ratios

Call _compute_metrics(row_h) in tests to derive expected pixel regions from the same ratios the renderer uses — no hardcoded magic numbers.

!grep -n "def _compute_metrics" -A 12 custom_components/eink_dashboard/render.py

SVG macro signatures (from _macros.svg.j2)

!grep -n "macro card_container\|macro card_row\|macro chip" custom_components/eink_dashboard/templates/_macros.svg.j2

Icon resolver (in render.py)

!grep -n "def _device_class_icon" -A 5 custom_components/eink_dashboard/render.py

SVG renderer registry

!grep -n "_SVG_RENDERERS" -A 12 custom_components/eink_dashboard/svg_render.py

Imports

import re

from custom_components.eink_dashboard.const import (
    COLOR_BLACK, COLOR_GRAY, PADDING, DEFAULT_CARD_STYLE,
    DEFAULT_ROW_H,
)
from custom_components.eink_dashboard.render import (
    WidgetMetrics, _compute_metrics, DEFAULT_METRICS,
    _device_class_icon, render_dashboard,
)
from custom_components.eink_dashboard.svg_render import (
    render_widget_svg,
)
from custom_components.eink_dashboard.widgets._helpers import (
    _card_insets, _metrics_context, _auto_row_height,
)
from tests.helpers import (
    assert_all_white, assert_card_border, assert_has_dark_pixels,
    assert_has_gray_pixels,
    assert_scales_proportionally, assert_vertically_centered,
    content_bbox, make_config, pixel, render_to_image,
)

Read the full file on GitHub · 464 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 464 lines · 46 tokens per session scan A 7b607d509d6f

Subscribe to this mod's changes

implement-widget-tests is a skill published in the GitHub repository cryptomilk/hass-eink-dashboard (124 stars, last pushed 2d ago), licensed Apache-2.0. It adds 46 tokens to every session and 4,319 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-26.