Skill
optimize-skill
Optimize prompts or skill docs for token efficiency while preserving intent, constraints, and capability. Use when user provides a folder path, file path, or plain text and asks to tighten wording.
Install this skill
npx skills add adiutama/skills --skill optimize-skill Invoked as /optimize-skill [folder-path|file-path|plain-text].
Optimize Skill
Goal
Return a shorter, sharper version with equal or better control quality. Keep meaning, constraints, and behavior intact.
Input modes
- Plain text: optimize provided text directly.
- File path: read file, optimize content.
- Folder path:
- Discover optimizable text files in that folder (recursive), including
SKILL.md,references/**/*.md,assets/**/*.md, and other docs/prompts (for example*.md,*.txt,*.prompt). - Exclude non-text or operational files (for example
scripts/**, binaries, lockfiles, and*.optimized.md). - If only one candidate exists, optimize it.
- If multiple candidates exist, show the candidate list and ask whether to optimize all or selected files.
- Discover optimizable text files in that folder (recursive), including
Optimization rules
- Preserve intent, constraints, safety gates, and required confirmations.
- Remove redundancy, filler, and repeated restatements.
- Prefer precise verbs and explicit boundaries.
- Keep important nouns/terms stable unless change improves clarity.
- Do not introduce new workflow steps unless they fix ambiguity.
- Keep user voice: concise, deliberate, not caveman unless requested.
Required checks
Before finalizing, verify:
- Same capability coverage as source (or stronger).
- No dropped hard constraints.
- Fewer tokens/lines than source.
- Instructions remain executable and unambiguous.
Output format
- Optimized version (full rewritten text).
- What changed (3-6 bullets, high signal only).
- Risk check (one line:
No semantic drift detectedor explicit caveat).
Write-back behavior
- If input is plain text: return optimized text in chat.
- If input is a file/folder path: write each optimized result to a temporary file first (for example
<target>.optimized.md), then ask before overwriting originals. - For folder input with multiple files: present per-file results and temporary paths clearly.
- When a temporary file is created, do not print the optimized prompt again in chat.
- Never overwrite files without explicit confirmation.
skills/optimize-skill/SKILL.md