zipai-optimizer

Ultra-dense token optimizer skill for prompt caching, log pruning, AST-based inspection, and minified JSON payloads.

5 stars

Best use case

zipai-optimizer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Ultra-dense token optimizer skill for prompt caching, log pruning, AST-based inspection, and minified JSON payloads.

Teams using zipai-optimizer should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/zipai-optimizer/SKILL.md --create-dirs "https://raw.githubusercontent.com/FrancoStino/opencode-skills-collection/main/bundled-skills/zipai-optimizer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/zipai-optimizer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How zipai-optimizer Compares

Feature / Agentzipai-optimizerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Ultra-dense token optimizer skill for prompt caching, log pruning, AST-based inspection, and minified JSON payloads.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# ZipAI: Context & Token Optimizer

## When to Use

Use this skill when the request needs context-window-aware triage, prompt caching optimizations, concise technical output, ambiguity handling, or selective reading of logs, source files, JSON/YAML payloads, VCS output, or MCP tool results.

## Rules

### Rule 1 — Adaptive Verbosity (No Filler)
- **Fixes:** technical only. ZERO filler (e.g., "Certainly", "I understand", "Here is", "Sure").
- **Analysis:** full reasoning allowed.
- **Direct Ask:** max 15 words in ultra-dense telegraphic style. Omit grammatical helper constructs.
- **Long Sessions:** never re-summarize past thread context.
- **Reviews:** use structured headers: `[ISSUE]`, `[SUGGESTION]`, `[NITPICK]`.

### Rule 2 — Ambiguity-First Execution
- Ask exactly ONE question if 2+ interpretations exist. Never stack questions.
- Default to minimal intervention for minor changes.
- Scope ambiguous requests to narrowest boundary.

### Rule 3 — Prompt Caching & Prefix Stability
- **Static-First Ordering:** Structure prompts to place invariant components (system instructions, core rules, static tool schemas) at the top of the prompt.
- **Isolate Dynamic Context:** Append dynamic and volatile elements (active conversation history, recently read file contents, CLI execution outputs) at the very end of the prompt to protect and reuse the cached prefix.
- **Prefix Integrity:** Avoid interleaving new queries or dynamic variables inside static system blocks. Keep the static instructions strictly invariant.
- **Cached Files Reuse:** Reuse already loaded file contents present in the conversation history; do not re-read files unless explicitly updated.

### Rule 4 — Semantic Input Pruning & Log Compression
- **Traceback Extraction:** When handling error or build outputs, parse and filter logs using grep/regex to extract only tracebacks, error statements, and a maximum of 3-5 lines of context around them. Strip all info logs, successful build tasks, and redundant progress messages.
- **Skeletal Code Viewing (AST):** For large files (>300 lines), do not view the full file. Use `grep -nE "^(class|def|async def|function|const|let|var).*="` (or language equivalents) to view class and function headers first, then target specific ranges with `view_file`.
- **Smart JSON/YAML Crusher:** Minify structured inputs. Strip pretty-printing whitespaces, comments, and unused fields from JSON/YAML payloads before placing them in context. Convert large arrays to dense CSV or key-value listings if they are queried.

### Rule 5 — Surgical & Compact Output
- **Local Replacements:** Perform edits using surgical tools (`str_replace` or single-hunk diffs). Never reprint unchanged surrounding code or perform full-file reprints.
- **Batch Modifies:** Consolidate multiple non-contiguous edits in a single file into a single multi-replace chunk operation, ordered from leaf dependencies upward.
- **Differential Output:** Limit conversational responses to the exact modified blocks, avoiding conversational code repetition.

### Rule 6 — Telegraphic Grammar & Density
- **Syntax Compression:** Strip articles ("a", "an", "the"), redundant helper verbs ("to be", "to have", "do"), and politeness/softening modifiers ("please", "simply", "just", "easy").
- **Structure:** Format output blocks into dense semantic mappings (`key: val`), short bullet lists, and compact tables. Avoid paragraphs of text.

### Rule 7 — Token-Budget Reasoning (CoT Optimization)
- **Direct Mode:** Skip long planning/thinking cycles for trivial, deterministic edits (typos, formatting, import adjustments).
- **Abbreviated Thoughts:** Keep thought blocks compact. Never reprint code snippets or copy-paste file blocks inside thoughts. Reference files via path and lines (e.g. `file.py#L12-18`).

---

## Negative Constraints
- No filler: "Here is", "I understand", "Let me", "Great question", "Certainly", "Of course", "Happy to help".
- No blind truncation of stacktraces or error logs.
- No full-file reads on large files.
- No re-reading files already in context.
- No multi-question clarification dumps.
- No silent bundling of unrelated changes.
- No full git diff ingestion on large changesets — extract hunks only.
- No git log beyond 20 entries unless a specific range is requested.
- No full MCP object inspection when field-level access suffices.
- No MCP mutations without prior read of current resource state.
- No SHA reuse across sessions for file updates.

---

## Limitations
- **Brainstorming:** disable during creative/open-ended design phases.
- **Grep Blindness:** key context may fall outside filter boundaries.
- **Overshadowing:** aggressive pruning may drop micro-variables in long sessions.

Related Skills

skill-optimizer

5
from FrancoStino/opencode-skills-collection

Diagnose and optimize Agent Skills (SKILL.md) with real session data and research-backed static analysis. Works with Claude Code, Codex, and any Agent Skills-compatible agent.

seo-meta-optimizer

5
from FrancoStino/opencode-skills-collection

Creates optimized meta titles, descriptions, and URL suggestions based on character limits and best practices. Generates compelling, keyword-rich metadata. Use PROACTIVELY for new content.

performance-optimizer

5
from FrancoStino/opencode-skills-collection

Identifies and fixes performance bottlenecks in code, databases, and APIs. Measures before and after to prove improvements.

odoo-inventory-optimizer

5
from FrancoStino/opencode-skills-collection

Expert guide for Odoo Inventory: stock valuation (FIFO/AVCO), reordering rules, putaway strategies, routes, and multi-warehouse configuration.

llm-prompt-optimizer

5
from FrancoStino/opencode-skills-collection

Use when improving prompts for any LLM. Applies proven prompt engineering techniques to boost output quality, reduce hallucinations, and cut token usage.

linkedin-profile-optimizer

5
from FrancoStino/opencode-skills-collection

High-intent expert for LinkedIn profile checks, authority building, and SEO optimization. Invoke to audit, rewrite, and enhance profiles for top 1% positioning.

dx-optimizer

5
from FrancoStino/opencode-skills-collection

Developer Experience specialist. Improves tooling, setup, and workflows. Use PROACTIVELY when setting up new projects, after team feedback, or when development friction is noticed.

aws-cost-optimizer

5
from FrancoStino/opencode-skills-collection

Comprehensive AWS cost analysis and optimization recommendations using AWS CLI and Cost Explorer

zustand-store-ts

5
from FrancoStino/opencode-skills-collection

Create Zustand stores following established patterns with proper TypeScript types and middleware.

zoom-automation

5
from FrancoStino/opencode-skills-collection

Automate Zoom meeting creation, management, recordings, webinars, and participant tracking via Rube MCP (Composio). Always search tools first for current schemas.

zoho-crm-automation

5
from FrancoStino/opencode-skills-collection

Automate Zoho CRM tasks via Rube MCP (Composio): create/update records, search contacts, manage leads, and convert leads. Always search tools first for current schemas.

zod-validation-expert

5
from FrancoStino/opencode-skills-collection

Expert in Zod — TypeScript-first schema validation. Covers parsing, custom errors, refinements, type inference, and integration with React Hook Form, Next.js, and tRPC.