New to Claude Skills? Learn how to install them →

Hdanielmiessler on GitHub

Hardening

Free

Strengthen your tests and code without adding new features.

Get this skill

Free · Opens the source repo

What Hardening does

The Hardening skill enhances the robustness of existing tests, ISCs (Invariant System Claims), and code by employing property-based and mutation testing methodologies. This skill is particularly useful for developers looking to ensure that their test suites are not only passing but also effectively catching edge cases and potential bugs that may not be covered by traditional example-based testing. It provides a structured approach to identifying weaknesses in your testing strategy without introducing new functionalities into the codebase.

The skill offers five distinct workflows, each targeting different aspects of test and code robustness. The PropertyTest workflow utilizes fast-check for property-based testing, allowing developers to express universal claims and shrink failures to minimal counterexamples. The MutationTest workflow, although currently a stub, is intended to assess the effectiveness of existing tests by injecting faults into the code and verifying that the tests can catch them. Additionally, the CRAP analysis and DRY analysis workflows aim to identify risky undertested code and duplication issues, respectively, while AcceptanceTestMutation focuses on validating that ISCs genuinely constrain the system's behavior.

This skill is ideal for teams that already have a suite of tests but want to ensure that those tests are as effective as possible. By mechanizing the process of testing the tests, developers can gain confidence in their code's reliability and robustness. The workflows are designed to work with existing tests, meaning that teams can integrate this skill into their current development process without the need for significant restructuring.

However, it is important to note that Hardening is not intended for writing new feature tests or for grading the quality of agent outputs. It is also not suitable for UI verification or security vulnerability assessments. Instead, it serves as a complementary tool for enhancing the quality of existing tests and ensuring that they are thorough and effective in identifying potential issues.

When to use it

Use Hardening when you want to improve the robustness of your existing test suite and ensure that your code is thoroughly validated against potential bugs.

When not to use it

Avoid using Hardening for creating new feature tests, grading agent outputs, or performing UI verification, as it is not designed for these tasks.

What you can build with it

Enhancing Test Coverage

Use Hardening to apply property-based testing on your existing test suite, ensuring that edge cases are covered.

Evaluating Test Effectiveness

Leverage mutation testing to evaluate how well your current tests can catch introduced bugs, improving overall test quality.

Identifying Code Duplication

Utilize the DRY analysis workflow to detect duplicate code in your project, prioritizing areas for additional testing.

How to install Hardening

View source

1. Install with the skills CLI

npx skills add danielmiessler/lifeos/Hardening --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by danielmiessler

Hardening Skill

What It Does

Hardening sharpens what already exists — tests, ISCs, and code — without adding new functionality. Five workflows target test-surface and code-surface robustness: property-based testing via fast-check, mutation testing via Stryker, CRAP-complexity scoring, DRY duplication detection, and acceptance-test mutation that perturbs ISC text to catch fluff.

The Problem

Example-based tests check a handful of inputs the author thought of, so the bugs that survive are the inputs the author didn't think of. A test suite can be green and still be weak. ISCs can read as crisp pass/fail and still be fluff that anything would satisfy. You can't see any of this by reading the tests — you need to test the tests. This skill mechanizes that: property tests express the universal claim and shrink failures to the minimal counterexample, mutation testing proves the suite catches injected bugs, and acceptance-test mutation proves each ISC actually constrains the work.

How It Works

Hardening techniques sharpen what already exists — tests, ISCs, code. They don't add new functionality. Five workflows, all targeting test-surface and code-surface robustness.

Workflow Routing

WorkflowTriggerFile
PropertyTestproperty test, property based testing, PBT, fast-check, universal quantified claim, shrink counterexample — pure functions, parsers, serializers, data transforms, invariantsWorkflows/PropertyTest.md
MutationTestmutation test, mutation testing, Stryker, test the tests— planned, not yet built (stub; see Status)
CrapAnalysisCRAP score, CRAP analysis, risky undertested code— planned, not yet built (stub; see Status)
DryAnalysisDRY scan, jscpd, duplication rot— planned, not yet built (stub; see Status)
AcceptanceTestMutationacceptance test mutation, sharpen ISCs, detect fluff ISCs— planned, not yet built (stub; see Status)

Doctrine

These workflows operate against the existing test surface. PropertyTest doesn't replace bun-test examples — properties express the universal claim, examples are sampled instances of it. MutationTest doesn't replace test authoring — it grades existing tests' robustness. CRAP and DRY don't add tests — they prioritize where to add them. Acceptance-test mutation doesn't add ISCs — it mechanizes the Fluff vs Load-bearing distinction from ISAFormat.md.

All five satisfy the same intent: strengthen the test of the test, the test of the ISC, the test of the code. The unifying frame is meta-test — testing the things that test the system.

Status

WorkflowStateBlocker
PropertyTestFully scaffolded (v1.0)None — ready to use
MutationTestStubStryker integration; deferred to v6.11.0
CrapAnalysisStubAST walker (oxc or bun build --print-ir)
DryAnalysisStubjscpd wrapper
AcceptanceTestMutationStubISC text perturbation generator

Integration Points

  • Testing Doctrine Rule #11 — names fast-check as the property-testing primitive (LIFEOS/DOCUMENTATION/Testing/TestingDoctrine.md).
  • ISA format — new bun-property ISC type with property | generator | runs columns (LIFEOS/DOCUMENTATION/ISA/ISAFormat.md § ISC Type Vocabulary).
  • Algorithm — hardening is elected during VERIFY when a run's claims warrant property/mutation depth; spend is discovered from the work (the v6.10.0-era tier-gated proposal predates the 2026-07-11 tier retirement).
  • System prompt — Verification Is the Mechanism section at top (LIFEOS/LIFEOS_SYSTEM_PROMPT.md).
  • BitterPillEngineering skillAcceptanceTestMutation is the mechanized form of BPE's "would a smarter model render this rule unnecessary" applied to ISCs.

Gotchas

  • fast-check shrinking is deterministic only when the seed is captured. Always pin the seed in a comment when a property fails: // fc seed: 0xdeadbeef.
  • numRuns: 1000 is the default budget. Increase to 10000 for invariant-critical properties; lower to 100 for slow generators (custom record types with large constraints).
  • Property tests spuriously fail with poorly-constrained generators. Constrain integer ranges, string lengths, and record nesting depth explicitly.
  • Properties on impure functions (functions that touch disk, network, clock) are wrong — fast-check generates random inputs but the property must be deterministic given the input. Either mock side effects or extract the pure core.
  • Generator over-constraint hides bugs (fc.integer({min: 0, max: 100}) for code that handles all integers). Constrain only what the function actually demands.
  • Generator under-constraint produces invalid inputs (fc.string() when the function only accepts ASCII). The property must hold across the function's actual valid input domain, no wider.

Examples

  • "Property-test the slug parser" → PropertyTest: express round-trip/idempotence claims as fast-check properties, run 1000 random inputs, pin the seed on any failure.
  • "What bugs are my example tests missing?" → PropertyTest candidate detection: scan for pure functions (parsers, serializers, transforms) with only example coverage.
  • "Mutation-test the hooks suite" → MutationTest is a stub (see Status) — not runnable yet; don't promise kill-rate numbers.

Frequently asked questions about Hardening

Similar skills