ax-cpp-refine

C++ guidance for using axllm, a package for building language-model programs, to generate candidates, evaluate them, and improve them repeatedly.

In plain words
What is it for?
Building reward-scored generation, applying evaluator feedback, using refinement and optimizer APIs, and following the package's C++ examples and capability limits.
Why use it?
Generated results often need evaluator feedback and optimization, and the available C++ interfaces may differ from those in other languages.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/ax-llm/ax/ax-cpp-refine
Any agent
npx skills add ax-llm/ax --skill ax-cpp-refine
Clone the repo
git clone --depth 1 https://github.com/ax-llm/ax

Made for: Claude Code, Codex.

Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 466 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00037 $0.00466
Opus 5 $0.00018 $0.00233
Sonnet 5 $0.00007 $0.00093
Haiku 4.5 $0.00004 $0.00047

Measured today against content hash 2273437949c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ax-cpp-refine 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.

Origin

Copies of this mod

3 near-identical copies found in the catalogue:

packages/cpp/skills/ax-cpp-refine/SKILL.md · 45 lines

What it actually says

Ax Refinement Patterns For C++

This skill helps an agent write C++ code with the generated Ax package axllm. Use the generated package API, examples, and manifests; do not import TypeScript-only APIs unless you are editing the TypeScript package.

When To Use

  • Improve generated outputs with evaluator feedback or optimizer artifacts.
  • Port TypeScript refinement intent into generated-language surfaces without assuming TypeScript-only helpers.
  • Use generated optimizer APIs when the target package does not expose a standalone refine helper.

Package Facts

  • Language: C++.
  • Package: axllm.
  • Package API docs: API.md and axir-api.json.
  • Capability manifest: axir-capabilities.json.
  • Runnable examples: examples/.
  • Real network support: yes.
  • Scripted no-key transport support: yes.
  • Runtime profiles: javascript-quickjs, python-pyodide.

Core Pattern

axllm::AxGEPA engine(reflection_client, options);
auto result = engine.optimize(request, evaluator);

Relevant API Surface

  • AxGen: axllm::ax, axllm::AxGen
  • Optimizers: axllm::optimize, axllm::playbook, axllm::AxPlaybook, axllm::AxBootstrapFewShot, axllm::AxGEPA, axllm::OptimizerEngine, axllm::OptimizerEvaluator

Guardrails

  • Start from package examples for exact native syntax before inventing a new call shape.
  • Use provider-api examples only when the user explicitly has provider credentials available.
  • Use no-key examples for deterministic local checks and provider request mapping.
  • Treat AxIR as the source of generated package truth: if package docs disagree with source code, update the compiler and regenerate packages.
  • Do not copy repo-maintainer skills from tools/*/skills/ into user packages.
Changes

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.

  1. today Changed 2273437949c2
  2. 3d ago First seen · 45 lines · 37 tokens per session scan A dea36183bdb5

Subscribe to this mod's changes

ax-cpp-refine is a skill published in the GitHub repository ax-llm/ax (2,890 stars, last pushed 2d ago), licensed Apache-2.0. It adds 37 tokens to every session and 466 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

implementing-jsc-classes-cpp

Implements JavaScript classes in C++ using JavaScriptCore. Use when creating new JS classes with C++ bindings, prototypes, or constructors.

oven-sh/bun · 38 tokens

mcpp-style-ref

为 mcpp 项目应用 Modern/Module C++ (C++23) 编码风格。适用于编写或审查带模块的 C++ 代码、命名标识符、组织 .cppm/.cpp 文件,或用户提及 mcpp、module C++、现代 C++ 风格时。.

Sunrisepeak/mbun · 73 tokens

compiler-port

Port a compiler pass from TypeScript to Rust. Gathers context, plans the port, implements in a subagent with test-fix loop, then reviews.

react/react · 35 tokens

spanify-buffers

Find and fix unsafe buffer operations in a C++ file by removing UNSAFETODO markers and replacing unsafe raw pointers/C-style functions with base::span and standard safe containers. Use when the user asks to fix unsafe buffer warnings or -Wunsafe-buffer-usage errors. Don't use for other types of memory safety bugs like…

chromium/chromium · 86 tokens

jni-type-conversion

How to use @JniType annotations for ergonomic JNI. Relevant for Java files that use @NativeMethods or @CalledByNative.

chromium/chromium · 32 tokens

convert-internal-package-to-typescript

Convert a legacy internal Ghost workspace package from JavaScript or CommonJS to the repository's TypeScript and ESM golden path while preserving file history and runtime compatibility. Use when modernizing an existing or newly migrated private package, including staged lib-to-src moves, JS-to-TS renames, consumer…

TryGhost/Ghost · 75 tokens