Agent skill · writing content · kochetkov-ma
text-optimize
Optimizes text/docs for LLM token efficiency. Triggers - optimize, reduce tokens, compress, deep compress.
Why this skill is useful
Adds specific compression modes and rules for optimizing text for LLMs that the AI wouldn't reliably generate on its own.
What it needs
About 12k tokens when loaded. Last updated 2026-08-06. 29 stars on the source repository.
What this skill does
Text & File Optimizer Prompt contract Position 1 of $ARGUMENTS is a free-form prompt (RU/EN) -- depth flags and paths are optional and may follow in any order. Nobody types keys: resolve the depth (mode) + scope FROM the prompt. The depth flags (-l/-s/-d/-x) ARE this skill's modes -- see the keyword-annotated Modes table below. 1. Strip flags (-l, -s, -d, -x, --light, --standard, --deep, --max). An explicit flag anywhere wins outright, no scoring. 2. Else score depths by distinct whole-word keyword hits (Modes table below / Context Hints table). Highest unique score wins; tie -> the keyword appearing first; all zero -> medium (Smart Auto-Detection then still applies file-type heuristics on top). 3. Empty arguments -> medium, or Smart Auto-Detection's per-file-type candidate when the input is an LLM-only or user-facing doc path; ask ONE scoping AskUserQuestion only when auto-detection is ambiguous (already Smart Auto-Detection step 4). 4. --max is opt-in only -- never auto-selected without an explicit -x/--max flag or an explicit maximum/extreme compress hint (unchanged rule, restated here for the contract). 5. Prose that is not a flag/depth keyword is still input: extract the target path(s) from it, never treat the first word of a sentence as a positional path. Then print this block ONCE, before the first action: Labels are literal; values follow the conversation language. SCOPE MUST name the resolved target paths and the resolved depth. Print it once mode + target files are resolved (end of Input Parsing below), before Phase 1 Analysis spawns. Step 0: Load Rules REQUIRED: Read references/rules-review.md before ANY optimization. If file not found -> ERROR + STOP. Do not proceed without rules reference. Modes Parse $ARGUMENTS: -l/--light -s/--standard -d/--deep -x/--max no flag -> medium (default) or auto-detect. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills kochetkov-ma/text-optimize--bcdf77