refine

A slash command that improves a prompt before you use it. A prompt is the instruction you give an AI assistant.

In plain words
What is it for?
Use it to refine a prompt, compare the before-and-after wording, copy the revised version, or choose whether to run it immediately.
Why use it?
It helps turn unclear or incomplete instructions into a more usable request, while showing the original and revised versions for review.

Command

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 commands/data-wise/craft/refine
Clone the repo
git clone --depth 1 https://github.com/Data-Wise/craft
Per session 6 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 675 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.00006 $0.00675
Opus 5 $0.00003 $0.00338
Sonnet 5 $0.00001 $0.00135
Haiku 4.5 $0.00001 $0.00068

Measured yesterday against content hash a409f1b98740, 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 yesterday.

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.

commands/refine.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

This command is a thin shim. The canonical behavior lives in the prompt-refiner skill. This file exists only to preserve the explicit /craft:refine slash entry point through the v2.34.0 → v3.0.0 migration (see ADR-002, which treats /refine as a separate consolidation into prompt-refiner, distinct from the six adhd-workflow commands).

When invoked

  1. Load the canonical procedure: read ${CLAUDE_PLUGIN_ROOT:-.}/skills/workflow/prompt-refiner/SKILL.md and follow it exactly — read context, rewrite, show the before/after box AND the fenced copy-paste-ready refined-prompt block (both as visible response text, before the confirm question), confirm via AskUserQuestion (Execute now / Copy for elsewhere / Edit first / Skip), return the chosen prompt. With no downstream command (standalone /refine "..."), stop after the confirm step regardless of which option is chosen — there is no caller to hand the result to.

    Note: prompt-refiner won't appear in the Skill tool's available-skill list (it's a nested, non-command-shaped skill) — invoke it by reading the file directly, not by guessing a Skill-tool name.

  2. Do not reimplement here. Any change to /refine behavior — including the optional --explain rationale mode — must be made in the skill, never duplicated into this shim.

Why this is a shim

/refine is consolidated into a skill under the v2.34.0 → v3.0.0 migration (ADR-002) — a separate consolidation from the six commands/workflow/*.md commands (done/recap/next/focus/stuck/spec-review) that route into the adhd-workflow skill. Both entry paths — the explicit /craft:refine slash command and the --refine flag on brainstorm/do/orchestrate/plan:feature/arch:plan — now route to the same prompt-refiner skill. The canonical body lives in the skill, not here.

Scope note: the pre-consolidation version of this command also had clipboard-copy and background-task-execution ("execute in background, check status via task-status/task-output") features. Those are command-routing concerns, not prompt-refining, and were intentionally dropped rather than ported — the skill's job is to rewrite the prompt and hand it back, not to execute or manage it. If background execution of a refined prompt is wanted, that belongs in the calling command (e.g. /craft:do --refine), not here.

Read the full file on GitHub · 51 lines

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. yesterday First seen · 51 lines · 6 tokens per session scan A a409f1b98740

Subscribe to this mod's changes

refine is a command published in the GitHub repository Data-Wise/craft (4 stars, last pushed 16d ago), licensed MIT. It adds 6 tokens to every session and 675 once invoked, about $0.0000 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-31.