---
title: "Harden skill | astack"
description: "Turn fixed bugs into tests and prove the invariants."
canonical: https://andrewwilkinson.io/skills/harden/
---

# Harden

Turn fixed bugs into tests and prove the invariants.

[astack](https://andrewwilkinson.io/skills/) Prove it works

npx skills@latest add ADWilkinson/astack --skill harden

To install just this skill with npm, run `npx astack-skills@latest install --agent all --skill harden`.

## What it does

Reads the repository's fix history, turns the fixes that matter into tests that fail on the code before the fix, then lists the invariants the code relies on and settles each one with a type, a property test, a constraint or a counterexample.

## When to reach for it

"Make sure this never breaks again", a run of regressions in one area, before a risky rewrite or migration, or when you want every bug you have fixed to stay fixed.

## Try saying

- Turn every bug we've fixed in billing into a test that fails without the fix
- Find the implicit invariants in the sync engine; prove them or find counterexamples
- Before the rewrite, lock today's behaviour down with tests

Include `harden` in your prompt to request this skill.

## It’s working if

Every test it adds was seen failing on the pre-fix commit and passing on the current one, each invariant carries a label (proven, inferred or broken) with its evidence, and the report gives the numbers: fixes read, tests added, invariants proven, counterexamples found.

## Pairs with

- [Dogfood Use the product for real, fix what breaks](https://andrewwilkinson.io/skills/dogfood/)
- [Ship Get to green, merge, deploy and prove it is live](https://andrewwilkinson.io/skills/ship/)
- [astack Own a product task up to a proven, review-ready PR](https://andrewwilkinson.io/skills/astack/)

## Source

- [SKILL.md astack-skills 0.16.1](https://github.com/ADWilkinson/astack/blob/main/skills/harden/SKILL.md)

[Dogfood](https://andrewwilkinson.io/skills/dogfood/) [Ship](https://andrewwilkinson.io/skills/ship/)
