prompt-optimization

Apply configurable prompt repetition to Haiku agents for structured tasks.

1.0k|200|Updated Dec 26, 2025
One-click install
npx skills add https://github.com/asklokesh/loki-mode --skill prompt-optimization-asklokesh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prompt-optimization
Source: https://github.com/asklokesh/loki-mode/tree/main/agent-skills/prompt-optimization
Command: npx skills add https://github.com/asklokesh/loki-mode --skill prompt-optimization-asklokesh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Automatically applies prompt repetition for Haiku agents to improve accuracy by 4-5x on structured tasks.

Core Features & Use Cases

  • Automatic prompt repetition for Haiku agents to enhance accuracy on structured tasks, unit tests, linting, parsing, and list operations.
  • Simple configuration through environment variables to enable/adjust repetition without code changes.
  • Real-world scenario: improve reliability of automated QA checks by repeating prompts to ensure consistent results.

Quick Start

Enable the skill by default for Haiku agents and set: LOKI_PROMPT_REPETITION=true LOKI_PROMPT_REPETition_COUNT=2 Then run your Haiku task as normal.

Frequently Asked Questions about prompt-optimization

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

FAQPage Schema
How do I improve LLM accuracy on structured tasks without adding latency?

You can improve LLM accuracy on structured tasks by applying prompt repetition during the prefill stage. This targets non-reasoning models to enhance reliability for parsing and unit tests without adding latency to the final response.

What is the best way to increase Haiku agent accuracy for automated unit tests and linting?

The best way to increase Haiku agent accuracy for unit tests and linting is prompt repetition. Configuring environment flags to repeat prompts boosts accuracy by 4-5x on structured tasks like automated QA checks.

How do I configure prompt repetition for Haiku agents?

You configure prompt repetition for Haiku agents by setting environment variables. Enable the feature with LOKI_PROMPT_REPETITION=true and define the repetition count with LOKI_PROMPT_REPETITION_COUNT before running your task.

Does prompt repetition work for all LLMs or only non-reasoning models?

Prompt repetition is specifically designed for non-reasoning LLMs like Haiku agents. It targets structured tasks such as list operations and parsing, where repeating prompts ensures consistent results without relying on advanced reasoning.

Why does prompt repetition not add latency to LLM processing?

Prompt repetition does not add latency because it operates in the prefill stage. By handling repeated prompts during this initial processing phase, the overall response time remains unaffected while improving accuracy.