Skip to content
Back to skills

Compress Prompt

ASecurity

Shortens a long prompt while preserving its behaviour, maps every original instruction to where it now lives, reports the real size reduction and lists test inputs to check nothing changed.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 26, 2026
ai-agentsgo

Security analysis

A100/100

Scanned November 26, 2026

npx -y skills add hermes-hq/hodios-dist --skill compress-prompt --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Compress Prompt?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Compress Prompt
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hermes-hq-compress-prompt/badge)](https://www.skillsdirectory.com/skills/hermes-hq-compress-prompt)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: compress-prompt
description: Shortens a long prompt while preserving its behaviour, maps every original instruction to where it now lives, reports the real size reduction and lists test inputs to check nothing changed.
license: CC0-1.0
arguments:
  - prompt
  - target_reduction
argument-hint: <prompt> [target_reduction]
disable-model-invocation: true
metadata:
  version: 1.0.0
  kind: prompt
  category: prompt-engineering
  source: https://hermes-ide.com/prompts/compress-prompt
  catalog: 2026.1014.1
---

# Compress a prompt

## Inputs

- `prompt` (required): The full prompt to shorten, including examples and placeholders.
- `target_reduction` (optional; default: 40%): How much shorter it should be, as a percentage or a word or token budget.

Arguments fill these in order. If a required value is empty, take it from the user’s message or ask for it once.

<context>
Long prompts cost tokens and latency, and they often bury their important instructions under repetition and filler. But a shorter prompt is only better if it behaves the same. Compression is safe when every behaviour of the original is listed first and checked off at the end, and when test inputs exist to compare the two versions.

<original_prompt>
$prompt
</original_prompt>
Target reduction: $target_reduction
</context>

<task>
1. Build a behaviour inventory: every distinct thing the prompt makes the model do or avoid (role, steps, rules, edge-case handling, output format, tone, examples and what each example teaches). Number them B1, B2 and so on.
2. Find what can go without changing behaviour: repetition, filler and politeness, emphasis words, explanations that do not change behaviour, instructions that restate model defaults, and examples that teach the same thing as another example.
3. Keep what carries behaviour: reasons that shape judgement in unforeseen cases, edge-case rules, the output format, placeholders, and examples that cover distinct cases.
4. Rewrite the prompt more tightly: merge overlapping rules, turn paragraphs into short lists where that is clearer, and keep the original order of priority.
5. Map each inventory item to where it now lives in the compressed prompt, or mark it as deliberately removed with the reason.
6. Estimate the size before and after in words and approximate tokens (roughly 1.3 tokens per English word), rounded and marked as estimates, and the reduction as a percentage. If the target cannot be met without losing behaviour, stop at the safe size and say which behaviours you would have to drop to go further.
7. Write five to eight test inputs that exercise the behaviours most at risk, each with the observable result both versions must produce.
</task>

<constraints>
- Preserve every placeholder, variable, delimiter tag name and required output field exactly.
- Never drop a safety, privacy or honesty instruction to save space.
- Do not change what the prompt does. Improvements you notice go in a separate "Possible improvements" line, not into the compressed prompt.
- You cannot run the tests. Present them for the user to run on both versions side by side.
</constraints>

<output_format>
## Behaviour inventory
Numbered list B1, B2...
## Compressed prompt
Fenced code block.
## Behaviour map
Table: Behaviour | Where it lives now (quote the phrase) or "removed: reason".
## What was cut
Bullets: what and why it was safe.
## Size
One line: "About N words (~T tokens) → about M words (~U tokens), about P% shorter." If the target was not met, one more line on what would have to go to reach it.
## Test inputs
Table: Input | Behaviours tested | Expected in both versions.
Possible improvements: one line, or "None".
</output_format>

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.