defect-to-guard

Turns a fixed defect class into a costed guard proposal for CI checks and lints.

64|11|Updated May 24, 2026
One-click install
npx skills add https://github.com/AlexanderMattTurner/agent-glovebox --skill defect-to-guard-alexandermattturner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: defect-to-guard
Source: https://github.com/AlexanderMattTurner/agent-glovebox/tree/main/.claude/skills/defect-to-guard
Command: npx skills add https://github.com/AlexanderMattTurner/agent-glovebox --skill defect-to-guard-alexandermattturner

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? After fixing a bug, teams often either ship no prevention at all or bolt on a hollow per-instance check that only re-tests the one bug already fixed. This Skill guides the disciplined decision of whether a defect class deserves a standing guard, and how to propose it with honest cost-benefit arithmetic. ## Core Features & Use Cases - Defect class analysis: Names the recurring class rather than the instance, checks whether an existing guard should have fired, and prefers SSOT-iterating checks over per-case assertions. - Guard economics: Requires each proposal to show measured benefit-versus-cost arithmetic, guard rent citations, false-red tracking, and baseline paydown obligations for ratchets. - Home selection and implementation: Routes each guard to the right home (repo-local pre-commit lint, auto-resolve merge check, or the ci-truth-serum pack) and mandates dogfooding a new lint against the real tree before shipping. - Use Case: After fixing a bug where a documented CLI flag was never declared, use this Skill to write a ## Proposed guards PR entry proposing a generic check that iterates the flag SSOT, with measured cost and a named home. ## Quick Start Ask the assistant to evaluate the bug just fixed and write a Proposed guards entry for the PR body following the defect-to-guard process.

Frequently Asked Questions about defect-to-guard

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

FAQPage Schema
How do I decide whether a fixed bug deserves a CI guard?

Propose a guard only when a generic CI check would have caught the whole defect class without anticipating the specific error, and the class can recur. One-off bugs, classes the fix makes unreachable, and classes already covered by existing checks get no guard.

How do I write a pre-commit lint that is not noisy?

Dogfood the lint against the real tree before committing and narrow its scope by directory, subcommand, or file pattern until only genuine violations remain. If the class cannot be separated from legitimate use with acceptable false positives, do not ship the lint.

When should a check live in ci-truth-serum instead of the repo?

A check belongs in ci-truth-serum when its subject is a workflow, action, Dockerfile, or shell script readable from files, the defect is a general GitHub Actions or supply-chain fact, and stating the rule needs no repo-specific paths or policy. Otherwise it stays repo-local.

Why should mutation testing run on CI and never locally?

Local mutation runs are slow and cosmic-ray mutates source files in place, which races commits and can corrupt the tree if interrupted. Write mutant-killing tests up front with exact-equality assertions and let the CI gate verify them.

What is guard rent and how is a blocking check kept?

Guard rent requires every blocking check to cite a real defect it caught pre-merge within the last 8 weeks, posted as a comment on the CI-health report issue. Uncited checks are demoted to advisory and eventually deleted at audit.