Agent skill

Patch Coverage

by FutureTense in FutureTense/keymaster

Procedure and guidelines for verifying and maintaining 100% patch test coverage on all modified and added lines across Keymaster PRs and branches.

MITAuto-check passedTesting & QA

Install Patch Coverage

skills CLI
$ npx skills add FutureTense/keymaster --skill patch-coverage -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install FutureTense/keymaster patch-coverage --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/FutureTense/keymaster.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/patch-coverage .claude/skills/patch-coverage && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
patch-coverage
GitHub stars
349
Token cost
~1.1k tokens
SKILL.md length
387 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Procedure and guidelines for verifying and maintaining 100% patch test coverage on all modified and added lines across Keymaster PRs and branches.

  • Works in 5 steps: Identify Changed Files and Lines → Run Targeted Tests with Missing Line… → Common Uncovered Line Patterns & Solutions → …
  • Tasks that involve Test coverage
  • SKILL.md covers Core Principles and Workflow for Verifying Patch…
  • Calls pytest and git

What it does

Patch Coverage is an agent skill from FutureTense/keymaster. Procedure and guidelines for verifying and maintaining 100% patch test coverage on all modified and added lines across Keymaster PRs and branches.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Test coverage. The repository describes itself as: Home Assistant integration for managing Z-Wave enabled locks. The licence is MIT.

When your agent uses it

  • Tasks that involve Test coverage

Example prompts

  • “/patch-coverage”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Identify Changed Files and Lines
  2. Run Targeted Tests with Missing Line Reporting
  3. Common Uncovered Line Patterns & Solutions
  4. Assert Diagnostic Logging with caplog
  5. Final Full-Suite Verification

What it can do on your machine

Read from SKILL.md and the folder at commit d94ffb2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pytest
    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Patch Coverage loads about 1.1k tokens when it runs. Until then it costs about 40 tokens; SKILL.md has 387 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~40
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from FutureTense/keymaster at commit d94ffb2, republished under its MIT licence (© FutureTense). 387 words, ~1,130 tokens.

