harden-code
Skill0 starsChanged 2 months agoMITView on GitHub
Iteratively hunts for crashes, data loss, and unintended contract changes in recently-changed files by running three reliability specialists in parallel (an agent team when enabled, otherwise sub-agents), re-running until no breaking findings remain. Use after a refactor or feature, or when the user says "harden", "audit for bugs", or "review for reliability".
In this repository7 other files it gives its agents.
- audit-with-subagentsSkill
- cleanupSkill
- complainSkill
- grade-fileSkill
- scope-and-planSkill
- simplify-codeSkill
- structurizeSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Stop when any of:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Harden recently-changed code
An iterative reliability loop over the code changed this session: three specialists advise, you decide and apply every fix, re-run until the code is free of crashes and data-loss risks. The specialists are read-only; you keep final judgment. Each iteration:
Fan out 3 angles in parallel, same files, fixed set:
- A. Data safety: lost writes, destructive migrations, races on persisted state.
- B. Crashes: null/undefined derefs, unhandled exceptions, broken control flow.
- C. Contracts: changed signatures, schemas, event payloads, config keys.
Agent team if enabled (
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS): 1 teammate/angle, persistent across rounds, cross-check each other, keeping only findings that reproduce on a concrete path. Else: 3 parallel sub-agents, no cross-check.- Triage the merged, deduped findings: use judgment on severity and blast radius. Fix what's clearly safe to fix. Stop and check with the user on anything ambiguous, risky, or that could break another caller; show the file and what would change. Dismiss non-issues in one line, and if you disagree with something a teammate flagged as serious, say why.
- Re-run on changed files.
Prompt framing. Phrase specialist prompts defensively, never as attacker hypotheticals: "could a malicious user bypass…" style language can trip safety checks even on your own code. Say "verify the access check is correct," not "find a bypass." For an actual security pass, use /security-review instead of adding a fourth angle here.
Exit
Stop when any of:
- Clean: nothing left to fix or confirm, tests passing (the Stop hook confirms; no exit if tests fail).
- Cap: 5 iterations done. Report what remains; don't silently loop.
- No convergence: the count of open findings didn't strictly decrease between two consecutive iterations. A fix likely introduced a new issue, or findings are contested. Stop and escalate.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

