$npx -y skills add levnikolaevich/claude-code-skills --skill ln-33-code-modernizerModernizes a bounded capability by removing obsolete custom mechanisms or reducing bundle and maintenance cost. Use for proven modernization value; not routine upgrades or tuning.
| 1 | # Code Modernizer |
| 2 | |
| 3 | **Goal:** Modernize a bounded capability only when the new design measurably reduces maintenance, risk, dependency duplication, or delivered artifact cost. Preserve behavior, isolate migrations, and revert changes that do not create net value. |
| 4 | |
| 5 | **Execution contract:** Treat the ordered checkbox workflow below as this skill's Definition of Done. Work through every item in order, and mark it complete only when its action and required evidence are complete. `N/A`, skipped, unavailable, or delegated items remain incomplete. |
| 6 | Before returning, apply this skill's verdict, decision, and approval rules to every incomplete item and prepend **Checklist: X/Y complete**<br>**Incomplete: None | section/item — reason; outcome impact; exact next action**; list every incomplete item. |
| 7 | |
| 8 | ## Tool Routing |
| 9 | |
| 10 | | Need | Preferred tool | Use it when | Fallback | |
| 11 | |---|---|---|---| |
| 12 | | Current mechanism and consumers | Native file search plus language server or host-native code intelligence | Mapping contracts, callers, configuration, data, lifecycle, and tests | Narrow import, symbol, route, and configuration search with direct reads | |
| 13 | | Existing platform capabilities | Manifests, lockfiles, runtime APIs, and current official documentation | Avoiding new dependencies or custom code for an already available feature | Repository examples and source inspection; mark capability `UNVERIFIED` if current docs are unavailable | |
| 14 | | External replacement candidates | Official package registries, source repositories, documentation, releases, advisories, and license data | Comparing maintained software with custom implementation | Primary-source web research; do not rely on popularity lists alone | |
| 15 | | Baseline and value | Build output, bundle analysis, code inventory, benchmark, defects, or maintenance evidence | Defining what modernization must improve | Reproducible static counts with documented scope and limitations | |
| 16 | | Safe migration | Git isolation, focused edits, native package manager, and repository generation commands | Replacing one bounded capability and its consumers | Stop if user changes or generated state cannot be protected | |
| 17 | | Verification | Repository-defined build, lint, type, test, smoke, packaging, and runtime checks | Before migration and after every retained step | Add a focused compatibility test when existing coverage cannot prove the contract | |
| 18 | | Delivered artifact analysis | Existing bundle analyzer, size report, startup profile, or dependency report | Bundle size, load path, or runtime cost is part of the goal | Build artifact comparison with reproducible file and compression rules | |
| 19 | |
| 20 | Do not replace working custom code merely because an external package exists. Do not introduce an unmaintained dependency, accept incompatible licensing, or remove the old path until all consumers and rollback conditions are understood. |
| 21 | |
| 22 | ## Evidence Rules |
| 23 | |
| 24 | - Start from a concrete defect, cost, duplication, unsupported mechanism, audit finding, or user goal. |
| 25 | - Compare net system complexity: removed code and risk minus new dependency, adapter, operational, and migration costs. |
| 26 | - External candidate claims require current primary evidence for maintenance, security, license, runtime support, and API fit. |
| 27 | - Bundle or performance value requires comparable measurements; line-count reduction alone does not prove a better design. |
| 28 | - Preserve public behavior unless the request explicitly authorizes a contract migration. |
| 29 | |
| 30 | ## Checklist |
| 31 | |
| 32 | ### 1. Define the Modernization Target |
| 33 | |
| 34 | - [ ] Resolve the bounded capability, current pain, affected users or operators, success metric, constraints, and explicit non-goals. |
| 35 | - [ ] Read repository instructions and inspect Git state, generated files, package-manager policy, and current user changes. |
| 36 | - [ ] Inventory the current implementation, public contracts, consumers, configuration, persisted data, runtime registration, tests, and operational procedures. |
| 37 | - [ ] Identify the specific maintenance, security, compatibility, duplication, bundle, startup, or delivery cost that must improve. |
| 38 | - [ ] Establish behavioral and relevant quantitative baselines before changing code. |
| 39 | - [ ] Isolate the work so each migration step can be reverted without touching unrelated or user-owned changes. |
| 40 | - [ ] Start a run-owned resource ledger with every created absolute path, worktree, process ID, cache, report, and temporary artifact; never register pre-existing resources as cleanup targets. |
| 41 | - [ ] Stop if modernization is only aesthetic, depends on speculative future scale, or cannot define a verifiable net benefit. |
| 42 | |
| 43 | ### 2. Evaluate the Simplest Credible Design |
| 44 | |
| 45 | - [ ] Check language, runtime, framework, platform, and already-declared dependency capabilities before searching for a new package. |
| 46 | - [ ] Ident |