Skip to content
Back to skills

Opt Compress

ASecurity

Rewrites project instruction and guideline files (AGENTS.md, workspace rules, styleguides) into high-signal declarative form, saving input tokens on every session without changing operational meaning. Backs up original file first.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 17, 2026
ai-agentsgoshellgitdatabasesecuritydocumentation

Works with

  • cursor

Security analysis

A100/100

Scanned October 17, 2026

npx -y skills add airshell/ai-optimizer --skill opt-compress --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Opt Compress?

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

Security grade badge for Opt Compress
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/airshell-opt-compress/badge)](https://www.skillsdirectory.com/skills/airshell-opt-compress)

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: opt-compress
description: >-
  Rewrites project instruction and guideline files (AGENTS.md, workspace rules,
  styleguides) into high-signal declarative form, saving input tokens on every
  session without changing operational meaning. Backs up original file first.
license: MIT
metadata:
  origin: AI Optimizer
  maintainer: Airshell (https://github.com/airshell)
---

# Instruction & Rule Compactor (`opt-compress`)

Project rules, system instructions, and guideline files (`AGENTS.md`, `.cursorrules`, workspace documentation) are re-ingested into model context on **every single interaction**. A one-time compression of these files saves input tokens and lowers latency across every subsequent turn.

## When to Use

- When project instruction files become long, conversational, or repetitive
- To reduce input token consumption across all coding sessions
- When asked to "compress rules", "trim AGENTS.md", or "clean up instructions"
- Apply strictly to prose documentation and rule files — never to source code, configs, or data.

## Step-by-Step Procedure

1. **Safety Backup First**:
   Copy `FILE` → `FILE.original.md`. If a backup already exists, stop and confirm before proceeding. Never overwrite a restore point.
2. **Compress Prose to High-Signal Declaratives**:
   - Replace long introductory narratives with concise bulleted constraints.
   - Eliminate filler words, conversational hedging, and polite pleasantries.
   - Merge overlapping or duplicate guidelines.
3. **Preserve All Behavioral Directives Exactly**:
   - Retain every single constraint, `MUST`, `NEVER`, path, version, and security boundary.
   - Shorter phrasing, 100% identical rules.
4. **Report Metrics**:
   Output the before-and-after line count, byte size, and backup path.

## Protected Elements (Never Compress)

- Exact command lines, paths, identifiers, and configuration flags.
- Load-bearing safety and governance constraints: security checks, database migrations, credentials, and delete safeguards.

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.

Comments

Loading comments…

Newsletter

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