Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/dosco/aithy/ax-agent-optimizenpx skills add dosco/aithy --skill ax-agent-optimizegit clone --depth 1 https://github.com/dosco/aithyWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/dosco/aithy/ax-agent-optimize)<a href="https://agentmods.dev/skills/dosco/aithy/ax-agent-optimize"><img src="https://agentmods.dev/badge/skills/dosco/aithy/ax-agent-optimize.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00057 | $0.04156 |
| Opus 5 | $0.00028 | $0.02078 |
| Sonnet 5 | $0.00011 | $0.00831 |
| Haiku 4.5 | $0.00006 | $0.00416 |
Grade A, and why
ax-agent-optimize scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 369 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AxAgent Optimize Codegen Rules (@ax-llm/ax)
Use this skill for agent.optimize(...) workflows. Prefer short, modern, copyable patterns. Do not repeat general agent-authoring guidance unless the user needs it. For generic ax(...) or flow(...) tuning with top-level optimize(...), use the ax-gepa skill instead.
Your job is to help the model choose a good optimization setup for the user's actual goal:
- If the user wants better tool use, prefer action-aware tasks and either a deterministic metric or the built-in judge depending on how objective the scoring is.
- If the user wants better wording only, responder optimization may be enough.
- If the user wants reusable improvements, include artifact save/load.
- If the user wants cost, tool-use, or child-agent delegation behavior improved, make the eval tasks expose those tradeoffs explicitly.
Use These Defaults
- Use
agent.optimize(...)only after the agent is already configured and runnable. - Prefer the built-in judge path first for normal agent tuning. Most users should start with tasks that include
inputandcriteria, then letagent.optimize(...)use its default actor target and judge-based metric. - Keep top-level
optimize(program, train, metric, options)for non-agent generators and flows; do not rewrite normal agent task-record examples to the generic helper. - Prefer a deterministic custom
metriconly when success is easy to score from the prediction and task record. - Add
judgeAIplusjudgeOptionswhen the judge should run on a stronger or separate model than the agent runtime model. - Only reach for a plain typed
AxGenevaluator when the user needs LLM-as-judge behavior outside the built-inagent.optimize(...)flow. - Default optimize target is the actor path; do not surface
targetunless the user clearly wants responder-only tuning or explicit program IDs. - Use eval-safe tools or in-memory mocks because optimization replays tasks many times.
- Prefer precise tool return schemas such as
f.object(...)over vaguef.json(...)whenever the agent must reason about returned fields. - Prefer task wording with canonical entity names like "the Atlas project" instead of ambiguous labels like "Atlas" when ambiguity could trigger pointless clarification.
- Save artifacts with
axSerializeOptimizedProgram(result.optimizedProgram!), then restore withaxDeserializeOptimizedProgram(saved)andagent.applyOptimization(...). - For browser-safe persistence, let the caller store the serialized JSON anywhere they want such as localStorage, IndexedDB, or a backend.
- If
bootstrapis enabled, bootstrapped demos are persisted insideresult.optimizedProgram.demos; raw failed traces are not saved in v1. - Auto-promoted context fields (large undeclared inputs kept runtime-only by
autoUpgrade) appear in captured traces/demos as their truncated preview string, not the full value — same as declared truncate-stylecontextFields. This is expected; do not treat the shortened value as a bug in the saved demos. - For first examples, pass a plain task array instead of splitting into
trainandvalidationunless the user already has a holdout set. - GEPA-backed
agent.optimize(...)now optimizes generic components exposed by the selected target programs;target: 'actor'only tunes actor components,target: 'responder'only tunes responder components, andtarget: 'all'broadens the component set. result.optimizedProgram.componentMapis the canonical saved artifact for agent GEPA runs. It may include actor instructions, descriptions, tool descriptions/names, templates, or runtime primitives depending on what the selected target exposes.- When child-agent delegation matters, expose the child agents as named functions and tune against realistic call/no-call tasks.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- today Changed · +8 lines 2cee84aa66ee
- 4d ago First seen · 361 lines · 57 tokens per session scan A 1b65e7cc0e98
ax-agent-optimize is a skill published in the GitHub repository dosco/aithy (107 stars, last pushed 3d ago), licensed Apache-2.0. It adds 57 tokens to every session and 4,156 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
worker-mcp-orchestrator
Guides the coordinator agent on how to orchestrate, delegate to, and supervise local worker agents using the worker-mcp server.
research-assistant
Conduct deep, multi-source research on technologies, companies, markets, and topics — synthesizing findings into structured reports with citations and actionable insights.
code-review
Analyze pull requests and diffs for bugs, security vulnerabilities, performance issues, style violations, and test coverage gaps — producing structured, actionable feedback.
customer-support
Triage incoming support tickets, draft responses, detect customer sentiment, suggest knowledge base articles, and track resolution metrics.
fleet-orchestration
Decompose a large task into DISJOINT file-owned workstreams, fan out isolated full-power peers, collect structured reports, run ONE authoritative gate, and commit when green — the collision-free, self-verifying multi-agent flow. Ultra-gated.
content-writer
Draft blog posts, social media content, email campaigns, and marketing copy.