Agent skill

Ax Gepa

by dosco in dosco/aithy

This skill helps an LLM generate correct AxGEPA optimization code using @ax-llm/ax.

Apache-2.0Auto-check passed

Install Ax Gepa

skills CLI
$ npx skills add dosco/aithy --skill ax-gepa -a claude-code

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

GitHub CLI
$ gh skill install dosco/aithy ax-gepa --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/dosco/aithy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/ax-gepa .claude/skills/ax-gepa && 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
ax-gepa
GitHub stars
107
Token cost
~2.6k tokens
SKILL.md length
716 words
Files
1
Skills in repo
17
Repo updated
First seen
Licence
Apache-2.0

At a glance

This skill helps an LLM generate correct AxGEPA optimization code using @ax-llm/ax.

  • The user asks about AxGEPA
  • SKILL.md covers Use These Defaults, Critical Rules, Metric Selection and Canonical Scalar Pattern, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Pareto optimization

What it does

Ax Gepa is an agent skill from dosco/aithy. This skill helps an LLM generate correct AxGEPA optimization code using @ax-llm/ax. Use when the user asks about AxGEPA, GEPA, Pareto optimization, multi-objective prompt tuning, reflective prompt evolution, validationExamples, maxMetricCalls, or optimizing a generator, flow, or agent tree.

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

The repository describes itself as: A personal AI agent that can work safely on your machine, remember useful context, and keep its data under your control. The licence is Apache-2.0.

When your agent uses it

  • The user asks about AxGEPA
  • Pareto optimization
  • Multi-objective prompt tuning
  • Reflective prompt evolution

Example prompts

  • “/ax-gepa”

What it can do on your machine

Read from SKILL.md and the folder at commit 0c9855f. 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 typescript).

    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

Ax Gepa loads about 2.6k tokens when it runs. Until then it costs about 75 tokens; SKILL.md has 716 words of instructions outside code blocks.

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

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 dosco/aithy at commit 0c9855f, republished under its Apache-2.0 licence (© dosco). 716 words, ~2,588 tokens.

