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/automagik-dev/genie/refinenpx skills add automagik-dev/genie --skill refinegit clone --depth 1 https://github.com/automagik-dev/genieWrote 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/automagik-dev/genie/refine)<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>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.00025 | $0.00660 |
| Opus 5 | $0.00013 | $0.00330 |
| Sonnet 5 | $0.00005 | $0.00132 |
| Haiku 4.5 | $0.00003 | $0.00066 |
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.
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
refinewith text or a file path - A worker needs to optimize a prompt before dispatching it
Flow
- Detect mode: argument starts with
@→ file mode; otherwise → text mode. - Read input: file mode reads the target file; text mode uses the raw argument.
- 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. - Dispatch refiner subagent: system prompt = the full text of
prompts/optimizer.md; user message = the input. Single turn. - Write output: file mode overwrites the source file in place; text mode writes to
/tmp/prompts/<slug>.md. - 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.
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.
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.
- 5d ago First seen · 51 lines · 25 tokens per session scan A fc3b04c4f0ff
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.
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)…
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.
prompt-writer
Write maximally terse agent prompts from scratch. Use when creating agent specs, command prompts, or instruction sets with constitutional governance.
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.
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.
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.