Agent Refinement
ruvnet/ruflo
Agent skill for refinement - invoke with $agent-refinement. An agent skill from ruvnet/ruflo.
A skill your agent uses when writing or reviewing Ax bestOfN/refine code, reward functions, thresholds, native sample selection, serial attempts, generated advice, and attempt diagnostics.
$ npx skills add dosco/aithy --skill ax-refine -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install dosco/aithy ax-refine --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/dosco/aithy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/ax-refine .claude/skills/ax-refine && rm -rf skills-srcUse ~/.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/
Install the "ax-refine" agent skill from https://github.com/dosco/aithy/tree/main/.claude/skills/ax-refine into .claude/skills/ax-refine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ax-refine", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/dosco/aithy/tree/main/.claude/skills/ax-refineType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add dosco/aithy --skill ax-refine -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install dosco/aithy ax-refine --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dosco/aithy.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/ax-refine .agents/skills/ax-refine && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "ax-refine" agent skill from https://github.com/dosco/aithy/tree/main/.claude/skills/ax-refine into .agents/skills/ax-refine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ax-refine", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add dosco/aithy --skill ax-refine -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install dosco/aithy ax-refine --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dosco/aithy.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/ax-refine .cursor/skills/ax-refine && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "ax-refine" agent skill from https://github.com/dosco/aithy/tree/main/.claude/skills/ax-refine into .cursor/skills/ax-refine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ax-refine", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/dosco/aithy.git --path .claude/skills/ax-refine--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add dosco/aithy --skill ax-refine -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install dosco/aithy ax-refine --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dosco/aithy.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/ax-refine .gemini/skills/ax-refine && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "ax-refine" agent skill from https://github.com/dosco/aithy/tree/main/.claude/skills/ax-refine into .gemini/skills/ax-refine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ax-refine", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install dosco/aithy ax-refineInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add dosco/aithy --skill ax-refine -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/dosco/aithy.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/ax-refine .github/skills/ax-refine && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "ax-refine" agent skill from https://github.com/dosco/aithy/tree/main/.claude/skills/ax-refine into .github/skills/ax-refine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ax-refine", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add dosco/aithy --skill ax-refine -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install dosco/aithy ax-refine --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dosco/aithy.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/ax-refine .opencode/skills/ax-refine && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "ax-refine" agent skill from https://github.com/dosco/aithy/tree/main/.claude/skills/ax-refine into .opencode/skills/ax-refine/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "ax-refine", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
ax-refineA skill your agent uses when writing or reviewing Ax bestOfN/refine code, reward functions, thresholds, native sample selection, serial attempts, generated advice, and attempt diagnostics.
Ax Refine is an agent skill from dosco/aithy. Use this skill when writing or reviewing Ax bestOfN/refine code, reward functions, thresholds, native sample selection, serial attempts, generated advice, and attempt diagnostics.
Its SKILL.md is about 870 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.
Read from SKILL.md and the folder at commit 0c9855f. It shows what the files ask for, not the result of running them.
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.
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.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Ax Refine loads about 868 tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 315 words of instructions outside code blocks.
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.
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.
The full file from dosco/aithy at commit 0c9855f, republished under its Apache-2.0 licence (© dosco). 315 words, ~868 tokens.
.claude/skills/ax-refine/SKILL.md (or your agent's skills folder).Use bestOfN(...) when you can score complete outputs independently. Use refine(...) when failed rounds should produce feedback that changes the next attempt.
Keep reward scoring, whole-output assertions, and streaming assertions separate:
addAssert(...) for whole-output hard invariants. Failed assertions feed correction text into the normal retry loop.addStreamingAssert(...) for partial streaming hard invariants. It aborts the current stream attempt as soon as the partial field fails, then feeds correction text into the normal retry loop.bestOfN(...) for complete-candidate selection.refine(...) for reward-scored retry rounds with generated feedback.import { bestOfN, refine } from '@ax-llm/ax';
const selected = bestOfN(program, {
n: 4,
threshold: 0.8,
rewardFn: ({ input, prediction, traces, chatLog }) => score(prediction),
});
const improved = refine(program, {
rounds: 3,
samplesPerRound: 2,
threshold: 0.85,
rewardDescription: 'Prefer complete, grounded, concise answers.',
rewardFn: ({ prediction }) => score(prediction),
});Rules:
forward(...) returns the selected prediction.streamingForward(...) is unsupported; score complete outputs instead.getUsage() aggregates usage across attempts.getTraces() and getChatLog() return the selected attempt's diagnostics.getAttempts() returns all attempt metadata, including reward, errors, and advice application.Reward functions return a number. Higher is better. A threshold marks a good-enough candidate and can stop serial attempts early.
const rewardFn = ({ prediction }) => {
const exact = prediction.answer === 'Paris' ? 1 : 0;
const concise = prediction.answer.length < 80 ? 0.2 : 0;
return exact + concise;
};Use serial strategy when the reward needs traces, chat logs, tools, or full flow behavior.
strategy: "auto" uses native samples for AxGen and serial attempts for composite programs.strategy: "native-samples" uses sampleCount and a reward-backed resultPicker; candidate context includes outputs, not full per-candidate traces.strategy: "serial" runs isolated full-program attempts with fresh memory/session IDs.refine(...) generates advice after a below-threshold round. Advice is appended temporarily to matching kind: "instruction" components exposed by getOptimizableComponents() and applied through applyOptimizedComponents().
Rules:
finally, on success and error.adviceApplied: false.hint_ signature fields; Ax uses instruction-component advice.Do not use refine(...) for streaming. For partial-output safety, use addStreamingAssert(fieldName, fn, message?) on AxGen. Streaming assertions fail fast within the current attempt with AxStreamingAssertionError, then retry with correction feedback when retries remain.
© 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
Just SKILL.md in .claude/skills/ax-refine of dosco/aithy.
Open the folder on GitHubat commit 0c9855f
Ax Refine 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Ax Refine this skilldosco/aithy | 107 | — | ~868 | Automated safety check: Pass | Apache-2.0 | |
| Agent Refinementruvnet/ruflo | 74k | 2 repos | ~3.5k | Automated safety check: Pass | MIT | |
| Refinewindmill-labs/windmill | 18k | — | ~420 | Automated safety check: Pass | Custom licence | |
| Refiner AutomationComposioHQ/awesome-claude-skills | 77k | 3 repos | ~730 | Automated safety check: Pass | None | |
| Sparc Refineruvnet/ruflo | 74k | — | ~1.5k | Automated safety check: Notes | MIT | |
| Refine Promptpenpot/penpot | 61k | — | ~1.6k | Automated safety check: Pass | MPL-2.0 |
ruvnet/ruflo
Agent skill for refinement - invoke with $agent-refinement. An agent skill from ruvnet/ruflo.
windmill-labs/windmill
End-of-session reflection. An agent skill from windmill-labs/windmill.
ComposioHQ/awesome-claude-skills
Automate Refiner tasks via Rube MCP (Composio). An agent skill from ComposioHQ/awesome-claude-skills.
ruvnet/ruflo
Run the SPARC Refinement and Completion phases — review code, improve test coverage, validate against specification, and generate documentation
penpot/penpot
Refine and improve a user-supplied prompt for maximum clarity and effectiveness using prompt-engineering best practices and Penpot project context.
addyosmani/agent-skills
Guides a conversation that takes a vague idea through divergent and convergent thinking and ends in a markdown one-pager covering scope and assumptions.
dosco/aithy
This skill helps an LLM generate correct AxAgent observability code using @ax-llm/ax.
dosco/aithy
This skill helps an LLM generate correct AxAgent tuning and evaluation code using @ax-llm/ax.
dosco/aithy
This skill helps an LLM generate correct audio code with @ax-llm/ax.
dosco/aithy
This skill helps an LLM generate correct AxGEPA optimization code using @ax-llm/ax.
dosco/aithy
This skill helps with using the @ax-llm/ax TypeScript library for building LLM applications.
dosco/aithy
This skill helps an LLM build correct native Model Context Protocol integrations with @ax-llm/ax.
A skill your agent uses when writing or reviewing Ax bestOfN/refine code, reward functions, thresholds, native sample selection, serial attempts, generated advice, and attempt diagnostics. Ax Refine is an agent skill from dosco/aithy. Use this skill when writing or reviewing Ax bestOfN/refine code, reward functions, thresholds, native sample selection, serial attempts, generated advice, and attempt diagnostics.
Ax Refine fits situations like: reviewing Ax bestOfN/refine code; reward functions; native sample selection; serial attempts.
Run `npx skills add dosco/aithy --skill ax-refine -a claude-code`. Or copy the skill folder (.claude/skills/ax-refine in dosco/aithy) into .claude/skills/ax-refine in your project. Claude Code loads it when a task matches its description.
Run `npx skills add dosco/aithy --skill ax-refine -a codex`. Or copy the skill folder (.claude/skills/ax-refine in dosco/aithy) into .agents/skills/ax-refine in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dosco/aithy --skill ax-refine -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-refine, .gemini/skills/ax-refine, .github/skills/ax-refine and .opencode/skills/ax-refine in your project.
SKILL.md names no scripts, command-line tools or credentials: Ax Refine is instructions for the agent only.
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.
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.
Ax Refine 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.
About 868 tokens (SKILL.md is roughly 3.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Ax Refine: Agent Refinement (ruvnet/ruflo, 74k stars), Refine (windmill-labs/windmill, 18k stars), Refiner Automation (ComposioHQ/awesome-claude-skills, 77k stars) and Sparc Refine (ruvnet/ruflo, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
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.