Download SKILL.mdSave it as .claude/skills/ax-gepa/SKILL.md (or your agent's skills folder).
name
ax-gepa
description
This skill helps an LLM generate correct AxGEPA optimization code using @ax-llm/ax. Use when the user asks about AxGEPA, GEPA, Pareto optimization, multi-objective prompt tuning, reflective prompt evolution, validationExamples, maxMetricCalls, or optimizing a generator, flow, or agent tree.
version
24.0.16

GEPA Optimization Codegen Rules (@ax-llm/ax)

Use this skill to generate GEPA optimization code. Prefer the top-level optimize(...) helper for normal code, and use direct AxGEPA / AxBootstrapFewShot only when the user needs low-level optimizer control.

Use These Defaults

  • Use optimize(program, train, metric, { studentAI, teacherAI, ... }) for normal generator and flow tuning.
  • Prefer ai(), ax(), and flow() for new code.
  • Use a strong teacherAI and a cheaper studentAI.
  • Pass validationExamples when you have a holdout set.
  • Set maxMetricCalls to bound optimizer cost; optimize(...) defaults it to 100.
  • Use scalar metrics for one objective and object metrics for Pareto optimization.
  • Apply results with program.applyOptimization(result.optimizedProgram!).
  • For tree-wide runs, expect optimizedProgram.componentMap.
  • Persist artifacts with axSerializeOptimizedProgram(...) and restore them with axDeserializeOptimizedProgram(...) so the same flow works in browsers and Node.
  • optimize(...) runs AxBootstrapFewShot -> AxGEPA for small starter sets by default, preserving the demos in result.optimizedProgram.demos.

Critical Rules

  • optimize(...) and AxGEPA.compile() work for a single generator and for tree-aware roots such as flows or agents with registered optimizable descendants.
  • There is no separate flow-only GEPA optimizer. Use AxGEPA for flows too.
  • The metric may return either number or Record<string, number>.
  • Keep metrics deterministic and cheap by default.
  • Avoid extra LLM calls inside the metric unless the user explicitly wants judge-based evaluation.
  • If the user needs LLM-as-judge scoring for a non-agent GEPA run, prefer a plain typed AxGen evaluator instead of writing a custom judge abstraction.
  • maxMetricCalls must be large enough to cover the initial validation pass over validationExamples.
  • GEPA optimizes generic string components exposed by getOptimizableComponents(). If a tree exposes no components, optimization will fail.
  • Use held-out validation examples for selection. Do not reuse the training set as validationExamples.
  • result.optimizedProgram is the easy-to-apply best candidate. result.paretoFront is the full trade-off set for multi-objective runs.
  • Direct AxGEPA still has its own bootstrap option, but top-level optimize(...) composes the existing AxBootstrapFewShot optimizer before GEPA instead.

Metric Selection

Choose the evaluation path deliberately:

  • Prefer a deterministic metric when correctness can be read directly from prediction and example.
  • Prefer a deterministic metric when cost, latency, recursion depth, or tool count matters.
  • Use a plain typed AxGen evaluator only when the task is genuinely qualitative and hard to score exactly.
  • For agent.optimize(...), prefer the built-in judge path instead of manually wrapping a judge metric. Normal agent users usually do not need to set target or metric at all.

Rule of thumb:

  • optimize(...) on AxGen or flow: use a metric first, optionally a plain typed AxGen evaluator if needed.
  • agent.optimize(...): use custom metric for crisp scoring, otherwise let the built-in judge handle scoring. Add judgeAI plus judgeOptions only when you want a stronger or separate judge model.
Show full SKILL.md (283 more words)Show less

Canonical Scalar Pattern

typescript
import { ai, ax, optimize, AxAIOpenAIModel } from '@ax-llm/ax';

const student = ai({
  name: 'openai',
  apiKey: process.env.OPENAI_APIKEY!,
  config: { model: AxAIOpenAIModel.GPT54Mini },
});

const teacher = ai({
  name: 'openai',
  apiKey: process.env.OPENAI_APIKEY!,
  config: { model: AxAIOpenAIModel.GPT54 },
});

const classifier = ax(
  'emailText:string -> priority:class "high, normal, low", rationale:string'
);

const train = [
  { emailText: 'URGENT: Server down!', priority: 'high' },
  { emailText: 'Weekly newsletter', priority: 'low' },
];

const validation = [
  { emailText: 'Invoice overdue', priority: 'high' },
  { emailText: 'Lunch plans?', priority: 'low' },
];

const metric = ({ prediction, example }: { prediction: any; example: any }) =>
  prediction?.priority === example?.priority ? 1 : 0;

const result = await optimize(classifier, train, metric, {
  studentAI: student,
  teacherAI: teacher,
  numTrials: 12,
  minibatch: true,
  minibatchSize: 4,
  earlyStoppingTrials: 4,
  sampleCount: 1,
  validationExamples: validation,
  maxMetricCalls: 120,
});

classifier.applyOptimization(result.optimizedProgram!);
console.log(result.bestScore);

Canonical Pareto Pattern

typescript
import { ai, flow, optimize, AxAIOpenAIModel } from '@ax-llm/ax';

const student = ai({
  name: 'openai',
  apiKey: process.env.OPENAI_APIKEY!,
  config: { model: AxAIOpenAIModel.GPT54Mini },
});

const teacher = ai({
  name: 'openai',
  apiKey: process.env.OPENAI_APIKEY!,
  config: { model: AxAIOpenAIModel.GPT54 },
});

const wf = flow<{ emailText: string }>()
  .n('classifier', 'emailText:string -> priority:class "high, normal, low"')
  .n(
    'rationale',
    'emailText:string, priority:string -> rationale:string "One concise sentence"'
  )
  .e('classifier', (state) => ({ emailText: state.emailText }))
  .e('rationale', (state) => ({
    emailText: state.emailText,
    priority: state.classifierResult.priority,
  }))
  .r((state) => ({
    priority: state.classifierResult.priority,
    rationale: state.rationaleResult.rationale,
  }));

const train = [
  { emailText: 'URGENT: Server down!', priority: 'high' },
  { emailText: 'Weekly newsletter', priority: 'low' },
];

const validation = [
  { emailText: 'Invoice overdue', priority: 'high' },
  { emailText: 'Lunch plans?', priority: 'low' },
];

const metric = ({ prediction, example }: { prediction: any; example: any }) => {
  const accuracy = prediction?.priority === example?.priority ? 1 : 0;
  const rationale = typeof prediction?.rationale === 'string'
    ? prediction.rationale
    : '';
  const brevity = rationale.length <= 40 ? 1 : rationale.length <= 80 ? 0.5 : 0.1;
  return { accuracy, brevity };
};

const result = await optimize(wf, train, metric, {
  studentAI: student,
  teacherAI: teacher,
  numTrials: 16,
  minibatch: true,
  minibatchSize: 6,
  earlyStoppingTrials: 5,
  sampleCount: 1,
  validationExamples: validation,
  maxMetricCalls: 240,
});

for (const point of result.paretoFront) {
  console.log(point.scores, point.configuration);
}

wf.applyOptimization(result.optimizedProgram!);
console.log(result.optimizedProgram?.componentMap);

Metric Patterns

typescript
// Scalar objective
const scalarMetric = ({ prediction, example }) =>
  prediction.answer === example.answer ? 1 : 0;

// Multi-objective
const multiMetric = ({ prediction, example }) => ({
  accuracy: prediction.answer === example.answer ? 1 : 0,
  brevity:
    typeof prediction?.reasoning === 'string' &&
    prediction.reasoning.length < 120
      ? 1
      : 0.2,
});
  • Return plain numbers or plain object literals.
  • Keep objective names stable across calls.
  • Prefer normalized scores such as 0..1 so trade-offs are easy to reason about.

Result Handling

typescript
const { optimizedProgram, paretoFront } = result;

program.applyOptimization(optimizedProgram!);

// Save for later
const saved = JSON.stringify(optimizedProgram);

// Load later and re-apply
const loaded = JSON.parse(saved);
program.applyOptimization(loaded);
  • Single-target runs usually populate both optimizedProgram.instruction and optimizedProgram.componentMap.
  • Tree-wide runs rely on componentMap, keyed by full component key.
  • Pareto points expose candidate configs under point.configuration.componentMap.

Useful Options

typescript
const optimizer = new AxGEPA({
  studentAI,
  teacherAI,
  numTrials: 20,
  minibatch: true,
  minibatchSize: 5,
  minibatchFullEvalSteps: 5,
  earlyStoppingTrials: 5,
  minImprovementThreshold: 0,
  sampleCount: 1,
  seed: 42,
  verbose: true,
});
  • numTrials: number of reflection/evolution rounds.
  • minibatch: reduce per-round evaluation cost.
  • minibatchSize: examples per minibatch.
  • earlyStoppingTrials: stop after repeated non-improvement.
  • minImprovementThreshold: reject tiny gains below this threshold.
  • seed: stabilize sampling during demos and tests.

Budgeting and Validation

  • Always create distinct train and validationExamples arrays.
  • Size maxMetricCalls for at least one full validation pass plus several rounds.
  • If the user wants a strict budget, say so explicitly and set maxMetricCalls.
  • For expensive trees, start with auto: 'light' or fewer numTrials, then scale up.
  • GEPA selects among exposed components using measured accept/reject history, not LLM-generated numeric scores. The LLM proposes component text; metrics decide whether to keep it.
  • Function/tool trace reflection is keyed by stable component IDs where available, so function renames do not break saved candidate maps.

Troubleshooting

  • Error about maxMetricCalls being too small: increase it until the initial validation pass fits.
  • Empty or poor Pareto front: verify the metric returns numbers for every example.
  • No tree optimization effect: ensure child programs are registered under the root and expose optimizable components.
  • Saved optimization applies only partly: use program.applyOptimization(...), not just setInstruction(...), so componentMap reaches the full tree.
  • Agent target seems too broad: when using agent.optimize(...), set target: 'actor', 'responder', 'all', or explicit program IDs. The wrapper filters GEPA components to the selected target.

Good Example Targets

  • /Users/vr/src/ax/src/examples/optimize.ts
  • /Users/vr/src/ax/src/examples/gepa.ts
  • /Users/vr/src/ax/src/examples/gepa-flow.ts
  • /Users/vr/src/ax/src/examples/gepa-train-inference.ts
  • /Users/vr/src/ax/src/examples/gepa-quality-vs-speed-optimization.ts
  • /Users/vr/src/ax/src/examples/axagent-gepa-optimization.ts

© dosco, Apache-2.0. 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 .claude/skills/ax-gepa of dosco/aithy.

Open the folder on GitHubat commit 0c9855f

Compare with similar skills

Ax Gepa 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.

Ax Gepa compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ax Gepa this skilldosco/aithy107—~2.6kAutomated safety check: PassApache-2.0
Harness Geparuvnet/ruflo74k—~826Automated safety check: NotesMIT
Correctcursor/plugins11k3 repos~612Automated safety check: PassNone
CorrectionNxcoreAI/EverRoom3k—~290Automated safety check: PassCustom licence
Correction Root-Cause Pipelinegarrytan/gbrain31k—~3.4kAutomated safety check: PassMIT
Audit Correctness Proofben-manes/caffeine18k—~275Automated safety check: PassApache-2.0

Similar skills

  • Harness Gepa

    ruvnet/ruflo

    Inspect and audit GEPA genomes via the @metaharness/darwin/gepa library entry (darwin 0.8.0) — load/validate a genome (default is the shipped cand-6 promotion), render the system prompt a genome…

    74k GitHub stars~826 tokensUpdated yesterday
    AI & LLM EngineeringAuto-check: notes
  • Correct

    cursor/plugins

    Official

    Find the mistakes agents keep repeating in this repo and make each one impossible.

    11k GitHub starsUsed in 3 repos~612 tokens
    Auto-check passed
  • Correction

    NxcoreAI/EverRoom

    Compute Room overview corrections—citation corrections as per-claim edits and general corrections as a single proposal.

    3k GitHub stars~290 tokensUpdated yesterday
    Research & ScienceAuto-check passed
  • Traces a factual error the user points out back to its source (a brain page, a memory file, SOUL.md or USER.md, or a hallucination) and fixes that source instead of just noting the correction.

    31k GitHub stars~3.4k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Audit Correctness Proof

    ben-manes/caffeine

    Attempt formal correctness proofs for all public cache methods

    18k GitHub stars~275 tokensUpdated 2 days ago
    Auto-check passed
  • The Logic & Correctness review perspective for PostHog Review.

    40k GitHub stars~988 tokensUpdated yesterday
    Data & AnalyticsAuto-check passed

More from dosco/aithy

All 17 skills in this repo
  • This skill helps an LLM generate correct AxAgent observability code using @ax-llm/ax.

    107 GitHub stars~4.4k tokensUpdated 1 mo ago
    Auto-check passed
  • This skill helps an LLM generate correct AxAgent tuning and evaluation code using @ax-llm/ax.

    107 GitHub stars~4.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Ax Audio

    dosco/aithy

    This skill helps an LLM generate correct audio code with @ax-llm/ax.

    107 GitHub stars~2.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Ax LLM

    dosco/aithy

    This skill helps with using the @ax-llm/ax TypeScript library for building LLM applications.

    107 GitHub stars~3.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Ax MCP

    dosco/aithy

    This skill helps an LLM build correct native Model Context Protocol integrations with @ax-llm/ax.

    107 GitHub stars~4.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Ax Playbook

    dosco/aithy

    This skill helps an LLM generate correct playbook code using @ax-llm/ax.

    107 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Ax Gepa

What does Ax Gepa do?

This skill helps an LLM generate correct AxGEPA optimization code using @ax-llm/ax. Ax Gepa is an agent skill from dosco/aithy. This skill helps an LLM generate correct AxGEPA optimization code using @ax-llm/ax.

When should I use Ax Gepa?

Ax Gepa fits situations like: the user asks about AxGEPA; pareto optimization; multi-objective prompt tuning; reflective prompt evolution.

How do I install Ax Gepa in Claude Code?

Run `npx skills add dosco/aithy --skill ax-gepa -a claude-code`. Or copy the skill folder (.claude/skills/ax-gepa in dosco/aithy) into .claude/skills/ax-gepa in your project. Claude Code loads it when a task matches its description.

How do I install Ax Gepa in Codex?

Run `npx skills add dosco/aithy --skill ax-gepa -a codex`. Or copy the skill folder (.claude/skills/ax-gepa in dosco/aithy) into .agents/skills/ax-gepa in your project. Codex loads it when a task matches its description.

Can I use Ax Gepa 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 dosco/aithy --skill ax-gepa -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ax-gepa, .gemini/skills/ax-gepa, .github/skills/ax-gepa and .opencode/skills/ax-gepa in your project.

What does Ax Gepa need to run?

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

Does Ax Gepa 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 Ax Gepa 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 Ax Gepa use?

Ax Gepa is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Ax Gepa use?

About 2.6k tokens (SKILL.md is roughly 10k 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 Ax Gepa?

Skills that share tags, products or a category with Ax Gepa: Harness Gepa (ruvnet/ruflo, 74k stars), Correct (cursor/plugins, 11k stars), Correction (NxcoreAI/EverRoom, 3k stars) and Correction Root-Cause Pipeline (garrytan/gbrain, 31k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ax Gepa?

dosco (a GitHub user) maintains it in dosco/aithy, which has 107 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on August 31, 2026.

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