# simplify-and-harden

A post-completion self-review pass: simplify, harden, re-verify and micro-document the code while the agent still remembers why it changed.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 535 installs · ★ 323
- Author: pskoett
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pskoett/pskoett-ai-skills/tree/HEAD/skills/simplify-and-harden/SKILL.md
- Updated: 2026-10-25
- HTML: https://affpapa.org/en/nevibecode/skills/simplify-and-harden

## What it does

The skill fires on its own once the agent finishes the main task and signals completion. It then walks the fresh diff looking for obvious bugs, confusing logic, brittle assumptions and missed hardening. The point is timing: context about the task fades fast, and the next task wipes it clean, so reviewing your own edits later gets harder.

Two passes run. The first simplifies — strip debug logs and dead code, fix names that read badly in hindsight, flatten nested conditionals, narrow an over-wide public API. The second hardens, re-verifies, and writes short notes on non-obvious decisions. Only files touched in the current task are fair game; no refactoring of nearby code. Budget is capped at 20% of the original diff size and 60 seconds, and hitting either limit stops the run with a `budget_exceeded` flag.

It stays quiet for docs-only, tests-only, formatting-only or generated-file diffs, and for a failed or interrupted task. You can skip it with `--no-review`. Treat it as a self-pass, not independent review: run it first, then a separate review pass, and merge only after both are addressed.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pskoett/pskoett-ai-skills --skill simplify-and-harden -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/simplify-and-harden/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/simplify-and-harden/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pskoett/pskoett-ai-skills --skill simplify-and-harden -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/simplify-and-harden/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pskoett/pskoett-ai-skills --skill simplify-and-harden -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/simplify-and-harden/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pskoett/pskoett-ai-skills simplify-and-harden
```

2. **Manually: put the files in place**
- File: `.github/skills/simplify-and-harden/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pskoett/pskoett-ai-skills --skill simplify-and-harden -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pskoett/pskoett-ai-skills --path skills/simplify-and-harden
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/simplify-and-harden/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pskoett/pskoett-ai-skills --skill simplify-and-harden -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/pskoett/pskoett-ai-skills/tree/HEAD/skills/simplify-and-harden/SKILL.md

## When to use it
- strip debug logs and dead code left from iteration
- rename variables that read badly on a fresh look
- flatten nested conditionals with early returns
- narrow a public API down to what is needed
- close gaps in input validation and auth checks

## Example prompts
- task is done, run simplify-and-harden on the diff
- review the changes in `auth.ts` with simplify-and-harden
- we finished this endpoint — do a simplify-and-harden pass

## Similar
- [simplify](https://affpapa.org/en/nevibecode/skills/simplify.md) — skill · 20100 installs
- [ce-simplify-code](https://affpapa.org/en/nevibecode/skills/ce-simplify-code.md) — skill · 3400 installs
- [review-and-simplify-changes](https://affpapa.org/en/nevibecode/skills/review-and-simplify-changes.md) — skill · 794 installs
- [agents-harden](https://affpapa.org/en/nevibecode/skills/agents-harden.md) — skill · 2000 installs
- [code-reviewer](https://affpapa.org/en/nevibecode/skills/httpsgithubcomjeffallan-code-reviewer.md) — skill · 6500 installs
- [simplify-code](https://affpapa.org/en/nevibecode/skills/simplify-code.md) — skill · 345 installs

From the same set: [pskoett/pskoett-ai-skills](https://affpapa.org/en/nevibecode/by/pskoett/pskoett-ai-skills.md) — 7 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
