refine

refine is a skill for Claude Code from dhofheinz/open-plugins. It costs 93 tokens per session (3,248 once invoked), scanned A, original, MIT.

A specification-management guide for planning software systems and features. A specification is a written description of what should be built, how it should work, and how the work should be organized.

In plain words
What is it for?
Creating specifications, refining existing ones, reviewing quality, detecting changes from the agreed design, finalizing plans, and breaking work into traceable tickets.
Why use it?
It keeps architecture, requirements, plans, reviews, and later changes connected in files so the project can be checked for gaps or drift.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the refinery plugin — 2 skills, 6 agents shipped together

Good fit Creating specifications, refining existing ones, reviewing quality, detecting changes from the agreed design, finalizing plans, and breaking work into traceable tickets.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add dhofheinz/open-plugins
Claude Code
/plugin install refinery

Made for: Claude Code.

Or install refinery, the plugin that ships this one along with the rest of its 2 skills, 6 agents.

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/dhofheinz/open-plugins/refine/github.svg)](https://agentmods.dev/skills/dhofheinz/open-plugins/refine)
Your own site
<a href="https://agentmods.dev/skills/dhofheinz/open-plugins/refine"><img src="https://agentmods.dev/badge/skills/dhofheinz/open-plugins/refine/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for refine

Your own site · 80×15
<a href="https://agentmods.dev/skills/dhofheinz/open-plugins/refine"><img src="https://agentmods.dev/badge/skills/dhofheinz/open-plugins/refine.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,248 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00093 $0.03248
Opus 5.5 $0.00037 $0.01299
Sonnet 5.5 $0.00019 $0.00650
Haiku 4.5 $0.00009 $0.00325

Measured 1mo ago against content hash adc874559342, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

plugins/refinery/skills/refine/SKILL.md · 216 lines

How it starts

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

Refinery — Unified Specification Refinement

You are the orchestrator for the Refinery plugin. Your job is to interpret the user's intent and dispatch to the correct mode procedure, never to perform operations directly. Mode files (loaded on demand) contain the actual procedures.

Directive

Refinery treats specifications as typed nodes in an artifact graph. Every operation reads working-directory state from artifact frontmatter, executes a focused mode procedure, writes results back to artifacts, and exits. The plugin is stateless across invocations — all state lives in markdown files.

Your responsibility on every invocation:

  1. Parse $ARGUMENTS to determine intent
  2. Read working-directory state (read frontmatter only — do not load full artifact bodies until a mode requires them)
  3. Resolve to one of eleven modes
  4. Load the corresponding mode file via Read from ${CLAUDE_SKILL_DIR}/mode-<name>.md
  5. Execute the mode's procedure (which may load further stage files, reference files, templates, and spawn agents)
  6. Report outcome and suggest next action
  7. Exit

You never embed mode logic directly in this orchestrator. You dispatch.

Working Directory

Default resolution order (highest priority first):

  1. --output-dir=<path> flag on the invocation
  2. ${user_config.working_directory} if set in plugin user config
  3. docs/refinery/ (built-in default, distinct from docs/specs/ to avoid colliding with legacy artifacts)

If the resolved working directory does not exist and the user did not invoke init, prompt before creating it.

Input Parsing

Process $ARGUMENTS in the following order. First match wins.

  1. Empty arguments + working directory has artifacts → mode = status
  2. Empty arguments + working directory has no artifacts → AskUserQuestion: "What would you like to refine?" with options:
    • "Initialize project conventions" → init
    • "Start a new system from an idea" → prompt for idea then advance --stage=principles
    • "Document an existing feature" → prompt for feature name then advance --stage=feature-spec
    • "Cancel"
  3. Mode keyword as first argument (init, advance, iterate, review, finalize, check, tickets, update, status, archive, mark-implemented) → use that mode; remaining arguments are passed through to the mode file.
  4. --stage=<name> flag present → mode = advance; target stage = <name>
  5. First argument is an existing file path (matches *.md and exists) → inspect file's artifact: and status: frontmatter; suggest the most likely operation and confirm via AskUserQuestion if ambiguous.
  6. First argument is a free-text idea (multi-word, no special characters that suggest a path or feature name) → mode = advance; target stage = principles; idea text passed as input.
  7. First argument is a single-word identifier that doesn't match a mode keyword and doesn't exist as a file → assumed to be a feature name; mode = advance; target stage = feature-spec; scope = feature; feature name = the argument.
  8. Otherwise → AskUserQuestion to clarify intent (do not guess).

Read the full file on GitHub · 216 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. 1mo ago First seen · 216 lines · 93 tokens per session scan A adc874559342

Subscribe to this mod's changes

refine is a skill published in the GitHub repository dhofheinz/open-plugins (9 stars, last pushed 6mo ago), licensed MIT. It adds 93 tokens to every session and 3,248 once invoked, about $0.0004 per session on Opus 5.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.

Related

Other skills, from other repositories

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens