Simplify Code With Invariants
Simplify a bounded implementation by identifying its invariants, consumers, accidental complexity, and available repository patterns, then proving behavior is preserved. Use when code is difficult to reason about but a rewrite would be unnecessarily risky.
Runs on
Scope
$npx @youdede/toolkit add simplify-code-with-invariants --target claude-code
What it does
Simplify a bounded code path while preserving observable behavior and repository conventions.
When it fires
- planning
- implementation
- review
How it behaves
It does not delete behavior because it appears unused without repository evidence.
It does not replace local complexity with a speculative framework or generic abstraction.
It does not claim simpler code from fewer lines alone.
- Version
- 1.3.0
- Licence
- RiskThis skill simplifies a bounded code path while preserving observable behavior and repository conventions; it does not claim simpler code from fewer lines alone.
- Medium
- ModeHow it works: fixed rules, model instructions, or both.
- Prompt only
- Behaviour
- Advises, never blocks
- On failure
- Stops and reports
- LatencyThe skill simplifies a bounded code path while preserving observable behavior and repository conventions, using sequential evidence and verification steps.
- Bounded
- Data retentionWhether data remains after use and who manages its storage.
- Managed by the runtime
Often used with
All in Development