Install
openclaw skills install @escoffier-labs/skillet-reduceUse when asked to simplify, clean up, tidy, or refactor code for clarity without changing what it does, or when the user says "simplify this", "clean this up", "make it readable", "reduce the complexity", or "tidy this". Behavior-preserving only; not a bug or security audit (use bug-hunt or security-sweep for those).
openclaw skills install @escoffier-labs/skillet-reduceA reduction simmers a sauce to drive off the water and concentrate the flavor, and the dish tastes the same, only sharper. You do that to code: boil off the excess, concentrate the intent, and the behavior comes out identical. The cook who reduces too hard scorches the pan and changes the dish; the discipline is knowing when to pull it off the heat.
Core principle: same inputs, same outputs, same side effects, same errors, same public interface, same evaluation order. If the behavior moved, it was not a reduction, it was a rewrite. No behavior-preservation evidence, no applied simplification. Violating the letter of that is violating its spirit.
Before you change a single line, establish the lock. This is the whole safety story; everything else is taste.
Apply is the default for recently changed code that has tests, or where characterization tests can be added safely. You make the edits, one category per commit, with the verification evidence.
Report is for broad scope, under-tested code, anything architectural or design-level, public-interface shifts, or when the user explicitly wants review before edits. You produce the simplification plan and stop. Auto-escalate from apply to report the moment the behavior lock cannot be established. When in doubt, report.
Highest value first. These are local, mechanical, structure-preserving moves.
This is the discipline that separates a reduction from a scorched pan.
utils.process() that hides three unrelated jobs is worse than the code it replaced.reduce tidies: local, mechanical, behavior-preserving cleanup. It does not move module boundaries, reshape data models, or pick new abstractions. Those are design decisions; surface them in report mode and hand off, never auto-apply. Tidying first earns the trust that makes the larger refactor possible later.
Default: the code that recently changed, from git diff against the merge base or the working tree. That keeps the reduction relevant and prevents repo-wide churn.
Allow an explicit scope on request: a file, a directory, a symbol, or a commit or PR range. Whole-repo reduction only when the user asks for it, and report-first.
Dead code in one commit, duplication in the next, guard clauses in the next. Each commit names its effect, stays reviewable, and reverts alone. One sweep that bundles five kinds of change is an unreviewable rewrite wearing a cleanup label.
reduce applies changes; it is not an audit and it does not hunt for defects.
reduce has its own artifact, not the shared audit contract:
## reduce: <scope> (<date>)
Mode: apply | report
### Simplification plan
- [category] what will change and why it is behavior-preserving
### Change log (apply mode)
- [category] what changed (<commit>)
### Verification evidence
Baseline: <command> -> <result>
After: <command> -> <result> (must match)
### Handed off
- correctness/security/design items routed to bug-hunt / security-sweep / line-check
In report mode, findings may also be written in the audit report format so expedite can consume them later.
| Mistake | Reality |
|---|---|
| "Cleaner" refactor that alters an edge case | If you did not re-run the tests, you changed behavior and do not know it. |
| Abstracting from two superficially similar snippets | Looks-alike is not duplication. Wait for three real call sites and a shared reason to change. |
| Deleting a defensive check that "can never fail" | That is the load-bearing redundancy. It fails the day you remove it. |
| Reformatting the whole file "while I was in there" | A semantic change now hides in the noise. One category per commit, scope held. |
| Fewer lines reported as simpler | Cognitive load is the metric, not line count. Dense is not simple. |
| "Behavior unchanged" with nothing run | A claim, not evidence. Lock, run, then claim. |