Safely simplifies a single tracked file in a git repo to its most essential form without losing functional information. One-pass, dry-run guarded, idempotent.
Safely simplifies a single tracked file by removing only redundant comments and prose without touching functional code or data. Use it to clean up documentation and comment clutter while preserving all constraints, values, and logic.
/plugin marketplace add lpasqualis/lpclaude/plugin install lpclaude-config@lpclaude-marketplace<file-path> [additional-constraints or focus-areas]Assumptions
.md, .txt, .rst, .adoc.json, .yaml/.yml, .toml, .ini, .env, .properties, .csv, .tsv.html, .xml(This matters only to decide what’s allowed to change.)
doc
code
config/data
# ..., ; ..., // ...) or trailing explanatory prose.markup
<!-- ... -->).Preflight
Read the working file → W.git show HEAD:<path> using Bash tool as the reference H. (If HEAD missing → abort.)W is binary/opaque → abort.Build GT‑mini (very small)
Extract only constraint‑bearing items you must preserve:
Represent as a short checklist in memory (no files).
Plan (dry‑run)
C by applying the plan mentally (dry‑run).C. If it would propose any further change → abort (too aggressive).< 1% and no duplicate removal occurred → abort (not worth it).Safety checks (dry‑run over C)
W and C. They must be byte‑for‑byte identical.
(Heuristic: strip comment spans and all ASCII whitespace; strings/numbers remain.)Apply
Edit the file to C.Post‑write verification
Read the file back → W2. Assert W2 == C.W2 → must be empty (fixed point). If not empty, revert by writing back original W and abort.Report (stdout only)
Print a 6‑line summary:
Paragraphs = blocks separated by ≥1 blank line (doc). When removing duplicates, require exact match.
Comments (code/config):
#, //, ; at start after optional whitespace./* ... */ (no nesting). Don’t cross strings.Non‑comment, non‑whitespace token stream:
\s chars; compare the resulting strings for W vs C.// TODO: cleanup repeated 3×.If you run simplify-file twice in a row, the second run should print “no changes” and exit. If not, your plan wasn’t minimal—tighten it or abort.
$ARGUMENTS
That's it. One file in, either a safe, measurable reduction, or a clean abort—no background machinery, no artifacts, no churn.