simplify-and-harden — Claude Code skill: review after the task
A post-completion self-review pass: simplify, harden, re-verify and micro-document the code while the agent still remembers why it changed.
npx skills add pskoett/pskoett-ai-skills --skill simplify-and-harden -a claude-codeWhat simplify-and-harden 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.
What it helps with
- 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 for the agent
- task is done, run simplify-and-harden on the diff
- review the changes in
auth.tswith simplify-and-harden - we finished this endpoint — do a simplify-and-harden pass
How to install simplify-and-harden
1Skills CLI (Vercel)
npx skills add pskoett/pskoett-ai-skills --skill simplify-and-harden -a claude-code2Manually: put the files in place
~/.claude/skills/simplify-and-harden/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/simplify-and-harden/
1Skills CLI (Vercel)
npx skills add pskoett/pskoett-ai-skills --skill simplify-and-harden -a codex2Manually: put the files in place
.agents/skills/simplify-and-harden/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add pskoett/pskoett-ai-skills --skill simplify-and-harden -a cursor2Manually: put the files in place
.cursor/skills/simplify-and-harden/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install pskoett/pskoett-ai-skills simplify-and-harden2Manually: put the files in place
.github/skills/simplify-and-harden/SKILL.md1Skills CLI (Vercel)
npx skills add pskoett/pskoett-ai-skills --skill simplify-and-harden -a gemini-cli2Platform CLI
gemini skills install https://github.com/pskoett/pskoett-ai-skills --path skills/simplify-and-hardenManually: put the files in place
.devin/skills/simplify-and-harden/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add pskoett/pskoett-ai-skills --skill simplify-and-harden -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about simplify-and-harden
How do I install simplify-and-harden in Claude?
With the Agent Skills CLI: npx skills add pskoett/pskoett-ai-skills --skill simplify-and-harden -a claude-code. The skill lands at ~/.claude/skills/simplify-and-harden/SKILL.md.
What does simplify-and-harden do?
It runs two passes over the code from the task you just finished: simplification, then hardening with re-verification. It also documents non-obvious decisions.
When does the skill not activate?
When the task failed or was interrupted, or when the diff is docs-only, tests-only, formatting-only or generated files. You can also skip it with the --no-review flag.