compression — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited compression (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Data and context compression — SaaS payload optimization (Zstd, Brotli, Gzip), database storage compression, and AI context-window compression (semantic summarization, token pruning) — applied to cut API latency, storage cost, and long-running agent context pressure.
What is this skill? This skill provides expertise in data and context compression: SaaS payload optimization (Zstd, Brotli, Gzip), database storage compression, and AI context window compression (Semantic Summarization, Token Pruning). Use when optimizing API latency, reducing storage costs, or managing long-running agent sessions near context limits. Do NOT use for image/video lossy compression (use product-photo) or file archiving.
Use primary codec and platform references for factual claims: RFC 8878 for Zstandard, RFC 7932 for Brotli, RFC 1952 for Gzip, MDN and HTTP docs for Accept-Encoding / Content-Encoding, and PostgreSQL's TOAST and default_toast_compression documentation for database storage behavior. Keep agent context-compression guidance separate from HTTP/database codec facts: summaries are correct only when they preserve intent, outcome, and evidence paths.
SaaS payload compression (Zstd, Brotli, Gzip algorithm selection, level tuning, content negotiation), PostgreSQL storage compression (TOAST with pglz/lz4 where supported, plus deliberate application-layer blob compression), and AI context window compression (semantic summarization, token pruning, dead context identification, state re-injection). Covers the decision tree for matching algorithms to data types, the Accept-Encoding negotiation order, and the three-phase token pruning workflow.
Compression is the science of increasing information density. In a modern SaaS, it applies at two layers: the Infrastructure Layer (reducing bytes on the wire/disk) and the Intelligence Layer (reducing tokens in the context window). Without this skill, agents default to generic compression advice that ignores the specific algorithm-to-data-type mapping (e.g., using Gzip everywhere instead of Zstd for dynamic API payloads) and fail to recognize that sub-1KB payloads should skip compression entirely. On the intelligence side, agents routinely let context windows bloat with dead research turns instead of applying structured summarization that preserves evidence paths.
Match the compression algorithm to the data type and lifecycle.
| Data Type | Recommended | Why? |
|---|---|---|
| Static Assets (JS/CSS) | Brotli (Level 11) | Highest ratio for web strings; slow build-time OK. |
| Dynamic API (JSON) | Zstd (Level 3) | Fastest decompression; lower TTFB than Gzip. |
| Small Payloads (<1KB) | None / Custom Dictionary | Compression overhead often increases size for small items. |
| Large DB Columns | PostgreSQL TOAST pglz/lz4, or explicit application-layer compression | PostgreSQL TOAST supports pglz and lz4 when built with lz4; use application-layer Zstd only when you own encode/decode and query tradeoffs. |
Accept-Encoding header. Order: zstd > br > gzip.Vary: Accept-Encoding is set to prevent cache pollution.Protect the context window by maximizing token density.
/clear or /compact to drop the bottom 50% of the session history.Source: skills/token-efficiency/SKILL.md (Adjacent)Optimize for cost and performance at the database layer.
pglz by default and lz4 when PostgreSQL is built with lz4 support. Do not claim native TOAST Zstd unless the deployed database explicitly provides it.zstd bindings) before storing as BYTEA.COMPRESSION CHECK
=================
[ ] Static assets pre-compressed with Brotli (Level 11)
[ ] API middleware supports Zstd with Gzip fallback
[ ] Vary: Accept-Encoding header present
[ ] AI context summary preserves Evidence Paths
[ ] redundant research/file reads pruned from session
[ ] DB compression matches the deployed database's actual TOAST options (`pglz` / `lz4`) or a deliberate application-layer codec
[ ] Payloads < 1KB skip compression to avoid overheadAfter applying this skill, verify:
Accept-Encoding negotiation respects the zstd > br > gzip priority orderVary: Accept-Encoding header is set to prevent cache pollution| Instead of this skill | Use | Why |
|---|---|---|
| Image/video lossy compression (JPEG quality, WebP, AVIF format selection) | product-photo | product-photo owns the image pipeline and format selection logic |
| Agent session lifecycle (when to compact, context budgets, compaction triggers) | context-management | context-management owns session-level compaction strategy and budget allocation |
| Token budget allocation and prompt compression techniques | token-efficiency | token-efficiency owns the token budget framework; compression handles the mechanics |
| Credential encryption at rest | credential-encryption | credential-encryption covers AES-256-GCM patterns, not data compression |
<!-- skill-graph-context:start (generated — do not edit by hand) -->
Classification
backend-engineeringtrueengineering/dataWhen to use
compression-skill, context-compression, payload-optimizationRelated skills
context-window, context-management, summarization, cognitive-load-theoryGrounding
universalhttps://www.rfc-editor.org/info/rfc8878, https://datatracker.ietf.org/doc/html/rfc7932, https://www.rfc-editor.org/rfc/rfc1952, https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Accept-Encoding, https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Encoding, https://www.postgresql.org/docs/current/storage-toast.html, https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-DEFAULT-TOAST-COMPRESSIONKeywords
compression, Zstd, Brotli, Gzip, context window, token efficiency, semantic summarization, payload reduction, DB TOAST<!-- skill-graph-context:end -->
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.