semi-minify
Installation
SKILL.md
Semi-Minify
Shorten verbose identifiers at author time to reduce bytes over the wire, keeping committed source legible in DevTools or when read directly.
What to do
Phase 1 — Inventory
- Confirm the target file is a browser-only
.jsfile (not a Node.js module, build script, or server-side file). Reject clearly if not. - Read the target
.jsfile. - Collect every user-defined identifier (variable, function, parameter, class, and local type name).
- From that list, remove:
- a. Exported names (
export const,export function,export class,export default, re-exports). - b. String literals used as error messages, log output, or attribute/key names.
- c. Built-in browser identifiers — anything that is a property or method of
window,document,navigator,console,Event,Element, or other platform globals (e.g.addEventListener,getElementById,querySelector). - d. Any identifier imported from an external module.
- e. Single-letter loop variables and index names (
i,j,k,n).
- a. Exported names (