# Harden

> Harden is an open-source agent skill for developer tools. Turns a project learning into a passing test that guards it from regressing. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/arjunrajlaboratory/mycelium/tree/main/skills/harden
- **Repository:** https://github.com/arjunrajlaboratory/mycelium
- **GitHub stars:** 73
- **License:** MIT
- **Skill name:** harden
- **Collection:** https://github.com/arjunrajlaboratory/mycelium
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

Harden takes one learning from a project's .living/learnings.md file that is still marked ambient-awareness but names a concrete check, and ships that check as a real test. It writes the test using the repository's existing test setup, or a simple stdlib Python or testthat file when none exists. Analysis code and analysis directories are left untouched.

The workflow centers on proving the test is meaningful. The agent makes the learning's problem present (with a fixture for data checks, or against the unmitigated implementation for code checks) and confirms the test fails there, then confirms it passes on the current code. If the test cannot fail on the bad input, or fails on the current code, the learning is not marked structural.

After the user confirms the planned edit, the skill changes only that one learning entry: it sets its mitigation type to structural and appends the shipped test path and date to the candidate text. It does not commit anything. It works with Mycelium's own .living/ files, so it expects a repository already set up with that structure.

## When your agent uses it

> Ship one learning's structural_mitigation_candidate as a real test, then mark the learning's mitigation_type structural. Picks a learning in .living/learnings.md that is still ambient-awareness but names a concrete check, writes the test in the repository's own test setup, proves it fails when the learning's problem is present and passes on the current code, and updates only that entry after the user confirms. Use when the user asks to harden, enforce, or turn a learning, gotcha, or lesson into a test or structural mitigation. Do not use for recording a new learning, promoting learnings to conventions, adding checks inside analysis code, or changing Mycelium itself.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/arjunrajlaboratory/mycelium/tree/HEAD/skills/harden)
- [License: MIT](https://github.com/arjunrajlaboratory/mycelium/tree/HEAD/skills/harden)

## Features

- **Candidate selection:** Finds learnings that name a concrete check but have not yet been turned into a test.
- **Test placement:** Writes the test within the repository's existing pytest, testthat, or test folder conventions.
- **Red and green verification:** Runs the test against the problem state and the current code to confirm it guards something.
- **Scoped learning update:** Edits only the chosen learning entry, and only after the user confirms.
- **Analysis code protection:** Keeps checks out of analysis scripts and notebook directories, placing them in tests instead.

## Good for

- Turn a recurring data gotcha about a column into a regression test
- Make a remembered lesson about a function's edge case into a failing-then-passing test
- Convert a file-format warning from a learning note into an enforced check
- Add a sample-count assertion to the test suite based on a past mistake

## Install

### Claude Code

This skill ships in the `mycelium` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add arjunrajlaboratory/mycelium
/plugin install mycelium@mycelium
```

Or copy only this skill to `~/.claude/skills/harden`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/arjunrajlaboratory/mycelium.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/harden &&
cp -R "$tmp/skills/harden" ~/.claude/skills/harden &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/harden` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/harden` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/arjunrajlaboratory/mycelium.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/harden &&
cp -R "$tmp/skills/harden" ~/.agents/skills/harden &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/harden` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/harden` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/arjunrajlaboratory/mycelium.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/harden &&
cp -R "$tmp/skills/harden" ~/.cursor/skills/harden &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/harden` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/arjunrajlaboratory/mycelium.git --path skills/harden
```

Or copy the folder to `~/.gemini/skills/harden` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/harden`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/arjunrajlaboratory/mycelium.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/harden &&
cp -R "$tmp/skills/harden" ~/.copilot/skills/harden &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/harden` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/arjunrajlaboratory/mycelium.git
```

Then copy `mycelium/skills/harden` into your agent's skills folder as `harden`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need before Harden can run?

It requires a .living/learnings.md file in the working repository. Without it, the skill stops and reports that.

### Where does the generated test go?

It follows the repository's existing test setup, such as pytest.ini, pyproject.toml, tests/testthat/, or existing test_*.py files. With no setup, it creates tests/test_<slug>.py or tests/testthat/test-<slug>.R.

### Does Harden change analysis code?

No. It never edits analysis code or places tests under analysis, notebook, or manifest-listed paths. Checks that live in analysis scripts are re-expressed as tests that read the same files.

### Does Harden commit the changes?

No. After confirmation it edits only the one learning entry and leaves committing to the user.

### When is a learning not marked as structural?

If the test cannot fail when the problem is present, or if it already fails on the current code, the learning stays ambient-awareness or is reported as a live problem.

### How do I install Harden in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/harden to use it in all your projects, or to .claude/skills/harden in one project. Or install the mycelium plugin, which includes it: /plugin marketplace add arjunrajlaboratory/mycelium, then /plugin install mycelium@mycelium.

### Does Harden run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Harden?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Harden?

The closest alternatives to Harden are Improve codebase architecture, Harness engineering, Characterization tests, TDD loop and Create formal verification skill.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Improve codebase architecture](https://ai-powered.com/skills/improve-codebase-architecture): Improve codebase architecture is an open-source agent skill for developer tools.
- [Harness engineering](https://ai-powered.com/skills/harness-engineering): Harness engineering is an open-source agent skill for developer tools.
- [Characterization tests](https://ai-powered.com/skills/characterization-tests): Characterization tests is an open-source agent skill for developer tools.
- [TDD loop](https://ai-powered.com/skills/tdd-loop): TDD loop is an open-source agent skill for developer tools.
- [Create formal verification skill](https://ai-powered.com/skills/create-formal-verification-skill): Create formal verification skill is an open-source agent skill for developer tools.
- [Develop](https://ai-powered.com/skills/develop-arjunrajlaboratory): Develop is an open-source agent skill for developer tools.
- [Property based testing](https://ai-powered.com/skills/property-based-testing): Property based testing is an open-source agent skill for developer tools.
- [Repo hypotheses](https://ai-powered.com/skills/repo-hypotheses): Repo hypotheses is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/harden
