prompt-optimization

Applies prompt repetition to improve accuracy of non-reasoning LLMs on structured tasks.

Updated Sep 11, 2026
One-click install
npx skills add https://github.com/CYRUS-pinto/pi-bot --skill prompt-optimization-cyrus-pinto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prompt-optimization
Source: https://github.com/CYRUS-pinto/pi-bot/tree/main/.agents/skills/loki-mode/agent-skills/prompt-optimization
Command: npx skills add https://github.com/CYRUS-pinto/pi-bot --skill prompt-optimization-cyrus-pinto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Non-reasoning LLMs like Haiku often underperform on structured tasks such as running tests, linting, and parsing. This Skill applies prompt repetition, a research-backed technique, to improve accuracy by 4-5x without adding latency. ## Core Features & Use Cases - Automatic Prompt Repetition: Duplicates prompts 2x (configurable to 3x) so bidirectional attention in the prefill stage improves comprehension. - Zero Latency Impact: Repetition occurs during the parallelizable prefill stage, not generation, so response time is unaffected. - Use Case: When a Haiku agent runs unit tests or parses structured data, its prompt is automatically repeated, raising accuracy from roughly 65% to 95% on test execution tasks. ## Quick Start Enable prompt repetition for Haiku agents by setting the LOKI_PROMPT_REPETITION environment variable to true before running structured tasks.

Frequently Asked Questions about prompt-optimization

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

FAQPage Schema
How do I improve Haiku agent accuracy on structured tasks?

Enable prompt repetition, which duplicates the prompt so bidirectional attention in the prefill stage improves comprehension. Set LOKI_PROMPT_REPETITION=true and optionally LOKI_PROMPT_REPETITION_COUNT=2 or 3 for position-critical tasks.

What is prompt repetition for non-reasoning LLMs?

Prompt repetition is a technique from arXiv 2512.14982v1 that repeats the input prompt, letting non-reasoning models attend to instructions bidirectionally during prefill. It improves accuracy on tasks like testing, linting, and parsing without increasing latency.

Does prompt repetition work with Opus or Sonnet models?

No, prompt repetition does not benefit reasoning models like Opus or Sonnet. The technique only improves non-reasoning LLMs such as Haiku, so the skill explicitly does not apply to reasoning agents.

Does prompt repetition increase latency or cost?

Prompt repetition adds zero latency because the duplicated text is processed in the parallelizable prefill stage rather than during generation. Accuracy improvements of 36-62% are reported across linting, parsing, and test tasks.

When should I use 3x prompt repetition instead of 2x?

Use 3x repetition for position-critical tasks where the model must track specific locations in the input, by setting LOKI_PROMPT_REPETITION_COUNT=3. The default 2x repetition is sufficient for most structured tasks.