Agent skill

Prompt Optimizer

by Ckokoski in Ckokoski/AuthorAgent

Automatically improves prompts based on output quality, user feedback, and A/B testing results

MITAuto-check passedAI & LLM Engineering

Install Prompt Optimizer

skills CLI
$ npx skills add Ckokoski/AuthorAgent --skill prompt-optimizer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Ckokoski/AuthorAgent prompt-optimizer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Ckokoski/AuthorAgent.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/core/prompt-optimizer .claude/skills/prompt-optimizer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
prompt-optimizer
GitHub stars
123
Token cost
~1.5k tokens
SKILL.md length
505 words
Files
1
Skills in repo
23
Repo updated
First seen
Licence
MIT

At a glance

Automatically improves prompts based on output quality, user feedback, and A/B testing results

  • Works in 7 steps: Add Specificity — Vague prompts ("write… → Add Examples — Show the AI what "good"… → Add Constraints — Boundaries improve… → …
  • Tasks that involve Prompt engineering
  • SKILL.md covers The Problem, How It Works, Manual Optimization and Integration, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Prompt Optimizer is an agent skill from Ckokoski/AuthorAgent. Automatically improves prompts based on output quality, user feedback, and A/B testing results

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Prompt engineering and A/B testing. The repository describes itself as: The Autonomous AI Writing Agent — a secure, author-focused AI for fiction and nonfiction authors (Planning, Revision, Promotion, and more). The licence is MIT.

When your agent uses it

  • Tasks that involve Prompt engineering
  • Tasks that involve A/B testing

Example prompts

  • “/prompt-optimizer”

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Add Specificity — Vague prompts ("write well") → Specific ("write in present tense, under 3000 words, with a cliffhanger ending")
  2. Add Examples — Show the AI what "good" looks like for this task
  3. Add Constraints — Boundaries improve output ("exactly 3 paragraphs", "no adverbs", "start with dialogue")
  4. Role Framing — "You are a [expert role]" can dramatically change quality
  5. Chain of Thought — For complex tasks, add "First analyze X, then plan Y, then write Z"
  6. Negative Examples — "Do NOT do X" can be as powerful as "Do Y"
  7. Output Format — Specifying exact output format reduces parsing errors

What it can do on your machine

Read from SKILL.md and the folder at commit 47e9570. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Prompt Optimizer loads about 1.5k tokens when it runs. Until then it costs about 28 tokens; SKILL.md has 505 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~28
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Ckokoski/AuthorAgent at commit 47e9570, republished under its MIT licence (© Ckokoski). 505 words, ~1,462 tokens.

Download SKILL.mdSave it as .claude/skills/prompt-optimizer/SKILL.md (or your agent's skills folder).
name
prompt-optimizer
description
Automatically improves prompts based on output quality, user feedback, and A/B testing results
author
AuthorAgent
version
1.0.0
triggers
optimize prompt, improve prompt, better prompt, prompt quality, test prompts, prompt a/b test, prompt lab
permissions
file:read, file:write

Prompt Optimizer — Core Skill

AuthorAgent's prompts are its most important tool. This skill continuously optimizes them based on what actually produces good results — not guesswork, but measured outcomes.

The Problem

Every skill, goal step, and system prompt contains prompts. Some work great. Some produce mediocre results. Without measurement, you're flying blind. The Prompt Optimizer tracks which prompt formulations produce the best outputs and evolves them over time.

How It Works

Prompt Tracking

Every prompt sent to an AI provider is logged with its outcome:

json
{
  "promptId": "p-347",
  "timestamp": "2026-02-24T15:00:00Z",
  "template": "Write a compelling book blurb for: {{description}}...",
  "skill": "blurb-writer",
  "taskType": "marketing",
  "provider": "gemini",
  "inputTokens": 450,
  "outputTokens": 890,
  "outcome": "accepted",
  "userEdited": false,
  "qualitySignals": {
    "wordCount": 147,
    "completeness": true,
    "followedInstructions": true,
    "userAccepted": true
  }
}
Quality Signals

The optimizer watches for these signals:

Positive signals (prompt is working):

  • User accepted output without edits
  • Output matched requested format/length
  • No follow-up "try again" or "that's not what I meant"
  • User explicitly praised the result
  • Output was saved to a file (user valued it enough to keep)

Negative signals (prompt needs improvement):

  • User heavily edited the output
  • User said "try again" or "not quite"
  • Output was too long/short for the task
  • AI produced an error or refusal
  • Output missed key requirements from the prompt
  • User abandoned the result
Prompt Evolution

When a prompt consistently underperforms, the optimizer creates variations:

Prompt Lab: "blurb-writer" skill
════════════════════════════════

Original (Score: 6.2/10 across 14 uses):
"Write a compelling book blurb for: {{description}}.
Create 3 versions: (1) short tagline, (2) back-cover
blurb (150 words), (3) Amazon description with HTML."

Variation A (Score: 7.8/10 across 6 uses):
"You are a bestselling book marketer. Write a blurb
for: {{description}}.
Rules: Hook in first sentence. No spoilers past Act 1.
End with a question or cliffhanger.
Format: tagline (10 words max), back cover (150 words),
Amazon listing (with <b> tags for emphasis)."

Variation B (Score: 8.1/10 across 4 uses):
"Study these bestselling blurbs for pacing and hooks:
[example 1], [example 2].
Now write a blurb for: {{description}} using the same
techniques. Output: tagline, 150-word back cover,
Amazon description."

→ RECOMMENDATION: Promote Variation B to primary.
Optimization Strategies
  1. Add Specificity — Vague prompts ("write well") → Specific ("write in present tense, under 3000 words, with a cliffhanger ending")

  2. Add Examples — Show the AI what "good" looks like for this task

  3. Add Constraints — Boundaries improve output ("exactly 3 paragraphs", "no adverbs", "start with dialogue")

  4. Role Framing — "You are a [expert role]" can dramatically change quality

  5. Chain of Thought — For complex tasks, add "First analyze X, then plan Y, then write Z"

  6. Negative Examples — "Do NOT do X" can be as powerful as "Do Y"

  7. Output Format — Specifying exact output format reduces parsing errors

Show full SKILL.md (219 more words)Show less
Automatic Optimization

When the optimizer detects a consistently weak prompt:

  1. Analyzes the failure pattern (too vague? wrong format? missing context?)
  2. Generates 2-3 variations using different strategies
  3. Rotates variations across future uses (A/B testing)
  4. Tracks outcomes per variation
  5. Promotes the best performer after sufficient data (minimum 5 uses)
  6. Logs the change to the improvement log
Storage

Prompt data lives in workspace/memory/prompts/:

workspace/memory/prompts/
├── prompt-log.jsonl          # All prompt executions and outcomes
├── prompt-variants.json      # Active A/B test variants
├── prompt-winners.json       # Promoted prompt improvements
└── prompt-archive.jsonl      # Retired prompt versions

Manual Optimization

Optimize a Specific Skill's Prompts
optimize prompt for blurb-writer

Analyzes all historical uses of the blurb-writer skill and suggests improvements.

Test a Prompt Variation
test prompt: "Write a blurb for {{description}} using the hook-mystery-stakes formula"

Runs the variation alongside the current prompt and compares results.

View Prompt Performance
prompt stats

Shows prompt win rates, A/B test status, and optimization suggestions.

Force a Prompt Update
update prompt for [skill]: [new prompt text]

Manually override a skill's prompt template.

Integration

  • Self-Improvement Loop — Prompt changes are logged as lessons
  • After-Action Review — Reviews identify which prompts contributed to good/bad outcomes
  • Goal Engine — Dynamic planning prompts are optimized too (not just skill prompts)
  • All AI Providers — Different providers may need different prompt styles (tracked separately)

Commands

  • optimize prompt for [skill] — Analyze and suggest improvements for a skill's prompts
  • prompt stats — View performance metrics across all prompts
  • prompt lab — Enter interactive prompt testing mode
  • test prompt [text] — A/B test a prompt variation
  • show prompt winners — See which optimizations have been promoted
  • prompt history [skill] — View prompt evolution for a specific skill

© Ckokoski, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/core/prompt-optimizer of Ckokoski/AuthorAgent.

Open the folder on GitHubat commit 47e9570

Compare with similar skills

Prompt Optimizer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Prompt Optimizer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Prompt Optimizer this skillCkokoski/AuthorAgent123—~1.5kAutomated safety check: PassMIT
Prompt Regressionagentscope-ai/OpenJudge870—~2.8kAutomated safety check: PassApache-2.0
Prompt Governancealirezarezvani/claude-skills28k—~2.8kAutomated safety check: PassMIT
Prompt LabMathews-Tom/armory328—~2.1kAutomated safety check: PassMIT
Sap AI Coresecondsky/sap-skills462—~3.3kAutomated safety check: PassGPL-3.0
Langchain Prompt Engineeringjeremylongshore/tons-of-skills-marketplace2.8k—~4.4kAutomated safety check: PassMIT

Similar skills

  • Prompt Regression

    agentscope-ai/OpenJudge

    A skill your agent uses when the user has changed a prompt (system prompt, RAG template, agent instruction, etc.) and wants to know whether the candidate is better or worse than the baseline.

    870 GitHub stars~2.8k tokensUpdated 28 days ago
    AI & LLM EngineeringAuto-check passed
  • Prompt Governance

    alirezarezvani/claude-skills

    A skill your agent uses when managing prompts in production at scale: versioning prompts, running A/B tests on prompts, building prompt registries, preventing prompt regressions, or creating eval…

    28k GitHub stars~2.8k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Prompt Lab

    Mathews-Tom/armory

    LLM prompt engineering: analyzes failure modes, generates variants (direct, few-shot, CoT), designs rubrics, produces test suites.

    328 GitHub stars~2.1k tokensUpdated 3 days ago
    AI & LLM EngineeringAuto-check passed
  • Sap AI Core

    secondsky/sap-skills

    Guides development with SAP AI Core and SAP AI Launchpad for enterprise AI/ML workloads on SAP BTP.

    462 GitHub stars~3.3k tokensUpdated 4 days ago
    AI & LLM EngineeringAuto-check passed
  • Langchain Prompt Engineering

    jeremylongshore/tons-of-skills-marketplace

    Manage LangChain 1.0 prompts like code — LangSmith prompt hub versioning, XML-tag conventions for Claude, few-shot example selection, discriminated-union extraction schemas, and A/B test wiring.

    2.8k GitHub stars~4.4k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Prompt Improver

    severity1/claude-code-prompt-improver

    This skill enriches vague prompts with targeted research and clarification before execution.

    1.9k GitHub starsUsed in 1 repo~1.7k tokens
    AI & LLM EngineeringAuto-check passed

More from Ckokoski/AuthorAgent

All 23 skills in this repo
  • After Action Review

    Ckokoski/AuthorAgent

    Structured post-goal reflection that extracts lessons, evaluates quality, and feeds the self-improvement loop

    123 GitHub stars~1.6k tokensUpdated 3 mo ago
    Auto-check passed
  • Comp Title Finder

    Ckokoski/AuthorAgent

    Find and analyze comparable titles for query letters, marketing, and positioning strategy

    123 GitHub stars~1.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Continuity Check

    Ckokoski/AuthorAgent

    Scan manuscript for inconsistencies in characters, timeline, settings, and names

    123 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Deep Voice Analysis

    Ckokoski/AuthorAgent

    Advanced 47-marker voice analysis engine — analyzes your writing to build a comprehensive Voice Profile for AuthorClaw

    123 GitHub stars~1.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Dictation Cleanup

    Ckokoski/AuthorAgent

    Transform raw speech-to-text dictation into polished prose while preserving the author's natural voice

    123 GitHub stars~1.2k tokensUpdated 3 mo ago
    Auto-check passed
  • Error Recovery

    Ckokoski/AuthorAgent

    Intelligent error diagnosis, automatic recovery strategies, and prevention of recurring failures

    123 GitHub stars~1.7k tokensUpdated 3 mo ago
    Auto-check passed

Questions about Prompt Optimizer

What does Prompt Optimizer do?

Automatically improves prompts based on output quality, user feedback, and A/B testing results. Prompt Optimizer is an agent skill from Ckokoski/AuthorAgent.

When should I use Prompt Optimizer?

Prompt Optimizer fits situations like: tasks that involve Prompt engineering; tasks that involve A/B testing.

How do I install Prompt Optimizer in Claude Code?

Run `npx skills add Ckokoski/AuthorAgent --skill prompt-optimizer -a claude-code`. Or copy the skill folder (skills/core/prompt-optimizer in Ckokoski/AuthorAgent) into .claude/skills/prompt-optimizer in your project. Claude Code loads it when a task matches its description.

How do I install Prompt Optimizer in Codex?

Run `npx skills add Ckokoski/AuthorAgent --skill prompt-optimizer -a codex`. Or copy the skill folder (skills/core/prompt-optimizer in Ckokoski/AuthorAgent) into .agents/skills/prompt-optimizer in your project. Codex loads it when a task matches its description.

Can I use Prompt Optimizer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Ckokoski/AuthorAgent --skill prompt-optimizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/prompt-optimizer, .gemini/skills/prompt-optimizer, .github/skills/prompt-optimizer and .opencode/skills/prompt-optimizer in your project.

What does Prompt Optimizer need to run?

SKILL.md names no scripts, command-line tools or credentials: Prompt Optimizer is instructions for the agent only.

Does Prompt Optimizer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Prompt Optimizer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Prompt Optimizer use?

Prompt Optimizer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Prompt Optimizer use?

About 1.5k tokens (SKILL.md is roughly 5.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Prompt Optimizer?

Skills that share tags, products or a category with Prompt Optimizer: Prompt Regression (agentscope-ai/OpenJudge, 870 stars), Prompt Governance (alirezarezvani/claude-skills, 28k stars), Prompt Lab (Mathews-Tom/armory, 328 stars) and Sap AI Core (secondsky/sap-skills, 462 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Prompt Optimizer?

Ckokoski (a GitHub user) maintains it in Ckokoski/AuthorAgent, which has 123 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on July 11, 2026.

Source: Ckokoski/AuthorAgent on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.