refine

refine is a skill for Claude Code, Codex from automagik-dev/genie. It costs 25 tokens per session (660 once invoked), scanned A, original, MIT.

A prompt-editing procedure that turns a short brief or draft into a more complete instruction for an AI agent. It can work from text or from a file.

In plain words
What is it for?
Use it to improve a one-line request, brief, or prompt, either by supplying the text directly or by pointing to a file.
Why use it?
It helps make vague requests more precise before they are given to an agent. Clearer instructions can define the expected result and constraints in a consistent format.

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/automagik-dev/genie/refine
Any agent
npx skills add automagik-dev/genie --skill refine
Clone the repo
git clone --depth 1 https://github.com/automagik-dev/genie

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for refine

README.md
[![agentmods](https://agentmods.dev/badge/skills/automagik-dev/genie/refine.svg)](https://agentmods.dev/skills/automagik-dev/genie/refine)
Your own site
<a href="https://agentmods.dev/skills/automagik-dev/genie/refine"><img src="https://agentmods.dev/badge/skills/automagik-dev/genie/refine.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 660 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.00025 $0.00660
Opus 5 $0.00013 $0.00330
Sonnet 5 $0.00005 $0.00132
Haiku 4.5 $0.00003 $0.00066

Measured 5d ago against content hash fc3b04c4f0ff, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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 5d ago.

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.

skills/refine/SKILL.md · 51 lines

How it starts

The opening of the file, as written. The whole thing — 51 lines — stays where its author put it; the contents beside it link to each section on GitHub.

refine — Prompt Optimizer

Runtime syntax: invoke the plugin copy through the active runtime's owner-qualified skill selector; use a bare selector only when intentionally selecting a user-tier copy (a separately installed personal copy; Genie no longer seeds this tier). Cross-skill prose below uses bare names as portable semantic routes; the orchestrator resolves the selector for the active runtime.

Transform any brief, draft, or one-liner into a production-ready structured prompt.

When to Use

  • User wants to improve a prompt or brief
  • User references refine with text or a file path
  • A worker needs to optimize a prompt before dispatching it

Flow

  1. Detect mode: argument starts with @ → file mode; otherwise → text mode.
  2. Read input: file mode reads the target file; text mode uses the raw argument.
  3. Load the optimizer prompt: at dispatch time, Read prompts/optimizer.md (relative to this skill's directory — skills/refine/prompts/optimizer.md). Its full contents are the refiner's system prompt.
  4. Dispatch refiner subagent: system prompt = the full text of prompts/optimizer.md; user message = the input. Single turn.
  5. Write output: file mode overwrites the source file in place; text mode writes to /tmp/prompts/<slug>.md.
  6. Report: lead with the path of the written file — that is the deliverable.

Modes

File mode Text mode
Invocation refine @path/to/file.md refine <text>
Input file contents (strip @ prefix) the raw argument
Output overwrite the same file /tmp/prompts/<slug>.md (mkdir -p /tmp/prompts/ first)
Report the updated file path the created file path

Slug: <unix-timestamp>-<word1>-<word2>-<word3> — first 3 words, lowercased, hyphenated. Example: 1708190400-fix-auth-bug.

Subagent Contract

The refiner is a single-turn subagent: input in, optimized prompt out.

  • System prompt: the full contents of prompts/optimizer.md — passed whole, never summarized.
  • Input: the raw text or file contents as the user message.
  • Output: optimized prompt body only — no labels, meta-commentary, rationale, or follow-up questions.
  • No tool calls. Receive input, produce output, terminate.

Read the full file on GitHub · 51 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 51 lines · 25 tokens per session scan A fc3b04c4f0ff

Subscribe to this mod's changes

refine is a skill published in the GitHub repository automagik-dev/genie (334 stars, last pushed yesterday), licensed MIT. It adds 25 tokens to every session and 660 once invoked, about $0.0001 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

review-prompts-quality

Review quality of changed or staged prompts in the archcore CLI project. Use when the user runs /review-prompts-quality. Inspects git diff (staged + unstaged) for changes in MCP tool descriptions (internal/mcp/tools/.go), system instructions (internal/mcp/server.go), and document templates (templates/templates.go)…

archcore-ai/cli · 98 tokens

opus-4-5-migration

Migrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5. Use when the user wants to update their codebase, prompts, or API calls to use Opus 4.5. Handles model string updates and prompt adjustments for known Opus 4.5 behavioral differences. Does NOT migrate Haiku 4.5.

gotalab/skillport · 97 tokens

prompt-writer

Write maximally terse agent prompts from scratch. Use when creating agent specs, command prompts, or instruction sets with constitutional governance.

rp1-run/rp1 · 29 tokens

bootstrap-llm-synthesis

Construct the LLM synthesis prompt from project surface scan + optional tree-sitter context + optional Q&A answers. Call the LLM. Parse and validate the response into 6-8 structured memory entries with clarity tags and source traceability. Used as Stage 3 of the /gaai:bootstrap pipeline.

digipulse-engineering/GAAI-framework · 69 tokens

promptly-prompt

Clarity gate for prompts: intercepts unclear requests and forces the model to restate the user's intent to align before working, then diagnose the root cause and reuse the domain's mature, established practices before improvising. Clear prompts pass through untouched.

ViryaZheng/promptly-prompt · 59 tokens

llm-app-engineering

Master modern LLM application engineering patterns. Use when designing prompt chains, evaluating output quality, managing token limits, streaming responses, or integrating LLMs into full-stack applications. SECURITY: Always sanitize user input before passing to LLM prompts to prevent prompt injection.

neverinfamous/memory-journal-mcp · 58 tokens