prompt-optimizer

Compress natural language prompts into structured, token-efficient instructions.

2|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/NagyVikt/codex-plugins --skill prompt-optimizer-nagyvikt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prompt-optimizer
Source: https://github.com/NagyVikt/codex-plugins/tree/main/plugins/prompt-optimizer/skills/prompt-optimizer
Command: npx skills add https://github.com/NagyVikt/codex-plugins --skill prompt-optimizer-nagyvikt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the challenge of high token consumption and bloated context windows by restructuring prompts to be concise and efficient without sacrificing the original intent or output quality.

Core Features & Use Cases

  • Token Reduction: Identifies and compresses redundant context, background prose, and oversized example blocks.
  • Structured Prompting: Converts vague requests into compact, schema-driven instructions using a standardized template.
  • Use Case: When working with large codebases, use this skill to transform a verbose, multi-paragraph prompt into a structured request that references specific file paths and line ranges, significantly lowering API costs while improving model focus.

Quick Start

Use the prompt-optimizer skill to rewrite my current project instructions into a compact format that minimizes token usage while preserving all functional constraints.

Frequently Asked Questions about prompt-optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compress prompts to save tokens without losing output quality?

Prompt compression restructures verbose requests into compact, schema-driven instructions to minimize token usage while maintaining high output fidelity. It identifies redundant context, background prose, and oversized examples to significantly lower API costs.

What is the best way to reduce context window usage for long LLM sessions?

Reducing long context windows involves restructuring conversation history to eliminate redundant information. This enforces strict output constraints and converts vague requests into compact, structured instructions, improving model focus during extended sessions.

How do I convert vague natural language prompts into structured LLM instructions?

Converting vague prompts requires structured input analysis to enforce strict output constraints. This process transforms verbose, multi-paragraph requests into compact, schema-driven instructions that reference specific file paths and line ranges for improved model focus.

Does token optimization work for large codebase prompts and API cost reduction?

Token optimization works effectively for large codebases by transforming verbose prompts into structured requests referencing specific file paths. This significantly lowers API costs by minimizing token consumption while preserving all functional constraints.

Why does my prompt engineering workflow consume so many tokens with large context?

Prompt engineering workflows consume excess tokens due to redundant context, background prose, and oversized example blocks. Compressing these elements into a compact schema-driven format minimizes token usage while preserving the original intent.

When should I not use prompt compression for conversation context?

Prompt compression should be avoided when original background prose or oversized example blocks are essential for model comprehension. If strict output constraints risk losing nuanced intent, maintaining the full context ensures higher output fidelity.