Download SKILL.mdSave it as .claude/skills/patch-coverage/SKILL.md (or your agent's skills folder).
name
patch-coverage
description
Procedure and guidelines for verifying and maintaining 100% patch test coverage on all modified and added lines across Keymaster PRs and branches.

Patch Coverage & Test Completeness Guide

This skill provides step-by-step instructions for ensuring every change or bugfix introduced in Keymaster achieves thorough patch test coverage (exercising all modified/added lines) and satisfies repository quality gates.

Core Principles

  1. Patch Coverage & Quality Gates:

    • The repository configures an overall project test coverage floor of >= 80% in pyproject.toml ([tool.coverage.report] fail_under = 80).
    • Every new line or modified execution branch in a pull request should be accompanied by automated tests to ensure no regressions or untested branches.
  2. Branch & Edge Case Completeness:

    • Cover both success (True, result objects) and failure branches (False, None, exceptions).
    • Test fallback and default paths (e.g. _node_id fallbacks when _node is None, disconnected clients, missing entities).
    • Test warning and error logging paths with pytest's caplog fixture to verify diagnostic log statements fire when intended.

Workflow for Verifying Patch Coverage

1. Identify Changed Files and Lines

Check your current git diff against the base branch (upstream/main or main):

bash
git diff upstream/main...HEAD --stat
git diff upstream/main...HEAD custom_components/
2. Run Targeted Tests with Missing Line Reporting

When running targeted tests on a single file or module, override addopts and pass --cov-fail-under=0 so pytest scopes the terminal table to the target module without failing on the global 80% project threshold:

bash
# Example for provider modifications:
pytest tests/providers/test_<provider>.py \
  -o addopts="-m 'not slow and not perf'" \
  --cov=custom_components.keymaster.providers.<provider> \
  --cov-report=term-missing \
  --cov-fail-under=0

# Example for coordinator modifications:
pytest tests/test_coordinator.py \
  -o addopts="-m 'not slow and not perf'" \
  --cov=custom_components.keymaster.coordinator \
  --cov-report=term-missing \
  --cov-fail-under=0

Inspect the Missing column in the terminal output to confirm that no newly added or edited line numbers in your diff are left uncovered.

Show full SKILL.md (168 more words)Show less
3. Common Uncovered Line Patterns & Solutions
  • if not self._node: return None/False:
    • Cause: No test exercised the method when the provider is uninitialized or disconnected.
    • Solution: Add test_<method>_no_node asserting None or False when provider._node = None.
  • except Exception as e: _LOGGER.warning(...):
    • Cause: Exception handling block was never triggered.
    • Solution: Add a unit test with side_effect=RuntimeError("test") and assert caplog.text.
  • node.node_id if node else self._node_id:
    • Cause: Ternary fallback branch when node is None not reached.
    • Solution: Add a test asserting get_node_id() returns self._node_id when _node is None.
  • Verification retry branch:
    • Cause: Logic handling transient write result or non-empty slot readback not tested.
    • Solution: Mock get/readback returning uncleared value and verify warning log + return False.
4. Assert Diagnostic Logging with caplog

When testing diagnostic logging (especially DEBUG or WARNING messages), ensure caplog.set_level is set appropriately. Note that provider-specific fixtures (such as zwave_provider and mock_zwave_node) are defined within their respective test modules (e.g. tests/providers/test_zwave_js.py):

python
import logging
from zwave_js_server.const import NodeStatus


async def test_operation_skips_when_node_dead(zwave_provider, mock_zwave_node, caplog):
    """Test operation logs debug message and returns False when node is dead."""
    caplog.set_level(logging.DEBUG)
    mock_zwave_node.status = NodeStatus.DEAD
    zwave_provider._node = mock_zwave_node

    result = await zwave_provider.async_clear_usercode(1)

    assert result is False
    assert "[ZWaveJSProvider] Node 14 is dead, skipping command" in caplog.text
5. Final Full-Suite Verification

Run the entire suite to verify overall coverage threshold and cross-module compatibility:

bash
pytest --cov=custom_components/keymaster --cov-report=term-missing

Or run via tox:

bash
tox -e py314

© FutureTense, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/patch-coverage of FutureTense/keymaster.

Open the folder on GitHubat commit d94ffb2

Compare with similar skills

Patch Coverage next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Patch Coverage compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Patch Coverage this skillFutureTense/keymaster349—~1.1kAutomated safety check: PassMIT
Requirementsrizsotto/Bear6.5k—~2kAutomated safety check: PassGPL-3.0
Crap Analysisardalis/RiverBooks1352 repos~3.4kAutomated safety check: PassNone
Code Coverages3s-project/s3s311—~789Automated safety check: PassApache-2.0
Project Statusbactopia/bactopia522—~787Automated safety check: PassMIT
Check Coverageldayton/Dippy243—~403Automated safety check: PassMIT

Similar skills

  • Requirements

    rizsotto/Bear

    Write, modify, or review a requirement file under docs/requirements -- pick the single owning file, keep the text contract-only, name IDs so they need no explanation, and verify cross-references and…

    6.5k GitHub stars~2k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Crap Analysis

    ardalis/RiverBooks

    Analyze code coverage and CRAP (Change Risk Anti-Patterns) scores to identify high-risk code.

    135 GitHub starsUsed in 2 repos~3.4k tokens
    Testing & QAAuto-check passed
  • Code Coverage

    s3s-project/s3s

    Measure and grow the line coverage of the s3s crate. An agent skill from s3s-project/s3s.

    311 GitHub stars~789 tokensUpdated today
    Testing & QAAuto-check passed
  • Project Status

    bactopia/bactopia

    Show a live snapshot of the Bactopia project state — component counts, GroovyDoc coverage, nf-test coverage, and structural issues.

    522 GitHub stars~787 tokensUpdated 2 mo ago
    Testing & QAAuto-check passed
  • Check Coverage

    ldayton/Dippy

    Ensure comprehensive test coverage for a CLI handler. An agent skill from ldayton/Dippy.

    243 GitHub stars~403 tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Guarding Destructive Operations

    kajisho5/ffmpeg-skill

    Add and review preconditions on operations that delete, overwrite, rewrite history, or resolve a caller-supplied name to a filesystem path — refusing instead of warning, placing the guard ahead of…

    1.9k GitHub stars~2.6k tokensUpdated 4 days ago
    Testing & QAAuto-check passed

More from FutureTense/keymaster

  • Ha Code Quality

    FutureTense/keymaster

    Standards and commands for linting, code formatting, typing validation (Ruff, MyPy, Codespell, ESLint, Pre-commit/Prek, Tox), and adherence to Home Assistant Python 3.14 standards in Keymaster.

    349 GitHub stars~462 tokensUpdated yesterday
    Auto-check passed
  • Ha Integration Testing

    FutureTense/keymaster

    Workflows, conventions, and commands for writing and running async Home Assistant unit and integration tests using pytest, tox, pytest-homeassistant-custom-component, and coverage tools.

    349 GitHub stars~522 tokensUpdated yesterday
    Auto-check passed
  • Ha Lock Provider

    FutureTense/keymaster

    Guide for developing, testing, and maintaining lock platform providers (e.g., zwavejs, zigbee2mqtt, zha, schlage, akuvox) implementing BaseLockProvider in Keymaster.

    349 GitHub stars~829 tokensUpdated yesterday
    Auto-check passed
  • Submit PR

    FutureTense/keymaster

    Procedure for preparing and submitting pull requests in keymaster, enforcing the required PR template (.github/PULLREQUESTTEMPLATE.md), checklist validation, and quality gates.

    349 GitHub stars~830 tokensUpdated yesterday
    Auto-check passed
  • Lovelace Strategy

    FutureTense/keymaster

    Workflows for developing, building, bundling, and testing the TypeScript / Lit Lovelace dashboard strategy in lovelacestrategy/.

    349 GitHub stars~345 tokensUpdated yesterday
    Auto-check passed
  • Coordinator Lifecycle

    FutureTense/keymaster

    Architectural patterns and lifecycle instructions for KeymasterCoordinator, KeymasterLockCoordinator, fan-out notification architecture, child entity platforms, and storage migrations.

    349 GitHub stars~857 tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Patch Coverage

What does Patch Coverage do?

Procedure and guidelines for verifying and maintaining 100% patch test coverage on all modified and added lines across Keymaster PRs and branches. Patch Coverage is an agent skill from FutureTense/keymaster. Procedure and guidelines for verifying and maintaining 100% patch test coverage on all modified and added lines across Keymaster PRs and branches.

When should I use Patch Coverage?

Patch Coverage fits situations like: tasks that involve Test coverage.

How do I install Patch Coverage in Claude Code?

Run `npx skills add FutureTense/keymaster --skill patch-coverage -a claude-code`. Or copy the skill folder (.agents/skills/patch-coverage in FutureTense/keymaster) into .claude/skills/patch-coverage in your project. Claude Code loads it when a task matches its description.

How do I install Patch Coverage in Codex?

Run `npx skills add FutureTense/keymaster --skill patch-coverage -a codex`. Or copy the skill folder (.agents/skills/patch-coverage in FutureTense/keymaster) into .agents/skills/patch-coverage in your project. Codex loads it when a task matches its description.

Can I use Patch Coverage in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add FutureTense/keymaster --skill patch-coverage -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/patch-coverage, .gemini/skills/patch-coverage, .github/skills/patch-coverage and .opencode/skills/patch-coverage in your project.

What does Patch Coverage need to run?

Going by SKILL.md and its folder, Patch Coverage needs the command-line tools its instructions call (pytest and git). Our summary lists: Python 3.

Does Patch Coverage access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Patch Coverage safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Patch Coverage use?

Patch Coverage is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Patch Coverage use?

About 1.1k tokens (SKILL.md is roughly 4.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Patch Coverage?

Skills that share tags, products or a category with Patch Coverage: Requirements (rizsotto/Bear, 6.5k stars), Crap Analysis (ardalis/RiverBooks, 135 stars), Code Coverage (s3s-project/s3s, 311 stars) and Project Status (bactopia/bactopia, 522 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Patch Coverage?

FutureTense (a GitHub user) maintains it in FutureTense/keymaster, which has 349 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 7, 2026.

Source: FutureTense/keymaster on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.